.badatelna-shell {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1.5rem;
  padding: 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}

.badatelna-filters {
  background: #f8f7f3;
  border: 1px solid #d8d2c4;
  border-radius: 6px;
  padding: 1rem;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.badatelna-filters h2 {
  margin: 0 0 1rem 0;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.badatelna-filters label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.75rem;
  margin-bottom: 0.25rem;
}

.badatelna-filters input,
.badatelna-filters select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c8c2b4;
  border-radius: 3px;
  font: inherit;
}

.badatelna-filters .year-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.badatelna-filters .typ-checkboxes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.badatelna-filters .typ-checkboxes label {
  font-weight: normal;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.badatelna-filters button[type="submit"] {
  margin-top: 1rem;
  width: 100%;
  padding: 0.5rem;
  background: #8a3033;
  color: #fff;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.badatelna-filters button[type="submit"]:hover { background: #6d2628; }

.badatelna-results h2 {
  margin: 0 0 0.5rem 0;
}

.badatelna-results .results-meta {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.badatelna-results table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.badatelna-results th,
.badatelna-results td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid #ebe6da;
  font-size: 0.92rem;
  vertical-align: top;
}

.badatelna-results th {
  background: #f4f0e4;
  font-weight: 600;
  font-size: 0.85rem;
}

.badatelna-results .pagination {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  justify-content: center;
}

.badatelna-results .pagination a,
.badatelna-results .pagination .current {
  padding: 0.4rem 0.7rem;
  border: 1px solid #d8d2c4;
  border-radius: 3px;
  text-decoration: none;
  color: #333;
}

.badatelna-results .pagination .current {
  background: #8a3033;
  color: #fff;
  border-color: #8a3033;
}

.htmx-indicator {
  opacity: 0;
  transition: opacity 0.2s;
}
.htmx-request .htmx-indicator { opacity: 1; }

@media (max-width: 768px) {
  .badatelna-shell { grid-template-columns: 1fr; }
  .badatelna-filters { position: static; }
}

.badatelna-tabs {
  display: flex;
  gap: 0.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid #d8d2c4;
  margin-bottom: 1rem;
}
.badatelna-tabs .tab {
  padding: 0.6rem 1.2rem;
  text-decoration: none;
  color: #666;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
}
.badatelna-tabs .tab.active {
  background: #fff;
  color: #333;
  border-color: #d8d2c4;
  margin-bottom: -1px;
  font-weight: 600;
}
.badatelna-tabs .tab:hover:not(.active) {
  background: #f4f0e4;
}

/* --- Deník --- */

.denik-shell {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.denik-header h1 {
  margin: 0 0 0.25rem;
}

.denik-meta {
  color: #666;
  font-size: 0.9rem;
}

.denik-item {
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 6px;
  padding: 1rem;
  margin-bottom: 1rem;
}

.denik-item header {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.denik-viewer-link {
  margin-left: auto;
  font-size: 0.85rem;
}

.denik-item textarea {
  width: 100%;
  padding: 0.5rem;
  border: 1px solid #d8d2c4;
  border-radius: 3px;
  font: inherit;
  resize: vertical;
}

.denik-item-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.denik-item-actions button {
  padding: 0.3rem 0.7rem;
  background: #8a3033;
  color: #fff;
  border: 0;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}

.denik-item-actions .denik-delete {
  background: transparent;
  color: #8a3033;
  border: 1px solid #8a3033;
}

.denik-timestamp {
  margin-left: auto;
  color: #999;
  font-size: 0.8rem;
}

.denik-save-btn {
  padding: 0.25rem 0.5rem;
  background: #f0e8d8;
  border: 1px solid #c8c2b4;
  border-radius: 3px;
  font-size: 0.85rem;
  cursor: pointer;
}
.denik-save-btn:hover { background: #e8dfca; }

.denik-saved-indicator {
  color: #5a7a3a;
  font-size: 0.85rem;
}

/* --- Osoby --- */

.osoby-shell, .osoba-detail-shell, .osoba-form-shell, .osoba-confirm-shell {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.osoby-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.osoby-header h1 { margin: 0; flex: 1; }
.osoby-header nav { display: flex; gap: 0.75rem; }

.osoby-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.osoba-card {
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 6px;
  padding: 1rem;
}
.osoba-card h3 { margin: 0 0 0.5rem; font-size: 1.1rem; }
.osoba-card h3 a { color: inherit; text-decoration: none; }
.osoba-card h3 a:hover { text-decoration: underline; }
.osoba-meta { color: #666; font-size: 0.9rem; }
.osoba-place { color: #888; font-size: 0.85rem; margin-top: 0.25rem; }
.osoba-count { color: #555; font-size: 0.85rem; margin-top: 0.5rem; }

.osoba-detail-shell h1 { margin: 0.5rem 0; }
.osoba-poznamka {
  background: #f8f7f3;
  padding: 0.75rem;
  border-radius: 4px;
  border-left: 3px solid #8a3033;
}
.osoba-actions {
  display: flex;
  gap: 1rem;
  margin: 1rem 0;
}
.osoba-actions .danger { color: #8a3033; }

.osoba-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: 1rem;
  background: #f0e8d8;
  padding: 0.2rem 0.5rem;
  border-radius: 12px;
  font-size: 0.85rem;
}
.osoba-badge .link-unlink {
  background: transparent;
  border: 0;
  cursor: pointer;
  font-size: 0.9rem;
  color: #999;
  padding: 0;
}
.osoba-badge .link-unlink:hover { color: #8a3033; }

.link-osoba-add {
  margin-left: 1rem;
  font-size: 0.85rem;
  color: #8a3033;
}

.year-range-set {
  border: 1px solid #d8d2c4;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
}
.year-range-set legend { padding: 0 0.5rem; font-weight: 600; }
.year-range-set label { display: inline-block; margin-right: 1rem; }
.year-range-set input { width: 5rem; }

.btn-primary {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  background: #8a3033;
  color: #fff;
  border-radius: 3px;
  text-decoration: none;
  cursor: pointer;
  border: 0;
  font: inherit;
}
.btn-primary:hover { background: #6d2628; }

.form-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.empty {
  color: #888;
  text-align: center;
  padding: 2rem;
}

/* --- Vztahy --- */

.vztahy-sekce {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #ebe6da;
}

.vztah-row {
  margin: 1rem 0;
}

.vztah-row h3 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1rem;
  color: #444;
  margin: 0.5rem 0;
}

.vztah-row .vztah-add {
  font-size: 0.85rem;
  color: #8a3033;
  text-decoration: none;
  background: #f4f0e4;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
}
.vztah-row .vztah-add:hover { background: #e8dfca; }

.vztah-row ul {
  list-style: none;
  margin: 0;
  padding-left: 1rem;
}
.vztah-row li {
  padding: 0.2rem 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.vztah-row .empty {
  color: #888;
  text-align: left;
  padding: 0.2rem 1rem;
  font-size: 0.9rem;
  font-style: italic;
}

.vztah-delete {
  color: #999;
  font-size: 0.85rem;
  text-decoration: none;
}
.vztah-delete:hover { color: #8a3033; }

.vztah-form-shell, .vztah-confirm-shell {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.vztah-help {
  margin-top: 1rem;
  font-size: 0.85rem;
  color: #888;
}

/* --- Strom --- */

.strom-shell {
  max-width: 100%;
  margin: 1rem auto;
  padding: 0 1rem;
}

.strom-nav {
  margin-bottom: 0.5rem;
}

.strom-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #f4f0e4;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.strom-controls label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
}

.strom-controls input,
.strom-controls select {
  padding: 0.25rem 0.5rem;
  border: 1px solid #c8c2b4;
  border-radius: 3px;
  font: inherit;
}

.strom-controls input[type="number"] {
  width: 4rem;
}

.strom-meta {
  color: #666;
  font-size: 0.9rem;
}

.strom-download {
  margin-left: auto;
  background: #8a3033;
  color: #fff;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  text-decoration: none;
  font-size: 0.9rem;
}
.strom-download:hover { background: #6d2628; }

.strom-canvas {
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 1rem;
  overflow-x: auto;
  text-align: center;
}

.strom-canvas svg {
  max-width: 100%;
  height: auto;
}

/* --- Matches --- */

.matches-shell {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.matches-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.match-row {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 1rem;
  align-items: center;
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 1rem;
}

.match-score {
  text-align: center;
}
.match-score strong {
  display: block;
  font-size: 1.5rem;
  color: #8a3033;
}
.match-score small {
  display: block;
  color: #888;
  font-size: 0.75rem;
  margin-top: 0.25rem;
}

.match-zaznam strong { font-size: 1rem; }
.match-zaznam small { color: #666; }
.match-viewer-link { font-size: 0.85rem; color: #8a3033; }

.match-actions {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.btn-accept, .btn-reject {
  padding: 0.4rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
  border: 1px solid;
  background: #fff;
}
.btn-accept {
  border-color: #5a7a3a;
  color: #5a7a3a;
}
.btn-accept:hover { background: #5a7a3a; color: #fff; }

.btn-reject {
  border-color: #8a3033;
  color: #8a3033;
}
.btn-reject:hover { background: #8a3033; color: #fff; }

.matches-link {
  display: inline-block;
  margin-left: 0.5rem;
  font-size: 0.9rem;
  color: #8a3033;
}

/* --- Sdílení --- */

.sdileni-shell {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.sdileni-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 1rem;
}

.sdileni-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.sdileni-target strong { display: block; }
.sdileni-meta { color: #888; font-size: 0.85rem; }

.badge {
  display: inline-block;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
}
.badge-viewer { background: #e8e0c8; color: #6b5e3a; }
.badge-editor { background: #d4e8d4; color: #4a6b4a; }

.guest-banner {
  background: #fff3cd;
  border: 1px solid #d6a64a;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  margin: 1rem auto;
  max-width: 1000px;
  font-size: 0.9rem;
}

.btn-secondary {
  background: transparent;
  color: #555;
  border: 1px solid #c8c2b4;
  padding: 0.3rem 0.7rem;
  border-radius: 3px;
  cursor: pointer;
  font: inherit;
}
.btn-secondary:hover { background: #f0e8d8; }

/* --- F2I: Tags + filter sidebar --- */

.osoby-shell-with-filter {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 1.5rem;
  max-width: 1200px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
}

.osoby-filters {
  background: #f4f0e4;
  padding: 1rem;
  border-radius: 4px;
  height: fit-content;
  position: sticky;
  top: 1rem;
}

.osoby-filters h2 {
  margin: 0 0 0.5rem;
  font-size: 1.1rem;
}

.osoby-filters label {
  display: block;
  margin: 0.75rem 0 0.25rem;
  font-weight: 600;
  font-size: 0.85rem;
}

.osoby-filters input,
.osoby-filters select {
  width: 100%;
  padding: 0.4rem 0.5rem;
  border: 1px solid #c8c2b4;
  border-radius: 3px;
  font: inherit;
  box-sizing: border-box;
}

.osoby-filters .year-range-set {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  border: 1px solid #d8d2c0;
  border-radius: 4px;
  padding: 0.5rem;
  margin: 0.75rem 0 0.25rem;
}
.osoby-filters .year-range-set legend {
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0 0.25rem;
}
.osoby-filters .year-range-set label {
  font-weight: normal;
  font-size: 0.8rem;
  margin: 0;
}

.tag-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
  margin-top: 0.25rem;
}

.tag-checkboxes .tag-check {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-weight: normal;
  font-size: 0.85rem;
  margin: 0;
}

.osoby-filters .form-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Tag color badges — coexist s existing .badge / .badge-viewer / .badge-editor */
.badge-zelena   { background: #d4e8d4; color: #4a6b4a; text-transform: none; font-weight: 500; }
.badge-modra    { background: #d4e8f4; color: #3a5a7a; text-transform: none; font-weight: 500; }
.badge-cervena  { background: #f4d4d4; color: #8a3033; text-transform: none; font-weight: 500; }
.badge-zluta    { background: #f4ecc8; color: #6a5a1a; text-transform: none; font-weight: 500; }
.badge-fialova  { background: #e4d4f4; color: #6a3a8a; text-transform: none; font-weight: 500; }
.badge-oranzova { background: #f4dcc4; color: #a05a1a; text-transform: none; font-weight: 500; }
.badge-seda     { background: #e4e4e4; color: #555; text-transform: none; font-weight: 500; }

.item-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin: 0.25rem 0 0.5rem;
}

@media (max-width: 768px) {
  .osoby-shell-with-filter { grid-template-columns: 1fr; padding: 0 0.5rem; }
  .osoby-filters { position: static; }
}

/* --- Aktivita --- */

.aktivita-shell {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.aktivita-filter {
  background: #f4f0e4;
  padding: 0.75rem 1rem;
  border-radius: 4px;
  margin: 1rem 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: end;
}

.aktivita-filter label {
  display: flex;
  flex-direction: column;
  font-size: 0.85rem;
  font-weight: 600;
}

.aktivita-feed {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 1rem;
}

.aktivita-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 1rem;
  background: #fff;
  border-bottom: 1px solid #ebe6da;
  padding: 0.5rem 0;
  font-size: 0.9rem;
}

.aktivita-time {
  color: #888;
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}

.aktivita-kind {
  font-weight: 600;
}

.aktivita-target em {
  font-style: normal;
  color: #8a3033;
}

.aktivita-body small {
  color: #888;
  margin-left: 0.5rem;
}

@media (max-width: 768px) {
  .aktivita-entry { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --- F2K: Notifikace --- */

.notification-link {
  position: relative;
  text-decoration: none;
  margin-left: 0.25rem;
  display: inline-block;
}

.notification-bell {
  font-size: 1rem;
  margin-right: 0.2rem;
}

.notification-label {
  /* Visually hidden but accessible; keeps badge centered on bell */
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.notification-badge {
  position: absolute;
  top: -8px;
  right: -12px;
  background: #8a3033;
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.4rem;
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 18px;
  text-align: center;
  line-height: 1.2;
}

.notifikace-shell {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.notifikace-header h1 {
  margin-bottom: 0.5rem;
}

.notifikace-filter {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid #d8d2c4;
  margin-bottom: 1rem;
}
.notifikace-filter a {
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #666;
  border-bottom: 2px solid transparent;
}
.notifikace-filter a.active {
  color: #8a3033;
  border-bottom-color: #8a3033;
  font-weight: 600;
}

.notifikace-actions {
  margin: 0.5rem 0 1rem;
}

.notifikace-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.notifikace-entry {
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 0.75rem 1rem;
}
.notifikace-entry.unread {
  background: #fef9ed;
  border-color: #d6a64a;
}

.notifikace-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
  color: #888;
  margin-bottom: 0.25rem;
}
.notifikace-kind {
  background: #f0e8d8;
  color: #6b5e3a;
  padding: 0.1rem 0.5rem;
  border-radius: 3px;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.notifikace-message {
  font-size: 0.95rem;
}

.notifikace-actions-row {
  margin-top: 0.5rem;
}

.btn-link {
  background: transparent;
  border: 0;
  color: #8a3033;
  cursor: pointer;
  font: inherit;
  padding: 0;
}
.btn-link:hover { text-decoration: underline; }


/* --- F2L Fotky --- */

.fotky-shell,
.foto-upload-shell,
.fotky-confirm-shell {
  max-width: 1100px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.fotky-back {
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
}

.fotky-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin: 1rem 0 1.5rem;
}

.fotky-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}

.foto-card {
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 6px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.foto-card.primarni {
  border-color: #5a7a3a;
  box-shadow: 0 0 0 1px #5a7a3a;
}

.foto-card > img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  display: block;
  background: #f4f0e4;
}

.foto-meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  padding: 0.5rem;
  font-size: 0.85rem;
  color: #666;
}

.foto-datum {
  color: #888;
}

.foto-popis {
  padding: 0 0.5rem;
  font-size: 0.9rem;
  margin: 0 0 0.5rem;
  color: #444;
}

.foto-actions {
  padding: 0.5rem;
  border-top: 1px solid #ebe6da;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.foto-avatar-form {
  display: inline;
  margin: 0;
}

.link-danger {
  color: #8a3033;
  font-size: 0.85rem;
}

.osoba-avatar-link {
  float: right;
  margin: 0 0 0.5rem 1rem;
}

.osoba-avatar {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #d8d2c4;
  display: block;
}

.osoba-card-avatar-link {
  float: left;
  margin: 0 0.6rem 0.2rem 0;
}

.osoba-card-avatar {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 50%;
  display: block;
  border: 1px solid #d8d2c4;
}

.fotky-link {
  color: #6b5e3a;
}

.foto-upload-form .form-row {
  margin-bottom: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.foto-upload-form .form-row-inline {
  flex-direction: row;
  align-items: center;
}

.foto-upload-form .help {
  color: #888;
  font-size: 0.8rem;
}

.fotky-confirm-preview {
  margin: 1rem 0 1.5rem;
}

.foto-confirm-img {
  max-width: 360px;
  max-height: 360px;
  display: block;
  border: 1px solid #d8d2c4;
  border-radius: 6px;
}

/* --- F2M: Site header + hamburger nav — REMOVED v Gentelella migraci
       Gentelella shell (`base.html`) má vlastní top_nav + responsive sidebar; obsolete CSS dropped. --- */

/* --- F2M: Mobile responsive sweep --- */

/* Touch target minimum 44×44 px (Apple HIG / Material Design) for primary tappables.
   Scoped to avoid clobbering small icon-only buttons (e.g. .link-unlink) that have
   their own appropriate sizing. */
.btn-primary,
.btn-secondary,
.btn-accept,
.btn-reject,
.denik-save-btn,
.badatelna-filters button[type="submit"],
.osoby-filters button[type="submit"],
.strom-download {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Form inputs: 16px font prevents iOS zoom-on-focus; 44px+ touch target. */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="date"],
input[type="datetime-local"],
select,
textarea {
  font-size: 16px;
  min-height: 40px;
  box-sizing: border-box;
}

textarea { min-height: 80px; }

/* Tablet + mobile breakpoint */
@media (max-width: 768px) {
  body { font-size: 15px; }

  /* Note: top nav + sidebar collapsing handled by Gentelella shell (base.html / custom.min.css). */

  /* Shell layouts → single column on mobile */
  .badatelna-shell,
  .osoby-shell,
  .osoby-shell-with-filter,
  .osoba-detail-shell,
  .osoba-form-shell,
  .denik-shell,
  .matches-shell,
  .sdileni-shell,
  .aktivita-shell,
  .notifikace-shell,
  .fotky-shell,
  .foto-upload-shell,
  .fotky-confirm-shell,
  .vztah-confirm-shell,
  .vztah-form-shell,
  .osoba-confirm-shell,
  .gedcom-shell,
  .strom-shell {
    padding: 0 1rem;
  }

  .badatelna-shell,
  .osoby-shell-with-filter {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .badatelna-filters,
  .osoby-filters {
    position: static;
    margin-bottom: 0.5rem;
  }

  /* Tab nav: horizontal scroll fallback (prevents collapse / wrap) */
  .badatelna-tabs,
  .notifikace-filter {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap;
    white-space: nowrap;
    padding: 0 1rem;
  }
  .badatelna-tabs::-webkit-scrollbar,
  .notifikace-filter::-webkit-scrollbar { height: 4px; }

  /* Card grids → single column */
  .osoby-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  /* Foto galerie: 2 sloupce na malých obrazovkách (větší než 1 = lépe využit prostor) */
  .fotky-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
  .foto-card > img { height: 140px; }

  /* Tables: horizontal scroll (badatelna search results, etc.) */
  .badatelna-results { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .badatelna-results table { min-width: 600px; }
  .badatelna-results th,
  .badatelna-results td { padding: 0.4rem 0.5rem; font-size: 0.88rem; }

  /* Match suggestion row: stack vertically */
  .match-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
    text-align: left;
  }
  .match-score { text-align: left; }
  .match-actions {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .btn-accept, .btn-reject { flex: 1 1 auto; }

  /* Sharing rows */
  .sdileni-row {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }

  /* Aktivita stacks already handled at line 818 but ensure padding alignment */
  .aktivita-entry { padding: 0.5rem 0; }
  .aktivita-filter { flex-direction: column; align-items: stretch; gap: 0.5rem; }
  .aktivita-filter label { flex-direction: column; }

  /* Osoba header — stack title and nav */
  .osoby-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .osoby-header nav {
    flex-wrap: wrap;
    width: 100%;
  }

  /* Osoba actions wrap (rodokmen / návrhy / smazat) */
  .osoba-actions { flex-wrap: wrap; gap: 0.75rem; }

  /* Avatar smaller on mobile to free vertical space */
  .osoba-avatar {
    width: 72px;
    height: 72px;
  }
  .osoba-avatar-link { margin: 0 0 0.5rem 0.5rem; }

  /* Form fieldsets compact */
  .year-range,
  .typ-checkboxes {
    grid-template-columns: 1fr 1fr;
  }
  .year-range-set label { display: inline-block; margin-right: 0.75rem; }

  /* Filter forms: full-width submit on mobile */
  .form-actions { flex-wrap: wrap; }
  .form-actions .btn-primary,
  .form-actions .btn-secondary { flex: 1 1 auto; }

  /* Strom controls stack */
  .strom-controls { gap: 0.5rem; }
  .strom-download { margin-left: 0; margin-top: 0.25rem; }

  /* Foto confirm preview fit */
  .foto-confirm-img { max-width: 100%; height: auto; }

  /* Notifikace meta single-line ok ale wrap if needed */
  .notifikace-meta { flex-wrap: wrap; gap: 0.25rem; }

  /* Guest banner */
  .guest-banner { margin: 0.5rem 1rem; }

  /* Pagination touch-friendly */
  .pagination a,
  .pagination .current { min-width: 44px; min-height: 44px; display: inline-flex;
                         align-items: center; justify-content: center; }
}

/* Small phones: bump base font to 16px (prevents zoom + improves legibility) */
@media (max-width: 380px) {
  body { font-size: 16px; }
  h1 { font-size: 1.4rem; }
  h2 { font-size: 1.15rem; }

  .badatelna-tabs .tab,
  .notifikace-filter a { padding: 0.6rem 0.8rem; }

  .fotky-grid { grid-template-columns: 1fr; }
  .foto-card > img { height: 200px; }
}

/* Family tree SVG: enable pan but block native zoom (handled by our controls) */
.strom-canvas svg {
  touch-action: pan-x pan-y;
}

/* ====================================================================== */
/* F2N: Saved searches + Bulk actions                                     */
/* ====================================================================== */

.saved-shell {
  max-width: 700px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saved-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #fff;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 0.75rem 1rem;
}

.saved-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.saved-name {
  font-weight: 600;
  color: #8a3033;
  text-decoration: none;
}
.saved-name:hover { text-decoration: underline; }

.saved-meta {
  color: #888;
  font-size: 0.85rem;
}

.saved-link {
  margin-top: 0.5rem;
  font-size: 0.85rem;
}
.saved-link a { color: #6b6253; }

.save-search-form {
  display: flex;
  gap: 0.25rem;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #d8d2c4;
  flex-wrap: wrap;
}
.save-search-form input[type="text"] {
  flex: 1;
  min-width: 120px;
  padding: 0.3rem 0.5rem;
  border: 1px solid #c8c2b4;
  border-radius: 3px;
  font: inherit;
  min-height: 0;
}

.bulk-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  background: #f4f0e4;
  border: 1px solid #d8d2c4;
  border-radius: 4px;
  padding: 0.5rem 1rem;
  margin-bottom: 1rem;
  position: sticky;
  top: 0;
  z-index: 50;
}

.bulk-actions button {
  font-size: 0.85rem;
  padding: 0.3rem 0.6rem;
  min-height: 36px;
}

.bulk-actions .danger { color: #8a3033; }

.bulk-select-wrapper {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 10;
}

.bulk-select-wrapper input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

/* Card needs relative positioning for the absolutely-positioned checkbox. */
.osoba-card { position: relative; }
.denik-item { position: relative; }

/* --- F2O.2: notification preferences + unsubscribe ----------------------- */
.prefs-shell {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.prefs-nav {
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.prefs-nav a {
  color: #8a3033;
  text-decoration: none;
}

.prefs-intro {
  color: #555;
  margin-bottom: 1.5rem;
}

.prefs-saved {
  background: #e8f4e0;
  border: 1px solid #b8d8a0;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  color: #305020;
  margin-bottom: 1rem;
}

.prefs-error {
  background: #f8e0e0;
  border: 1px solid #d8a0a0;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  color: #503020;
  margin-bottom: 1rem;
}

.prefs-form {
  background: #fafaf6;
  border: 1px solid #ebe6da;
  border-radius: 6px;
  padding: 0.5rem 1.5rem;
  margin-bottom: 1.5rem;
}

.pref-row {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 0;
  border-bottom: 1px solid #ebe6da;
}

.pref-row:last-child {
  border-bottom: none;
}

.pref-row label {
  font-weight: 600;
  color: #2a2a2a;
}

.pref-row select {
  padding: 0.45rem 0.6rem;
  font-size: 0.95rem;
  border: 1px solid #d8d2c4;
  border-radius: 3px;
  background: #fff;
  min-height: 36px;
}

.prefs-form .form-actions {
  padding: 1rem 0 0.5rem;
  text-align: right;
}

.prefs-help {
  background: #f4f0e4;
  border: 1px solid #ebe6da;
  border-radius: 4px;
  padding: 1rem 1.25rem;
  color: #555;
  font-size: 0.9rem;
}

.prefs-help p {
  margin: 0.4rem 0;
}

.unsubscribe-shell {
  max-width: 600px;
  margin: 3rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.unsubscribe-shell h1 {
  color: #8a3033;
}

.unsubscribe-help {
  color: #555;
  font-size: 0.95rem;
  margin: 1.5rem 0;
}

@media (max-width: 640px) {
  .pref-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
}

/* --- Homepage (`/`) + archive landings (`/<slug>/`) ----------------------- */
/* Layout přechází na Bootstrap/Gentelella x_panel — staré .home-shell/.archive-tile/.archive-landing-shell
   classy odstraněny. Inline `.archive-tile` styly v templates jsou MVP — vyladění follow-up. */
.archive-tile:hover {
  background: #efe9d4;
}
@media (max-width: 600px) {
  .signatura-list {
    columns: 1 !important;
  }
}

/* --- Empty state partial (templates/_empty_state.html) ---------------------- */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: #888;
}
.empty-state-icon {
  font-size: 2.5rem;
  color: #ccc;
  margin-bottom: 0.6rem;
}
.empty-state-icon .fa {
  font-size: inherit;
}
.empty-state-title {
  margin: 0 0 0.6rem 0;
  color: #555;
  font-size: 1.2rem;
  font-weight: 500;
}
.empty-state-message {
  margin: 0 auto;
  max-width: 480px;
  line-height: 1.5;
  color: #777;
}
.empty-state-action {
  margin-top: 1.2rem;
}

/* --- Mobile overflow + 44px touch target sweep (audit 2026-05-28 P2) ------- */

/* Wide tables (wikipedie osoba detail, family relations, etc.) — wrap. */
.table-responsive-x {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* SVG strom — vizuální hint "swipe →" pro mobile uživatele. */
@media (max-width: 768px) {
  .strom-canvas::after {
    content: "← →";
    position: absolute;
    bottom: 0.4rem;
    right: 0.5rem;
    background: rgba(0, 0, 0, 0.3);
    color: #fff;
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    pointer-events: none;
  }
  .strom-canvas {
    position: relative;
  }
}

/* Notification badge — větší tap target na mobile (Apple HIG 44px min). */
@media (max-width: 768px) {
  .notification-badge {
    min-width: 1.6rem;
    min-height: 1.6rem;
    line-height: 1.6rem;
    padding: 0;
    font-size: 0.75rem;
  }
  /* Tap area kolem badge ikony — wrap link s padding 12px = 44px effective. */
  .notification-bell-link {
    display: inline-block;
    padding: 0.6rem 0.8rem;
    min-width: 44px;
    min-height: 44px;
  }
}

/* --- Global search v top navu (P2 #8 audit 2026-05-28) -------------------- */
.global-search-form {
  margin: 0;
  padding: 0;
}
.global-search-inner {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}
.global-search-input {
  flex: 1;
  min-width: 180px;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.7rem;
  font-size: 0.9rem;
  outline: none;
}
.global-search-input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}
.global-search-scope {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.5rem;
  font-size: 0.85rem;
  outline: none;
  cursor: pointer;
}
.global-search-scope option {
  color: #333;
}
.global-search-submit {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
}
.global-search-submit:hover {
  background: rgba(255, 255, 255, 0.15);
}
@media (max-width: 768px) {
  .global-search-form {
    width: 100%;
    margin-top: 0.5rem;
  }
  .global-search-input {
    font-size: 16px; /* iOS no-zoom-on-focus */
  }
}

/* --- Form errors partial (templates/_form_errors.html) ------------------- */
.form-errors-shell {
  margin: 0 0 1rem 0;
}
.form-errors-shell .alert {
  margin-bottom: 0.4rem;
  border-radius: 3px;
  padding: 0.6rem 0.9rem;
}
.form-errors-nonfield {
  font-weight: 500;
}
.form-errors-field {
  font-size: 0.92rem;
}
.form-errors-field strong {
  color: #8a3033;
}

/* --- HTMX global error toast (htmx:responseError handler v base.html) ----- */
.htmx-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  background: #8a3033;
  color: #fff;
  padding: 0.8rem 1.2rem;
  border-radius: 4px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
  z-index: 99999;
  max-width: 320px;
  font-size: 0.9rem;
  animation: htmx-toast-in 0.25s ease-out;
}
.htmx-toast.htmx-toast-fading {
  opacity: 0;
  transition: opacity 0.4s ease-out;
}
@keyframes htmx-toast-in {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
@media (max-width: 768px) {
  .htmx-toast {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}

/* --- A11y: skip link (audit 2026-05-28) ----------------------------------- */
/* Visible only when focused (Tab → first interactive element).
   Standard pattern: GitHub, MDN, gov.uk. */
.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: #8a3033;
  color: #fff;
  padding: 0.7rem 1.2rem;
  border-radius: 0 0 4px 0;
  text-decoration: none;
  z-index: 100000;
  font-weight: 500;
  transition: top 0.15s ease-out;
}
.skip-link:focus {
  top: 0;
  outline: 2px solid #fff;
  outline-offset: -4px;
}

/* Hide default outline on main if focused programatically by skip link */
main:focus {
  outline: none;
}

/* --- Generic pagination partial (templates/_pagination.html) --------------- */
.pagination-shell {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 1.5rem 0;
  gap: 0.5rem;
}
.pagination-shell .pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem;
  padding: 0;
  margin: 0;
  list-style: none;
  justify-content: center;
}
.pagination-shell .page-item {
  margin: 0;
}
.pagination-shell .page-link {
  display: inline-block;
  padding: 0.4rem 0.7rem;
  min-width: 38px;
  text-align: center;
  border: 1px solid #ddd;
  border-radius: 3px;
  color: #8a3033;
  background: #fff;
  text-decoration: none;
  font-size: 0.92rem;
  transition: background 0.12s;
}
.pagination-shell .page-link:hover {
  background: #efe9d4;
}
.pagination-shell .page-item.active .page-link {
  background: #8a3033;
  color: #fff;
  border-color: #8a3033;
  font-weight: 600;
}
.pagination-shell .page-item.disabled .page-link {
  color: #aaa;
  background: #f5f5f5;
  cursor: default;
}
.pagination-meta {
  font-size: 0.85rem;
  margin: 0;
}
@media (max-width: 600px) {
  .pagination-shell .page-link {
    padding: 0.45rem 0.55rem;
    min-width: 44px; /* Apple HIG touch target */
  }
}

/* --- Cookie consent banner (templates/_cookie_consent.html) --------------- */
.cookie-consent {
  position: fixed;
  bottom: 0;
  /* Na desktopu se vyhnout překryvu sidebar-footer (230px wide Gentelella).
     Mobile (≤768) má sidebar collapsed jako drawer → cookie banner full-width. */
  left: 230px;
  right: 0;
  background: #2c3e50;
  color: #fff;
  padding: 1rem 1.2rem;
  box-shadow: 0 -2px 16px rgba(0, 0, 0, 0.3);
  z-index: 99998;
}
@media (max-width: 768px) {
  .cookie-consent { left: 0; }
}
.cookie-consent-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
}
.cookie-consent h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  flex-shrink: 0;
}
.cookie-consent p {
  margin: 0;
  flex: 1;
  min-width: 280px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.cookie-consent p a {
  color: #1ABB9C;
  text-decoration: underline;
}
.cookie-consent-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}
.cookie-consent-actions .btn {
  min-height: 44px;  /* Apple HIG touch target */
}
/* Override Bootstrap btn-default na dark navy bg — světlejší pro čitelnost. */
.cookie-consent-actions .btn-default {
  background: #fff;
  color: #2c3e50;
  border-color: #fff;
}
.cookie-consent-actions .btn-default:hover,
.cookie-consent-actions .btn-default:focus {
  background: #ecf0f1;
  color: #2c3e50;
  border-color: #ecf0f1;
}
.cookie-consent-actions .btn-primary {
  background: #8a3033;
  border-color: #8a3033;
}
.cookie-consent-actions .btn-primary:hover,
.cookie-consent-actions .btn-primary:focus {
  background: #6e2629;
  border-color: #6e2629;
}
@media (max-width: 600px) {
  .cookie-consent-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .cookie-consent-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* --- Print stylesheet (audit 2026-05-28) ---------------------------------- */
@media print {
  /* Hide UI chrome — sidebar, top nav, footer, modals, banners. */
  #sidebar-menu,
  .top_nav,
  .left_col,
  footer,
  .global-search-form,
  .cookie-consent,
  .htmx-toast,
  .skip-link,
  .nprogress,
  .modal,
  .modal-backdrop,
  .btn,
  .pagination-shell,
  .global-search-input,
  #pwa-install-btn,
  [aria-disabled="true"],
  .disabled-link {
    display: none !important;
  }

  /* Reset body + main content — full width, black on white. */
  body,
  body.nav-md,
  body.nav-sm {
    background: #fff !important;
    color: #000 !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  .right_col,
  main {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
  }
  .container,
  .main_container,
  .x_panel {
    box-shadow: none !important;
    border: 0 !important;
    background: #fff !important;
    padding: 0 !important;
    margin: 0 0 0.5cm 0 !important;
  }
  .x_title {
    border-bottom: 1px solid #000 !important;
    padding-bottom: 0.2cm !important;
    margin-bottom: 0.3cm !important;
  }

  /* Tables — bordered, no zebra (toner). */
  table.table,
  .table-responsive-x table {
    border-collapse: collapse !important;
  }
  table.table th,
  table.table td {
    border: 1px solid #444 !important;
    background: transparent !important;
    color: #000 !important;
  }

  /* Links — show URL after text (genealog tištěný report → reference). */
  a[href]:not([href^="javascript:"]):not([href^="#"]):after {
    content: " (" attr(href) ")";
    font-size: 0.85em;
    color: #666;
    font-weight: normal;
  }

  /* Page-break hints. */
  .x_panel,
  .osoba-card,
  .matches-list .match-row,
  .foto-card,
  .table-responsive-x {
    page-break-inside: avoid;
    break-inside: avoid;
  }
  h1, h2, h3, h4 {
    page-break-after: avoid;
    break-after: avoid;
  }

  /* SVG rodokmen — keep visible, full width. */
  .strom-canvas,
  svg {
    max-width: 100% !important;
    height: auto !important;
  }

  /* Empty state + alert — keep visible. */
  .empty-state,
  .alert {
    border: 1px dashed #888 !important;
    padding: 0.5cm !important;
  }
}

/* --- Wikipedie index featured lists --------------------------------------- */
.featured-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.2rem;
  margin: 0.5rem 0 1.5rem 0;
}
.featured-list li {
  padding: 0.25rem 0;
}
.tile-stats h3 a {
  color: inherit;
  text-decoration: none;
}
.tile-stats h3 a:hover {
  text-decoration: underline;
}

/* --- Sticky footer pattern (audit 2026-05-29 revize) ----------------------- */
/* Gentelella .container.body je už flex (sidebar + content). Nelze nastavovat
   body.nav-md flex-direction: column — rozbije se layout sidebaru.
   Místo toho: min-height na .right_col tak aby content vyplnil viewport. */
html, body {
  min-height: 100vh;
}
.right_col {
  min-height: calc(100vh - 50px);
  display: flex;
  flex-direction: column;
}
.right_col > main {
  flex: 1 0 auto;
}
.right_col > footer {
  flex-shrink: 0;
}

/* --- Long-text overflow safety ------------------------------------------ */
/* Pro Wikipedie etymology + osobní jména s diakritiku + dlouhé URL anchor texts. */
.word-break-anywhere {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.x_content {
  overflow-wrap: break-word;
}

/* --- Django messages toast (audit 2026-05-29) ---------------------------- */
.django-toast {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 280px;
}
.django-toast-icon {
  font-weight: bold;
  font-size: 1.1rem;
  min-width: 1.5rem;
  text-align: center;
}
.django-toast-text {
  flex: 1;
}
.django-toast-close {
  background: transparent;
  border: 0;
  color: rgba(255, 255, 255, 0.8);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.3rem;
  min-width: 30px;
  min-height: 30px;
}
.django-toast-close:hover { color: #fff; }

.django-toast[data-level~="success"] { background: #2c8a3a; }
.django-toast[data-level~="error"],
.django-toast[data-level~="danger"] { background: #c0392b; }
.django-toast[data-level~="warning"] { background: #e67e22; }
.django-toast[data-level~="info"] { background: #2980b9; }

/* Stack toasts (multiple messages) */
#django-messages-container .django-toast {
  position: relative;
  bottom: auto;
  right: auto;
  margin-bottom: 0.5rem;
}
#django-messages-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 99999;
  max-width: 360px;
}
@media (max-width: 768px) {
  #django-messages-container {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    max-width: none;
  }
}

/* --- Unified search UI (audit 2026-05-29 P2 #13) ------------------------ */
.search-unified {
  max-width: 980px;
  margin: 0 auto;
}
.search-tabs {
  margin-bottom: 1rem;
  border-bottom: 2px solid #ddd;
}
.search-tabs > li > a {
  color: #555;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.search-tabs > li > a:hover {
  background: #f5f5f5;
  color: #8a3033;
}
.search-tabs > li.active > a,
.search-tabs > li.active > a:focus,
.search-tabs > li.active > a:hover {
  color: #8a3033;
  border-bottom: 2px solid #8a3033;
  margin-bottom: -2px;
  background: transparent;
}
.search-tab-badge {
  display: inline-block;
  background: #1ABB9C;
  color: #fff;
  padding: 0.05rem 0.4rem;
  border-radius: 8px;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  min-width: 1.4rem;
  text-align: center;
}
.search-tabs > li.active .search-tab-badge {
  background: #8a3033;
}
.search-tab-content {
  padding: 0.5rem 0 1rem 0;
}
.search-hits {
  list-style: none;
  padding: 0;
  margin: 0;
}
.search-hit {
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid #eee;
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.search-hit:hover {
  background: #fafafa;
}
.search-hit:last-child {
  border-bottom: 0;
}
.search-hit-title {
  font-weight: 500;
  color: #2c3e50;
  text-decoration: none;
  flex-grow: 1;
}
.search-hit-title:hover {
  color: #8a3033;
  text-decoration: underline;
}
.search-hit-subtitle {
  color: #888;
  font-size: 0.85rem;
}
.search-more {
  margin-top: 1.2rem;
  text-align: center;
}
@media (max-width: 600px) {
  .search-tabs > li > a {
    padding: 0.4rem 0.5rem;
    font-size: 0.85rem;
  }
}
