:root {
  --navy:      #020659;
  --navy-deep: #031059;
  --plum:      #574973;
  --salmon:    #E7180B;
  --salmon-light: #FFF0ED;
  --white:     #FFFFFF;
  --gray-50:   #FAFAFA;
  --gray-100:  #F0F0F0;
  --gray-200:  #E5E5E5;
  --gray-300:  #D4D4D4;
  --gray-500:  #737373;
  --gray-700:  #404040;
  --focus-ring: 0 0 0 3px rgba(231, 24, 11, 0.4);
  --transition-fast: 150ms ease;
  --transition-normal: 200ms ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Arial', sans-serif;
  background: var(--white);
  color: var(--navy);
  line-height: 1.5;
  min-height: 100vh;
}

/* SKIP LINK - Accessibilité */
.skip-link {
  position: absolute;
  top: -100px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--navy);
  color: var(--white);
  padding: 12px 24px;
  z-index: 9999;
  text-decoration: none;
  font-weight: bold;
  border-radius: 0 0 4px 4px;
  transition: top var(--transition-fast);
}
.skip-link:focus {
  top: 0;
  outline: none;
}

/* Visually hidden - pour lecteurs d'écran */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* FOCUS STATES - Accessibilité */
:focus-visible {
  outline: 2px solid var(--salmon);
  outline-offset: 2px;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  box-shadow: var(--focus-ring);
  outline: none;
}

/* HEADER */
header {
  border-bottom: 1px dotted var(--salmon);
  padding: 24px 40px;
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 20px;
}
.salmon-bar {
  width: 8px;
  height: 48px;
  background: var(--salmon);
  flex-shrink: 0;
}
.brand {
  flex: 1;
}
.brand-title {
  font-family: 'Arial Black', sans-serif;
  font-size: 18px;
  color: var(--navy);
  letter-spacing: 0.5px;
}
.brand-title .light {
  font-family: 'Arial', sans-serif;
  font-weight: normal;
  color: var(--plum);
}
.brand-sub {
  font-size: 10px;
  color: var(--plum);
  margin-top: 2px;
  letter-spacing: 0.3px;
}
.stats-inline {
  display: flex;
  gap: 24px;
  font-size: 10px;
  color: var(--plum);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.stats-inline strong {
  font-family: 'Arial Black', sans-serif;
  color: var(--navy);
  font-size: 14px;
  display: block;
  margin-top: 2px;
}

/* HERO + SEARCH */
.hero {
  padding: 60px 40px 40px;
  max-width: 1400px;
  margin: 0 auto;
}
.hero-label {
  font-size: 9px;
  color: var(--plum);
  letter-spacing: 1.5px;
  margin-bottom: 12px;
}
.hero h1 {
  font-size: clamp(32px, 6vw, 52px);
  line-height: 1;
  margin-bottom: 20px;
  letter-spacing: -1px;
}
.hero h1 .strong {
  font-family: 'Arial Black', sans-serif;
  font-weight: bold;
  color: var(--navy);
}
.hero h1 .light {
  font-family: 'Arial', sans-serif;
  font-weight: normal;
  color: var(--gray-700);
}
.hero-sub {
  font-style: italic;
  color: var(--plum);
  font-size: 14px;
  margin-bottom: 32px;
}

.search-container {
  display: flex;
  gap: 12px;
  align-items: stretch;
  max-width: 860px;
}
.search-box {
  position: relative;
  flex: 1;
  max-width: 720px;
}
.search-box input {
  width: 100%;
  padding: 18px 54px 18px 52px;
  font-size: 16px;
  font-family: 'Arial', sans-serif;
  border: 2px solid var(--navy);
  background: var(--white);
  color: var(--navy);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  border-radius: 0;
}
.search-box input:focus {
  border-color: var(--salmon);
  box-shadow: var(--focus-ring);
}
.search-box input::placeholder {
  color: var(--gray-500);
  font-style: italic;
}
/* Cacher le X natif de type="search" */
.search-box input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}
.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  stroke: var(--navy);
  fill: none;
  stroke-width: 2.5;
  pointer-events: none;
}
.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--navy);
  color: var(--white);
  border: none;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  display: none;
  align-items: center;
  justify-content: center;
  font-family: 'Arial', sans-serif;
  transition: background var(--transition-fast), transform var(--transition-fast);
}
.clear-btn:hover {
  background: var(--salmon);
}
.clear-btn:active {
  transform: translateY(-50%) scale(0.95);
}
.clear-btn.visible { display: flex; }

