/* ============================================================
   Baza pytań i arkuszy maturalnych CKE — matura.halonik.pl
   Styl: Soft Neobrutalism
   - Czyste tło, mocna grafitowa kreska (--ink)
   - Twarde, przesunięte cienie neobrutalistyczne bez rozmycia
   - Żywa, czytelna paleta pastelowych akcentów
   - Zaokrąglone rogi i dopracowane mikrointerakcje
   ============================================================ */

:root {
  /* Skala szarości */
  --gray-50:  #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;

  /* Kontur i twardy cień neobrutalizmu */
  --ink: #1e222e;

  /* Powierzchnie i tekst */
  --bg-main:   #ffffff;
  --bg-card:   #ffffff;
  --bg-subtle: #f8fafc;
  --text-main: var(--gray-900);
  --text-body: var(--gray-700);
  --text-muted: var(--gray-500);

  /* Akcenty neobrutalizmu — pastele o wysokim kontraście */
  --accent-blue:        #3d5afe;
  --accent-blue-hover:  #2a3fd6;
  --accent-blue-light:  #e0e7ff;

  --accent-green:       #059669;
  --accent-green-hover: #047857;
  --accent-green-light: #d1fae5;

  --accent-amber:       #d97706;
  --accent-amber-hover: #b45309;
  --accent-amber-light: #fef3c7;

  --accent-red:         #ef4444;
  --accent-red-hover:   #dc2626;
  --accent-red-light:   #fee2e2;

  --accent-purple:      #8b5cf6;
  --accent-purple-light: #ede9fe;

  /* Zaokrąglenia */
  --radius-sm: 8px;
  --radius:    12px;
  --radius-lg: 16px;

  /* Twarde cienie neobrutalizmu */
  --shadow-sm: 3px 3px 0 var(--ink);
  --shadow:    4px 4px 0 var(--ink);
  --shadow-md: 6px 6px 0 var(--ink);
  --shadow-lg: 8px 8px 0 var(--ink);

  --font-main: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--bg-main);
  color: var(--text-body);
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a {
  color: var(--accent-blue);
  text-decoration: none;
  font-weight: 600;
}

a:hover {
  text-decoration: underline;
}

h1, h2, h3, h4 {
  color: var(--text-main);
  line-height: 1.25;
  margin: 0 0 .4em;
  letter-spacing: -0.02em;
}

h1 { font-size: 1.65rem; font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }

[x-cloak] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ---------- Kontenery i układ bazowy ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.25rem;
  width: 100%;
}

.site-header {
  border-bottom: 1.5px solid var(--ink);
  background: #ffffff;
  padding: 0.85rem 0;
}

.site-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.header-brand-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.brand img {
  display: block;
  height: 38px;
  width: auto;
}

/* ---------- Wyraz Biologia dosunięty do logo ---------- */
.header-subject-wrap {
  display: inline-flex;
  align-items: center;
  margin-left: 0.15rem;
}

.header-subject-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--ink);
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1;
  user-select: none;
}

.header-subject-badge .ic {
  width: 20px;
  height: 20px;
  color: var(--accent-blue);
}

.header-subject-badge .ic svg {
  stroke: var(--accent-blue);
  stroke-width: 2.4px;
}

.header-subject-badge.is-select {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 1px;
}

.header-subject-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-color: transparent;
  border: none;
  font-family: inherit;
  font-size: 1.35rem;
  font-weight: 900;
  color: var(--ink);
  cursor: pointer;
  padding: 0.1rem 1.6rem 0.1rem 0.1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e222e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.1rem center;
  background-size: 15px 15px;
  outline: none;
}

/* ---------- Wyszukiwarka i filtry w nagłówku ---------- */
.header-nav-center {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex: 1;
  max-width: 440px;
  min-width: 180px;
}

.header-search-wrap {
  flex: 1;
  position: relative;
}

.header-search-wrap input {
  width: 100%;
  height: 2.15rem;
  padding: 0.35rem 0.65rem 0.35rem 1.95rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: 2px 2px 0 var(--ink);
  transition: border-color .1s, box-shadow .1s;
}

