/* =========================================================
   AGRO PAGE — FEUILLE DE STYLE COMPLÈTE
   ========================================================= */

.agro-page {
  --agro-bg: #f3f7f4;
  --agro-surface: #ffffff;
  --agro-surface-muted: #f7faf8;

  --agro-text: #17231b;
  --agro-muted: #66736a;
  --agro-line: #dfe8e1;

  --agro-primary: #237a46;
  --agro-primary-dark: #155e35;
  --agro-primary-hover: #1b693c;
  --agro-primary-soft: #e7f5ec;
  --agro-primary-light: #eff9f2;
  --agro-accent: #dff27d;

  --agro-radius-sm: 10px;
  --agro-radius-md: 16px;
  --agro-radius-lg: 24px;
  --agro-radius-xl: 30px;

  --agro-shadow-xs: 0 1px 2px rgba(20, 54, 32, 0.04);
  --agro-shadow-sm: 0 8px 24px rgba(24, 65, 39, 0.07);
  --agro-shadow-md: 0 16px 40px rgba(24, 65, 39, 0.10);
  --agro-shadow-lg: 0 26px 70px rgba(24, 65, 39, 0.15);

  width: 100%;
  min-width: 0;
  min-height: 100%;

  color: var(--agro-text);
  background:
    radial-gradient(
      circle at 85% 5%,
      rgba(223, 242, 125, 0.15),
      transparent 24rem
    ),
    radial-gradient(
      circle at 5% 65%,
      rgba(35, 122, 70, 0.06),
      transparent 30rem
    ),
    var(--agro-bg);

  font-family: "Manrope", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

.agro-page button,
.agro-page input,
.agro-page select {
  font: inherit;
}

.agro-page button {
  cursor: pointer;
}

.agro-page a {
  color: inherit;
  text-decoration: none;
}

.agro-page .sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* =========================================================
   STRUCTURE GÉNÉRALE
   ========================================================= */

.agro-page .app-shell {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;

  width: 100%;
  min-width: 0;
  min-height: 100vh;

  padding: 18px;
  align-items: start;
}

.agro-page .main-content {
  width: 100%;
  min-width: 0;
  padding: 18px 0 18px 0;
}


/* =========================================================
   SIDEBAR FLOTTANTE ET STICKY
   ========================================================= */

.agro-page .sidebar {
  position: sticky;
  top: 18px;
  z-index: 10;

  width: 100%;
  height: calc(100vh - 36px);
  min-height: 0;

  display: flex;
  flex-direction: column;

  padding: 18px 14px;

  border: 1px solid rgba(35, 122, 70, 0.10);
  border-radius: var(--agro-radius-lg);

  background:
    linear-gradient(
      180deg,
      rgba(255, 255, 255, 0.97),
      rgba(247, 250, 248, 0.95)
    );

  box-shadow:
    0 18px 45px rgba(24, 65, 39, 0.08),
    0 2px 8px rgba(24, 65, 39, 0.04);

  backdrop-filter: blur(18px);
  overflow: hidden;
}

.agro-page .sidebar__inner {
  flex: 1;
  min-height: 0;
  padding-right: 4px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.agro-page .sidebar__inner::-webkit-scrollbar {
  width: 6px;
}

.agro-page .sidebar__inner::-webkit-scrollbar-track {
  background: transparent;
}

.agro-page .sidebar__inner::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(35, 122, 70, 0.16);
}

.agro-page .sidebar__inner::-webkit-scrollbar-thumb:hover {
  background: rgba(35, 122, 70, 0.28);
}

.agro-page .sidebar__eyebrow {
  margin: 6px 12px 10px;

  color: #849087;

  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.agro-page .sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 5px;

  margin: 0;
  padding: 0;

  list-style: none;
}

.agro-page .sidebar__nav li + li {
  margin-top: 0;
}

.agro-page .sidebar__nav a {
  position: relative;
  overflow: hidden;

  display: flex;
  align-items: center;
  gap: 12px;

  min-height: 46px;
  padding: 11px 13px;

  border: 1px solid transparent;
  border-radius: 14px;

  color: #56635a;
  background: transparent;

  font-size: 13px;
  font-weight: 700;

  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.agro-page .sidebar__nav a::before {
  content: "";

  position: absolute;
  left: 6px;
  top: 50%;

  width: 3px;
  height: 0;

  border-radius: 999px;
  background: var(--agro-primary);

  transform: translateY(-50%);
  transition: height 180ms ease;
}

.agro-page .sidebar__nav a i {
  width: 20px;

  display: grid;
  place-items: center;

  color: #819087;
  font-size: 14px;

  transition:
    color 160ms ease,
    transform 160ms ease;
}

.agro-page .sidebar__nav a:hover {
  transform: translateX(3px);

  color: var(--agro-primary-dark);
  border-color: rgba(35, 122, 70, 0.08);
  background: rgba(35, 122, 70, 0.055);
}

.agro-page .sidebar__nav a:hover::before,
.agro-page .sidebar__nav a.is-active::before {
  height: 22px;
}

.agro-page .sidebar__nav a:hover i {
  color: var(--agro-primary);
  transform: scale(1.06);
}

.agro-page .sidebar__nav a.is-active {
  color: var(--agro-primary-dark);

  border-color: rgba(35, 122, 70, 0.12);

  background:
    linear-gradient(
      135deg,
      rgba(231, 245, 236, 0.98),
      rgba(241, 249, 244, 0.98)
    );

  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.65),
    0 8px 20px rgba(35, 122, 70, 0.07);
}

.agro-page .sidebar__nav a.is-active i {
  color: var(--agro-primary);
}

.agro-page .badge {
  margin-left: auto;
  padding: 4px 8px;

  border: 1px solid rgba(35, 122, 70, 0.08);
  border-radius: 999px;

  color: #718078;
  background: rgba(255, 255, 255, 0.78);

  font-size: 10px;
  font-weight: 800;
}

.agro-page .sidebar__divider {
  height: 1px;
  margin: 18px 8px;

  background:
    linear-gradient(
      90deg,
      transparent,
      var(--agro-line),
      transparent
    );
}

.agro-page .sidebar__help {
  position: relative;
  overflow: hidden;

  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;

  padding: 14px;

  border-radius: 17px;

  color: #fff;

  background:
    radial-gradient(
      circle at 100% 0,
      rgba(223, 242, 125, 0.18),
      transparent 8rem
    ),
    linear-gradient(135deg, #173f2a, #215f3b);

  box-shadow: 0 12px 26px rgba(23, 63, 42, 0.18);
}

.agro-page .sidebar__help-icon {
  width: 36px;
  height: 36px;

  display: grid;
  place-items: center;

  border-radius: 11px;
  background: rgba(255, 255, 255, 0.11);
}

.agro-page .sidebar__help strong {
  display: block;
  font-size: 12px;
}

.agro-page .sidebar__help p {
  margin: 3px 0 0;

  color: rgba(255, 255, 255, 0.68);

  font-size: 10px;
  line-height: 1.45;
}

.agro-page .sidebar__help a {
  color: var(--agro-accent);
}


/* =========================================================
   HERO
   ========================================================= */

.agro-page .hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;

  margin-bottom: 26px;
  padding: 10px 4px;
}

.agro-page .eyebrow,
.agro-page .ai-search__label {
  display: block;


  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.agro-page .hero h1 {
  max-width: 760px;
  margin: 8px 0 10px;

  color: #14241a;

  font-size: clamp(30px, 4vw, 52px);
  line-height: 1.08;
  letter-spacing: -0.05em;
  text-wrap: balance;
}

.agro-page .hero p {
  max-width: 720px;
  margin: 0;

  color: var(--agro-muted);

  font-size: 15px;
  line-height: 1.7;
}

.agro-page .hero__stats {
  display: flex;
  gap: 10px;
}

.agro-page .stat-card {
  position: relative;
  overflow: hidden;

  min-width: 130px;
  padding: 16px;

  border: 1px solid rgba(35, 122, 70, 0.12);
  border-radius: var(--agro-radius-md);

  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--agro-shadow-sm);
  backdrop-filter: blur(12px);

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.agro-page .stat-card::after {
  content: "";

  position: absolute;
  right: -22px;
  bottom: -30px;

  width: 70px;
  height: 70px;

  border-radius: 50%;
  background: rgba(35, 122, 70, 0.06);
}

.agro-page .stat-card:hover {
  transform: translateY(-3px);
  border-color: rgba(35, 122, 70, 0.25);
  box-shadow: var(--agro-shadow-md);
}

.agro-page .stat-card strong {
  position: relative;
  z-index: 1;

  display: block;

  font-size: 20px;
}

.agro-page .stat-card span {
  position: relative;
  z-index: 1;

  color: var(--agro-muted);
  font-size: 10px;
}


/* =========================================================
   BLOC DE RECHERCHE IA
   ========================================================= */

.agro-page .ai-search {
  position: relative;
  isolation: isolate;
  overflow: hidden;

  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;

  width: 100%;
  min-width: 0;
  max-width: 100%;

  margin-bottom: 22px;
  padding: 22px;

  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: var(--agro-radius-lg);

  color: #fff;

  background:
    radial-gradient(
      circle at 92% 5%,
      rgba(223, 242, 125, 0.18),
      transparent 16rem
    ),
    linear-gradient(
      135deg,
      #124e2c 0%,
      #1c6d3d 48%,
      #2b8d51 100%
    );

  box-shadow: var(--agro-shadow-lg);
}

.agro-page .ai-search::before {
  content: "";

  position: absolute;
  inset: 0;
  z-index: -1;

  opacity: 0.12;
  pointer-events: none;

  background-image:
    linear-gradient(
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px
    ),
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.08) 1px,
      transparent 1px
    );

  background-size: 32px 32px;
  mask-image: linear-gradient(to right, transparent, #000);
}

.agro-page .ai-search::after {
  content: "";

  position: absolute;
  right: -70px;
  top: -100px;

  width: 250px;
  height: 250px;

  border-radius: 50%;
  background: rgba(223, 242, 125, 0.13);

  pointer-events: none;
}

.agro-page .ai-search > *,
.agro-page .ai-search__content,
.agro-page .ai-response {
  min-width: 0;
  max-width: 100%;
}

.agro-page .ai-search__icon {
  position: relative;
  z-index: 1;

  width: 46px;
  height: 46px;

  display: grid;
  place-items: center;

  border-radius: 14px;

  color: var(--agro-primary-dark);
  background: var(--agro-accent);

  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.agro-page .ai-search__content {
  position: relative;
  z-index: 1;
}

.agro-page #ai-title {
  color: rgba(255, 255, 255, 0.62) !important;
}

.agro-page .ai-search h2 {
  margin: 4px 0 14px;
  font-size: 18px;
}

.agro-page .ai-form {
  display: flex;
  gap: 10px;
  margin-bottom: 0;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.agro-page .ai-form input {
  flex: 1 1 auto;

  min-width: 0;
  max-width: 100%;
  min-height: 48px;

  padding: 14px 16px;

  border: 1px solid rgba(255, 255, 255, 0.20);
  border-radius: 14px;
  outline: 0;

  background: rgba(255, 255, 255, 0.14);

  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 4px 14px rgba(0, 0, 0, 0.08);

  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.agro-page .ai-form input::placeholder {
  color: rgba(255, 255, 255, 0.67);
}

.agro-page .ai-form input:hover {
  background: rgba(255, 255, 255, 0.18);
}

.agro-page .ai-form input:focus {
  border-color: rgba(223, 242, 125, 0.85);
  background: rgba(255, 255, 255, 0.20);

  box-shadow:
    0 0 0 4px rgba(223, 242, 125, 0.14),
    0 8px 24px rgba(0, 0, 0, 0.10);
}

.agro-page .ai-form button {
  flex: 0 0 auto;

  min-height: 48px;
  padding: 0 22px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;

  border: 0;
  border-radius: 14px;

  color: var(--agro-primary-dark);
  background: var(--agro-accent);

  font-size: 12px;
  font-weight: 800;

  box-shadow: 0 8px 20px rgba(12, 51, 28, 0.18);

  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    background-color 160ms ease;
}

.agro-page .ai-form button:hover {
  transform: translateY(-2px);
  background: #e8f895;
  box-shadow: 0 12px 26px rgba(12, 51, 28, 0.24);
}

.agro-page .ai-form button:active {
  transform: translateY(0);
}

.agro-page .ai-response {
  position: relative;

  grid-column: 2;

  width: 100%;
  padding: 18px 20px;

  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: var(--agro-radius-md);

  color: rgba(255, 255, 255, 0.95);
  background: rgba(255, 255, 255, 0.115);

  font-size: 14px;
  line-height: 1.72;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(8px);

  overflow-wrap: anywhere;
  word-break: break-word;
}

.agro-page .ai-response > :first-child {
  margin-top: 0;
}

.agro-page .ai-response > :last-child {
  margin-bottom: 0;
}

.agro-page .ai-response strong {
  color: #fff;
}

.agro-page .ai-response a:not([href^="#citation-"]) {
  color: var(--agro-accent);

  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.agro-page .ai-response img {
  display: block;
  max-width: 100%;
  height: auto;
}

.agro-page .ai-response pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
}

.agro-page .ai-response table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
}

.agro-page .ai-response th,
.agro-page .ai-response td {
  overflow-wrap: anywhere;
  word-break: break-word;
}


/* =========================================================
   CITATIONS DANS LA RÉPONSE
   ========================================================= */

.agro-page .ai-response a[href^="#citation-"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 20px;
  height: 20px;

  padding: 0 6px;
  margin-inline: 3px;

  border: 1px solid rgba(223, 242, 125, 0.65);
  border-radius: 999px;

  color: #efffa1;
  background: rgba(223, 242, 125, 0.13);

  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  vertical-align: super;

  opacity: 1;
  cursor: pointer;

  box-shadow: 0 3px 8px rgba(10, 40, 22, 0.15);

  transition:
    transform 140ms ease,
    background-color 140ms ease,
    color 140ms ease,
    box-shadow 140ms ease;
}

.agro-page .ai-response a[href^="#citation-"]:hover {
  transform: translateY(-2px);

  color: var(--agro-primary-dark);
  background: var(--agro-accent);

  box-shadow: 0 6px 15px rgba(10, 40, 22, 0.22);
}

.agro-page .ai-response a[href^="#citation-"]:focus-visible {
  outline: 2px solid var(--agro-accent);
  outline-offset: 2px;
}


/* =========================================================
   LOADER
   ========================================================= */

.agro-page .loader {
  width: 20px;
  padding: 15px;
  aspect-ratio: 1;
  margin-top: 10px;

  --_c: no-repeat radial-gradient(
    farthest-side,
    var(--agro-accent) 12%,
    transparent
  );

  background:
    var(--_c) top,
    var(--_c) left,
    var(--_c) right,
    var(--_c) bottom;

  background-size: 12px 12px;
  animation: agro-loader-spin 1s infinite linear;
}

@keyframes agro-loader-spin {
  to {
    transform: rotate(180deg);
  }
}


/* =========================================================
   PANNEAU BIBLIOTHÈQUE
   ========================================================= */

.agro-page .library-panel {
  padding: 20px;

  border: 1px solid rgba(35, 122, 70, 0.11);
  border-radius: var(--agro-radius-lg);

  background: rgba(255, 255, 255, 0.90);
  box-shadow: var(--agro-shadow-md);
  backdrop-filter: blur(16px);
}

.agro-page .library-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;

  padding-bottom: 18px;
  border-bottom: 1px solid var(--agro-line);
}

.agro-page .library-toolbar__left {
  flex: 1;
  min-width: 0;
}

.search-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.agro-page .suggested-questions {
  grid-column: 2;

  width: 100%;
  max-width: 100%;
  min-width: 0;

  opacity: 0;
  max-height: 0;
  overflow: hidden;

  transform: translateY(8px);

  transition:
    opacity .35s ease,
    transform .35s ease,
    max-height .35s ease;
}

.agro-page .suggested-questions.visible {
  opacity: 1;
  max-height: 800px;
  transform: translateY(0);
  pointer-events: auto;
}

.agro-page .suggested-questions__title {
  display: flex;
  align-items: center;
  gap: 10px;

  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
}

.agro-page .suggested-questions__icon {
  color: #d9ff55;
  font-size: 18px;
}

.agro-page .suggested-questions__grid {
  display: grid;

  /* IMPORTANT */
  grid-template-columns: repeat(3, minmax(0, 1fr));

  width: 100%;
  max-width: 100%;
  min-width: 0;

  gap: 14px;
}

.agro-page .suggested-question {
  width: 100%;
  max-width: 100%;
  min-width: 0;

  min-height: 74px;

  display: flex;
  align-items: center;
  gap: 16px;

  padding: 16px 20px;

  box-sizing: border-box;

  background: rgba(255, 255, 255, 0.10);

  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 14px;

  color: #fff;

  cursor: pointer;
  text-align: left;

  overflow: hidden;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease,
    box-shadow 0.2s ease;
}

.agro-page .suggested-question:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(217, 255, 85, 0.55);

  transform: translateY(-2px);

  box-shadow:
    0 8px 22px rgba(0, 0, 0, 0.12);
}