/* Bouton Rechercher */
.search-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 24px;
  background: var(--salmon);
  color: var(--white);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-family: 'Arial', sans-serif;
  font-weight: bold;
  letter-spacing: 0.5px;
  transition: background var(--transition-fast), transform var(--transition-fast);
  flex-shrink: 0;
}
.search-btn:hover {
  background: var(--navy);
}
.search-btn:active {
  transform: scale(0.98);
}
.search-btn svg {
  flex-shrink: 0;
}

/* FILTERS */
.filters {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 40px 20px;
}
.filter-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.filter-label {
  font-size: 9px;
  color: var(--plum);
  letter-spacing: 1.5px;
}

/* Switch / Toggle */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  background: var(--gray-300);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: background var(--transition-fast);
  padding: 0;
}
.switch:hover {
  background: var(--gray-500);
}
.switch[aria-checked="true"] {
  background: var(--salmon);
}
.switch-slider {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: var(--white);
  border-radius: 50%;
  transition: transform var(--transition-fast);
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.switch[aria-checked="true"] .switch-slider {
  transform: translateX(20px);
}

/* Bouton effacer filtre */
.clear-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  font-size: 10px;
  font-family: 'Arial', sans-serif;
  background: var(--salmon-light);
  color: var(--salmon);
  border: 1px solid var(--salmon);
  cursor: pointer;
  transition: all var(--transition-fast);
  margin-left: auto;
}
.clear-filter-btn:hover {
  background: var(--salmon);
  color: var(--white);
}
.clear-filter-btn.visible {
  display: inline-flex;
}

.theme-chips-wrapper {
  overflow: hidden;
  margin: 0 -40px;
  padding: 0 40px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--gray-300) transparent;
  max-height: 500px;
  transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
  overflow-x: auto;
}
.theme-chips-wrapper.collapsed {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  pointer-events: none;
}
.theme-chips-wrapper::-webkit-scrollbar {
  height: 6px;
}
.theme-chips-wrapper::-webkit-scrollbar-track {
  background: transparent;
}
.theme-chips-wrapper::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 3px;
}
.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-start;
}