.header-search-wrap input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 3px 3px 0 var(--accent-blue);
}

.header-search-icon {
  position: absolute;
  left: 0.55rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--text-muted);
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.header-divider {
  width: 1.5px;
  height: 20px;
  background-color: var(--gray-300);
  margin: 0 0.15rem;
}

/* ---------- Zwijana szuflada filtrów pod nagłówkiem ---------- */
.header-filters-drawer {
  border-top: 1.5px dashed var(--gray-300);
  background-color: var(--bg-subtle);
  padding: 0.75rem 0 0.85rem;
}

.header-filters-drawer .filters-grid-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  align-items: center;
}

.header-filters-drawer .filters-drawer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.filters-tag-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  line-height: 1;
}

.site-main {
  flex: 1;
  padding: 1.5rem 0 3.5rem;
}

/* ---------- Przyciski Soft Neobrutalism ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  background-color: var(--bg-card);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 0.5rem 0.95rem;
  min-height: 2.45rem;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
  box-shadow: var(--shadow-sm);
  transition: transform 0.1s ease, box-shadow 0.1s ease, background-color 0.12s ease;
  user-select: none;
}

.btn:hover {
  text-decoration: none;
  transform: translate(-1.5px, -1.5px);
  box-shadow: 4.5px 4.5px 0 var(--ink);
}

.btn:active {
  transform: translate(1.5px, 1.5px);
  box-shadow: 1px 1px 0 var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn.sm {
  padding: 0.35rem 0.75rem;
  min-height: 2.1rem;
  font-size: 0.8rem;
}

.btn.icon-btn {
  width: 32px;
  height: 32px;
  min-height: unset;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn.icon-btn .ic {
  width: 16px;
  height: 16px;
}

.btn.xs {
  padding: 0.2rem 0.5rem;
  min-height: 1.75rem;
  font-size: 0.75rem;
  box-shadow: 2px 2px 0 var(--ink);
}

/* Warianty kolorów przycisków */
.btn.ghost  { background-color: var(--bg-card); }
.btn.ghost:hover { background-color: var(--gray-100); }

.btn.blue   { background-color: var(--accent-blue-light); }
.btn.blue:hover { background-color: #c7d2fe; }

.btn.green  { background-color: var(--accent-green-light); }
.btn.green:hover { background-color: #a7f3d0; }

.btn.amber  { background-color: var(--accent-amber-light); }
.btn.amber:hover { background-color: #fde68a; }

.btn.danger { background-color: var(--accent-red-light); }
.btn.danger:hover { background-color: #fecaca; }

.btn-label {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

/* Segmented groups */
.btn-group {
  display: inline-flex;
  align-items: stretch;
}

.btn-group .btn {
  border-radius: 0;
  margin-left: -1.5px;
}

.btn-group .btn:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
  margin-left: 0;
}

.btn-group .btn:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

/* ---------- Ikony Lucide ---------- */
.ic {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  line-height: 0;
  color: inherit;
}

.ic svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  stroke: currentColor;
  stroke-width: 2.2px;
}

/* ---------- Pigułki / Odznaki (Pills) ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1.5px solid var(--ink);
  line-height: 1.2;
}

/* Punkty zadania — jednolity neutralny szary o wysokim kontraście */
.pill.points {
  background-color: var(--gray-100);
  color: var(--ink);
}

.pill.blue   { background-color: var(--accent-blue-light);  color: var(--ink); }
.pill.green  { background-color: var(--accent-green-light); color: var(--ink); }
.pill.amber  { background-color: var(--accent-amber-light); color: var(--ink); }
.pill.red    { background-color: var(--accent-red-light);   color: var(--ink); }
.pill.purple { background-color: var(--accent-purple-light); color: var(--ink); }
/* ---------- Panel informacyjny („O platformie”) ---------- */
.about {
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.35rem;
  overflow: hidden;
}

.about summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-main);
  outline: none;
  list-style: none;
  user-select: none;
  padding: 0.75rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-card);
  transition: background-color .12s;
}