.agro-page .suggested-question:active {
  transform: translateY(0);
}

.agro-page .suggested-question__arrow {
  flex: 0 0 auto;

  color: #d9ff55;

  font-size: 25px;
  font-weight: 400;

  transition: transform 0.2s ease;
}

.agro-page .suggested-question:hover .suggested-question__arrow {
  transform: translateX(4px);
}

.agro-page .suggested-question__text {
  min-width: 0;

  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;

  /* SUPPRIMER nowrap */
  white-space: normal;

  overflow-wrap: anywhere;
  word-break: normal;
}

/* Tablet */
@media (max-width: 900px) {
  .agro-page .suggested-questions__grid {
    grid-template-columns: 1fr;
  }

  .agro-page .suggested-question {
    min-height: 60px;
  }
}

/* Mobile */
@media (max-width: 600px) {
  .agro-page .suggested-questions {
    margin-top: 16px;
  }

  .agro-page .suggested-questions__title {
    font-size: 10px;
    letter-spacing: 1.5px;
  }

  .agro-page .suggested-question {
    padding: 14px 16px;
  }

  .agro-page .suggested-question__text {
    font-size: 14px;
  }
}

.agro-page .search-field {
  position: relative;

  display: flex;
  align-items: center;

  width: min(580px, 100%);
}