/* Groupe parent + enfants */
.chip-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chip {
  padding: 8px 14px;
  font-size: 11px;
  font-family: 'Arial', sans-serif;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all var(--transition-fast);
  letter-spacing: 0.3px;
  white-space: nowrap;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip:hover {
  border-color: var(--navy);
  background: var(--gray-50);
}
.chip.active {
  background: var(--salmon);
  color: var(--white);
  border-color: var(--salmon);
}
.chip .count {
  color: var(--plum);
  font-size: 10px;
}
.chip.active .count {
  color: var(--white);
  font-weight: bold;
}

/* Parent avec flèche */
.chip-parent {
  font-weight: bold;
}
.chip-arrow {
  color: var(--plum);
  transition: transform var(--transition-fast);
  flex-shrink: 0;
}
.chip-parent[aria-expanded="true"] .chip-arrow {
  transform: rotate(180deg);
}
.chip-parent.active .chip-arrow {
  color: var(--white);
}

/* Conteneur enfants */
.chip-children {
  display: none;
  flex-wrap: wrap;
  gap: 4px;
  padding-left: 12px;
  border-left: 2px solid var(--gray-200);
  margin-left: 8px;
}
.chip-children.expanded {
  display: flex;
}

/* Chips enfants */
.chip-child {
  font-size: 10px;
  padding: 6px 10px;
  min-height: 32px;
  background: var(--gray-50);
}
.chip-child:hover {
  background: var(--gray-100);
}
.chip-child.active {
  background: var(--navy);
  border-color: var(--navy);
}

/* RESULTS HEADER */
.results-header {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-top: 1px solid var(--gray-200);
}
.results-info {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.results-count {
  font-size: 11px;
  color: var(--plum);
  letter-spacing: 0.5px;
}
.results-count strong {
  font-family: 'Arial Black', sans-serif;
  color: var(--navy);
  font-size: 13px;
}

/* SORT CONTROLS */
.sort-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.sort-label {
  font-size: 10px;
  color: var(--plum);
  letter-spacing: 0.3px;
  text-transform: uppercase;
}
.sort-select {
  padding: 8px 32px 8px 12px;
  font-size: 11px;
  font-family: 'Arial', sans-serif;
  border: 1px solid var(--gray-300);
  background: var(--white);
  color: var(--navy);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23020659' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-height: 36px;
  transition: border-color var(--transition-fast);
}
.sort-select:hover {
  border-color: var(--navy);
}
.sort-select:focus {
  border-color: var(--salmon);
}

.view-toggle {
  display: flex;
  gap: 4px;
}
.view-btn {
  padding: 8px 16px;
  font-size: 10px;
  font-family: 'Arial', sans-serif;
  letter-spacing: 0.5px;
  background: var(--white);
  color: var(--navy);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  text-transform: uppercase;
  min-height: 36px;
  transition: all var(--transition-fast);
}
.view-btn:hover {
  border-color: var(--navy);
}
.view-btn.active {
  background: var(--navy);
  color: var(--white);
  border-color: var(--navy);
}

/* MAIN CONTENT */
main {
  min-height: 300px;
}

/* GRID VIEW */
.grid {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px 60px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
}
.card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-4px);
  border-color: var(--navy);
  box-shadow: 0 8px 24px rgba(2, 6, 89, 0.12);
}
.card:focus-visible {
  transform: translateY(-4px);
  border-color: var(--salmon);
  box-shadow: var(--focus-ring);
  outline: none;
}
.card-image {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--gray-100);
  position: relative;
}
.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--transition-normal);
}
.card:hover .card-image img {
  transform: scale(1.03);
}
/* Skeleton loading pour images */
.card-image.loading {
  background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-50) 50%, var(--gray-100) 75%);
  background-size: 200% 100%;
  animation: skeleton 1.5s infinite;
}
@keyframes skeleton {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.card-number {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--navy);
  color: var(--white);
  font-family: 'Arial Black', sans-serif;
  font-size: 11px;
  padding: 4px 10px;
  letter-spacing: 0.5px;
}
.card-body {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-theme {
  font-family: 'Arial Black', sans-serif;
  font-size: 12px;
  color: var(--navy);
  line-height: 1.3;
  margin-bottom: 8px;
  flex: 1;
}
.card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px dotted var(--salmon);
  font-size: 10px;
  color: var(--plum);
  letter-spacing: 0.3px;
}
.card-meta .voir {
  color: var(--navy);
  font-weight: bold;
  transition: color var(--transition-fast);
}
.card:hover .card-meta .voir {
  color: var(--salmon);
}

/* MATCH HIGHLIGHT */
.match-badge {
  display: inline-block;
  background: var(--salmon);
  color: var(--white);
  font-family: 'Arial Black', sans-serif;
  font-size: 9px;
  padding: 3px 8px;
  letter-spacing: 0.3px;
  margin-left: 8px;
  vertical-align: middle;
}
.match-preview {
  margin-top: 8px;
  padding: 10px;
  background: var(--salmon-light);
  border-left: 3px solid var(--salmon);
  font-size: 11px;
  color: var(--navy);
  font-style: italic;
  line-height: 1.5;
  max-height: 70px;
  overflow: hidden;
}
.match-preview mark {
  background: var(--salmon);
  color: var(--white);
  padding: 1px 3px;
  font-weight: bold;
  font-style: normal;
}