.about summary:hover {
  background-color: var(--gray-50);
}

.about summary::-webkit-details-marker {
  display: none;
}

.about summary::after {
  content: "";
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e222e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.2s ease;
}

.about[open] summary::after {
  transform: rotate(180deg);
}

.about-body {
  padding: 1rem 1.1rem;
  border-top: 1.5px solid var(--ink);
  background-color: var(--bg-subtle);
}

.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}

.about-card {
  background: #ffffff;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  box-shadow: 2px 2px 0 var(--ink);
}

.about-card-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.about-card p {
  font-size: 0.82rem;
  color: var(--text-body);
  margin: 0;
  line-height: 1.45;
}

/* ---------- Pasek Mojego Zestawu (Board Bar) ---------- */
.board-bar {
  background-color: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.35rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  transition: background-color 0.15s ease;
}

/* Aktywne zielone tło TYLKO gdy w zestawie są zadania */
.board-bar.has-items {
  background-color: var(--accent-green-light);
}

.board-bar-info {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.board-badge {
  background-color: var(--gray-100);
  color: var(--ink);
  border: 1.5px solid var(--ink);
  font-size: 0.8rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 999px;
}

.board-bar.has-items .board-badge {
  background-color: var(--ink);
  color: #ffffff;
}

.board-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.copy-status {
  color: var(--accent-green);
  font-weight: 700;
  font-size: 0.82rem;
}

/* ---------- Wyszukiwarka i filtry (zwijany panel) ---------- */
.filters-wrap {
  background-color: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.5rem;
  overflow: hidden;
}

.filters-bar-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 1rem;
  flex-wrap: wrap;
}

.filters-search-wrap {
  flex: 1;
  min-width: 240px;
}

.filters-search-wrap input {
  width: 100%;
  height: 2.45rem;
  padding: 0.55rem 0.85rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9rem;
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: 2px 2px 0 var(--ink);
}

.filters-search-wrap input:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 3px 3px 0 var(--accent-blue);
}

.filters-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.filters-drawer {
  padding: 0.85rem 1rem 1rem;
  border-top: 1.5px dashed var(--gray-300);
  background-color: var(--bg-subtle);
}

.filters-grid-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.65rem;
  align-items: center;
}

.filters-drawer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.65rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--gray-200);
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.filters-tag-counter {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--accent-blue);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 800;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  line-height: 1;
}
.filters input, .filters select, select {
  padding: 0.55rem 0.75rem;
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.88rem;
  background-color: #ffffff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  transition: border-color 0.1s, box-shadow 0.1s;
  height: 2.45rem;
}

.filters select, select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%231e222e' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 16px;
  padding-right: 2.4rem;
  cursor: pointer;
}

.filters input:focus, .filters select:focus, select:focus {
  outline: none;
  border-color: var(--accent-blue);
  box-shadow: 4px 4px 0 var(--ink);
}

.filters-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.65rem;
  padding: 0 0.2rem;
  font-size: 0.84rem;
  color: var(--text-muted);
}

/* ---------- Siatka i Karty zadań ---------- */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
}

.q-card {
  background: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.12s ease, border-color 0.12s ease;
  position: relative;
}

.q-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--shadow-md);
}

/* Karta w zestawie — zielona ramka + zachowany cień */
.q-card.in-arkusz {
  border-color: var(--accent-green);
  box-shadow: var(--shadow-sm), 0 0 0 2px var(--accent-green) inset;
}

.q-card.in-arkusz:hover {
  box-shadow: var(--shadow-md), 0 0 0 2px var(--accent-green) inset;
}

.q-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  gap: 0.4rem;
}

.q-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tez-w {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  background-color: var(--accent-purple-light);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  padding: 2px 7px;
  line-height: 1.2;
}

.q-img-wrap {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  padding: 6px;
  min-height: 160px;
  max-height: 240px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
  transition: background-color 0.12s;
}

.q-img-wrap:hover {
  background: #ffffff;
}

.q-img-wrap img {
  width: 100%;
  max-height: 228px;
  object-fit: contain;
  display: block;
}