.agro-page .search-field > i {
  position: absolute;
  left: 15px;

  color: #879188;
  font-size: 13px;
}

.agro-page .search-field input {
  width: 100%;
  min-height: 46px;

  padding: 13px 58px 13px 41px;

  border: 1px solid var(--agro-line);
  border-radius: 14px;
  outline: 0;

  color: var(--agro-text);
  background: #f8fbf9;

  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.agro-page .search-field input:focus {
  border-color: rgba(35, 122, 70, 0.48);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(35, 122, 70, 0.08);
}

.agro-page .search-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 52px;
    padding: 0 22px;
    border: none;
    border-radius: 12px;
    background: #1f8f4d;
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    transition: .2s;

    &:hover {
        background: #18753f;
    }
}

.agro-page .filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;

  margin-top: 12px;
}

.agro-page .filter-dropdown {
  position: relative;
}

.agro-page .filter-button,
.agro-page .clear-filters {
  height: 38px;

  display: inline-flex;
  align-items: center;
  gap: 8px;

  padding: 0 12px;

  border-radius: 11px;

  font-size: 11px;
  font-weight: 800;
}

.agro-page .filter-button {
  border: 1px solid var(--agro-line);

  color: #536158;
  background: #fff;

  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease,
    transform 160ms ease;
}