/* LIST VIEW */
.list-view {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px 40px 60px;
}
.list-card {
  display: flex;
  flex-direction: row;
  margin-bottom: 12px;
  min-height: 110px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  cursor: pointer;
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
}
.list-card:hover {
  transform: translateX(4px);
  border-color: var(--navy);
  box-shadow: 0 4px 16px rgba(2, 6, 89, 0.1);
}
.list-card:focus-visible {
  border-color: var(--salmon);
  box-shadow: var(--focus-ring);
  outline: none;
}
.list-card-image {
  width: 180px;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.list-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.list-card-body {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* EMPTY STATE */
.empty-state {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 40px;
  text-align: center;
}
.empty-state h2 {
  font-family: 'Arial Black', sans-serif;
  font-size: 24px;
  color: var(--navy);
  margin-bottom: 12px;
}
.empty-state p {
  font-style: italic;
  color: var(--plum);
  font-size: 14px;
  margin-bottom: 24px;
}
.empty-state-suggestions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}
.suggestion-chip {
  padding: 8px 16px;
  font-size: 12px;
  font-family: 'Arial', sans-serif;
  background: var(--gray-100);
  color: var(--navy);
  border: 1px solid var(--gray-300);
  cursor: pointer;
  transition: all var(--transition-fast);
}
.suggestion-chip:hover {
  background: var(--salmon);
  color: var(--white);
  border-color: var(--salmon);
}

/* MODAL */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 89, 0.9);
  z-index: 1000;
  display: none;
  align-items: flex-start;
  justify-content: center;
  overflow-y: auto;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
}
.modal-overlay.open {
  display: flex;
}
.modal {
  background: var(--white);
  max-width: 1100px;
  width: 100%;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  background: var(--navy);
  color: var(--white);
  border: none;
  width: 44px;
  height: 44px;
  font-size: 18px;
  cursor: pointer;
  z-index: 10;
  font-family: 'Arial', sans-serif;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}
.modal-close:hover {
  background: var(--salmon);
}
.modal-image-wrap {
  background: var(--gray-100);
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-image-wrap img {
  width: 100%;
  height: auto;
  max-height: 90vh;
  object-fit: contain;
  display: block;
}
.modal-content {
  padding: 40px 36px;
  overflow-y: auto;
}

/* Desktop : image sticky */
@media (min-width: 1025px) {
  .modal-image-wrap {
    position: sticky;
    top: 0;
    align-self: start;
    max-height: 90vh;
  }
  .modal-content {
    max-height: 90vh;
  }
}
.modal-label {
  font-size: 9px;
  color: var(--plum);
  letter-spacing: 1.5px;
  margin-bottom: 8px;
}
.modal-title {
  font-size: 28px;
  line-height: 1.1;
  margin-bottom: 8px;
  letter-spacing: -0.5px;
}
.modal-title .num {
  font-family: 'Arial Black', sans-serif;
  color: var(--navy);
  white-space: nowrap;
}
.modal-title .theme {
  font-family: 'Arial', sans-serif;
  font-weight: normal;
  color: var(--gray-700);
  display: block;
  font-size: 20px;
  margin-top: 4px;
}
.modal-subtitle {
  font-style: italic;
  color: var(--plum);
  font-size: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px dotted var(--salmon);
}

.items-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}
.items-table thead th {
  text-align: left;
  padding: 10px 8px;
  font-family: 'Arial', sans-serif;
  font-size: 9px;
  font-weight: normal;
  color: var(--plum);
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-bottom: 2px solid var(--navy);
  position: sticky;
  top: 0;
  background: var(--white);
}
.items-table tbody tr {
  border-bottom: 1px solid var(--gray-100);
  transition: background var(--transition-fast);
}
.items-table tbody tr:hover {
  background: var(--gray-50);
}
.items-table td {
  padding: 12px 8px;
  vertical-align: top;
}
.items-table .col-n {
  font-family: 'Arial Black', sans-serif;
  font-size: 11px;
  color: var(--plum);
  width: 32px;
  white-space: nowrap;
}
.items-table .col-article {
  font-family: 'Arial Black', sans-serif;
  font-size: 11px;
  color: var(--navy);
}
.items-table .col-type {
  color: var(--navy);
  font-size: 11px;
}
.items-table .col-qty {
  text-align: center;
  font-family: 'Arial Black', sans-serif;
  color: var(--navy);
  width: 44px;
}
.items-table .col-notes {
  color: var(--plum);
  font-size: 10px;
  font-style: italic;
}
.items-table mark {
  background: var(--salmon);
  color: var(--white);
  padding: 1px 3px;
  font-weight: bold;
  font-style: normal;
}
.item-row.highlighted {
  background: var(--salmon-light);
}
.item-row.highlighted td:first-child {
  border-left: 3px solid var(--salmon);
}