.q-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  padding-top: 0.3rem;
}

.q-actions .btn {
  flex: 1;
}

/* ---------- Pusty stan ---------- */
.empty-card {
  text-align: center;
  padding: 3.5rem 1.5rem;
  background: var(--bg-card);
  border: 1.5px dashed var(--ink);
  border-radius: var(--radius);
  margin: 1.5rem 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}

.empty-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--gray-100);
  border: 1.5px solid var(--ink);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}

.empty-title {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
}

.empty-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  max-width: 420px;
  margin: 0;
}

/* ---------- Modal podglądu zadania ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 24, 39, 0.65);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-box {
  background: var(--bg-card);
  border: 2px solid var(--ink);
  border-radius: var(--radius-lg);
  width: min(880px, 96vw);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.4rem;
  border-bottom: 1.5px solid var(--ink);
  background: var(--bg-card);
}

.modal-head-title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.modal-x {
  background: var(--bg-card);
  border: 1.5px solid var(--ink);
  color: var(--ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-shadow: 2px 2px 0 var(--ink);
  transition: transform 0.1s, background-color 0.1s;
}

.modal-x:hover {
  background: var(--accent-red-light);
  transform: translate(-1px, -1px);
}

.modal-body {
  padding: 1.25rem 1.4rem;
  overflow-y: auto;
  flex: 1;
}

.modal-body .mb-img {
  max-width: 100%;
  display: block;
  margin: 0.75rem auto;
  background: #ffffff;
  border: 1.5px solid var(--gray-300);
  border-radius: var(--radius-sm);
  cursor: default;
}

.modal-answer {
  margin-top: 1.25rem;
  padding: 1rem 1.2rem;
  background: var(--accent-amber-light);
  border: 1.5px solid var(--ink);
  border-left: 5px solid var(--accent-amber);
  border-radius: var(--radius-sm);
}

.modal-answer b {
  color: var(--ink);
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 800;
}

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0.8rem 1.4rem;
  border-top: 1.5px solid var(--ink);
  background: var(--bg-subtle);
}

.modal-foot-nav, .modal-foot-ops {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.modal-nav-group {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.modal-nav-counter {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-main);
  padding: 0.35rem 0.75rem;
  background-color: var(--bg-card);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: 2px 2px 0 var(--ink);
  min-height: 2.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.kbd-badge {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.72rem;
  font-family: inherit;
  font-weight: 700;
  color: var(--gray-700);
  background: var(--gray-100);
  border: 1px solid var(--gray-300);
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0,0,0,0.15);
}

/* ---------- Stopka strony ---------- */
.site-footer {
  margin-top: auto;
  background: var(--ink);
  color: #ffffff;
  font-size: 0.88rem;
  padding: 1.2rem 0;
  border-top: 2px solid var(--ink);
}

.site-footer-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--accent-amber-light);
  font-weight: 700;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* ---------- Druk (Print) ---------- */
@media print {
  .site-header, .filters-wrap, .board-bar, .no-print, .about {
    display: none !important;
  }
  .container {
    max-width: 100%;
    padding: 0;
  }
  body {
    font-size: 12pt;
    background: #ffffff;
  }
}

/* ---------- Responsywność ---------- */
@media (max-width: 900px) {
  .site-header-row {
    flex-wrap: wrap;
    gap: 0.65rem;
  }
  .header-nav-center {
    order: 3;
    max-width: 100%;
    flex-basis: 100%;
  }
  .header-actions {
    margin-left: auto;
  }
}

@media (max-width: 640px) {
  .header-brand-group {
    flex-wrap: wrap;
    gap: 0.2rem;
  }
  .header-subject-badge {
    font-size: 1.15rem;
  }
  .board-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .board-bar-actions {
    margin-left: 0;
    width: 100%;
    justify-content: flex-start;
  }
  .grid-3 {
    grid-template-columns: 1fr;
  }
  .modal-foot {
    flex-direction: column;
    align-items: stretch;
    gap: 0.6rem;
  }
  .modal-foot-nav, .modal-foot-ops {
    justify-content: space-between;
  }
}