.agro-page .filter-button:hover {
  transform: translateY(-1px);

  border-color: rgba(35, 122, 70, 0.30);

  color: var(--agro-primary-dark);
  background: var(--agro-primary-light);
}

.agro-page .clear-filters {
  border: 0;
  color: #849087;
  background: transparent;
}

.agro-page .dropdown-menu {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  z-index: 20;

  display: none;
  min-width: 230px;

  max-height: 250px;
  overflow: hidden;
  overflow-y: scroll;

  padding: 8px;

  border: 1px solid var(--agro-line);
  border-radius: 14px;

  background: #fff;
  box-shadow: var(--agro-shadow-lg);
}

.agro-page .dropdown-menu.is-open {
  display: block;
}

.agro-page .dropdown-option {
  display: flex;
  align-items: center;
  gap: 9px;

  padding: 9px 10px;

  border-radius: 9px;

  color: #526056;

  font-size: 11px;
  cursor: pointer;
}

.agro-page .dropdown-option:hover {
  background: var(--agro-surface-muted);
}

.agro-page .library-toolbar__right {
  display: flex;
  align-items: flex-end;
  gap: 12px;
}

.agro-page .sort-control {
  display: grid;
  gap: 5px;

  color: var(--agro-muted);

  font-size: 10px;
  font-weight: 800;
}

.agro-page .sort-control select {
  padding: 9px 32px 9px 10px;

  border: 1px solid var(--agro-line);
  border-radius: 11px;

  color: var(--agro-text);
  background: #fff;
}

.agro-page .view-toggle {
  display: flex;
  padding: 3px;

  border-radius: 12px;
  background: var(--agro-surface-muted);
}

.agro-page .view-button {
  width: 36px;
  height: 36px;

  border: 0;
  border-radius: 9px;

  color: #859087;
  background: transparent;
}

.agro-page .view-button.is-active {
  color: var(--agro-primary);
  background: #fff;
  box-shadow: 0 3px 10px rgba(24, 65, 39, 0.08);
}

.agro-page .results-summary {
  display: flex;
  justify-content: space-between;

  padding: 16px 2px 10px;

  color: var(--agro-muted);
  font-size: 11px;
}

.agro-page .results-summary p {
  margin: 0;
}

.agro-page .results-summary strong {
  color: var(--agro-text);
  font-size: 13px;
}


/* =========================================================
   CARTES DE DOCUMENTS
   ========================================================= */

.agro-page .document-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.agro-page .document-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;

  padding: 15px;

  border: 1px solid rgba(35, 122, 70, 0.10);
  border-radius: 17px;

  background: #fff;
  box-shadow: var(--agro-shadow-xs);

  transition:
    transform 190ms ease,
    border-color 190ms ease,
    box-shadow 190ms ease;
}

.agro-page .document-card:hover {
  transform: translateY(-4px);

  border-color: rgba(35, 122, 70, 0.28);
  box-shadow: var(--agro-shadow-md);
}

.agro-page .document-card__visual {
  position: relative;
  overflow: hidden;

  width: 72px;
  height: 88px;

  display: grid;
  place-items: center;

  border: 1px solid rgba(218, 76, 76, 0.08);
  border-radius: 13px;

  color: #da4c4c;
  background: linear-gradient(160deg, #fff4f4, #f7eeee);

  font-size: 25px;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.agro-page .file-type {
  position: absolute;
  top: 7px;
  left: 7px;

  padding: 3px 5px;

  border-radius: 5px;

  color: #b13838;
  background: rgba(255, 255, 255, 0.80);

  font-size: 8px;
  font-weight: 800;
}

.agro-page .document-card__content {
  min-width: 0;
}

.agro-page .document-card__topline {
  display: flex;
  gap: 7px;

  margin-bottom: 7px;
}

.agro-page .source-pill,
.agro-page .year-pill {
  padding: 4px 7px;

  border-radius: 999px;

  font-size: 9px;
  font-weight: 800;
}

.agro-page .source-pill {
  color: var(--agro-primary-dark);
  background: var(--agro-primary-soft);
}

.agro-page .year-pill {
  color: #6f7750;
  background: #f2f6dd;
}

.agro-page .document-card h3 {
  margin: 0 0 8px;

  color: #1d2c22;

  font-size: 14px;
  line-height: 1.45;

  transition: color 160ms ease;
}

.agro-page .document-card:hover h3 {
  color: var(--agro-primary-dark);
}

.agro-page .document-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 11px;

  color: var(--agro-muted);
  font-size: 10px;
}

.agro-page .document-meta span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.agro-page .tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;

  margin-top: 10px;
}