/* BACK TO TOP BUTTON */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  background: var(--navy);
  color: var(--white);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px);
  transition: all var(--transition-normal);
  z-index: 500;
  box-shadow: 0 4px 12px rgba(2, 6, 89, 0.3);
}
.back-to-top:hover {
  background: var(--salmon);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(231, 24, 11, 0.3);
}
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* LOADING SPINNER */
.loading-spinner {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 60px;
}
.loading-spinner::after {
  content: '';
  width: 40px;
  height: 40px;
  border: 3px solid var(--gray-200);
  border-top-color: var(--salmon);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* FOOTER */
footer {
  border-top: 1px solid var(--gray-200);
  padding: 24px 40px;
  text-align: center;
  font-size: 10px;
  color: var(--plum);
  letter-spacing: 0.3px;
}

/* RESPONSIVE - Tablette */
@media (max-width: 1024px) {
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }

  /* Modal tablette */
  .modal {
    grid-template-columns: 1fr;
    max-width: 700px;
  }
  .modal-image-wrap {
    position: relative;
    top: auto;
    max-height: none;
    height: auto;
  }
  .modal-image-wrap img {
    max-height: 50vh;
    width: 100%;
    object-fit: contain;
  }
  .modal-content {
    max-height: none;
    overflow-y: visible;
  }

  /* Table tablette - garder le format tableau */
  .items-table .col-n {
    white-space: nowrap;
  }
}

