/* Доп. стили поверх Tailwind. Палитра подогнана под spbiiran.ru:
   navy: #215ca5 / #1d4c82 / #13385f / #06315c
   rust: #cf2e2e
   paper: #f7f7f7 / #EDF2F7 / #fbfbfb
*/

mark {
  background: #fde68a;
  color: inherit;
  padding: 0 .12em;
  border-radius: .15em;
  box-shadow: inset 0 -2px 0 rgba(207, 46, 46, .35);
}

/* Табы секций */
.tab {
  padding: .55rem 1rem;
  border: 1px solid transparent;
  border-bottom: none;
  border-top-left-radius: .55rem;
  border-top-right-radius: .55rem;
  font-size: .9rem; font-weight: 500;
  color: #4A5568;
  background: transparent;
  margin-bottom: -1px;
  cursor: pointer;
  transition: background .12s ease, color .12s ease;
}
.tab:hover { background: #EDF2F7; color: #1A202C; }
.tab-active {
  background: #fff;
  color: #1d4c82;
  border-color: #e1e4f0;
  border-bottom: 1px solid #fff;
  font-weight: 600;
}

.result-card {
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.result-card:hover {
  transform: translateY(-1px);
  border-color: #215ca5;
  box-shadow: 0 6px 16px -8px rgba(33, 92, 165, .25);
}
.snippet {
  font-family: 'PT Serif', Georgia, serif;
  color: #2D3748;
  line-height: 1.55;
}
.page-block {
  border-left: 3px solid #215ca5;
  padding: .6rem .9rem;
  margin: .8rem 0;
  background: #f7f9fc;
  border-radius: 0 .5rem .5rem 0;
  white-space: pre-wrap;
  font-family: 'PT Serif', Georgia, serif;
}

.badge {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .15rem .55rem; border-radius: 999px;
  font-size: 11px; line-height: 1.2;
  background: #EDF2F7; color: #2D3748; border: 1px solid #e1e4f0;
}
.badge-accent { background: #1d4c82; color: #fff; border-color: #13385f; }
.badge-rust   { background: #cf2e2e; color: #fff; border-color: #a92424; }
.badge-section-zes { background: #e8f1fb; color: #13385f; border-color: #c7dcf3; }
.badge-section-rs  { background: #fbeeee; color: #7d1a1a; border-color: #f1c9c9; }
.badge-ocd { background: #fff7d6; color: #7a5a1c; border-color: #f0d98a; }
.badge-ocr { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.badge-orig { background: #dcfce7; color: #166534; border-color: #86efac; }

.pg-btn {
  min-width: 2.25rem; height: 2.25rem; padding: 0 .6rem;
  display:inline-flex; align-items:center; justify-content:center;
  border:1px solid #e1e4f0; border-radius:.5rem; background:#fff;
  font-size:.875rem; color:#2D3748;
}
.pg-btn:hover { background:#EDF2F7; }
.pg-btn.active { background:#1d4c82; color:#fff; border-color:#13385f; }
.pg-btn[disabled] { opacity:.4; cursor:not-allowed; }

/* Шапка результатов с большими числами */
.results-header {
  background: linear-gradient(135deg, #fff 0%, #f7f9fc 100%);
  border: 1px solid #e1e4f0;
  border-radius: .9rem;
  padding: 1rem 1.25rem;
  display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap;
  box-shadow: 0 2px 8px -4px rgba(33, 92, 165, .08);
}
.stat-row { display:flex; gap: 1rem; flex-wrap: wrap; }
.stat-tile {
  display: flex; flex-direction: column; align-items: flex-start;
  padding: .35rem .9rem;
  border-left: 4px solid #215ca5;
  background: rgba(237, 242, 247, .55);
  border-radius: 0 .5rem .5rem 0;
}
.stat-tile + .stat-tile { border-left-color: #cf2e2e; }
.stat-num {
  font-family: 'PT Serif', Georgia, serif;
  font-size: 1.85rem; line-height: 1; font-weight: 700; color: #1A202C;
  letter-spacing: -.02em;
}
.stat-lbl {
  font-size: .78rem; color: #4A5568; text-transform: lowercase;
  margin-top: .2rem;
}
.results-meta {
  margin-left: auto; font-size: .85rem; color: #4A5568;
}

/* Кнопки */
.btn-primary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: .55rem;
  background: #215ca5; color: #fff; font-size: .875rem; font-weight: 500;
  border: 1px solid #1d4c82;
  text-decoration: none; cursor: pointer;
  transition: background .12s ease, transform .12s ease;
  box-shadow: 0 1px 3px rgba(33, 92, 165, .25);
}
.btn-primary:hover { background: #1d4c82; transform: translateY(-1px); }
.btn-secondary {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .5rem .9rem; border-radius: .55rem;
  background: #cf2e2e; color: #fff; font-size: .875rem; font-weight: 500;
  border: 1px solid #a92424;
  text-decoration: none; cursor: pointer;
  transition: background .12s ease, transform .12s ease;
  box-shadow: 0 1px 3px rgba(207, 46, 46, .25);
}
.btn-secondary:hover { background: #a92424; transform: translateY(-1px); }
.btn-link {
  display: inline-flex; align-items: center; gap: .25rem;
  padding: .5rem .6rem; border-radius: .55rem;
  background: transparent; color: #4A5568; font-size: .875rem;
  border: 1px solid #e1e4f0;
  text-decoration: none;
}
.btn-link:hover { background: #EDF2F7; color: #1d4c82; }

/* Чипы уточнений */
.chip {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .3rem .55rem .3rem .4rem;
  background: #fff; border: 1px solid #e1e4f0; border-radius: 999px;
  font-size: .85rem; color: #1A202C;
  box-shadow: 0 1px 2px rgba(33, 92, 165, .06);
}
.chip-num {
  display:inline-flex; align-items:center; justify-content:center;
  width: 1.25rem; height: 1.25rem; border-radius: 999px;
  background:#215ca5; color:#fff; font-size:.7rem; font-weight:600;
}
.chip-text { font-family: 'PT Serif', Georgia, serif; }
.chip-x {
  appearance:none; border:none; background:transparent; color:#4A5568;
  font-size: 1.05rem; line-height: 1; cursor: pointer; padding: 0 .15rem;
  border-radius: 999px;
}
.chip-x:hover { background:#EDF2F7; color:#cf2e2e; }

/* Тёмная тема */
body.dark { background: #0f1722; color: #EDF2F7; }
body.dark .bg-white { background: #1a2433 !important; color: #EDF2F7; }
body.dark .bg-paper-100, body.dark .bg-paper-200 { background: #14202f !important; }
body.dark .border-paper-300 { border-color: #2a3a52 !important; }
body.dark .text-ink-900, body.dark .text-ink-800, body.dark .text-ink-700 { color: #EDF2F7 !important; }
body.dark .text-ink-600 { color: #a0aec0 !important; }
body.dark mark { background: #7a5a1c; color: #fff8e1; }
body.dark .page-block { background: #15202e; color: #EDF2F7; border-left-color: #4a90d9; }
body.dark .snippet { color: #EDF2F7; }
body.dark input, body.dark select { background: #1a2433; color: #EDF2F7; border-color: #2a3a52; }
body.dark .pg-btn { background: #1a2433; color: #EDF2F7; border-color: #2a3a52; }
body.dark .pg-btn:hover { background: #2a3a52; }
body.dark .pg-btn.active { background: #215ca5; }
body.dark .badge { background: #1a2433; color: #EDF2F7; border-color: #2a3a52; }
body.dark .results-header { background: #1a2433; border-color: #2a3a52; }
body.dark .stat-tile { background: rgba(42, 58, 82, .5); }
body.dark .stat-num { color: #EDF2F7; }
body.dark .tab { color: #a0aec0; }
body.dark .tab:hover { background: #14202f; color: #EDF2F7; }
body.dark .tab-active { background: #1a2433; color: #83b9f8; border-color: #2a3a52; border-bottom-color: #1a2433; }
body.dark .chip { background: #1a2433; color: #EDF2F7; border-color: #2a3a52; }
body.dark .chip-x { color: #a0aec0; }