.agro-page .tag-list span {
  padding: 5px 8px;

  border: 1px solid #e7ece8;
  border-radius: 999px;

  color: #6a756d;
  background: #fafcfb;

  font-size: 9px;
}

.agro-page .document-card__actions {
  display: grid;
  grid-template-columns: repeat(3, 36px);
  gap: 6px;
  justify-content: end;
}

.agro-page .action-primary {
  grid-column: 1 / -1;

  height: 38px;
  padding: 0 14px;

  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;

  border: 0;
  border-radius: 11px;

  color: #fff;
  background: var(--agro-primary);

  font-size: 10px;
  font-weight: 800;

  transition:
    transform 160ms ease,
    background-color 160ms ease,
    box-shadow 160ms ease;
}

.agro-page .action-primary:hover {
  transform: translateY(-1px);

  background: var(--agro-primary-hover);
  box-shadow: 0 8px 18px rgba(35, 122, 70, 0.22);
}

.agro-page .action-icon {
  width: 36px;
  height: 36px;

  border: 1px solid var(--agro-line);
  border-radius: 10px;

  color: #69756d;
  background: #fff;

  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background-color 160ms ease,
    color 160ms ease;
}

.agro-page .action-icon:hover {
  transform: translateY(-1px);

  border-color: rgba(35, 122, 70, 0.28);

  color: var(--agro-primary);
  background: var(--agro-primary-light);
}

.agro-page .document-list.is-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.agro-page .document-list.is-grid .document-card {
  grid-template-columns: 1fr;
  align-items: stretch;
}

.agro-page .document-list.is-grid .document-card__visual {
  width: 100%;
  height: 130px;
}

.agro-page .document-list.is-grid .document-card__actions {
  grid-template-columns: 1fr repeat(3, 36px);
}

.agro-page .document-list.is-grid .action-primary {
  grid-column: auto;
}

.agro-page .empty-state {
  padding: 60px 20px;

  color: var(--agro-muted);
  text-align: center;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.agro-page .pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;

  margin-top: 22px;
}

.agro-page .pagination button {
  width: 36px;
  height: 36px;

  border: 1px solid var(--agro-line);
  border-radius: 10px;

  color: #5d6961;
  background: #fff;

  font-size: 11px;
  font-weight: 800;

  transition:
    transform 150ms ease,
    border-color 150ms ease,
    color 150ms ease,
    background-color 150ms ease;
}

.agro-page .pagination button:hover:not(.is-active) {
  transform: translateY(-1px);

  border-color: rgba(35, 122, 70, 0.35);

  color: var(--agro-primary);
  background: var(--agro-primary-light);
}

.agro-page .pagination button.is-active {
  border-color: var(--agro-primary);

  color: #fff;
  background: var(--agro-primary);
}


/* =========================================================
   APERÇU DOCUMENT
   ========================================================= */

.agro-page a.docPrev {
  width: 100%;
  padding: 5px;
  height: 100%;
}

.agro-page a.docPrev div {
  width: 100%;
  height: 100%;

  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

#preview {
    position: fixed !important;

    width: 300px;
    height: 400px;

    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    background-color: white;

    pointer-events: none;
    z-index: 2147483647;

    margin: 0 !important;
    transform: none !important;

    display: none;
}

/* =========================================================
   POPUP DE CITATION
   ========================================================= */

.citation-popup[hidden] {
  display: none;
}

.citation-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 2rem;
}


.citation-popup__content {
  position: relative;
  z-index: 2;
  overflow: hidden;

  width: min(780px, 100%);
  max-height: min(70vh, 820px);

  display: flex;
  flex-direction: column;

  padding: 2rem;

  border: 1px solid rgba(35, 122, 70, 0.13);
  border-radius: 28px;

  background:
    radial-gradient(
      circle at 100% 0,
      rgba(223, 242, 125, 0.10),
      transparent 15rem
    ),
    #fff;

  box-shadow:
    0 30px 90px rgba(12, 40, 23, 0.25),
    0 4px 18px rgba(12, 40, 23, 0.08);
}

.citation-popup__content::before {
  content: "CITATION";

  display: block;
  margin-bottom: 0.4rem;

  color: var(--agro-primary);

  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
}

.citation-popup h2 {
  margin: 0 0 1.5rem;

  color: #1d2939;

  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
}

.citation-popup__close {
  position: absolute;
  top: 20px;
  right: 20px;

  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border: 0;
  border-radius: 50%;

  color: var(--agro-primary);
  background: #f3f8f4;

  font-size: 24px;
  line-height: 1;

  box-shadow: inset 0 0 0 1px rgba(35, 122, 70, 0.08);

  transition:
    transform 180ms ease,
    background-color 180ms ease;
}

.citation-popup__close:hover {
  transform: rotate(90deg);
  background: #e5f3e9;
}

.citation-popup__metadata {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;

  padding: 1.25rem;

  border: 1px solid rgba(35, 122, 70, 0.10);
  border-radius: 18px;

  background:
    linear-gradient(
      135deg,
      rgba(247, 250, 248, 0.96),
      rgba(239, 248, 242, 0.96)
    );
}

.citation-popup__metadata p {
  display: flex;
  flex-direction: column;

  min-width: 0;
  margin: 0;

  color: #475467;

  font-size: 0.75rem;
  overflow-wrap: anywhere;
}