/* RESPONSIVE - Mobile */
@media (max-width: 768px) {
  header {
    padding: 12px 16px;
    flex-wrap: wrap;
    gap: 12px;
  }
  .salmon-bar {
    width: 6px;
    height: 40px;
  }
  .brand-title {
    font-size: 16px;
  }
  .stats-inline {
    width: 100%;
    justify-content: space-between;
    margin-top: 0;
    padding-top: 10px;
    border-top: 1px dotted var(--gray-200);
    gap: 12px;
  }
  .stats-inline strong {
    font-size: 12px;
  }

  .hero {
    padding: 24px 16px 20px;
  }
  .hero-label {
    font-size: 8px;
    margin-bottom: 8px;
  }
  .hero h1 {
    font-size: 28px;
    margin-bottom: 12px;
  }
  .hero-sub {
    font-size: 12px;
    margin-bottom: 20px;
  }
  .search-container {
    flex-direction: column;
    gap: 10px;
  }
  .search-box {
    max-width: none;
  }
  .search-box input {
    padding: 14px 44px 14px 44px;
    font-size: 16px; /* Évite le zoom sur iOS */
  }
  .search-icon {
    left: 14px;
    width: 20px;
    height: 20px;
  }
  .clear-btn {
    right: 10px;
    width: 28px;
    height: 28px;
  }
  .search-btn {
    width: 100%;
    padding: 12px;
    font-size: 13px;
  }
  .search-btn svg {
    width: 18px;
    height: 18px;
  }

  .filters {
    padding: 0 16px 12px;
  }
  .filter-header {
    gap: 8px;
    flex-wrap: wrap;
  }
  .filter-label {
    font-size: 8px;
  }
  .switch {
    width: 40px;
    height: 22px;
  }
  .switch-slider {
    width: 18px;
    height: 18px;
  }
  .switch[aria-checked="true"] .switch-slider {
    transform: translateX(18px);
  }
  .clear-filter-btn {
    font-size: 9px;
    padding: 5px 10px;
  }
  .theme-chips-wrapper {
    margin: 0 -16px;
    padding: 0 16px 10px;
  }
  .theme-chips {
    flex-wrap: nowrap;
    align-items: stretch;
  }
  .chip-group {
    flex-shrink: 0;
  }
  .chip {
    padding: 6px 10px;
    font-size: 10px;
    min-height: 36px;
  }
  .chip-child {
    padding: 5px 8px;
    min-height: 28px;
    font-size: 9px;
  }
  .chip-children {
    padding-left: 6px;
    margin-left: 4px;
  }
  .chip-arrow {
    width: 10px;
    height: 10px;
  }

  .results-header {
    padding: 12px 16px 8px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .results-info {
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .results-count {
    font-size: 10px;
  }
  .results-count strong {
    font-size: 12px;
  }
  .sort-controls {
    width: 100%;
  }
  .sort-label {
    font-size: 9px;
  }
  .sort-select {
    flex: 1;
    font-size: 10px;
    padding: 8px 28px 8px 10px;
    min-height: 34px;
  }
  .view-toggle {
    width: 100%;
    margin-top: 4px;
  }
  .view-btn {
    flex: 1;
    justify-content: center;
    padding: 8px 12px;
    font-size: 9px;
    min-height: 34px;
  }

  .grid {
    padding: 12px 16px 32px;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .card-image {
    aspect-ratio: 1/1;
  }
  .card-number {
    top: 8px;
    left: 8px;
    font-size: 10px;
    padding: 3px 8px;
  }
  .card-body {
    padding: 10px;
  }
  .card-theme {
    font-size: 10px;
    margin-bottom: 6px;
  }
  .card-meta {
    font-size: 9px;
    padding-top: 6px;
  }
  .match-badge {
    display: block;
    margin-left: 0;
    margin-top: 4px;
    width: fit-content;
    font-size: 8px;
    padding: 2px 6px;
  }
  .match-preview {
    font-size: 9px;
    padding: 6px;
    margin-top: 6px;
    max-height: 50px;
  }

  .list-view {
    padding: 12px 16px 32px;
  }
  .list-card {
    flex-direction: column;
    min-height: auto;
    margin-bottom: 10px;
  }
  .list-card-image {
    width: 100%;
    height: 150px;
  }
  .list-card-body {
    padding: 12px;
  }

  .modal {
    grid-template-columns: 1fr;
    margin: 0;
    max-height: none;
    min-height: 100vh;
  }
  .modal-overlay {
    padding: 0;
    align-items: flex-start;
  }
  .modal-image-wrap {
    position: relative;
    top: auto;
    max-height: none;
    height: auto;
    flex-shrink: 0;
  }
  .modal-image-wrap img {
    max-height: 40vh;
    width: 100%;
    object-fit: cover;
  }
  .modal-content {
    padding: 20px 16px;
    max-height: none;
    overflow-y: visible;
    flex: 1;
  }
  .modal-label {
    font-size: 8px;
  }
  .modal-title {
    font-size: 20px;
  }
  .modal-title .theme {
    font-size: 14px;
  }
  .modal-subtitle {
    font-size: 11px;
    margin-bottom: 16px;
    padding-bottom: 12px;
  }
  .modal-close {
    top: 10px;
    right: 10px;
    width: 40px;
    height: 40px;
  }

  /* Table responsive */
  .items-table {
    font-size: 10px;
    display: block;
  }
  .items-table thead {
    display: none;
  }
  .items-table tbody {
    display: block;
  }
  .items-table tr {
    display: block;
    padding: 10px 0;
    border-bottom: 1px solid var(--gray-200);
    position: relative;
    padding-right: 45px;
  }
  .items-table td {
    display: block;
    padding: 3px 0;
  }
  .items-table td::before {
    content: attr(data-label);
    font-size: 8px;
    color: var(--plum);
    text-transform: uppercase;
    display: block;
    margin-bottom: 1px;
  }
  .items-table .col-n {
    position: absolute;
    right: 0;
    top: 10px;
    background: var(--gray-100);
    padding: 3px 6px;
    font-size: 10px;
  }
  .items-table .col-article {
    font-size: 10px;
  }
  .items-table .col-type,
  .items-table .col-notes {
    font-size: 9px;
  }
  .item-row.highlighted td:first-child {
    border-left: none;
  }
  .item-row.highlighted {
    border-left: 3px solid var(--salmon);
    padding-left: 10px;
  }

  .back-to-top {
    bottom: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
  }
  .back-to-top svg {
    width: 20px;
    height: 20px;
  }

  .empty-state {
    padding: 40px 20px;
  }
  .empty-state h2 {
    font-size: 20px;
  }
  .empty-state p {
    font-size: 12px;
  }
  .suggestion-chip {
    font-size: 11px;
    padding: 6px 12px;
  }

  footer {
    padding: 16px;
    font-size: 9px;
  }
}

/* RESPONSIVE - Très petit écran (< 400px) */
@media (max-width: 400px) {
  header {
    padding: 10px 12px;
  }
  .brand-title {
    font-size: 14px;
  }
  .brand-sub {
    font-size: 9px;
  }
  .stats-inline {
    gap: 8px;
    font-size: 9px;
  }
  .stats-inline strong {
    font-size: 11px;
  }

  .hero {
    padding: 20px 12px 16px;
  }
  .hero h1 {
    font-size: 24px;
  }
  .hero-sub {
    font-size: 11px;
  }
  .search-box input {
    padding: 12px 40px 12px 38px;
    font-size: 15px;
  }
  .search-icon {
    left: 10px;
    width: 18px;
    height: 18px;
  }
  .clear-btn {
    right: 8px;
    width: 26px;
    height: 26px;
  }
  .search-btn {
    padding: 10px;
    font-size: 12px;
  }

  .filters {
    padding: 0 12px 10px;
  }
  .theme-chips-wrapper {
    margin: 0 -12px;
    padding: 0 12px 8px;
  }

  .results-header {
    padding: 10px 12px 8px;
  }

  .grid {
    padding: 10px 12px 24px;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .card-body {
    padding: 8px;
  }
  .card-theme {
    font-size: 9px;
  }
  .card-meta {
    font-size: 8px;
  }
  .card-number {
    font-size: 9px;
    padding: 2px 6px;
  }

  .list-view {
    padding: 10px 12px 24px;
  }
  .list-card-image {
    height: 120px;
  }

  .modal-content {
    padding: 16px 12px;
  }
  .modal-title {
    font-size: 18px;
  }
  .modal-title .theme {
    font-size: 13px;
  }
}

/* Réduction des animations si préférence utilisateur */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
}

/* Mode sombre (optionnel, suit les préférences système) */
@media (prefers-color-scheme: dark) {
  :root {
    --white: #1a1a2e;
    --gray-50: #242438;
    --gray-100: #2d2d44;
    --gray-200: #3d3d58;
    --gray-300: #4d4d68;
    --gray-500: #8888a0;
    --gray-700: #c0c0d0;
    --navy: #e0e0ff;
    --navy-deep: #d0d0f0;
    --plum: #a0a0c0;
  }

  body {
    background: #0f0f1a;
  }

  header {
    background: #1a1a2e;
  }

  .search-box input {
    background: #242438;
  }

  .modal {
    background: #1a1a2e;
  }

  .items-table thead th {
    background: #1a1a2e;
  }
}