.citation-popup__metadata strong {
  margin-bottom: 0.3rem;

  color: var(--agro-primary);

  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.citation-popup__excerpt {
  flex: 1;
  min-height: 0;

  font-size: 14px;

  display: flex;
  flex-direction: column;
}

.citation-popup__excerpt h3 {
  margin: 0 0 0.8rem;

  color: var(--agro-primary);

  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.citation-popup__excerpt p {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;

  margin: 0;
  padding: 1.4rem;

  border: 1px solid rgba(35, 122, 70, 0.10);
  border-left: 5px solid var(--agro-primary);
  border-radius: 14px;

  color: #344054;

  background:
    linear-gradient(
      135deg,
      #fbfdfb,
      #f5faf6
    );

  line-height: 1.8;
  white-space: pre-wrap;

  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.citation-popup__excerpt p::-webkit-scrollbar {
  width: 8px;
}

.citation-popup__excerpt p::-webkit-scrollbar-track {
  background: transparent;
}

.citation-popup__excerpt p::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: #c8d8ce;
}

.citation-popup__excerpt p::-webkit-scrollbar-thumb:hover {
  background: #9fb7a6;
}

.citation-popup__actions {
  display: flex;
  margin: 1rem 0 1.25rem;
}

.citation-popup__document-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;

  padding: 0.65rem 1rem;
  border-radius: 0.6rem;

  background: #9fb7a6;
  border: 1px solid #d9dee5;

  color: #1f2937;
  font-weight: 600;
  text-decoration: none;

  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.citation-popup__document-link:hover {
  background: #e9edf2;
  border-color: #c7cdd5;
  transform: translateY(-1px);
}

.citation-popup__document-link:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.citation-popup__document-icon {
  font-size: 1.1em;
}

/* =========================================================
   ACCESSIBILITÉ
   ========================================================= */

.agro-page button:focus-visible,
.agro-page a:focus-visible,
.agro-page input:focus-visible,
.agro-page select:focus-visible,
.citation-popup button:focus-visible {
  outline: 3px solid rgba(223, 242, 125, 0.75);
  outline-offset: 3px;
}


/* =========================================================
   RESPONSIVE
   ========================================================= */

@media (max-width: 1050px) {
  .agro-page .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 16px;
    padding: 12px;
  }

  .agro-page .sidebar {
    top: 12px;
    height: calc(100vh - 24px);
    padding: 16px 12px;
  }

  .agro-page .main-content {
    padding-right: 18px;
  }

  .agro-page .hero {
    align-items: flex-start;
  }
}

@media (max-width: 760px) {
  .agro-page .app-shell {
    display: block;
    padding: 0;
  }

  .agro-page .sidebar {
    position: relative;
    top: auto;

    width: 100%;
    height: auto;

    padding: 14px;

    border: 0;
    border-bottom: 1px solid var(--agro-line);
    border-radius: 0;

    box-shadow: none;
    overflow: visible;
  }

  .agro-page .sidebar__inner {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;

    overflow: visible;
  }

  .agro-page .sidebar__divider {
    display: none;
  }

  .agro-page .sidebar__help {
    margin-top: 14px;
  }

  .agro-page .main-content {
    padding: 24px 14px 48px;
  }

  .agro-page .hero {
    display: block;
  }

  .agro-page .hero__stats {
    width: 100%;
    margin-top: 18px;
  }

  .agro-page .stat-card {
    flex: 1;
  }

  .agro-page .hero h1 {
    font-size: 34px;
  }

  .agro-page .ai-search {
    grid-template-columns: 1fr;
    padding: 18px;
    border-radius: 20px;
  }

  .agro-page .ai-search__icon {
    display: none;
  }

  .agro-page .ai-response,.sources-panel,.suggested-questions {
    grid-column: 1;
    padding: 16px;
  }

  .agro-page .ai-form {
    flex-direction: column;
  }

  .agro-page .ai-form button {
    width: 100%;
    height: 44px;
  }

  .agro-page .library-toolbar {
    flex-direction: column;
  }

  .agro-page .library-toolbar__right {
    width: 100%;
    justify-content: space-between;
  }

  .agro-page .document-card {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
  }

  .agro-page .document-card__visual {
    width: 56px;
    height: 70px;
  }

  .agro-page .document-card__actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr repeat(3, 38px);
  }

  .agro-page .action-primary {
    grid-column: auto;
  }

  .citation-popup {
    padding: 1rem;
  }

  .citation-popup__content {
    max-height: 70vh;
    padding: 1.5rem;
    border-radius: 20px;
  }

  .citation-popup__metadata {
    grid-template-columns: 1fr;
  }

  .citation-popup h2 {
    font-size: 1.6rem;
  }
}

@media (max-width: 470px) {
  .agro-page .sidebar__inner {
    grid-template-columns: 1fr;
  }

  .agro-page .hero h1 {
    font-size: 31px;
    letter-spacing: -0.04em;
  }

  .agro-page .hero__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .agro-page .stat-card {
    min-width: 0;
  }

  .agro-page .results-summary span {
    display: none;
  }

  .agro-page .document-card {
    grid-template-columns: 1fr;
  }

  .agro-page .document-card__visual {
    width: 100%;
    height: 110px;
  }

  .agro-page .document-card__actions {
    grid-template-columns: repeat(3, 1fr);
  }

  .agro-page .action-primary {
    grid-column: 1 / -1;
  }

  .citation-popup__content {
    padding: 1.25rem;
    border-radius: 18px;
  }

  .citation-popup__close {
    top: 14px;
    right: 14px;

    width: 38px;
    height: 38px;
  }
}

/* =========================================================
   PASSAGES CORRESPONDANT À LA RECHERCHE
   ========================================================= */

.search-matches {
  margin-top: 12px;
  max-width: 900px;
}


/* suppression de la flèche native */
.search-matches > summary {
  list-style: none;
}

.search-matches > summary::-webkit-details-marker {
  display: none;
}


/* bouton */
.search-matches__trigger {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  width: fit-content;

  padding: 5px 9px;

  border: 1px solid #dbe8df;
  border-radius: 8px;

  background: #f8fbf9;

  color: #36724f;

  font-size: 11px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background-color 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}


.search-matches__trigger:hover {
  background: #eef7f1;
  border-color: #bdd8c5;
  color: #218447;
}


/* petite flèche */
.search-matches__chevron {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  font-size: 9px;

  transition: transform 0.2s ease;
}


/* rotation de la flèche */
.search-matches[open] .search-matches__chevron {
  transform: rotate(180deg);
}


/* compteur */
.search-matches__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  min-width: 20px;
  height: 20px;

  padding: 0 6px;

  border-radius: 999px;

  background: #e0f2e5;
  color: #218447;

  font-size: 10px;
  font-weight: 700;
}


/* =========================================================
   ZONE OUVERTE
   ========================================================= */

.search-matches__content {
  margin-top: 8px;
  padding: 9px;

  display: flex;
  flex-direction: column;
  gap: 6px;

  border-left: 3px solid #26884b;
  border-radius: 0 8px 8px 0;

  background: #f7faf8;
}


/* chaque extrait */
.search-match {
  padding: 8px 10px;

  border: 1px solid #e2ebe5;
  border-radius: 7px;

  background: #fff;

  color: #58645d;

  font-size: 11px;
  line-height: 1.55;
}


/* Highlight Elasticsearch classique */
.search-match em {
  padding: 1px 3px;

  border-radius: 3px;

  background: #dff3e5;
  color: #176d39;

  font-style: normal;
  font-weight: 700;
}


/* si jamais tu utilises <mark> */
.search-match mark {
  padding: 1px 3px;

  border-radius: 3px;

  background: #dff3e5;
  color: #176d39;

  font-weight: 700;
}

.current-pdf {
  display: flex;
  align-items: center;
  gap: 14px;
}

.current-pdf__icon {
  width: 42px;
  height: 46px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  color: #fff;
  background: #ef4444;
  border-radius: 8px;

  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.12);
}

.current-pdf__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.current-pdf__name {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
}

.current-pdf__meta {
  display: flex;
  align-items: center;
  gap: 7px;

  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
}

.current-pdf__dot {
  opacity: 0.6;
}

.file-context.visible {
    opacity: 1;
    max-height: 800px;
    transform: translateY(0);
    pointer-events: auto;
    padding: 14px 18px;
}


.file-context {
  display: flex;
  align-items: center;
  gap: 28px;

  grid-column: 2;

  width: 100%;

  color: #fff;

  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 14px;

  opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    max-height: 0;
    transition:
        opacity .35s ease,
        transform .35s ease;

  box-sizing: border-box;
}


/* --------------------------------
   Document
-------------------------------- */

.file-context__document {
  display: flex;
  align-items: center;
  gap: 14px;

  min-width: 330px;
}

.file-context__icon {
  width: 42px;
  height: 48px;

  display: flex;
  align-items: center;
  justify-content: center;

  flex-shrink: 0;

  background: #f04444;
  border-radius: 7px;

  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.12);
}

.file-context__icon span {
  font-size: 9px;
  font-weight: 700;
  color: white;
}


.file-context__info {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.file-context__info strong {
  font-size: 15px;
  font-weight: 650;
}

.file-context__info span {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.72);
}


/* --------------------------------
   Séparateurs
-------------------------------- */

.file-context__separator {
  width: 1px;
  height: 42px;

  flex-shrink: 0;

  background: rgba(255, 255, 255, 0.22);
}


/* --------------------------------
   Message
-------------------------------- */

.file-context__message {
  flex: 1;

  font-size: 14px;
  font-weight: 500;

  color: rgba(255, 255, 255, 0.92);
}


/* --------------------------------
   Bouton reset
-------------------------------- */

.file-context__reset {
  display: flex;
  align-items: center;
  gap: 12px;

  min-width: 235px;

  padding: 10px 16px;

  color: white;
  background: transparent;

  border: 1px solid rgba(255, 255, 255, 0.75);
  border-radius: 10px;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.1s ease;
}

.file-context__reset:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: white;
}

.file-context__reset:active {
  transform: translateY(1px);
}


.file-context__reset-icon {
  font-size: 25px;
  line-height: 1;
}


.file-context__reset-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

.file-context__reset-text strong {
  font-size: 14px;
  font-weight: 650;
}

.file-context__reset-text small {
  font-size: 11px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.72);
}


/* --------------------------------
   Responsive
-------------------------------- */

@media (max-width: 900px) {

  .file-context {
    align-items: stretch;
    flex-direction: column;
    grid-column: 1;
    gap: 14px;
  }

  .file-context__document {
    min-width: 0;
  }

  .file-context__separator {
    width: 100%;
    height: 1px;
  }

  .file-context__reset {
    width: 100%;
    min-width: 0;
  }
}


/* =========================================================
   RÉDUCTION DES ANIMATIONS
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .agro-page *,
  .agro-page *::before,
  .agro-page *::after,
  .citation-popup *,
  .citation-popup *::before,
  .citation-popup *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.energy-footprint {
  grid-column: 2;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: rgba(255, 255, 255, 0.78);
}

.energy-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.energy-icon {
  width: 26px;
  height: 26px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(210, 240, 90, 0.14);
  color: #d9f45f;
}

.energy-stats {
  display: flex;
  align-items: center;
  gap: 26px;
  flex: 1;
  justify-content: flex-end;
}

.energy-stat {
  padding-left: 22px;
    border-left: 1px solid rgba(255, 255, 255, 0.14);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.energy-value {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.2;
}

.energy-label {
  font-size: 10px;
  opacity: 0.65;
}

.energy-grade {
  display: flex;
  align-items: center;
  gap: 9px;
  padding-left: 22px;
  border-left: 1px solid rgba(255, 255, 255, 0.14);
}

.energy-grade > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.energy-grade strong {
  color: #fff;
  font-size: 12px;
}

.energy-grade span:last-child {
  font-size: 10px;
  opacity: 0.65;
}

.grade-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 14px;
}

.grade-a {
  background: #d9f45f;
  color: #17351e;
}

.action-cards{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:24px;
    margin:32px 0;
}

.action-card{
    display:flex;
    gap:24px;
    padding:28px;
    border:1px solid #E7ECE8;
    border-radius:20px;
    background:#FFF;
    text-decoration:none;
    color:#1D2D23;
    transition:.25s;
}

.action-card:hover{
    transform:translateY(-3px);
    box-shadow:0 15px 40px rgba(0,0,0,.08);
}

.action-card--primary{
    border-color:#8ED35A;
    background:linear-gradient(
        135deg,
        #F8FFF4,
        #FFFFFF
    );
}

.action-card__icon{
    width:72px;
    height:72px;
    flex-shrink:0;

    display:flex;
    align-items:center;
    justify-content:center;

    border-radius:18px;
    background:#EEF9E7;
    font-size:34px;
}

.action-card__content{
    flex:1;
}

.action-card h3{
    margin:0;
    font-size:25px;
    color:#167C3D;
}

.action-card p{
    margin:14px 0 24px;
    color:#5F6E65;
    line-height:1.6;
}

.action-card__button{
    display:inline-flex;
    align-items:center;
    gap:10px;

    padding:14px 22px;
    border-radius:12px;

    background:#168A45;
    color:white;
    font-weight:600;
}

.action-card__button--outline{
    background:transparent;
    color:#168A45;
    border:2px solid #168A45;
}

.action-card__stats{
    display:flex;
    gap:18px;
    margin-bottom:24px;
}

.action-card__stats div{
    padding:14px 18px;
    border:1px solid #E6ECE7;
    border-radius:14px;
    min-width:95px;
}

.action-card__stats strong{
    display:block;
    font-size:26px;
    color:#1D2D23;
}

.action-card__stats span{
    font-size:13px;
    color:#738177;
}

@media (max-width:900px){

    .action-cards{
        grid-template-columns:1fr;
    }

}


@media (max-width: 900px) {
  .energy-footprint {
    align-items: flex-start;
    flex-direction: column;
    grid-column: 1;
  }

  .energy-stats {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
  }

  .energy-grade {
    padding-left: 0;
    border-left: 0;
  }
}

.active-filters {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e6ece7;
}

.active-filters__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.active-filters__title {
  font-size: 12px;
  font-weight: 600;
  color: #6d756f;
}

.active-filters__clear {
  padding: 0;
  border: 0;
  background: transparent;
  color: #6d756f;
  font-size: 11px;
  cursor: pointer;
  transition: color 0.2s ease;
}

.active-filters__clear:hover {
  color: #1f7a46;
}

.active-filters__list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;

  min-height: 28px;
  padding: 5px 8px 5px 11px;

  border: 1px solid #dce8df;
  border-radius: 999px;

  background: #f3f9f4;
  color: #245d3c;

  font-family: inherit;
  font-size: 11px;
  font-weight: 500;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.15s ease;
}

.filter-chip:hover {
  background: #e9f5eb;
  border-color: #bdd8c5;
}

.filter-chip:active {
  transform: scale(0.97);
}

.filter-chip__label {
  white-space: nowrap;
  font-size:11px;
}

.filter-chip__remove {
  display: grid;
  place-items: center;

  width: 16px;
  height: 16px;

  border-radius: 50%;

  background: rgba(31, 122, 70, 0.1);

  font-size: 14px;
  line-height: 1;
  font-weight: 400;
  color: #1f7a46;
}

.filter-chip:hover .filter-chip__remove {
  background: rgba(31, 122, 70, 0.17);
}

@media (max-width: 700px) {
  .active-filters__header {
    align-items: flex-start;
  }

  .active-filters__list {
    gap: 6px;
  }

  .filter-chip {
    font-size: 10px;
  }
}

/* =========================
   SOURCES / DOCUMENTS UTILISÉS
   ========================= */

.sources-panel {
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.07);
    overflow: hidden;
    grid-column: 2;
}

/* Retire le triangle natif */
.sources-panel summary {
    list-style: none;
}

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

.sources-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 14px 18px;
    cursor: pointer;

    color: #fff;
    transition: background 0.2s ease;
}

.sources-summary:hover {
    background: rgba(255, 255, 255, 0.05);
}

.sources-summary-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sources-icon {
    width: 34px;
    height: 34px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 9px;

    background: rgba(215, 245, 93, 0.16);
    font-size: 16px;
}

.sources-summary-left strong {
    display: block;
    font-size: 14px;
    font-weight: 600;
}

.sources-summary-left small {
    display: block;
    margin-top: 3px;

    font-size: 11px;
    color: rgba(255, 255, 255, 0.62);
}

.sources-arrow {
    font-size: 22px;
    line-height: 1;
    color: #d9f75b;

    transition: transform 0.25s ease;
}

/* Rotation de la flèche */
.sources-panel[open] .sources-arrow {
    transform: rotate(180deg);
}


/* =========================
   CONTENU DÉPLIÉ
   ========================= */

#sources-content {
    padding: 0 18px 14px;
}

.sources-panel {
  margin: 0;
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    max-height: 0;
    transition:
        opacity .35s ease,
        transform .35s ease;
}

.sources-panel.visible {
    opacity: 1;
    max-height: 800px;
    transform: translateY(0);
    pointer-events: auto;
}

.source-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;

    padding: 13px 0;

    border-top: 1px solid rgba(255, 255, 255, 0.10);
}

.source-main {
    min-width: 0;
}

.source-title {
    color: #fff;

    font-size: 13px;
    font-weight: 500;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.source-meta {
    margin-top: 5px;

    font-size: 11px;
    color: rgba(255, 255, 255, 0.60);
}

.dot {
    margin: 0 6px;
}

.source-score {
    flex-shrink: 0;

    display: flex;
    align-items: center;
    gap: 8px;

    font-size: 11px;
    color: rgba(255, 255, 255, 0.55);
}

.source-score strong {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    min-width: 48px;
    padding: 5px 9px;

    border-radius: 8px;

    background: rgba(215, 245, 93, 0.14);
    color: #d9f75b;

    font-size: 12px;
    font-weight: 600;
}


/* =========================
   RESPONSIVE
   ========================= */

@media (max-width: 700px) {
    .agro-page .suggested-questions,
    .sources-panel,.suggested-questions {
      grid-column: 1;
    }
    .source-item {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .source-title {
        white-space: normal;
    }
}