:root {
  /* Dark élégance : noir profond, or champagne, touche d'émeraude */
  --basalte: #0b0a09;
  --basalte-2: #060606;
  --pierre: #141210;
  --pierre-clair: #1e1b17;
  --liseret: #2e2921;
  --quartz: #efe9dc;
  --quartz-mat: #a2937b;
  --malachite: #2e6b57;
  --malachite-clair: #5da88c;
  --citrine: #d6b26b;
  --citrine-clair: #e9cd90;
  --grenat: #b35a45;
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: "EB Garamond", Georgia, serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--basalte);
  color: var(--quartz);
  font-family: var(--font-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* subtle grain texture over the whole page, evokes raw stone */
.grain {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: inherit; }

::selection { background: var(--citrine); color: var(--basalte-2); }

:focus-visible {
  outline: 2px solid var(--citrine);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.6rem 1.8rem 1rem;
  max-width: 920px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-display);
  font-size: 1.05rem;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--citrine);
}

.header-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--quartz-mat);
}

.main-nav {
  display: flex;
  gap: 0.4rem;
}

.nav-tab {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.9rem;
  background: transparent;
  color: var(--quartz-mat);
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.nav-tab:hover { color: var(--quartz); }

.nav-tab.nav-active {
  color: var(--citrine);
  border-color: var(--liseret);
  border-bottom-color: var(--citrine);
}

/* Menu adapté au mobile : logo au-dessus, onglets centrés qui passent à la ligne */
@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 1.2rem 0.8rem 0.6rem;
  }

  .main-nav {
    width: 100%;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem;
  }

  .nav-tab {
    font-size: 0.68rem;
    padding: 0.45rem 0.65rem;
    letter-spacing: 0.03em;
  }
}

/* ---------- Hero ---------- */
.hero {
  max-width: 720px;
  margin: 0 auto;
  padding: 3.2rem 1.8rem 2.4rem;
  text-align: center;
  position: relative;
  z-index: 2;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--malachite-clair);
  margin: 0 0 1.1rem;
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 1.12;
  margin: 0 0 1.1rem;
  color: var(--quartz);
}

.hero h1 em {
  font-style: italic;
  color: var(--citrine);
}

.hero-sub {
  font-size: 1.05rem;
  color: var(--quartz-mat);
  max-width: 480px;
  margin: 0 auto;
}

/* ---------- Specimen frame (signature element) ---------- */
.specimen-frame {
  position: relative;
  background: var(--pierre);
  border: 1px solid var(--liseret);
  padding: 2px;
}

.facet {
  position: absolute;
  width: 22px;
  height: 22px;
  pointer-events: none;
  z-index: 3;
}
.facet::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1.5px solid var(--citrine);
  opacity: 0.85;
}
.facet-tl { top: -1px; left: -1px; border-top: none; border-left: none; clip-path: polygon(0 0, 100% 0, 0 100%); }
.facet-tl::before { border-right: none; border-bottom: none; clip-path: polygon(0 0, 100% 0, 0 100%); }
.facet-tr { top: -1px; right: -1px; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.facet-tr::before { border-left: none; border-bottom: none; clip-path: polygon(0 0, 100% 0, 100% 100%); }
.facet-bl { bottom: -1px; left: -1px; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.facet-bl::before { border-right: none; border-top: none; clip-path: polygon(0 0, 100% 100%, 0 100%); }
.facet-br { bottom: -1px; right: -1px; clip-path: polygon(100% 0, 100% 100%, 0 100%); }
.facet-br::before { border-left: none; border-top: none; clip-path: polygon(100% 0, 100% 100%, 0 100%); }

/* ---------- Upload ---------- */
.upload-section {
  max-width: 560px;
  margin: 0 auto;
  padding: 0 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.drop-zone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  padding: 3.4rem 1.5rem;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
  text-align: center;
}

.drop-zone:hover { background: var(--pierre-clair); }
.drop-zone.drag-over { background: var(--pierre-clair); }

.drop-icon { color: var(--citrine); opacity: 0.85; }

.drop-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0.3rem 0 0;
}

.drop-sub {
  font-size: 0.85rem;
  color: var(--quartz-mat);
  margin: 0;
}

.preview-wrap {
  padding: 1rem;
}
.preview-wrap img {
  display: block;
  width: 100%;
  max-height: 380px;
  object-fit: contain;
  margin: 0 auto;
}

.upload-actions {
  display: flex;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 1.4rem;
}

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.75rem 1.6rem;
  border-radius: 2px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.2s ease;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--citrine);
  color: var(--basalte-2);
}
.btn-primary:hover { background: var(--citrine-clair); }

.btn-ghost {
  background: transparent;
  color: var(--quartz-mat);
  border-color: var(--liseret);
}
.btn-ghost:hover { color: var(--quartz); border-color: var(--quartz-mat); }

/* ---------- Loading ---------- */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  margin-top: 1.6rem;
  text-align: center;
}

.loading-facet {
  width: 28px;
  height: 28px;
  border: 2px solid var(--citrine);
  clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%);
  animation: spin 1.4s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading p {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--quartz-mat);
}

.error-msg {
  margin-top: 1.2rem;
  padding: 0.9rem 1.1rem;
  background: rgba(193, 96, 74, 0.12);
  border: 1px solid var(--grenat);
  color: #e8a392;
  font-size: 0.88rem;
  text-align: center;
}

/* ---------- Result ---------- */
.result {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.4rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.result-inner { padding: 2.2rem 2rem; }

.result-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
}

.result-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--malachite-clair);
  margin: 0 0 0.4rem;
}

.result-head h2 {
  font-family: var(--font-display);
  font-size: 1.9rem;
  margin: 0;
  color: var(--quartz);
}

.result-scientific {
  font-family: var(--font-mono);
  font-style: italic;
  color: var(--quartz-mat);
  font-size: 0.85rem;
  margin: 0.3rem 0 0;
}

.confidence-badge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.35rem 0.7rem;
  border: 1px solid currentColor;
  white-space: nowrap;
}
.confidence-faible { color: var(--grenat); }
.confidence-moyen { color: var(--citrine); }
.confidence-élevé { color: var(--malachite-clair); }

.result-type {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--quartz-mat);
  margin: 1.1rem 0 0;
}

.result-description {
  margin: 0.6rem 0 0;
  color: var(--quartz);
  line-height: 1.65;
}

.result-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.6rem;
  margin-top: 1.8rem;
}

@media (max-width: 600px) {
  .result-grid { grid-template-columns: 1fr; }
}

.result-block h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin: 0 0 0.7rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--liseret);
}

.result-block ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.result-block li {
  font-size: 0.9rem;
  padding-left: 1rem;
  position: relative;
}
.result-block li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.05em;
  font-size: 0.55rem;
  color: var(--malachite-clair);
}

.alternatives-block { margin-top: 1.8rem; }

.alt-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--liseret);
  font-size: 0.88rem;
}
.alt-item:last-child { border-bottom: none; }
.alt-item strong { color: var(--quartz); white-space: nowrap; }
.alt-item span { color: var(--quartz-mat); text-align: right; }

.result-warning {
  margin-top: 1.8rem;
  padding-top: 1.2rem;
  border-top: 1px dashed var(--liseret);
  font-size: 0.8rem;
  color: var(--quartz-mat);
  font-style: italic;
}

/* ---------- Expert chat ---------- */
.expert-chat {
  max-width: 720px;
  margin: 0 auto;
  padding: 1.6rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1rem 1.2rem;
  background: var(--pierre);
  border: 1px solid var(--liseret);
  border-bottom: none;
}

.expert-avatar {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--basalte-2);
  border: 1px solid var(--citrine);
  color: var(--citrine);
  flex-shrink: 0;
}

.chat-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  margin: 0;
  color: var(--quartz);
}

.chat-subtitle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin: 0.15rem 0 0;
}

.chat-messages {
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-bottom: none;
  padding: 1.2rem;
  min-height: 120px;
  max-height: 420px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.7rem 1rem;
  font-size: 0.92rem;
  line-height: 1.55;
  white-space: pre-wrap;
}

.chat-msg.from-user {
  align-self: flex-end;
  background: var(--citrine);
  color: var(--basalte-2);
  border-radius: 8px 8px 2px 8px;
}

.chat-msg.from-expert {
  align-self: flex-start;
  background: var(--pierre);
  color: var(--quartz);
  border: 1px solid var(--liseret);
  border-radius: 8px 8px 8px 2px;
}

.chat-msg.msg-error {
  align-self: center;
  background: rgba(193, 96, 74, 0.12);
  border: 1px solid var(--grenat);
  color: #e8a392;
  font-size: 0.82rem;
}

.chat-typing {
  display: flex;
  gap: 5px;
  padding: 0.8rem 1.2rem;
  background: var(--basalte-2);
  border-left: 1px solid var(--liseret);
  border-right: 1px solid var(--liseret);
}

.chat-typing span {
  width: 7px;
  height: 7px;
  background: var(--quartz-mat);
  clip-path: polygon(50% 0, 100% 35%, 80% 100%, 20% 100%, 0 35%);
  animation: typing-pulse 1.2s ease-in-out infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.18s; }
.chat-typing span:nth-child(3) { animation-delay: 0.36s; }

@keyframes typing-pulse {
  0%, 100% { opacity: 0.25; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-3px); }
}

.chat-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  background: var(--basalte-2);
  border-left: 1px solid var(--liseret);
  border-right: 1px solid var(--liseret);
}

.suggestion-chip {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.4rem 0.8rem;
  background: transparent;
  color: var(--citrine);
  border: 1px solid var(--citrine);
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.suggestion-chip:hover {
  background: var(--citrine);
  color: var(--basalte-2);
}

.chat-input-row {
  display: flex;
  gap: 0;
  border: 1px solid var(--liseret);
}

#chat-input {
  flex: 1;
  background: var(--pierre);
  border: none;
  padding: 0.9rem 1.1rem;
  color: var(--quartz);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

#chat-input::placeholder { color: var(--quartz-mat); opacity: 0.7; }
#chat-input:focus { outline: none; background: var(--pierre-clair); }

.chat-send {
  border-radius: 0;
  flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
  .chat-typing span { animation: none; opacity: 0.6; }
}

/* ---------- Les outils du lapidaire ---------- */
.tools-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 4rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.tool-card {
  background: linear-gradient(170deg, var(--pierre) 0%, var(--basalte-2) 100%);
  border: 1px solid var(--liseret);
  border-top: 2px solid var(--citrine);
  padding: 1.8rem 1.6rem;
  text-align: left;
  margin-top: 1.4rem;
}

.tool-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 0.4rem;
}

.tool-desc {
  font-size: 0.86rem;
  color: var(--quartz-mat);
  line-height: 1.55;
  margin: 0 0 1.4rem;
}

/* --- Échelle de Mohs --- */
.mohs-scale {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 4px;
}

@media (max-width: 560px) {
  .mohs-scale { grid-template-columns: repeat(5, 1fr); }
}

.mohs-seg {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  padding: 0.8rem 0;
  background: var(--basalte-2);
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  cursor: pointer;
  text-align: center;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.mohs-seg:hover {
  border-color: var(--citrine);
  color: var(--citrine);
  transform: translateY(-2px);
}

.mohs-seg.mohs-active {
  background: var(--citrine);
  color: var(--basalte-2);
  border-color: var(--citrine);
  font-weight: 500;
}

.mohs-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.3rem;
  margin-top: 0.8rem;
}

.mohs-legend span {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--quartz-mat);
}

.mohs-legend em {
  font-style: normal;
  color: var(--citrine);
}

.mohs-info {
  margin-top: 1.2rem;
  padding: 1.1rem 1.2rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--citrine);
  min-height: 60px;
}

.mohs-info-placeholder {
  color: var(--quartz-mat);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
}

.mohs-info h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.35rem;
}

.mohs-info p {
  font-size: 0.87rem;
  color: var(--quartz);
  line-height: 1.6;
  margin: 0 0 0.4rem;
}

.mohs-info .mohs-examples {
  font-size: 0.8rem;
  color: var(--quartz-mat);
  margin: 0;
}

/* --- Calculateur & convertisseur --- */
.tools-row {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

@media (max-width: 720px) {
  .tools-row { grid-template-columns: 1fr; }
}

.tool-form {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.tool-form label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin-top: 0.5rem;
}

.tool-form label:first-child { margin-top: 0; }

.tool-form select,
.tool-form input {
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  padding: 0.75rem 0.9rem;
  color: var(--quartz);
  font-family: var(--font-body);
  font-size: 0.93rem;
  width: 100%;
}

.tool-form select:focus,
.tool-form input:focus {
  outline: none;
  border-color: var(--citrine);
}

.calc-grams {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--citrine);
  margin: 0.1rem 0 0;
  min-height: 1em;
}

.tool-btn {
  margin-top: 1rem;
  align-self: flex-start;
}

.calc-result {
  margin-top: 1.3rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--liseret);
}

.calc-range {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--citrine);
  margin: 0 0 0.6rem;
}

.calc-note {
  font-size: 0.78rem;
  color: var(--quartz-mat);
  font-style: italic;
  line-height: 1.55;
  margin: 0 0 1rem;
}

.conv-form { position: relative; }

.conv-symbol {
  font-size: 1.1rem;
  color: var(--citrine);
  text-align: center;
  margin: 0.3rem 0;
}

.conv-hint {
  margin: 1.2rem 0 0;
  font-size: 0.78rem;
  color: var(--quartz-mat);
  font-style: italic;
  line-height: 1.55;
}

/* --- Simulateur UV --- */
.tool-head-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.uv-toggle { flex-shrink: 0; }

.uv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.8rem;
  margin-top: 0.4rem;
  padding: 1rem;
  border: 1px solid var(--liseret);
  background: var(--pierre);
  transition: background 0.5s ease;
}

.uv-grid.uv-on {
  background: #050508;
}

.uv-stone {
  padding: 0.85rem 0.95rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  transition: border-color 0.5s ease;
}

.uv-grid.uv-on .uv-stone {
  background: #030306;
}

.uv-dot {
  display: block;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  margin-bottom: 0.6rem;
  transition: background 0.5s ease, box-shadow 0.5s ease;
}

.uv-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--quartz);
  margin: 0 0 0.25rem;
}

.uv-reaction {
  font-size: 0.76rem;
  color: var(--quartz-mat);
  line-height: 1.45;
  margin: 0;
}

/* --- Compatibilité à l'eau --- */
.water-result {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
}

.water-verdict {
  font-family: var(--font-mono);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  margin: 0 0 0.5rem;
}

.water-verdict.water-ok { color: var(--malachite-clair); }
.water-verdict.water-brief { color: var(--citrine); }
.water-verdict.water-never { color: #e07a63; }

.water-reason {
  font-size: 0.85rem;
  color: var(--quartz-mat);
  line-height: 1.6;
  margin: 0;
}

/* --- Pierre de naissance --- */
.birth-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.45rem;
}

.birth-btn {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.55rem 0.2rem;
  background: var(--basalte-2);
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.birth-btn:hover {
  color: var(--citrine);
  border-color: var(--citrine);
}

.birth-btn.birth-active {
  background: var(--citrine);
  color: var(--basalte-2);
  border-color: var(--citrine);
}

.birth-result {
  margin-top: 1.2rem;
  padding: 1rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--citrine);
}

.birth-result h4 {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.4rem;
}

.birth-result p {
  font-size: 0.85rem;
  color: var(--quartz);
  line-height: 1.6;
  margin: 0;
}

/* --- Guide des tailles de gemmes --- */
.cuts-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

@media (max-width: 820px) {
  .cuts-grid { grid-template-columns: repeat(2, 1fr); }
}

.cut-item {
  text-align: center;
  padding: 1.2rem 0.9rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.cut-item:hover {
  border-color: var(--citrine);
  transform: translateY(-3px);
}

.cut-item svg {
  width: 62px;
  height: 62px;
  color: var(--citrine);
  filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.5));
  margin-bottom: 0.7rem;
}

.cut-item h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 0.35rem;
}

.cut-item p {
  font-size: 0.76rem;
  color: var(--quartz-mat);
  line-height: 1.5;
  margin: 0;
}

/* --- Carte mondiale des gisements --- */
.world-map-wrap {
  position: relative;
  border: 1px solid var(--liseret);
  background: var(--basalte-2);
  padding: 0.6rem;
}

.world-map svg {
  display: block;
  width: 100%;
  height: auto;
}

.wm-country {
  fill: var(--pierre-clair);
  stroke: var(--basalte);
  stroke-width: 0.5;
}

.wm-gem {
  fill: rgba(214, 178, 107, 0.38);
  stroke: var(--citrine);
  stroke-width: 0.6;
  cursor: pointer;
  transition: fill 0.15s ease;
}

.wm-gem:hover,
.wm-gem.wm-selected {
  fill: var(--citrine);
}

.wm-tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--basalte-2);
  border: 1px solid var(--citrine);
  color: var(--citrine);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.65rem;
  white-space: nowrap;
  z-index: 5;
}

.wm-info {
  margin-top: 1rem;
  padding: 1rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--citrine);
  min-height: 58px;
}

.wm-info-placeholder {
  color: var(--quartz-mat);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
}

.wm-info h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.35rem;
}

.wm-info p {
  font-size: 0.87rem;
  color: var(--quartz);
  line-height: 1.6;
  margin: 0;
}

.wm-error {
  color: var(--quartz-mat);
  font-style: italic;
  font-size: 0.85rem;
  padding: 2rem;
  text-align: center;
}

/* ---------- Glossaire ---------- */
.glossary-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 2.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.glossary-search {
  display: block;
  width: 100%;
  background: var(--pierre);
  border: 1px solid var(--liseret);
  padding: 0.9rem 1.1rem;
  color: var(--quartz);
  font-family: var(--font-body);
  font-size: 0.95rem;
  margin-bottom: 1.8rem;
}

.glossary-search::placeholder { color: var(--quartz-mat); opacity: 0.6; }
.glossary-search:focus { outline: none; border-color: var(--citrine); }

.glossary-list {
  margin: 0;
}

.glossary-list dt {
  font-family: var(--font-display);
  font-size: 1.08rem;
  font-weight: 500;
  color: var(--citrine);
  padding-top: 1.1rem;
  margin-top: 1.1rem;
  border-top: 1px solid var(--liseret);
}

.glossary-list dt:first-child {
  border-top: none;
  margin-top: 0;
  padding-top: 0;
}

.glossary-list dd {
  font-size: 0.9rem;
  color: var(--quartz-mat);
  line-height: 1.65;
  margin: 0.35rem 0 0;
}

.glossary-empty {
  text-align: center;
  color: var(--quartz-mat);
  font-style: italic;
  font-size: 0.9rem;
  padding: 2rem 0;
}

/* ---------- Les quatre précieuses ---------- */
.precious-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 4rem 1.8rem 1.5rem;
  position: relative;
  z-index: 2;
  text-align: center;
}

.precious-eyebrow { margin-bottom: 0.8rem; }

.precious-title {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 500;
  margin: 0 0 0.7rem;
  color: var(--quartz);
}

.precious-intro {
  color: var(--quartz-mat);
  font-size: 0.92rem;
  max-width: 520px;
  margin: 0 auto 2.6rem;
  line-height: 1.6;
}

.gems-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  text-align: left;
}

@media (max-width: 900px) {
  .gems-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .gems-grid { grid-template-columns: 1fr; }
}

.gem-card {
  background: linear-gradient(170deg, var(--pierre) 0%, var(--basalte-2) 100%);
  border: 1px solid var(--liseret);
  border-top: 2px solid var(--citrine);
  padding: 1.6rem 1.3rem 1.5rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.gem-card:hover {
  transform: translateY(-4px);
  border-color: var(--citrine);
}

.gem-visual {
  display: flex;
  justify-content: center;
  margin-bottom: 1.1rem;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.5));
}

.gem-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 500;
  text-align: center;
  margin: 0 0 0.3rem;
  color: var(--quartz);
}

.gem-hardness {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  text-align: center;
  color: var(--citrine);
  margin: 0 0 0.9rem;
  padding-bottom: 0.8rem;
  border-bottom: 1px solid var(--liseret);
}

.gem-info {
  font-size: 0.83rem;
  line-height: 1.6;
  color: var(--quartz-mat);
  margin: 0;
}

/* ---------- About & keywords ---------- */
.about-section {
  max-width: 720px;
  margin: 0 auto;
  padding: 3rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.about-inner h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 500;
  margin: 0 0 1.2rem;
  color: var(--quartz);
}

.about-inner p {
  color: var(--quartz-mat);
  font-size: 0.95rem;
  line-height: 1.7;
  margin: 0 0 1rem;
}

.keywords-block {
  margin-top: 2.2rem;
  padding-top: 1.6rem;
  border-top: 1px solid var(--liseret);
}

.keywords-block h3 {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin: 0 0 1rem;
}

.keywords-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.keywords-cloud span {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  padding: 0.32rem 0.7rem;
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  border-radius: 999px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.keywords-cloud span:hover {
  color: var(--malachite-clair);
  border-color: var(--malachite);
}

/* ---------- E-book ---------- */
.ebook-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 3.4rem 1.8rem 2rem;
  position: relative;
  z-index: 2;
}

.ebook-inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: center;
  padding: 2.4rem 2.2rem;
}

@media (max-width: 680px) {
  .ebook-inner { grid-template-columns: 1fr; }
  .ebook-visual { order: -1; }
}

.ebook-text h2 {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  margin: 0.3rem 0 0.9rem;
  color: var(--quartz);
}

.ebook-text > p {
  color: var(--quartz-mat);
  font-size: 0.93rem;
  line-height: 1.65;
  margin: 0 0 1.1rem;
}

.ebook-points {
  list-style: none;
  margin: 0 0 1.6rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ebook-points li {
  font-size: 0.88rem;
  color: var(--quartz);
  padding-left: 1rem;
  position: relative;
}

.ebook-points li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0.1em;
  font-size: 0.55rem;
  color: var(--citrine);
}

.btn-gold {
  display: inline-block;
  background: var(--citrine);
  color: var(--basalte-2);
  text-decoration: none;
  font-weight: 600;
}

.btn-gold:hover { background: #e8b654; }

.ebook-visual {
  display: flex;
  justify-content: center;
}

.ebook-cover {
  width: 180px;
  aspect-ratio: 3 / 4.2;
  background: linear-gradient(155deg, var(--pierre-clair), var(--basalte-2));
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--citrine);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1.4rem 1rem;
  text-align: center;
  color: var(--citrine);
  box-shadow: 8px 10px 30px rgba(0, 0, 0, 0.45);
  transform: rotate(2.5deg);
  transition: transform 0.25s ease;
}

.ebook-cover:hover { transform: rotate(0deg) scale(1.02); }

.ebook-cover-title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  line-height: 1.3;
  color: var(--quartz);
  margin: 0;
}

.ebook-cover-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--quartz-mat);
  margin: 0;
}

/* ---------- Footer social ---------- */
.footer-social {
  display: flex;
  justify-content: center;
  gap: 1.1rem;
  margin-bottom: 1.4rem;
}

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  border-radius: 50%;
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.footer-social a:hover {
  color: var(--citrine);
  border-color: var(--citrine);
  transform: translateY(-2px);
}

/* ---------- Compteur ---------- */
.hero-counter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--quartz-mat);
  margin: 1.4rem 0 0;
}

.hero-counter strong {
  color: var(--citrine);
  font-size: 1rem;
  font-weight: 500;
}

/* ---------- Badge compteur vitrine dans la nav ---------- */
.nav-count {
  display: inline-block;
  min-width: 1.3em;
  padding: 0.05em 0.35em;
  margin-left: 0.25em;
  background: var(--citrine);
  color: var(--basalte-2);
  border-radius: 999px;
  font-size: 0.85em;
  text-align: center;
}

/* ---------- Sélecteur de mode ---------- */
.mode-toggle {
  display: flex;
  justify-content: center;
  margin-bottom: 1.2rem;
  border: 1px solid var(--liseret);
  border-radius: 2px;
  overflow: hidden;
  width: fit-content;
  margin-left: auto;
  margin-right: auto;
}

.mode-btn {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.6rem 1.1rem;
  background: transparent;
  color: var(--quartz-mat);
  border: none;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.mode-btn:hover { color: var(--quartz); }

.mode-btn.mode-active {
  background: var(--citrine);
  color: var(--basalte-2);
}

/* ---------- Grille de photos ---------- */
.preview-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.7rem;
  padding: 1rem;
}

.preview-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid var(--liseret);
}

.preview-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.preview-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 26px;
  height: 26px;
  background: rgba(21, 19, 15, 0.85);
  color: var(--quartz);
  border: 1px solid var(--liseret);
  border-radius: 50%;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.preview-remove:hover {
  background: var(--grenat);
  color: var(--quartz);
}

/* ---------- Champ authenticité ---------- */
.claimed-row {
  margin-top: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.claimed-row label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
}

.claimed-row input {
  background: var(--pierre);
  border: 1px solid var(--liseret);
  padding: 0.85rem 1rem;
  color: var(--quartz);
  font-family: var(--font-body);
  font-size: 0.95rem;
}

.claimed-row input::placeholder { color: var(--quartz-mat); opacity: 0.6; }
.claimed-row input:focus { outline: none; border-color: var(--citrine); background: var(--pierre-clair); }

/* ---------- Actions du résultat ---------- */
.result-actions {
  margin-top: 1.4rem;
  display: flex;
  justify-content: center;
}

.result-actions .btn:disabled {
  opacity: 0.75;
  cursor: default;
}

/* ---------- Ma vitrine ---------- */
.collection-section {
  max-width: 820px;
  margin: 0 auto;
  padding: 2.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.collection-title {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  text-align: center;
  margin: 0 0 0.4rem;
  color: var(--quartz);
}

.collection-sub {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center;
  color: var(--quartz-mat);
  margin: 0 0 2rem;
}

.collection-empty {
  text-align: center;
  color: var(--quartz-mat);
  font-size: 0.92rem;
  padding: 2.5rem 1rem;
  border: 1px dashed var(--liseret);
}

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

.collection-card {
  background: var(--pierre);
  border: 1px solid var(--liseret);
  overflow: hidden;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.collection-card:hover {
  transform: translateY(-3px);
  border-color: var(--quartz-mat);
}

.collection-card img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

.collection-card-body {
  padding: 0.75rem 0.85rem 0.9rem;
}

.collection-card-name {
  font-family: var(--font-display);
  font-size: 0.98rem;
  color: var(--quartz);
  margin: 0 0 0.25rem;
  line-height: 1.25;
}

.collection-card-meta {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--quartz-mat);
  margin: 0 0 0.6rem;
}

.collection-card-delete {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.3rem 0.65rem;
  background: transparent;
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.collection-card-delete:hover {
  color: #e8a392;
  border-color: var(--grenat);
}

/* ---------- How it works ---------- */
.how-it-works {
  max-width: 820px;
  margin: 0 auto;
  padding: 4.5rem 1.8rem 3rem;
  position: relative;
  z-index: 2;
}

.how-it-works h2 {
  font-family: var(--font-display);
  font-size: 1.5rem;
  text-align: center;
  margin: 0 0 2.4rem;
  color: var(--quartz);
  font-weight: 500;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.3rem;
}

@media (max-width: 700px) {
  .steps { grid-template-columns: 1fr; gap: 1.2rem; }
}

.step {
  position: relative;
  background: linear-gradient(165deg, var(--pierre) 0%, var(--basalte-2) 100%);
  border: 1px solid var(--liseret);
  padding: 1.7rem 1.5rem 1.6rem;
  /* coin supérieur droit biseauté, en écho aux facettes */
  clip-path: polygon(0 0, calc(100% - 26px) 0, 100% 26px, 100% 100%, 0 100%);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.step::before {
  /* liseré doré du biseau */
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, transparent 48%, var(--citrine) 48%, var(--citrine) 55%, transparent 55%);
  pointer-events: none;
}

.step::after {
  /* fine ligne dorée en pied de carte */
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(90deg, var(--citrine), transparent 65%);
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.step:hover {
  transform: translateY(-4px);
  border-color: var(--citrine);
}

.step:hover::after { opacity: 1; }

.step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.step-num {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--citrine);
  display: block;
}

.step-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  color: var(--citrine);
  border: 1px solid var(--liseret);
  background: var(--basalte-2);
  /* pastille hexagonale */
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  transition: border-color 0.2s ease;
}

.step:hover .step-icon { border-color: var(--citrine); }

.step h3 {
  font-family: var(--font-display);
  font-size: 1.18rem;
  margin: 0 0 0.5rem;
  font-weight: 500;
  color: var(--quartz);
}

.step p {
  font-size: 0.87rem;
  color: var(--quartz-mat);
  margin: 0;
  line-height: 1.6;
}

/* ---------- Footer ---------- */
.site-footer {
  text-align: center;
  padding: 2.4rem 1.8rem 3rem;
  position: relative;
  z-index: 2;
}

.site-footer p {
  font-size: 0.78rem;
  color: var(--quartz-mat);
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  .loading-facet { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Identificateur par critères ---------- */
.crit-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}

@media (max-width: 720px) { .crit-form { grid-template-columns: 1fr; } }

.crit-form label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin-bottom: 0.4rem;
}

.crit-form select {
  width: 100%;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  padding: 0.75rem 0.9rem;
  color: var(--quartz);
  font-family: var(--font-body);
  font-size: 0.9rem;
}

.crit-form select:focus { outline: none; border-color: var(--citrine); }

.crit-results {
  margin-top: 1.3rem;
  padding: 1rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  min-height: 55px;
}

.crit-placeholder { color: var(--quartz-mat); font-style: italic; font-size: 0.85rem; margin: 0; }

.crit-count {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--citrine);
  margin: 0 0 0.8rem;
}

.crit-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.crit-chip {
  font-size: 0.82rem;
  padding: 0.45rem 0.85rem;
  background: var(--pierre);
  color: var(--quartz);
  border: 1px solid var(--liseret);
}

.crit-chip em {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--citrine);
  margin-left: 0.4rem;
}

/* ---------- Anatomie d'une gemme ---------- */
.anatomy-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.3rem; align-items: center; }
@media (max-width: 720px) { .anatomy-wrap { grid-template-columns: 1fr; } }

.anatomy-svg { width: 100%; height: auto; color: var(--citrine); }

.ana-zone {
  fill: rgba(214, 178, 107, 0.22);
  stroke: var(--citrine);
  stroke-width: 1.1;
  cursor: pointer;
  transition: fill 0.15s ease;
}

.ana-zone:hover, .ana-zone.ana-active { fill: var(--citrine); }

/* ---------- Pléochroïsme ---------- */
.pleo-wrap { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; align-items: center; }
@media (max-width: 720px) { .pleo-wrap { grid-template-columns: 1fr; } }

.pleo-gem { display: flex; justify-content: center; }
.pleo-gem svg { width: 130px; height: 130px; filter: drop-shadow(0 8px 18px rgba(0,0,0,0.55)); }

#pleo-angle {
  width: 100%;
  accent-color: var(--citrine);
  margin-top: 0.3rem;
}

.pleo-axis {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--citrine);
  margin: 0.4rem 0 0;
  min-height: 1em;
}

/* ---------- Formation géologique ---------- */
.geo-tabs { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.2rem; }

.geo-tab {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  padding: 0.6rem 1rem;
  background: var(--basalte-2);
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.geo-tab:hover { color: var(--citrine); border-color: var(--citrine); }
.geo-tab.geo-active { background: var(--citrine); color: var(--basalte-2); border-color: var(--citrine); }

.geo-step { display: flex; gap: 1rem; padding: 0.9rem 0; border-bottom: 1px solid var(--liseret); }
.geo-step:last-of-type { border-bottom: none; }

.geo-num {
  font-family: var(--font-mono);
  color: var(--citrine);
  font-size: 0.85rem;
  flex-shrink: 0;
  padding-top: 0.1rem;
}

.geo-step p { font-size: 0.88rem; color: var(--quartz); line-height: 1.6; margin: 0; }

.geo-stones {
  margin-top: 1rem;
  padding: 0.9rem 1rem;
  background: var(--basalte-2);
  border-left: 3px solid var(--citrine);
  font-size: 0.84rem;
  color: var(--quartz-mat);
}

.geo-stones strong { color: var(--citrine); font-weight: 500; }

/* ---------- Frise historique ---------- */
.history-timeline { position: relative; padding-left: 1.6rem; }

.history-timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: linear-gradient(180deg, var(--citrine), var(--liseret));
}

.hist-item { position: relative; padding: 0.7rem 0; }

.hist-item::before {
  content: "◆";
  position: absolute;
  left: -1.6rem;
  top: 0.85rem;
  font-size: 0.55rem;
  color: var(--citrine);
}

.hist-date {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--citrine);
  letter-spacing: 0.05em;
  display: block;
  margin-bottom: 0.2rem;
}

.hist-item p { font-size: 0.88rem; color: var(--quartz); line-height: 1.55; margin: 0; }

/* ---------- Étiquettes de collection ---------- */
.label-row { align-items: center; }

.label-preview-zone { display: flex; justify-content: center; }

.collection-label {
  width: 260px;
  padding: 1.1rem 1.2rem;
  background: linear-gradient(160deg, #fdfaf3, #f0e9da);
  border: 1.5px solid var(--citrine);
  color: #2a2418;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  box-shadow: 6px 8px 22px rgba(0,0,0,0.45);
}

.cl-brand {
  font-family: var(--font-mono);
  font-size: 0.58rem;
  letter-spacing: 0.28em;
  color: #a07c33;
}

.cl-name {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: #1d1810;
  border-bottom: 1px solid #d8c9a0;
  padding-bottom: 0.35rem;
  margin-bottom: 0.2rem;
}

.cl-line { font-size: 0.72rem; color: #5a5140; }

/* ---------- Section Guides ---------- */
.guides-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

/* --- Guide des inclusions --- */
.incl-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.9rem;
}

@media (max-width: 640px) { .incl-grid { grid-template-columns: 1fr; } }

.incl-item {
  padding: 1rem 1.1rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--malachite);
}

.incl-item.incl-alert { border-left-color: var(--grenat); }

.incl-item h4 {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 0.35rem;
}

.incl-item p {
  font-size: 0.8rem;
  color: var(--quartz-mat);
  line-height: 1.55;
  margin: 0;
}

/* --- Métaux précieux --- */
.metal-block {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--liseret);
}

.metal-block:last-of-type { border-bottom: none; }

.metal-block h4 {
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.3rem;
}

.metal-block p {
  font-size: 0.84rem;
  color: var(--quartz-mat);
  line-height: 1.6;
  margin: 0;
}

.metal-block strong { color: var(--quartz); font-weight: 500; }

/* --- Poinçons --- */
.hallmark-list { display: flex; flex-direction: column; gap: 0.55rem; }

.hallmark {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.hm-badge {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--citrine);
  border: 1px solid var(--citrine);
  padding: 0.4rem 0.55rem;
  width: 108px;
  text-align: center;
  clip-path: polygon(8px 0, calc(100% - 8px) 0, 100% 50%, calc(100% - 8px) 100%, 8px 100%, 0 50%);
  background: var(--basalte-2);
}

.hallmark p {
  font-size: 0.8rem;
  color: var(--quartz-mat);
  line-height: 1.45;
  margin: 0;
}

/* ---------- GEM-CURSOR : une gemme dorée à la place de la flèche ---------- */
body {
  cursor: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M2 2L16 4L20 20L4 16Z" fill="%23d6b26b" stroke="%23060606" stroke-width="1.5" stroke-linejoin="round"/><path d="M2 2L20 20M16 4L11 11M4 16L11 11" stroke="%23060606" stroke-width="0.9" opacity="0.55"/></svg>') 2 2, auto;
}

/* ---------- Mots-clés en pied de site ---------- */
.keywords-footer {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 1.8rem 2.8rem;
  position: relative;
  z-index: 2;
}

/* ---------- PIERRE-DU-JOUR ---------- */
.daily-section {
  max-width: 620px;
  margin: 0 auto;
  padding: 1rem 1.8rem 2rem;
  position: relative;
  z-index: 2;
}

.daily-inner {
  padding: 1.8rem 2rem;
  text-align: center;
}

.daily-label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--citrine);
  margin: 0 0 0.8rem;
}

.daily-name {
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 0.3rem;
}

.daily-meta {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--quartz-mat);
  margin: 0 0 0.9rem;
}

.daily-story {
  font-size: 0.92rem;
  color: var(--quartz-mat);
  line-height: 1.65;
  margin: 0;
  max-width: 460px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Flèche retour en haut ---------- */
#back-top {
  position: fixed;
  right: 1.4rem;
  bottom: 1.6rem;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--basalte-2);
  color: var(--citrine);
  border: 1px solid var(--citrine);
  border-radius: 50%;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
  transition: background 0.15s ease, transform 0.15s ease;
}

#back-top:hover {
  background: var(--citrine);
  color: var(--basalte-2);
  transform: translateY(-3px);
}

/* ---------- Nuancier ---------- */
.hue-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.4rem;
}

.hue-dot {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 2px solid var(--liseret);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.hue-dot:hover {
  transform: scale(1.12);
  border-color: var(--citrine);
}

.hue-dot.hue-active {
  border-color: var(--citrine);
  box-shadow: 0 0 0 3px rgba(214, 178, 107, 0.35);
}

.chip-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 0.45rem;
  vertical-align: baseline;
  border: 1px solid rgba(0, 0, 0, 0.4);
}

/* ---------- Astérisme ---------- */
.aster-gem {
  display: flex;
  justify-content: center;
}

.aster-gem svg {
  width: 100%;
  max-width: 260px;
  height: auto;
  filter: drop-shadow(0 10px 22px rgba(0, 0, 0, 0.55));
}

/* ---------- GEMME-3D : octaèdre CSS de la pierre du jour ---------- */
.gem3d-scene {
  width: 130px;
  height: 150px;
  margin: 0 auto 1.2rem;
  perspective: 520px;
}

.gem3d {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  animation: gem-spin 9s linear infinite;
}

@keyframes gem-spin {
  from { transform: rotateX(-14deg) rotateY(0deg); }
  to   { transform: rotateX(-14deg) rotateY(360deg); }
}

.gem3d-face {
  position: absolute;
  left: 50%;
  width: 85px;
  height: 90px;
  margin-left: -42.5px;
  backface-visibility: hidden;
}

.gem3d-face.up {
  top: calc(50% - 90px);
  transform-origin: 50% 100%;
  clip-path: polygon(50% 0, 0 100%, 100% 100%);
}

.gem3d-face.down {
  top: 50%;
  transform-origin: 50% 0;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

@media (prefers-reduced-motion: reduce) {
  .gem3d { animation: none; transform: rotateX(-14deg) rotateY(28deg); }
}

/* ---------- Bouton de langue ---------- */
.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  padding: 0.45rem 0.75rem;
  background: transparent;
  color: var(--citrine);
  border: 1px solid var(--citrine);
  border-radius: 999px;
  cursor: pointer;
  margin-left: 0.5rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle:hover {
  background: var(--citrine);
  color: var(--basalte-2);
}

/* ---------- Accordéon des outils ---------- */
.tools-section .tool-card { padding: 0; overflow: hidden; }

.tool-acc-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1.1rem 1.4rem;
  background: linear-gradient(115deg, rgba(214, 178, 107, 0.13) 0%, rgba(214, 178, 107, 0.03) 45%, transparent 72%);
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  text-align: left;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.tool-acc-header:hover {
  background: linear-gradient(115deg, rgba(214, 178, 107, 0.26) 0%, rgba(214, 178, 107, 0.07) 50%, transparent 78%);
}

.tool-card:not(.acc-collapsed) .tool-acc-header {
  background: linear-gradient(115deg, rgba(214, 178, 107, 0.32) 0%, rgba(214, 178, 107, 0.09) 55%, transparent);
  border-left-color: var(--citrine);
}

.tool-acc-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  color: var(--citrine);
  border: 1px solid var(--liseret);
  background: var(--basalte-2);
  clip-path: polygon(50% 0, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
}

.tool-acc-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--quartz);
}

.tool-acc-chevron {
  color: var(--citrine);
  font-size: 0.85rem;
  transition: transform 0.25s ease;
}

.tool-card:not(.acc-collapsed) .tool-acc-chevron { transform: rotate(180deg); }
.tool-card:not(.acc-collapsed) .tool-acc-icon { border-color: var(--citrine); }

.tool-body { padding: 0.2rem 1.5rem 1.6rem; }
.tool-card.acc-collapsed .tool-body { display: none; }

/* ---------- THEME-CLAIR (ivoire & argent) ---------- */
[data-theme="light"] {
  --basalte: #efece4;
  --basalte-2: #faf8f2;
  --pierre: #ffffff;
  --pierre-clair: #f3efe6;
  --liseret: #d9d2c2;
  --quartz: #2a2620;
  --quartz-mat: #6e6350;
  --citrine: #a8813a;
  --citrine-clair: #c29a52;
  --malachite: #2a6a55;
  --malachite-clair: #38826a;
}

[data-theme="light"] .grain { opacity: 0.05; }

/* Texte foncé sur les fonds dorés (sinon illisible en clair) */
[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-gold,
[data-theme="light"] .mode-btn.mode-active,
[data-theme="light"] .suggestion-chip:hover,
[data-theme="light"] .chat-msg.from-user,
[data-theme="light"] .mohs-seg.mohs-active,
[data-theme="light"] .birth-btn.birth-active,
[data-theme="light"] .geo-tab.geo-active,
[data-theme="light"] .nav-count,
[data-theme="light"] #back-top:hover {
  color: #fdfbf5;
}

[data-theme="light"] .ebook-cover { box-shadow: 8px 10px 26px rgba(90, 78, 55, 0.25); }
[data-theme="light"] .gem-visual { filter: drop-shadow(0 6px 12px rgba(90, 78, 55, 0.3)); }
[data-theme="light"] #back-top,
[data-theme="light"] .collection-card,
[data-theme="light"] .step,
[data-theme="light"] .gem-card,
[data-theme="light"] .tool-card { box-shadow: 0 3px 14px rgba(90, 78, 55, 0.08); }

/* ---------- Bouton sombre/clair ---------- */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  margin: 0.2rem auto 1.2rem;
  background: transparent;
  border: 1px solid var(--quartz-mat);
  border-radius: 50%;
  cursor: pointer;
  color: var(--quartz);          /* icône soleil claire en mode sombre */
  transition: color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.theme-toggle:hover { transform: translateY(-2px); border-color: var(--quartz); }

.theme-toggle .icon-moon { display: none; }

/* En mode clair : lune argentée */
.theme-toggle.is-light { color: #8c96a4; border-color: #aab2bd; }
.theme-toggle.is-light:hover { border-color: #8c96a4; }
.theme-toggle.is-light .icon-sun { display: none; }
.theme-toggle.is-light .icon-moon { display: block; }

/* ---------- LITHO-STYLES ---------- */
.litho-section {
  max-width: 920px;
  margin: 0 auto;
  padding: 2.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.litho-section .tool-card { padding: 0; overflow: hidden; }

.chakra-wrap {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.4rem;
  align-items: center;
}

@media (max-width: 720px) { .chakra-wrap { grid-template-columns: 1fr; } }

.chakra-figure {
  color: var(--quartz-mat);
  max-width: 230px;
  margin: 0 auto;
}

.chakra-figure svg { width: 100%; height: auto; }

.chakra-dot {
  cursor: pointer;
  transition: r 0.15s ease, filter 0.15s ease;
}

.chakra-dot:hover, .chakra-dot.chakra-active {
  r: 5.5;
  filter: drop-shadow(0 0 5px currentColor);
}

/* --- Composeur de bracelet & oracle --- */
.bracelet-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.4rem;
  align-items: start;
}

@media (max-width: 720px) { .bracelet-wrap { grid-template-columns: 1fr; } }

.bracelet-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.bracelet-btns .tool-btn { margin-top: 0.6rem; }

.bracelet-visual svg {
  width: 100%;
  max-width: 250px;
  display: block;
  margin: 0 auto;
  filter: drop-shadow(0 8px 18px rgba(0, 0, 0, 0.4));
}

.oracle-wrap { text-align: center; padding: 0.4rem 0 0.2rem; }
.oracle-wrap .birth-result { text-align: left; margin-top: 1.2rem; }

/* --- Quiz, lune & encyclopédie litho --- */
.moon-head {
  display: flex;
  align-items: center;
  gap: 1.3rem;
  flex-wrap: wrap;
}

.moon-svg {
  width: 105px;
  height: 105px;
  flex-shrink: 0;
  filter: drop-shadow(0 6px 16px rgba(0, 0, 0, 0.5));
}

.moon-illum {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--quartz-mat);
  margin: 0.3rem 0 0;
}

.quiz-q { margin-bottom: 1.2rem; }

.quiz-question {
  font-size: 0.92rem;
  color: var(--quartz);
  margin: 0 0 0.55rem;
}

.quiz-opts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.45rem;
}

@media (max-width: 640px) { .quiz-opts { grid-template-columns: 1fr; } }

.quiz-opt {
  font-family: var(--font-body);
  font-size: 0.82rem;
  padding: 0.6rem 0.8rem;
  background: var(--basalte-2);
  color: var(--quartz-mat);
  border: 1px solid var(--liseret);
  cursor: pointer;
  text-align: left;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.quiz-opt:hover { color: var(--citrine); border-color: var(--citrine); }

.quiz-opt.quiz-active {
  background: var(--citrine);
  color: var(--basalte-2);
  border-color: var(--citrine);
}

[data-theme="light"] .quiz-opt.quiz-active { color: #fdfbf5; }

#quiz-wrap .btn-gold:disabled { opacity: 0.4; cursor: not-allowed; }
#quiz-wrap .birth-result { margin-top: 1.2rem; }

.vertus-meta {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  line-height: 1.7;
  color: var(--citrine);
  margin: 0.6rem 0 0 !important;
}

/* ---------- Boutons boutiques e-book ---------- */
.ebook-buy-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.4rem;
}

.ebook-buy {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1.3rem;
  text-decoration: none;
  border-radius: 6px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
}

.ebook-buy:hover {
  transform: translateY(-3px);
  filter: brightness(1.08);
}

.ebook-buy span {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  font-family: var(--font-body);
  font-size: 0.98rem;
  font-weight: 600;
}

.ebook-buy span em {
  font-style: normal;
  font-weight: 400;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
}

/* Amazon Kindle : ambre signature, texte sombre */
.ebook-buy-amazon {
  background: linear-gradient(160deg, #ffb84d 0%, #f29111 100%);
  color: #191510;
  box-shadow: 0 5px 16px rgba(242, 145, 17, 0.3);
}

.ebook-buy-amazon:hover { box-shadow: 0 8px 22px rgba(242, 145, 17, 0.45); }

/* Kobo : rouge signature, texte blanc */
.ebook-buy-kobo {
  background: linear-gradient(160deg, #e8453c 0%, #bf1e2e 100%);
  color: #fdf6f4;
  box-shadow: 0 5px 16px rgba(191, 30, 46, 0.3);
}

.ebook-buy-kobo:hover { box-shadow: 0 8px 22px rgba(191, 30, 46, 0.45); }

[data-theme="light"] .ebook-buy-amazon { box-shadow: 0 5px 14px rgba(180, 110, 20, 0.35); }
[data-theme="light"] .ebook-buy-kobo { box-shadow: 0 5px 14px rgba(160, 30, 40, 0.3); }

/* Les onglets de navigation peuvent être des liens entre pages */
a.nav-tab {
  text-decoration: none;
  display: inline-block;
}

/* ---------- Texte SEO des pages de catégorie ---------- */
.page-seo {
  max-width: 780px;
  margin: 0 auto;
  padding: 3.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.page-seo h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 1.2rem;
  line-height: 1.3;
}

.page-seo h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 2rem 0 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--liseret);
}

.page-seo p {
  font-size: 0.94rem;
  color: var(--quartz-mat);
  line-height: 1.75;
  margin: 0 0 1rem;
}

.page-seo strong {
  color: var(--quartz);
  font-weight: 500;
}

.page-seo a {
  color: var(--citrine);
  text-decoration: none;
  border-bottom: 1px solid rgba(214, 178, 107, 0.4);
}

.page-seo a:hover { border-bottom-color: var(--citrine); }

/* ---------- Textes SEO des pages Guides & Lithothérapie ---------- */
.seo-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 3.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.seo-title {
  font-family: var(--font-display);
  font-size: 1.55rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 1.4rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--liseret);
}

.seo-section h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 2rem 0 0.7rem;
}

.seo-section p {
  font-size: 0.92rem;
  color: var(--quartz-mat);
  line-height: 1.75;
  margin: 0 0 1rem;
}

.seo-section strong {
  color: var(--quartz);
  font-weight: 500;
}

.seo-section a {
  color: var(--citrine);
  text-decoration: none;
  border-bottom: 1px solid rgba(214, 178, 107, 0.4);
}

.seo-section a:hover { border-bottom-color: var(--citrine); }

/* ---------- TAROT-STYLES ---------- */
.tarot-disclaimer {
  font-size: 0.75rem;
  color: var(--quartz-mat);
  font-style: italic;
  line-height: 1.55;
  padding: 0.7rem 0.9rem;
  background: var(--basalte-2);
  border-left: 2px solid var(--citrine);
  margin: 0 0 1.2rem;
}

.tarot-controls {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  margin-bottom: 0.8rem;
}

.tarot-status {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--citrine);
  margin: 0 0 1rem;
  min-height: 1em;
}

.tarot-spread {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(62px, 1fr));
  gap: 0.5rem;
}

.tarot-card {
  position: relative;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.18s ease, filter 0.18s ease;
}

.tarot-card svg { width: 100%; height: auto; display: block; }
.tarot-card:hover { transform: translateY(-6px); filter: drop-shadow(0 6px 12px rgba(214, 178, 107, 0.35)); }

.tarot-card.tarot-chosen {
  transform: translateY(-4px);
  filter: drop-shadow(0 0 9px rgba(214, 178, 107, 0.6));
}

.tarot-badge {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--citrine);
  color: #0d0c0b;
  font-family: var(--font-mono);
  font-size: 0.78rem;
}

@keyframes tarot-shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px) rotate(-0.6deg); }
  75% { transform: translateX(4px) rotate(0.6deg); }
}

.tarot-spread.tarot-shuffling { animation: tarot-shake 0.15s linear 4; }

@keyframes tarot-slide {
  from { transform: translateX(-14px); opacity: 0.5; }
  to { transform: translateX(0); opacity: 1; }
}

.tarot-spread.tarot-cutting { animation: tarot-slide 0.35s ease; }

@keyframes tarot-flip {
  from { transform: rotateY(90deg); opacity: 0; }
  to { transform: rotateY(0); opacity: 1; }
}

.tarot-reading { margin-top: 1.4rem; }

.tarot-result {
  display: flex;
  gap: 1.3rem;
  align-items: flex-start;
  padding: 1.5rem 0;
  border-top: 1px solid var(--liseret);
  animation: tarot-flip 0.5s ease backwards;
}

.tarot-face { flex-shrink: 0; width: 78px; }
.tarot-face svg { width: 100%; height: auto; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.45)); }

.tarot-text h4 {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.2rem;
}

.tarot-pos {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--quartz-mat);
  margin: 0 0 0.5rem !important;
}

.tarot-essence {
  font-size: 0.83rem;
  color: var(--quartz-mat);
  font-style: italic;
  line-height: 1.6;
  padding-left: 0.8rem;
  border-left: 2px solid var(--liseret);
  margin: 0 0 0.7rem !important;
}

.tarot-body {
  font-size: 0.9rem;
  color: var(--quartz);
  line-height: 1.7;
  margin: 0 !important;
}

.tarot-synth {
  margin-top: 1.3rem;
  padding: 1.1rem 1.2rem;
  background: var(--basalte-2);
  border: 1px solid var(--liseret);
  border-left: 3px solid var(--citrine);
}

.tarot-synth h4 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 500;
  color: var(--citrine);
  margin: 0 0 0.4rem;
}

.tarot-synth p { font-size: 0.88rem; color: var(--quartz); line-height: 1.6; margin: 0 0 0.5rem; }

.tarot-synth-note {
  font-size: 0.78rem !important;
  color: var(--quartz-mat) !important;
  font-style: italic;
  margin: 0 !important;
}

.tarot-synth-note strong { color: var(--citrine); font-weight: 500; }

/* ---------- Arbre de vie ---------- */
.sephirot-wrap {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 1.4rem;
  align-items: center;
}

@media (max-width: 720px) { .sephirot-wrap { grid-template-columns: 1fr; } }

.sephirot-tree {
  color: var(--citrine);
  max-width: 250px;
  margin: 0 auto;
}

.sephirot-tree svg { width: 100%; height: auto; }

.seph-dot { cursor: pointer; transition: r 0.15s ease, filter 0.15s ease; }
.seph-dot:hover, .seph-dot.seph-active { r: 6.4; filter: drop-shadow(0 0 4px var(--citrine)); }


@media (max-width: 640px) {
  .tarot-result { flex-direction: column; gap: 0.9rem; }
  .tarot-face { width: 95px; margin: 0 auto; }
}

/* ---------- FOOTER-MENU ---------- */
.footer-nav {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto 2.5rem;
  padding: 0 1.8rem;
  text-align: left;
}

@media (max-width: 820px) {
  .footer-nav { grid-template-columns: 1fr 1fr; gap: 1.6rem; }
  .footer-col-wide { grid-column: 1 / -1; }
}

@media (max-width: 520px) {
  .footer-nav { grid-template-columns: 1fr; }
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--citrine);
  margin: 0 0 0.9rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--liseret);
}

.footer-col h4 a { color: inherit; text-decoration: none; }
.footer-col h4 a:hover { text-decoration: underline; }

.footer-col ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-two-col {
  columns: 2;
  column-gap: 1.4rem;
}

@media (max-width: 520px) { .footer-two-col { columns: 1; } }

.footer-col li { margin-bottom: 0.45rem; break-inside: avoid; }

.footer-col a {
  font-size: 0.82rem;
  color: var(--quartz-mat);
  text-decoration: none;
  transition: color 0.15s ease, padding-left 0.15s ease;
  display: inline-block;
}

.footer-col a:hover {
  color: var(--citrine);
  padding-left: 3px;
}

.footer-more { color: var(--citrine) !important; font-style: italic; }

.footer-bottom {
  border-top: 1px solid var(--liseret);
  padding-top: 1.8rem;
  text-align: center;
}

.footer-disclaimer {
  font-size: 0.78rem;
  color: var(--quartz-mat);
  line-height: 1.6;
  max-width: 560px;
  margin: 0 auto 1rem;
}

.footer-copy {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  color: var(--quartz-mat);
  opacity: 0.75;
  margin: 0;
}

/* ---------- Lien vers la page dédiée d'un outil ---------- */
.tool-page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin-right: 0.5rem;
  flex-shrink: 0;
  color: var(--citrine);
  border: 1px solid var(--liseret);
  border-radius: 50%;
  text-decoration: none;
  font-size: 0.72rem;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.tool-page-link:hover {
  background: var(--citrine);
  color: var(--basalte-2);
  transform: translateY(-2px);
}

/* ---------- Pages dédiées d'outils ---------- */
.breadcrumb {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.6rem 1.8rem 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  color: var(--quartz-mat);
  position: relative;
  z-index: 2;
}

.breadcrumb a { color: var(--quartz-mat); text-decoration: none; }
.breadcrumb a:hover { color: var(--citrine); }
.breadcrumb span { margin: 0 0.4rem; color: var(--liseret); }
.breadcrumb em { font-style: normal; color: var(--citrine); }

.tool-page {
  max-width: 920px;
  margin: 0 auto;
  padding: 1.4rem 1.8rem 0;
  position: relative;
  z-index: 2;
}

.tool-page-title {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 500;
  color: var(--quartz);
  margin: 0 0 1.4rem;
  line-height: 1.25;
}

@media (max-width: 640px) { .tool-page-title { font-size: 1.6rem; } }

/* Sur une page dédiée, la carte est déployée (pas d'accordéon) */
.tool-page .tool-card { padding: 1.8rem 1.6rem; }

/* ---------- Outils voisins ---------- */
.neighbours-section {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.8rem 1rem;
  position: relative;
  z-index: 2;
}

.neighbours-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--citrine);
  margin: 0 0 1rem;
}

.neighbours { display: flex; flex-wrap: wrap; gap: 0.6rem; }

.neighbour {
  font-size: 0.85rem;
  padding: 0.6rem 1rem;
  background: var(--pierre);
  color: var(--quartz);
  border: 1px solid var(--liseret);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.neighbour:hover {
  border-color: var(--citrine);
  color: var(--citrine);
  transform: translateY(-2px);
}

.neighbours-all { margin: 1.2rem 0 0; }

.neighbours-all a {
  font-size: 0.82rem;
  color: var(--citrine);
  text-decoration: none;
}

.neighbours-all a:hover { text-decoration: underline; }

/* Le sélecteur de langue est un lien entre versions FR/EN */
a.lang-toggle {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.footer-soon {
  font-size: 0.82rem;
  color: var(--quartz-mat);
  opacity: 0.5;
  font-style: italic;
}

/* ==========================================================================
   LAPIDEM — DESIGN 2.0 · « luxe tech »
   Couche de refonte appliquée par-dessus la feuille historique.
   Aucune classe n'est supprimée : tout est conservé, tout est modernisé.
   ========================================================================== */

/* ---------- 1. Jetons de design ---------- */

:root {
  /* Sombre : basalte plus profond, or champagne plus lumineux */
  --basalte: #08090c;
  --basalte-2: #040507;
  --pierre: #101319;
  --pierre-clair: #171b23;
  --liseret: #262c38;
  --liseret-vif: #333b4a;
  --quartz: #eef1f6;
  --quartz-mat: #94a0b4;
  --citrine: #e0b968;
  --citrine-clair: #f4dda4;
  --malachite: #34a37f;
  --malachite-clair: #5fd6ab;
  --grenat: #d0705a;
  --azur: #6ba8f0;

  /* Surfaces & profondeur */
  --surface: rgba(255, 255, 255, 0.028);
  --surface-2: rgba(255, 255, 255, 0.055);
  --glass: rgba(10, 12, 16, 0.72);
  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-2: rgba(255, 255, 255, 0.16);

  /* Rayons */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 30px;
  --r-pill: 999px;

  /* Ombres */
  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.4);
  --sh-2: 0 4px 16px -4px rgba(0, 0, 0, 0.55);
  --sh-3: 0 18px 48px -18px rgba(0, 0, 0, 0.7);
  --sh-gold: 0 8px 28px -10px rgba(224, 185, 104, 0.42);

  /* Transitions */
  --t-fast: 140ms cubic-bezier(0.4, 0, 0.2, 1);
  --t: 240ms cubic-bezier(0.33, 1, 0.68, 1);
  --t-slow: 480ms cubic-bezier(0.33, 1, 0.68, 1);

  /* Dégradés signature */
  --grad-gold: linear-gradient(135deg, #f4dda4 0%, #e0b968 42%, #c99a45 100%);
  --grad-ink: linear-gradient(165deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.012));
  --grad-line: linear-gradient(90deg, transparent, var(--citrine), transparent);

  --maxw: 1100px;
}

[data-theme="light"] {
  --basalte: #f4f1ea;
  --basalte-2: #fcfaf5;
  --pierre: #ffffff;
  --pierre-clair: #f7f4ec;
  --liseret: #e2dccd;
  --liseret-vif: #d2c9b4;
  --quartz: #1f1c17;
  --quartz-mat: #6a6152;
  --citrine: #9a7229;
  --citrine-clair: #b98d3c;
  --malachite: #226b53;
  --malachite-clair: #2f8467;
  --grenat: #b0503a;
  --azur: #2f6bb8;

  --surface: rgba(31, 28, 23, 0.026);
  --surface-2: rgba(31, 28, 23, 0.05);
  --glass: rgba(252, 250, 245, 0.78);
  --hairline: rgba(31, 28, 23, 0.1);
  --hairline-2: rgba(31, 28, 23, 0.18);

  --sh-1: 0 1px 2px rgba(90, 78, 55, 0.09);
  --sh-2: 0 4px 18px -6px rgba(90, 78, 55, 0.2);
  --sh-3: 0 20px 50px -20px rgba(90, 78, 55, 0.3);
  --sh-gold: 0 8px 26px -10px rgba(154, 114, 41, 0.34);

  --grad-gold: linear-gradient(135deg, #c39a4a 0%, #9a7229 55%, #7d5a1c 100%);
  --grad-ink: linear-gradient(165deg, rgba(31, 28, 23, 0.035), rgba(31, 28, 23, 0.008));
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  -webkit-text-size-adjust: 100%;
}

body {
  background:
    radial-gradient(1100px 620px at 18% -8%, rgba(224, 185, 104, 0.075), transparent 62%),
    radial-gradient(900px 520px at 92% 6%, rgba(52, 163, 127, 0.062), transparent 60%),
    var(--basalte);
  background-attachment: fixed;
  letter-spacing: -0.005em;
}

[data-theme="light"] body {
  background:
    radial-gradient(1100px 620px at 18% -8%, rgba(154, 114, 41, 0.085), transparent 62%),
    radial-gradient(900px 520px at 92% 6%, rgba(34, 107, 83, 0.06), transparent 60%),
    var(--basalte);
}

.grain { opacity: 0.028; }
[data-theme="light"] .grain { opacity: 0.04; }

::selection { background: var(--citrine); color: #08090c; }

:focus-visible {
  outline: 2px solid var(--citrine);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 2. En-tête sticky en verre dépoli ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  max-width: none;
  width: 100%;
  padding: 0.85rem clamp(0.9rem, 3vw, 2rem);
  display: flex;
  align-items: center;
  gap: 1rem;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t), border-color var(--t), padding var(--t), backdrop-filter var(--t);
}

body.is-scrolled .site-header {
  border-bottom-color: var(--hairline);
  padding-top: 0.55rem;
  padding-bottom: 0.55rem;
  box-shadow: var(--sh-2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(20px) saturate(1.6);
  backdrop-filter: blur(20px) saturate(1.6);
}

.logo {
  font-size: 0.98rem;
  letter-spacing: 0.26em;
  gap: 0.55rem;
  flex: 0 0 auto;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  transition: opacity var(--t-fast);
}

.logo svg { color: var(--citrine); -webkit-text-fill-color: currentColor; flex: 0 0 auto; }
.logo:hover { opacity: 0.82; }

.main-nav {
  margin-left: auto;
  gap: 0.15rem;
  align-items: center;
  padding: 0.22rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-tab {
  position: relative;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  padding: 0.5rem 0.85rem;
  border: 0;
  border-radius: var(--r-pill);
  color: var(--quartz-mat);
  text-decoration: none;
  white-space: nowrap;
  transition: color var(--t-fast), background var(--t-fast);
}

.nav-tab:hover { color: var(--quartz); background: var(--surface-2); }

.nav-tab.nav-active {
  color: #08090c;
  background: var(--grad-gold);
  border: 0;
  box-shadow: var(--sh-gold);
}

[data-theme="light"] .nav-tab.nav-active { color: #fdfbf5; }

.nav-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.25rem;
  padding: 0 0.3rem;
  border-radius: var(--r-pill);
  font-size: 0.62rem;
  background: var(--citrine);
  color: #08090c;
}

.lang-toggle {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.42rem 0.62rem;
  margin-left: 0.3rem;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-pill);
  color: var(--quartz-mat);
  text-decoration: none;
  transition: color var(--t-fast), border-color var(--t-fast);
}

.lang-toggle:hover { color: var(--citrine); border-color: var(--citrine); }

@media (max-width: 900px) {
  .site-header { flex-direction: column; align-items: stretch; gap: 0.55rem; padding: 0.7rem 0.8rem; }
  .logo { justify-content: center; }
  .main-nav {
    margin-left: 0;
    justify-content: flex-start;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-padding-inline: 0.25rem;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .nav-tab { font-size: 0.66rem; padding: 0.45rem 0.7rem; }
}

/* ---------- 3. Typographie & sections ---------- */

main { position: relative; z-index: 2; }

.hero {
  max-width: 860px;
  padding: clamp(2.6rem, 7vw, 5rem) 1.5rem clamp(1.8rem, 4vw, 3rem);
}

.hero h1 {
  font-size: clamp(2rem, 5.6vw, 3.5rem);
  line-height: 1.06;
  letter-spacing: -0.028em;
  margin: 0.5rem 0 1rem;
}

.hero h1 em {
  font-style: italic;
  background: var(--grad-gold);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub {
  font-size: clamp(0.98rem, 1.6vw, 1.12rem);
  color: var(--quartz-mat);
  max-width: 62ch;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.62;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.19em;
  color: var(--citrine);
  padding: 0.34rem 0.8rem;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-pill);
  background: var(--surface);
}

.hero-counter {
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  margin-top: 1.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--quartz-mat);
}

.hero-counter strong {
  font-size: 1.05rem;
  color: var(--citrine);
  font-variant-numeric: tabular-nums;
}

.precious-title,
.tools-section > h2,
.litho-section > h2,
.guides-section > h2,
.how-it-works > h2,
.neighbours-title,
.collection-title,
.seo-section h2 {
  letter-spacing: -0.022em;
}

.tools-section,
.litho-section,
.guides-section,
.precious-section,
.how-it-works,
.about-section,
.daily-section,
.collection-section,
.ebook-section,
.seo-section,
.neighbours-section,
.tool-page,
.upload-section,
.result,
.expert-chat {
  max-width: var(--maxw);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(0.9rem, 3vw, 1.8rem);
  padding-right: clamp(0.9rem, 3vw, 1.8rem);
}

/* Filet doré décoratif sous les titres de section */
.tools-section > h2::after,
.litho-section > h2::after,
.guides-section > h2::after,
.precious-title::after {
  content: "";
  display: block;
  width: 68px;
  height: 2px;
  margin: 0.9rem auto 0;
  border-radius: 2px;
  background: var(--grad-gold);
  opacity: 0.85;
}

/* ---------- 4. Boutons ---------- */

.btn,
.tool-btn,
.ebook-buy,
.suggestion-chip,
.mode-btn {
  border-radius: var(--r-pill);
  transition: transform var(--t-fast), box-shadow var(--t-fast), background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

.btn {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  padding: 0.78rem 1.5rem;
  border: 1px solid transparent;
  cursor: pointer;
}

.btn-primary,
.btn-gold {
  background: var(--grad-gold);
  color: #08090c;
  border-color: transparent;
  box-shadow: var(--sh-gold);
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-gold { color: #fdfbf5; }

.btn-primary:hover,
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px -10px rgba(224, 185, 104, 0.6);
}

.btn-primary:active, .btn-gold:active { transform: translateY(0); }

.btn-ghost {
  background: var(--surface);
  border-color: var(--hairline-2);
  color: var(--quartz);
}

.btn-ghost:hover {
  border-color: var(--citrine);
  color: var(--citrine);
  background: var(--surface-2);
  transform: translateY(-2px);
}

.mode-toggle {
  display: inline-flex;
  gap: 0.25rem;
  padding: 0.25rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.mode-btn {
  border: 0;
  padding: 0.58rem 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  background: transparent;
  color: var(--quartz-mat);
  cursor: pointer;
}

.mode-btn.mode-active {
  background: var(--grad-gold);
  color: #08090c;
  box-shadow: var(--sh-1);
}

.suggestion-chip {
  border: 1px solid var(--hairline-2);
  background: var(--surface);
  color: var(--quartz-mat);
  padding: 0.46rem 0.9rem;
  font-size: 0.76rem;
  cursor: pointer;
}

.suggestion-chip:hover {
  background: var(--grad-gold);
  color: #08090c;
  border-color: transparent;
  transform: translateY(-1px);
}

/* ---------- 5. Cartes & cadres ---------- */

.tool-card,
.step,
.gem-card,
.collection-card,
.specimen-frame,
.about-inner,
.seo-section,
.neighbours-section {
  border-radius: var(--r-lg);
}

.tool-card {
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
  overflow: hidden;
  transition: border-color var(--t), box-shadow var(--t), transform var(--t);
}

.tool-card:hover { border-color: var(--hairline-2); }

.step,
.gem-card {
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.step:hover,
.gem-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--hairline-2);
}

.specimen-frame {
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-3);
}

.facet { opacity: 0.5; }

.steps,
.gems-grid {
  display: grid;
  gap: clamp(0.9rem, 2vw, 1.3rem);
}

.steps { grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); }
.gems-grid { grid-template-columns: repeat(auto-fit, minmax(226px, 1fr)); }

.step-num {
  font-family: var(--font-mono);
  color: var(--citrine);
  opacity: 0.8;
}

.step-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--citrine);
}

/* ---------- 6. Formulaires ---------- */

.tool-form input,
.tool-form select,
.crit-form select,
.claimed-row input,
.chat-input-row input,
input[type="text"],
input[type="number"],
select,
textarea,
.gem-search input {
  background: var(--basalte-2);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm);
  color: var(--quartz);
  padding: 0.7rem 0.85rem;
  font-family: var(--font-body);
  font-size: 0.92rem;
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
  -webkit-appearance: none;
  appearance: none;
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2394a0b4' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 1rem;
  padding-right: 2.2rem;
}

.tool-form input:focus,
.tool-form select:focus,
.crit-form select:focus,
.claimed-row input:focus,
.chat-input-row input:focus,
input:focus,
select:focus {
  outline: none;
  border-color: var(--citrine);
  box-shadow: 0 0 0 3px rgba(224, 185, 104, 0.16);
}

.tool-form label,
.crit-form label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--quartz-mat);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--grad-gold);
  border: 0;
  box-shadow: var(--sh-gold);
  cursor: grab;
}

input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--citrine);
  border: 0;
  cursor: grab;
}

/* ---------- 7. Zone de dépôt ---------- */

.drop-zone {
  border: 1.5px dashed var(--hairline-2);
  border-radius: var(--r-md);
  background: var(--surface);
  transition: border-color var(--t), background var(--t), transform var(--t);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--citrine);
  background: rgba(224, 185, 104, 0.06);
  transform: scale(1.005);
}

.drop-icon { color: var(--citrine); opacity: 0.75; }

/* ---------- 8. Accordéon des outils ---------- */

.tool-acc-header {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: 100%;
  padding: 1.05rem 1.25rem;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  color: var(--quartz);
  transition: background var(--t-fast);
}

.tool-acc-header:hover { background: var(--surface); }

.tool-acc-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--citrine);
  transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.tool-acc-header:hover .tool-acc-icon { transform: translateY(-1px); border-color: var(--citrine); }

.tool-acc-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: 1.06rem;
  letter-spacing: -0.012em;
}

.tool-acc-chevron {
  color: var(--quartz-mat);
  transition: transform var(--t), color var(--t-fast);
}

.tool-card:not(.acc-collapsed) .tool-acc-chevron { color: var(--citrine); }
.tool-card:not(.acc-collapsed) { border-color: rgba(224, 185, 104, 0.32); }
.tool-body { padding: 0.2rem 1.25rem 1.5rem; }

/* ---------- 9. Fil d'Ariane & pages outil ---------- */

.breadcrumb {
  max-width: var(--maxw);
  margin: 1.6rem auto 0.4rem;
  padding: 0 clamp(0.9rem, 3vw, 1.8rem);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--quartz-mat);
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
}

.breadcrumb a { color: var(--quartz-mat); text-decoration: none; transition: color var(--t-fast); }
.breadcrumb a:hover { color: var(--citrine); }
.breadcrumb em { color: var(--citrine); font-style: normal; }
.breadcrumb span { opacity: 0.45; }

.tool-page-title {
  font-size: clamp(1.7rem, 4.2vw, 2.6rem);
  letter-spacing: -0.026em;
  margin: 0.4rem 0 1.4rem;
}

.seo-section {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: clamp(1.4rem, 3vw, 2.4rem) !important;
  margin: 2.4rem auto;
}

.seo-section h2 {
  font-size: 1.22rem;
  margin-top: 1.7rem;
  color: var(--citrine-clair);
}

[data-theme="light"] .seo-section h2 { color: var(--citrine); }
.seo-section h2:first-child { margin-top: 0; }
.seo-section p { color: var(--quartz-mat); line-height: 1.72; }
.seo-section strong { color: var(--quartz); }

.neighbours {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 0.7rem;
}

.neighbour {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.9rem 1.05rem;
  border-radius: var(--r-md);
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  color: var(--quartz);
  text-decoration: none;
  font-size: 0.9rem;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.neighbour::before { content: "◆"; color: var(--citrine); font-size: 0.66rem; }

.neighbour:hover {
  transform: translateY(-2px);
  border-color: var(--citrine);
  box-shadow: var(--sh-2);
}

/* ---------- 10. Chat ---------- */

.expert-chat {
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  padding: 0 !important;
  overflow: hidden;
  max-width: 860px;
}

.chat-header {
  padding: 1.05rem 1.3rem;
  border-bottom: 1px solid var(--hairline);
  background: var(--surface);
}

.expert-avatar {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--citrine);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chat-messages { padding: 1.2rem 1.3rem; }

.chat-msg {
  border-radius: 18px;
  line-height: 1.62;
}

.chat-msg.from-user {
  background: var(--grad-gold);
  color: #08090c;
  border-bottom-right-radius: 6px;
}

[data-theme="light"] .chat-msg.from-user { color: #fdfbf5; }

.chat-msg.from-expert {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  border-bottom-left-radius: 6px;
}

.chat-suggestions { padding: 0 1.3rem 0.4rem; gap: 0.45rem; flex-wrap: wrap; display: flex; }
.chat-input-row { padding: 0.9rem 1.3rem 1.2rem; gap: 0.6rem; }
.chat-input-row input { flex: 1; border-radius: var(--r-pill); }
.chat-send { flex: 0 0 auto; }

/* ---------- 11. Pied de page ---------- */

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--hairline);
  background: linear-gradient(180deg, transparent, var(--surface));
  position: relative;
  z-index: 2;
}

.footer-nav {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2.8rem clamp(0.9rem, 3vw, 1.8rem) 1.6rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(178px, 1fr));
  gap: 1.8rem 1.2rem;
}

.footer-col h4 {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--citrine);
  margin: 0 0 0.85rem;
}

.footer-col h4 a { text-decoration: none; }
.footer-col ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; }

.footer-col a {
  color: var(--quartz-mat);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color var(--t-fast), padding-left var(--t-fast);
}

.footer-col ul a:hover { color: var(--citrine); padding-left: 3px; }
.footer-more { color: var(--quartz) !important; font-weight: 500; }

.footer-bottom {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.2rem clamp(0.9rem, 3vw, 1.8rem) 2.4rem;
  border-top: 1px solid var(--hairline);
  text-align: center;
}

.footer-social { display: flex; justify-content: center; gap: 0.5rem; margin-bottom: 0.9rem; }

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--quartz-mat);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.footer-social a:hover { color: var(--citrine); border-color: var(--citrine); transform: translateY(-2px); }

.theme-toggle {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--hairline-2);
  background: var(--surface);
  color: var(--quartz-mat);
  transition: color var(--t-fast), border-color var(--t-fast), transform var(--t-fast);
}

.theme-toggle:hover { color: var(--citrine); border-color: var(--citrine); transform: rotate(-12deg); }

.footer-disclaimer, .footer-copy { color: var(--quartz-mat); font-size: 0.78rem; }

#back-top {
  position: fixed;
  right: 1.1rem;
  bottom: 1.1rem;
  z-index: 55;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  border: 1px solid var(--hairline-2);
  background: var(--glass);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  color: var(--quartz);
  cursor: pointer;
  box-shadow: var(--sh-2);
  transition: transform var(--t-fast), color var(--t-fast), border-color var(--t-fast);
}

#back-top:hover { transform: translateY(-3px); color: var(--citrine); border-color: var(--citrine); }

/* ---------- 12. Divers composants existants, modernisés ---------- */

.mohs-seg { border-radius: var(--r-xs); transition: transform var(--t-fast), background var(--t-fast); }
.mohs-seg:hover { transform: translateY(-2px); }
.mohs-seg.mohs-active { background: var(--grad-gold); color: #08090c; }
.mohs-info, .crit-results, .wm-info, .birth-result, .water-result, .calc-result {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.birth-btn, .geo-tab, .hue-swatch {
  border-radius: var(--r-sm);
  transition: transform var(--t-fast), border-color var(--t-fast);
}

.birth-btn:hover, .geo-tab:hover { transform: translateY(-2px); }
.birth-btn.birth-active, .geo-tab.geo-active { background: var(--grad-gold); color: #08090c; }

.collection-card {
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
  overflow: hidden;
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.collection-card:hover { transform: translateY(-3px); box-shadow: var(--sh-3); }

.confidence-badge {
  border-radius: var(--r-pill);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  padding: 0.34rem 0.8rem;
}

.about-inner {
  background: var(--surface);
  border: 1px solid var(--hairline);
  padding: clamp(1.4rem, 3vw, 2.4rem);
}

.about-inner h2 { letter-spacing: -0.022em; }
.about-inner p { color: var(--quartz-mat); line-height: 1.74; }

.ebook-buy { border-radius: var(--r-md); }
.ebook-buy:hover { transform: translateY(-2px); }
.ebook-cover { border-radius: var(--r-xs); box-shadow: var(--sh-3); }

.world-map-wrap { border-radius: var(--r-md); overflow: hidden; }

/* ---------- 13. Révélation au défilement ---------- */

/* Le masquage n'est appliqué que si le script a « armé » les blocs : si le JS
   ne s'exécute pas (ou tarde), le contenu reste visible — jamais de page blanche. */
@media (prefers-reduced-motion: no-preference) {
  .reveal.is-armed {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 620ms cubic-bezier(0.33, 1, 0.68, 1), transform 620ms cubic-bezier(0.33, 1, 0.68, 1);
  }
  .reveal.is-armed.is-in { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  html { scroll-behavior: auto; }
}

/* ==========================================================================
   GEMMOTHÈQUE — hub de recherche & fiches détaillées
   ========================================================================== */

.gem-hub { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(0.9rem, 3vw, 1.8rem) 2rem; }

.gem-hub-head { text-align: center; padding: clamp(1.4rem, 4vw, 2.6rem) 0 1.4rem; }

.gem-hub-head h1 {
  font-size: clamp(1.9rem, 5vw, 3rem);
  letter-spacing: -0.028em;
  margin: 0.7rem 0 0.7rem;
}

.gem-hub-head p { color: var(--quartz-mat); max-width: 66ch; margin: 0 auto; line-height: 1.66; }

/* --- Barre de recherche --- */

.gem-toolbar {
  position: sticky;
  top: 74px;
  z-index: 40;
  display: grid;
  gap: 0.7rem;
  padding: 0.9rem;
  margin-bottom: 1.4rem;
  border-radius: var(--r-lg);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
}

.gem-search { position: relative; display: flex; align-items: center; }

.gem-search svg {
  position: absolute;
  left: 0.9rem;
  width: 18px;
  height: 18px;
  color: var(--quartz-mat);
  pointer-events: none;
}

.gem-search input {
  width: 100%;
  padding: 0.85rem 2.7rem 0.85rem 2.7rem;
  border-radius: var(--r-pill);
  font-size: 1rem;
}

.gem-search-clear {
  position: absolute;
  right: 0.55rem;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 0;
  background: var(--surface-2);
  color: var(--quartz-mat);
  cursor: pointer;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.gem-search-clear.is-on { display: inline-flex; }
.gem-search-clear:hover { color: var(--citrine); }

.gem-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.gem-filter-group {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  align-items: center;
}

.gem-filter-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--quartz-mat);
  margin-right: 0.15rem;
}

.gem-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.36rem 0.72rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-2);
  background: var(--surface);
  color: var(--quartz-mat);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--t-fast);
}

.gem-chip:hover { color: var(--quartz); border-color: var(--hairline-2); transform: translateY(-1px); }

.gem-chip.is-on {
  background: var(--grad-gold);
  color: #08090c;
  border-color: transparent;
  box-shadow: var(--sh-1);
}

[data-theme="light"] .gem-chip.is-on { color: #fdfbf5; }

.gem-chip .gem-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.25);
  flex: 0 0 10px;
}

.gem-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--quartz-mat);
}

.gem-count strong { color: var(--citrine); }

.gem-sort { display: flex; gap: 0.3rem; align-items: center; }

/* --- Grille de cartes --- */

.gem-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(216px, 1fr));
  gap: clamp(0.7rem, 1.6vw, 1.05rem);
}

.gem-card-link {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.1rem 1rem;
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
  color: var(--quartz);
  text-decoration: none;
  overflow: hidden;
  transition: transform var(--t), box-shadow var(--t), border-color var(--t);
}

.gem-card-link::before {
  content: "";
  position: absolute;
  inset: -40% 40% 60% -40%;
  background: radial-gradient(circle, var(--gem-glow, rgba(224, 185, 104, 0.3)), transparent 68%);
  opacity: 0;
  transition: opacity var(--t);
  pointer-events: none;
}

.gem-card-link:hover {
  transform: translateY(-5px);
  box-shadow: var(--sh-3);
  border-color: var(--gem-accent, var(--citrine));
}

.gem-card-link:hover::before { opacity: 0.55; }

.gem-icon {
  width: 56px;
  height: 56px;
  flex: 0 0 56px;
  filter: drop-shadow(0 5px 12px rgba(0, 0, 0, 0.42));
  transition: transform var(--t);
}

.gem-card-link:hover .gem-icon { transform: scale(1.08) rotate(-4deg); }

.gem-card-name {
  font-family: var(--font-display);
  font-size: 1.14rem;
  letter-spacing: -0.014em;
  line-height: 1.2;
}

.gem-card-tag {
  font-size: 0.79rem;
  color: var(--quartz-mat);
  line-height: 1.42;
  flex: 1;
}

.gem-card-foot {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.05em;
  color: var(--quartz-mat);
  padding-top: 0.5rem;
  border-top: 1px solid var(--hairline);
}

.gem-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.2rem 0.5rem;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--hairline);
}

.gem-swatches { display: inline-flex; gap: 3px; margin-left: auto; }

.gem-swatch {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.3);
}

.gem-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--quartz-mat);
  border-radius: var(--r-lg);
  border: 1px dashed var(--hairline-2);
  background: var(--surface);
}

/* --- Index alphabétique --- */

.gem-alpha {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  justify-content: center;
  margin: 0 0 1.2rem;
}

.gem-alpha button {
  width: 30px;
  height: 30px;
  border-radius: var(--r-xs);
  border: 1px solid var(--hairline);
  background: var(--surface);
  color: var(--quartz-mat);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  cursor: pointer;
  transition: all var(--t-fast);
}

.gem-alpha button:hover:not(:disabled) { color: var(--citrine); border-color: var(--citrine); }
.gem-alpha button:disabled { opacity: 0.25; cursor: default; }
.gem-alpha button.is-on { background: var(--grad-gold); color: #08090c; border-color: transparent; }

/* --- Fiche pierre --- */

.gem-page { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(0.9rem, 3vw, 1.8rem) 2rem; }

.gem-hero {
  position: relative;
  display: flex;
  gap: clamp(1rem, 3vw, 2.2rem);
  align-items: center;
  flex-wrap: wrap;
  padding: clamp(1.3rem, 3.4vw, 2.4rem);
  border-radius: var(--r-xl);
  background: linear-gradient(150deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-3);
  overflow: hidden;
  margin-bottom: 1.6rem;
}

.gem-hero::before {
  content: "";
  position: absolute;
  inset: -60% 55% 40% -30%;
  background: radial-gradient(circle, var(--gem-glow, rgba(224, 185, 104, 0.3)), transparent 66%);
  opacity: 0.6;
  pointer-events: none;
}

.gem-hero-visual {
  position: relative;
  width: clamp(112px, 22vw, 168px);
  flex: 0 0 auto;
  filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.5));
}

@media (prefers-reduced-motion: no-preference) {
  .gem-hero-visual { animation: gemFloat 7s ease-in-out infinite; }
  @keyframes gemFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-9px) rotate(2.5deg); }
  }
}

.gem-hero-text { flex: 1 1 300px; min-width: 250px; position: relative; }

.gem-hero-text h1 {
  font-size: clamp(1.9rem, 5.2vw, 3.1rem);
  letter-spacing: -0.03em;
  margin: 0.55rem 0 0.5rem;
  line-height: 1.04;
}

.gem-hero-tag {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1rem, 2.1vw, 1.2rem);
  color: var(--citrine-clair);
  margin: 0 0 0.9rem;
}

[data-theme="light"] .gem-hero-tag { color: var(--citrine); }

.gem-hero-intro { color: var(--quartz-mat); line-height: 1.68; max-width: 60ch; margin: 0; }

.gem-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 1.1rem; }

/* Barre de propriétés clés */

.gem-keys {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.6rem;
}

.gem-key {
  padding: 0.85rem 0.95rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  transition: border-color var(--t-fast), transform var(--t-fast);
}

.gem-key:hover { border-color: var(--hairline-2); transform: translateY(-2px); }

.gem-key dt {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--quartz-mat);
  margin-bottom: 0.3rem;
}

.gem-key dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.08rem;
  line-height: 1.24;
  color: var(--quartz);
}

/* Jauge de dureté */

.gem-gauge { margin-top: 0.4rem; height: 5px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; }
.gem-gauge span { display: block; height: 100%; border-radius: var(--r-pill); background: var(--grad-gold); }

/* Blocs de contenu */

.gem-block {
  padding: clamp(1.2rem, 2.6vw, 2rem);
  border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--pierre), var(--pierre-clair));
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-2);
  margin-bottom: 1.2rem;
}

.gem-block > h2 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
}

.gem-block > h2::before {
  content: "";
  width: 4px;
  height: 1.05em;
  border-radius: 2px;
  background: var(--grad-gold);
  flex: 0 0 4px;
}

.gem-block h3 {
  font-size: 1.02rem;
  margin: 1.5rem 0 0.5rem;
  color: var(--citrine-clair);
  letter-spacing: -0.012em;
}

[data-theme="light"] .gem-block h3 { color: var(--citrine); }
.gem-block h3:first-of-type { margin-top: 0; }
.gem-block p { color: var(--quartz-mat); line-height: 1.74; margin: 0 0 0.9rem; }
.gem-block strong { color: var(--quartz); }

/* Tableau de propriétés */

.gem-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 0;
  margin: 0;
}

.gem-prop {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.68rem 0.2rem;
  border-bottom: 1px solid var(--hairline);
}

.gem-prop dt {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--quartz-mat);
  flex: 0 0 auto;
}

.gem-prop dd { margin: 0; text-align: right; font-size: 0.92rem; color: var(--quartz); }

/* Listes de reconnaissance / imitations / entretien */

.gem-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.7rem; }

.gem-list li {
  position: relative;
  padding: 0.9rem 1rem 0.9rem 2.6rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  line-height: 1.62;
  color: var(--quartz-mat);
  transition: border-color var(--t-fast);
}

.gem-list li:hover { border-color: var(--hairline-2); }
.gem-list li strong { display: block; color: var(--quartz); margin-bottom: 0.2rem; }

.gem-list li::before {
  position: absolute;
  left: 0.95rem;
  top: 0.92rem;
  font-size: 0.82rem;
  line-height: 1.4;
}

.gem-list.is-check li::before { content: "✓"; color: var(--malachite-clair); }
.gem-list.is-warn li::before { content: "⚠"; color: var(--grenat); }
.gem-list.is-care li::before { content: "◆"; color: var(--citrine); font-size: 0.66rem; top: 1.05rem; }

/* Entretien : pastilles eau / soleil / sel */

.gem-care-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 0.6rem;
  margin-bottom: 1.1rem;
}

.gem-care-tile {
  text-align: center;
  padding: 0.9rem 0.5rem;
  border-radius: var(--r-md);
  border: 1px solid var(--hairline);
  background: var(--surface);
}

.gem-care-tile .gem-care-ico { font-size: 1.35rem; line-height: 1; display: block; margin-bottom: 0.4rem; }

.gem-care-tile .gem-care-name {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--quartz-mat);
  display: block;
  margin-bottom: 0.25rem;
}

.gem-care-tile .gem-care-val { font-size: 0.86rem; font-weight: 500; }
.gem-care-tile.ok { border-color: rgba(52, 163, 127, 0.42); }
.gem-care-tile.ok .gem-care-val { color: var(--malachite-clair); }
.gem-care-tile.mid { border-color: rgba(224, 185, 104, 0.42); }
.gem-care-tile.mid .gem-care-val { color: var(--citrine); }
.gem-care-tile.no { border-color: rgba(208, 112, 90, 0.45); }
.gem-care-tile.no .gem-care-val { color: var(--grenat); }

/* Le saviez-vous */

.gem-fact {
  position: relative;
  padding: 1.3rem 1.4rem 1.3rem 3.4rem;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, rgba(224, 185, 104, 0.11), rgba(224, 185, 104, 0.03));
  border: 1px solid rgba(224, 185, 104, 0.3);
  margin-bottom: 1.2rem;
  line-height: 1.7;
}

.gem-fact::before {
  content: "✦";
  position: absolute;
  left: 1.3rem;
  top: 1.25rem;
  color: var(--citrine);
  font-size: 1.05rem;
}

.gem-fact-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--citrine);
  margin-bottom: 0.35rem;
}

/* FAQ */

.gem-faq { display: grid; gap: 0.6rem; }

.gem-faq details {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  overflow: hidden;
  transition: border-color var(--t-fast);
}

.gem-faq details[open] { border-color: rgba(224, 185, 104, 0.35); }

.gem-faq summary {
  cursor: pointer;
  padding: 0.95rem 2.6rem 0.95rem 1.1rem;
  font-weight: 500;
  position: relative;
  list-style: none;
  transition: color var(--t-fast);
}

.gem-faq summary::-webkit-details-marker { display: none; }
.gem-faq summary:hover { color: var(--citrine); }

.gem-faq summary::after {
  content: "+";
  position: absolute;
  right: 1.1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--citrine);
  font-size: 1.2rem;
  transition: transform var(--t);
}

.gem-faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.gem-faq details > p { padding: 0 1.1rem 1.05rem; margin: 0; color: var(--quartz-mat); line-height: 1.7; }

/* Tradition : encadré prudence */

.gem-tradition {
  border-left: 3px solid var(--malachite);
  padding-left: 1.1rem;
  font-style: italic;
  color: var(--quartz-mat);
  line-height: 1.72;
}

.gem-disclaimer {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.03em;
  color: var(--quartz-mat);
  opacity: 0.8;
}

/* Bandeau d'appel à l'action */

.gem-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  border-radius: var(--r-lg);
  background: var(--surface);
  border: 1px dashed var(--hairline-2);
  margin-bottom: 1.2rem;
  text-align: center;
}

.gem-cta p { margin: 0; flex: 1 1 260px; color: var(--quartz-mat); }

/* Pays / gisements */

.gem-countries { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.9rem; }

/* Deux colonnes sur grand écran */

@media (min-width: 900px) {
  .gem-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; align-items: start; }
  .gem-cols > .gem-block { margin-bottom: 0; }
}

@media (max-width: 640px) {
  .gem-toolbar { top: 0; border-radius: var(--r-md); }
  .gem-grid { grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: 0.6rem; }
  .gem-card-link { padding: 0.9rem 0.85rem; }
  .gem-icon { width: 46px; height: 46px; flex-basis: 46px; }
  .gem-card-name { font-size: 1rem; }
  .gem-card-tag { font-size: 0.74rem; }
  .gem-prop { flex-direction: column; gap: 0.15rem; }
  .gem-prop dd { text-align: left; }
}

/* Carte de l'outil Gemmothèque sur l'accueil */

.gemmo-teaser {
  display: grid;
  gap: 0.9rem;
}

.gemmo-teaser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 0.55rem;
}

.gemmo-mini {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 0.4rem;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
  color: var(--quartz);
  text-decoration: none;
  font-size: 0.74rem;
  text-align: center;
  transition: transform var(--t-fast), border-color var(--t-fast), box-shadow var(--t-fast);
}

.gemmo-mini:hover { transform: translateY(-3px); border-color: var(--citrine); box-shadow: var(--sh-2); }
.gemmo-mini svg { width: 34px; height: 34px; }

/* ---------- Gemmothèque : filtres repliables sur petit écran ---------- */

.gem-filter-toggle { display: none; }

.gem-filter-toggle .gem-filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.1rem;
  height: 1.1rem;
  padding: 0 0.28rem;
  margin-left: 0.3rem;
  border-radius: var(--r-pill);
  background: var(--citrine);
  color: #08090c;
  font-size: 0.6rem;
}

.gem-filter-toggle.is-on .gem-filter-badge { background: rgba(0, 0, 0, 0.28); color: inherit; }

@media (max-width: 760px) {
  .gem-filter-toggle { display: inline-flex; }
  .gem-filter-panel { display: none; }
  .gem-filter-panel.is-open { display: grid; gap: 0.65rem; }
  .gem-toolbar { gap: 0.55rem; padding: 0.7rem; }
  .gem-alpha { gap: 0.2rem; }
  .gem-alpha button { width: 27px; height: 27px; font-size: 0.66rem; }
  .gem-meta-row { font-size: 0.68rem; }
}

/* La rangée de tri défile latéralement plutôt que de casser les pastilles */
@media (max-width: 760px) {
  .gem-meta-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .gem-meta-row::-webkit-scrollbar { display: none; }
  .gem-sort { flex: 0 0 auto; }
  .gem-count { flex: 0 0 auto; }
}

/* Fiche pierre : visuel centré et respirant sur mobile */
@media (max-width: 700px) {
  .gem-hero { flex-direction: column; align-items: center; }
  .gem-hero-visual { align-self: center; margin-bottom: 0.2rem; }
  .gem-hero-text { text-align: left; width: 100%; }
  .gem-hero::before { inset: -40% 20% 55% -30%; }
  .gem-keys { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
  .gem-block > h2 { font-size: 1.1rem; }
  .gem-list li { padding-left: 2.35rem; }
}

/* ==========================================================================
   DESIGN 2.1 — thème clair « blanc pur », boutons épurés, anti-débordement
   Couche finale : elle prime sur tout ce qui précède.
   ========================================================================== */

/* ---------- 1. Jetons : le remplissage d'accent devient thématique ---------- */

:root {
  /* Remplissage des éléments « actifs » (boutons primaires, onglet actif…) */
  --fill: linear-gradient(180deg, #efd28c 0%, #e0b968 52%, #cfa550 100%);
  --fill-flat: #e0b968;
  --fill-on: #0a0b0e;
  --fill-edge: rgba(255, 255, 255, 0.28);
  --fill-glow: rgba(224, 185, 104, 0.34);
  --r-btn: 999px;
}

/* ---------- 2. Thème clair : blanc neutre, plus de beige ---------- */

[data-theme="light"] {
  --basalte: #f5f6f8;
  --basalte-2: #ffffff;
  --pierre: #ffffff;
  --pierre-clair: #fbfcfd;
  --liseret: #e6e9ee;
  --liseret-vif: #d4d9e1;
  --quartz: #14171c;
  --quartz-mat: #5d6673;
  --citrine: #8f6c1e;
  --citrine-clair: #a8813a;
  --malachite: #1c7a5d;
  --malachite-clair: #248f6d;
  --grenat: #bf4c36;
  --azur: #2a63b0;

  --surface: rgba(20, 23, 28, 0.022);
  --surface-2: rgba(20, 23, 28, 0.045);
  --glass: rgba(255, 255, 255, 0.84);
  --hairline: rgba(20, 23, 28, 0.085);
  --hairline-2: rgba(20, 23, 28, 0.155);

  --sh-1: 0 1px 2px rgba(20, 23, 28, 0.05);
  --sh-2: 0 2px 10px -2px rgba(20, 23, 28, 0.07), 0 1px 2px rgba(20, 23, 28, 0.04);
  --sh-3: 0 16px 40px -18px rgba(20, 23, 28, 0.16), 0 2px 6px rgba(20, 23, 28, 0.04);
  --sh-gold: 0 6px 20px -8px rgba(20, 23, 28, 0.22);

  /* En clair, le remplissage actif passe en encre : net, lisible, contrasté */
  --fill: linear-gradient(180deg, #23272f 0%, #16191f 100%);
  --fill-flat: #16191f;
  --fill-on: #ffffff;
  --fill-edge: rgba(255, 255, 255, 0.14);
  --fill-glow: rgba(20, 23, 28, 0.24);

  --grad-gold: linear-gradient(135deg, #a8813a 0%, #8f6c1e 55%, #75570f 100%);
  --grad-ink: linear-gradient(165deg, rgba(20, 23, 28, 0.03), rgba(20, 23, 28, 0.008));
}

/* Fond : voile froid quasi imperceptible au lieu du lavis doré */
[data-theme="light"] body {
  background:
    radial-gradient(1200px 640px at 15% -10%, rgba(20, 23, 28, 0.035), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(143, 108, 30, 0.035), transparent 58%),
    var(--basalte);
}

[data-theme="light"] .grain { opacity: 0.022; }

[data-theme="light"] ::selection { background: #16191f; color: #ffffff; }

/* Les cartes blanches se détachent par une bordure fine, pas par une teinte */
[data-theme="light"] .tool-card,
[data-theme="light"] .step,
[data-theme="light"] .gem-card,
[data-theme="light"] .collection-card,
[data-theme="light"] .specimen-frame,
[data-theme="light"] .gem-card-link,
[data-theme="light"] .gem-block,
[data-theme="light"] .gem-hero,
[data-theme="light"] .neighbour,
[data-theme="light"] .expert-chat {
  background: #ffffff;
  border-color: var(--hairline);
}

[data-theme="light"] .gem-key,
[data-theme="light"] .gem-list li,
[data-theme="light"] .gem-care-tile,
[data-theme="light"] .gem-faq details,
[data-theme="light"] .about-inner,
[data-theme="light"] .seo-section,
[data-theme="light"] .gemmo-mini,
[data-theme="light"] .mohs-info,
[data-theme="light"] .crit-results,
[data-theme="light"] .wm-info,
[data-theme="light"] .birth-result,
[data-theme="light"] .water-result,
[data-theme="light"] .calc-result {
  background: #fdfdfe;
  border-color: var(--hairline);
}

[data-theme="light"] .tool-form input,
[data-theme="light"] .tool-form select,
[data-theme="light"] .crit-form select,
[data-theme="light"] .claimed-row input,
[data-theme="light"] .chat-input-row input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] select,
[data-theme="light"] textarea,
[data-theme="light"] .gem-search input {
  background: #ffffff;
  border-color: var(--hairline-2);
}

[data-theme="light"] .drop-zone { background: #f4f6f9; border-color: var(--hairline-2); }
[data-theme="light"] .drop-zone:hover,
[data-theme="light"] .drop-zone.drag-over { background: #eef1f6; border-color: var(--citrine); }

[data-theme="light"] .site-footer {
  background: linear-gradient(180deg, transparent, rgba(20, 23, 28, 0.022));
}

/* ---------- 3. Thème sombre : neutralisé, plus profond ---------- */
/* Ciblé sur « tout sauf le thème clair » : sans cela, ces jetons écraseraient
   le bloc [data-theme="light"] ci-dessus (spécificité égale, déclaré après). */

html:not([data-theme="light"]) {
  --basalte: #070809;
  --basalte-2: #030405;
  --pierre: #0f1116;
  --pierre-clair: #14171d;
  --liseret: #23262e;
  --liseret-vif: #30343e;
  --quartz: #eef0f4;
  --quartz-mat: #949cab;
  --hairline: rgba(255, 255, 255, 0.075);
  --hairline-2: rgba(255, 255, 255, 0.145);
  --glass: rgba(8, 9, 12, 0.76);
}

html:not([data-theme="light"]) body {
  background:
    radial-gradient(1200px 660px at 16% -10%, rgba(224, 185, 104, 0.055), transparent 60%),
    radial-gradient(900px 520px at 92% 4%, rgba(52, 163, 127, 0.045), transparent 58%),
    var(--basalte);
}

/* ---------- 4. Boutons épurés ---------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.09em;
  padding: 0.8rem 1.55rem;
  border-radius: var(--r-btn);
  border: 1px solid transparent;
  box-shadow: none;
  isolation: isolate;
  transition: transform 130ms cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 200ms cubic-bezier(0.4, 0, 0.2, 1),
              background 160ms ease, color 160ms ease, border-color 160ms ease;
}

/* Primaire : à plat, un liseré clair en haut, la lueur seulement au survol */
.btn-primary,
.btn-gold {
  background: var(--fill);
  color: var(--fill-on);
  border-color: transparent;
  box-shadow: inset 0 1px 0 var(--fill-edge), var(--sh-1);
}

[data-theme="light"] .btn-primary,
[data-theme="light"] .btn-gold { color: var(--fill-on); }

.btn-primary:hover,
.btn-gold:hover {
  background: var(--fill);
  filter: brightness(1.06);
  transform: translateY(-1px);
  box-shadow: inset 0 1px 0 var(--fill-edge), 0 6px 22px -8px var(--fill-glow);
}

.btn-primary:active,
.btn-gold:active { transform: translateY(0); box-shadow: inset 0 1px 0 var(--fill-edge); }

/* Secondaire : un simple filet, remplissage discret au survol */
.btn-ghost {
  background: transparent;
  border-color: var(--hairline-2);
  color: var(--quartz);
  box-shadow: none;
}

.btn-ghost:hover {
  background: var(--surface-2);
  border-color: var(--quartz-mat);
  color: var(--quartz);
  transform: translateY(-1px);
}

.btn:disabled,
.btn[disabled] {
  opacity: 0.45;
  transform: none !important;
  box-shadow: none !important;
  cursor: not-allowed;
}

.btn:focus-visible {
  outline: 2px solid var(--citrine);
  outline-offset: 3px;
}

/* Tous les éléments « actifs » suivent le même remplissage */
.nav-tab.nav-active,
.mode-btn.mode-active,
.mohs-seg.mohs-active,
.birth-btn.birth-active,
.geo-tab.geo-active,
.gem-chip.is-on,
.gem-alpha button.is-on,
.chat-msg.from-user,
.nav-count,
.quiz-opt.quiz-active {
  background: var(--fill);
  color: var(--fill-on);
  border-color: transparent;
  box-shadow: inset 0 1px 0 var(--fill-edge);
}

[data-theme="light"] .nav-tab.nav-active,
[data-theme="light"] .mode-btn.mode-active,
[data-theme="light"] .mohs-seg.mohs-active,
[data-theme="light"] .birth-btn.birth-active,
[data-theme="light"] .geo-tab.geo-active,
[data-theme="light"] .gem-chip.is-on,
[data-theme="light"] .gem-alpha button.is-on,
[data-theme="light"] .chat-msg.from-user,
[data-theme="light"] .nav-count,
[data-theme="light"] .quiz-opt.quiz-active { color: var(--fill-on); }

.nav-tab.nav-active { box-shadow: inset 0 1px 0 var(--fill-edge), var(--sh-1); }

.suggestion-chip:hover {
  background: var(--fill);
  color: var(--fill-on);
  border-color: transparent;
}

[data-theme="light"] .suggestion-chip:hover { color: var(--fill-on); }

.gem-gauge span { background: var(--fill); }

/* Le curseur de plage reprend le même remplissage */
input[type="range"]::-webkit-slider-thumb {
  background: var(--fill);
  box-shadow: inset 0 1px 0 var(--fill-edge), var(--sh-1);
}

input[type="range"]::-moz-range-thumb { background: var(--fill-flat); }

/* Liens d'achat de l'e-book : mêmes codes, plus sobres */
.ebook-buy { box-shadow: var(--sh-2); }
.ebook-buy:hover { box-shadow: var(--sh-3); }

/* ---------- 5. Anti-débordement horizontal (mobile) ---------- */

html { overflow-x: clip; }
body { overflow-x: clip; max-width: 100%; }

img, svg, video, canvas { max-width: 100%; }

main, section, article,
.result-inner, .result-block, .result-grid, .result-head,
.chat-messages, .chat-msg, .about-inner, .seo-section,
.gem-block, .gem-cols, .gem-props, .gem-prop, .tool-body, .tool-card,
.collection-card, .neighbour, .gem-card-link {
  min-width: 0;
}

/* Les longs noms scientifiques et formules chimiques peuvent enfin se couper */
#result-name, #result-scientific, #result-type, #result-description,
.result-head h2, .result-block li, .result-warning,
.alt-item strong, .alt-item span,
.chat-msg, .gem-prop dd, .gem-key dd, .gem-hero-text h1,
.gem-pill, .gem-card-name, .gem-card-tag,
.collection-card .cc-name, .cl-name, .cl-line,
.seo-section p, .gem-block p, .gem-list li, .tool-desc {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Hypothèses alternatives : c'était la cause du débordement */
.alt-item { flex-wrap: wrap; }
.alt-item strong { white-space: normal; }
.alt-item > * { min-width: 0; max-width: 100%; }

@media (max-width: 620px) {
  .alt-item { flex-direction: column; gap: 0.2rem; }
  .alt-item span { text-align: left; }
  .result-head { flex-direction: column; align-items: flex-start; }
  .result-head h2 { font-size: clamp(1.35rem, 6.2vw, 1.75rem); line-height: 1.15; }
  .result-inner { padding: 1.4rem 1.1rem; }
  .result-grid { grid-template-columns: 1fr; }
}

/* Barre de saisie du chat : l'input peut rétrécir, le bouton non */
.chat-input-row { min-width: 0; }
.chat-input-row input { min-width: 0; flex: 1 1 auto; }
.chat-send { flex: 0 0 auto; }

@media (max-width: 430px) {
  .chat-input-row { flex-wrap: wrap; }
  .chat-input-row input { flex: 1 1 100%; }
  .chat-send { width: 100%; }
  .chat-messages { padding: 1rem 0.9rem; }
  .chat-header { padding: 0.9rem 1rem; }
  .chat-suggestions, .chat-input-row { padding-left: 1rem; padding-right: 1rem; }
}

/* Grilles d'aperçu et vitrine : jamais plus large que l'écran */
.preview-grid, .collection-grid, .steps, .gems-grid, .gem-grid,
.birth-grid, .hue-row, .mohs-scale {
  max-width: 100%;
}

.world-map-wrap, .pleo-wrap, .aster-gem, .anatomy-wrap, .tarot-spread,
.sephirot-wrap, .bracelet-wrap, .chakra-wrap {
  max-width: 100%;
  overflow-x: auto;
}

/* ==========================================================================
   LAPIDEM — DESIGN 3.0 · « CRISTAL »
   Blanc lumineux, verre, accents prismatiques (violet → cyan → ambre),
   grands rayons, ombres douces. Couche finale : elle prime sur tout.
   ========================================================================== */

/* ---------- 1. Typographie & jetons partagés ---------- */

:root {
  --font-display: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;

  /* Accents prismatiques */
  --prism-1: #7A5CE0;
  --prism-2: #38C4DE;
  --prism-3: #F0B25A;
  --grad-prism: linear-gradient(94deg, var(--prism-1) 0%, var(--prism-2) 52%, var(--prism-3) 100%);

  /* Rayons — nettement plus généreux */
  --r-xs: 10px;
  --r-sm: 14px;
  --r-md: 18px;
  --r-lg: 24px;
  --r-xl: 30px;
  --r-pill: 999px;
  --r-btn: 999px;

  --t-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --t: 260ms cubic-bezier(0.33, 1, 0.68, 1);
  --maxw: 1120px;
}

/* ---------- 2. Thème clair (par défaut) ---------- */

[data-theme="light"] {
  --basalte: #ffffff;
  --basalte-2: #ffffff;
  --pierre: #ffffff;
  --pierre-clair: #ffffff;
  --liseret: rgba(15, 18, 22, 0.09);
  --liseret-vif: rgba(15, 18, 22, 0.16);
  --quartz: #0F1216;
  --quartz-mat: #5A6472;

  /* L'ancien « or » devient l'accent violet : tout le site suit */
  --citrine: #5B45B8;
  --citrine-clair: #7A5CE0;
  --malachite: #12806A;
  --malachite-clair: #17977C;
  --grenat: #C4472F;
  --azur: #2F6BB8;

  --surface: rgba(15, 18, 22, 0.026);
  --surface-2: rgba(15, 18, 22, 0.052);
  --glass: rgba(255, 255, 255, 0.74);
  --hairline: rgba(15, 18, 22, 0.075);
  --hairline-2: rgba(15, 18, 22, 0.13);

  --sh-1: 0 1px 2px rgba(15, 18, 22, 0.05);
  --sh-2: 0 10px 26px -20px rgba(15, 18, 22, 0.32), 0 1px 2px rgba(15, 18, 22, 0.04);
  --sh-3: 0 20px 48px -30px rgba(15, 18, 22, 0.38), 0 2px 8px rgba(15, 18, 22, 0.05);
  --sh-gold: 0 14px 34px -16px rgba(15, 18, 22, 0.45);

  --grad-gold: var(--grad-prism);
  --grad-ink: linear-gradient(165deg, rgba(15, 18, 22, 0.024), rgba(15, 18, 22, 0.006));

  --fill: linear-gradient(180deg, #22262E 0%, #0F1216 100%);
  --fill-flat: #0F1216;
  --fill-on: #ffffff;
  --fill-edge: rgba(255, 255, 255, 0.13);
  --fill-glow: rgba(15, 18, 22, 0.42);
}

/* ---------- 3. Thème sombre — « Cristal nuit » ---------- */

html:not([data-theme="light"]) {
  --basalte: #0A0B10;
  --basalte-2: #0D0F15;
  --pierre: #12141B;
  --pierre-clair: #161923;
  --liseret: rgba(255, 255, 255, 0.09);
  --liseret-vif: rgba(255, 255, 255, 0.17);
  --quartz: #EEF0F5;
  --quartz-mat: #98A1B3;

  --prism-1: #A78BFA;
  --prism-2: #5FD4EA;
  --prism-3: #F5C57C;

  --citrine: #B49CFB;
  --citrine-clair: #C9B6FD;
  --malachite: #2FA483;
  --malachite-clair: #4FD0AB;
  --grenat: #E0785F;
  --azur: #7FB0F5;

  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.065);
  --glass: rgba(10, 11, 16, 0.74);
  --hairline: rgba(255, 255, 255, 0.085);
  --hairline-2: rgba(255, 255, 255, 0.16);

  --sh-1: 0 1px 2px rgba(0, 0, 0, 0.5);
  --sh-2: 0 10px 30px -18px rgba(0, 0, 0, 0.8);
  --sh-3: 0 26px 64px -34px rgba(0, 0, 0, 0.9);
  --sh-gold: 0 16px 44px -18px rgba(167, 139, 250, 0.55);

  --grad-gold: var(--grad-prism);

  --fill: var(--grad-prism);
  --fill-flat: #A78BFA;
  --fill-on: #0A0B10;
  --fill-edge: rgba(255, 255, 255, 0.24);
  --fill-glow: rgba(167, 139, 250, 0.55);
}

/* ---------- 4. Fond : le voile prismatique ---------- */

html { scroll-padding-top: 100px; }

body {
  background: var(--basalte);
  color: var(--quartz);
  font-family: var(--font-body);
  letter-spacing: -0.006em;
  background-attachment: scroll;
}

/* Halo prismatique en haut de page, posé sous le contenu */
body::before {
  content: "";
  position: absolute;
  top: -220px;
  left: 0;
  right: 0;
  width: auto;
  max-width: 100%;
  height: 820px;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(560px 360px at 14% 40%, rgba(122, 92, 224, 0.21), transparent 68%),
    radial-gradient(540px 340px at 52% 16%, rgba(56, 196, 222, 0.19), transparent 68%),
    radial-gradient(560px 350px at 88% 46%, rgba(240, 178, 90, 0.19), transparent 68%);
  filter: blur(16px);
}

html:not([data-theme="light"]) body::before {
  background:
    radial-gradient(580px 370px at 13% 38%, rgba(167, 139, 250, 0.26), transparent 68%),
    radial-gradient(560px 350px at 53% 14%, rgba(95, 212, 234, 0.17), transparent 68%),
    radial-gradient(560px 350px at 89% 44%, rgba(245, 197, 124, 0.13), transparent 68%);
}

.grain { display: none !important; }

::selection { background: var(--prism-1); color: #fff; }

:focus-visible {
  outline: 2px solid var(--prism-1);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- 5. En-tête : pilule flottante en verre ---------- */

.site-header {
  padding: 1.1rem clamp(0.9rem, 3vw, 2.4rem);
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  gap: 1rem;
}

body.is-scrolled .site-header {
  background: transparent;
  border-bottom: 0;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  padding-top: 0.7rem;
  padding-bottom: 0.7rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: var(--quartz);
  background: none;
  -webkit-text-fill-color: currentColor;
  gap: 0.55rem;
}

.logo svg { color: var(--prism-1); -webkit-text-fill-color: currentColor; }

.main-nav {
  gap: 0.15rem;
  padding: 0.32rem;
  border-radius: var(--r-pill);
  background: var(--glass);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border: 1px solid var(--hairline);
  box-shadow: 0 12px 32px -20px rgba(15, 18, 22, 0.34);
}

html:not([data-theme="light"]) .main-nav { box-shadow: 0 14px 34px -22px rgba(0, 0, 0, 0.9); }

.nav-tab {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.6rem 1rem;
  border-radius: var(--r-pill);
  color: var(--quartz-mat);
  border: 0;
}

.nav-tab:hover { color: var(--quartz); background: var(--surface-2); }

.nav-tab.nav-active {
  background: var(--fill);
  color: var(--fill-on);
  box-shadow: inset 0 1px 0 var(--fill-edge), var(--sh-1);
}

.nav-count {
  background: var(--prism-1);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.64rem;
}

.lang-toggle {
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-2);
  color: var(--quartz-mat);
}

.lang-toggle:hover { color: var(--prism-1); border-color: var(--prism-1); }

/* ---------- 6. Typographie de contenu ---------- */

h1, h2, h3, h4,
.tool-page-title, .precious-title, .neighbours-title, .collection-title,
.tool-acc-title, .gem-card-name, .daily-name, .gem-hero-text h1 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.032em;
}

.hero h1 {
  font-size: clamp(2.1rem, 5.6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.042em;
}

.hero h1 em {
  display: block;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.6rem, 3.9vw, 2.9rem);
  letter-spacing: -0.018em;
  margin-top: 0.35rem;
  background: var(--grad-prism);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-sub { font-size: clamp(1rem, 1.5vw, 1.06rem); line-height: 1.72; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--citrine);
  background: color-mix(in srgb, var(--prism-1) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--prism-1) 24%, transparent);
  padding: 0.44rem 1rem;
  border-radius: var(--r-pill);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .eyebrow { background: var(--surface); border-color: var(--hairline-2); }
}

.hero-counter {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--r-pill);
  padding: 0.6rem 1.15rem;
}

.hero-counter strong { font-size: 1.06rem; font-weight: 700; color: var(--quartz); }

/* Titres de section : centrés, sans filet doré */
.tools-section > h2,
.litho-section > h2,
.guides-section > h2,
.precious-title,
.how-it-works > h2 {
  font-size: clamp(1.7rem, 3.6vw, 2.5rem);
}

.tools-section > h2::after,
.litho-section > h2::after,
.guides-section > h2::after,
.precious-title::after { display: none; }

/* ---------- 7. Boutons ---------- */

.btn {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.85rem 1.7rem;
  border-radius: var(--r-pill);
}

.btn-primary,
.btn-gold {
  background: var(--fill);
  color: var(--fill-on);
  box-shadow: 0 14px 32px -18px var(--fill-glow), inset 0 1px 0 var(--fill-edge);
}

.btn-primary:hover,
.btn-gold:hover {
  background: var(--fill);
  filter: brightness(1.08);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -18px var(--fill-glow), inset 0 1px 0 var(--fill-edge);
}

.btn-ghost {
  background: var(--pierre);
  border: 1px solid var(--hairline-2);
  color: var(--quartz);
  box-shadow: var(--sh-2);
}

.btn-ghost:hover {
  background: var(--pierre);
  border-color: var(--prism-1);
  color: var(--quartz);
  transform: translateY(-2px);
  box-shadow: var(--sh-3);
}

.mode-toggle {
  padding: 0.3rem;
  border-radius: var(--r-pill);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.mode-btn {
  font-family: var(--font-body);
  font-size: 0.84rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  padding: 0.62rem 1.15rem;
  border-radius: var(--r-pill);
}

.suggestion-chip {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 500;
  border-radius: var(--r-pill);
  border: 1px solid var(--hairline-2);
  background: var(--pierre);
  box-shadow: var(--sh-1);
}

/* ---------- 8. Cartes ---------- */

.tool-card,
.step,
.gem-card,
.collection-card,
.specimen-frame,
.gem-card-link,
.gem-block,
.gem-hero,
.neighbour,
.expert-chat,
.about-inner,
.seo-section {
  background: var(--pierre);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}

.gem-hero, .gem-card-link, .gem-block { border-radius: var(--r-xl); }
.specimen-frame { border-radius: var(--r-xl); box-shadow: var(--sh-3); }

.step:hover,
.gem-card:hover,
.neighbour:hover,
.collection-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--sh-3);
  border-color: var(--hairline-2);
}

.tool-card:hover { border-color: var(--hairline-2); }
.tool-card:not(.acc-collapsed) { border-color: color-mix(in srgb, var(--prism-1) 30%, transparent); }

/* Les coins « facettes » dorés n'ont plus lieu d'être */
.facet { display: none !important; }

.step-icon,
.tool-acc-icon,
.expert-avatar,
.footer-social a,
.theme-toggle,
#back-top {
  border-radius: 14px;
}

.step-icon, .tool-acc-icon, .expert-avatar {
  background: var(--surface-2);
  border: 1px solid var(--hairline);
  color: var(--prism-1);
}

.step-num { font-family: var(--font-body); font-weight: 700; color: var(--prism-1); opacity: 1; }

/* ---------- 9. Formulaires ---------- */

.tool-form input,
.tool-form select,
.crit-form select,
.claimed-row input,
.chat-input-row input,
input[type="text"],
input[type="number"],
input[type="search"],
select,
textarea,
.gem-search input {
  background: var(--pierre);
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-sm);
  font-family: var(--font-body);
  font-size: 0.94rem;
  padding: 0.78rem 0.95rem;
  box-shadow: var(--sh-1);
}

.tool-form input:focus,
.tool-form select:focus,
.crit-form select:focus,
.claimed-row input:focus,
.chat-input-row input:focus,
input:focus,
select:focus {
  border-color: var(--prism-1);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--prism-1) 18%, transparent);
}

.tool-form label,
.crit-form label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--quartz-mat);
}

input[type="range"] { background: var(--surface-2); border: 1px solid var(--hairline); }
input[type="range"]::-webkit-slider-thumb { background: var(--grad-prism); box-shadow: 0 4px 12px -4px var(--prism-1); }
input[type="range"]::-moz-range-thumb { background: var(--prism-1); }

.drop-zone {
  border: 1.5px dashed color-mix(in srgb, var(--prism-1) 34%, transparent);
  border-radius: var(--r-lg);
  background: var(--surface);
}

.drop-zone:hover,
.drop-zone.drag-over {
  border-color: var(--prism-1);
  background: color-mix(in srgb, var(--prism-1) 5%, transparent);
}

.drop-icon { color: var(--prism-1); opacity: 1; }
.drop-title { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.02em; }

/* ---------- 10. Accordéon des outils ---------- */

.tool-acc-header { padding: 1.15rem 1.35rem; }
.tool-acc-header:hover { background: var(--surface); }
.tool-acc-title { font-size: 1.08rem; font-weight: 650; letter-spacing: -0.024em; }
.tool-acc-chevron { color: var(--quartz-mat); }
.tool-card:not(.acc-collapsed) .tool-acc-chevron { color: var(--prism-1); }
.tool-acc-header:hover .tool-acc-icon { border-color: var(--prism-1); }

.tool-page-link {
  color: var(--prism-1) !important;
  border-color: var(--hairline-2) !important;
}

/* ---------- 11. Fil d'Ariane, SEO, voisines ---------- */

.breadcrumb {
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0;
}

.breadcrumb a:hover { color: var(--prism-1); }
.breadcrumb em { color: var(--prism-1); }

.seo-section { background: var(--pierre); }
.seo-section h2 { font-size: 1.28rem; color: var(--quartz); font-weight: 650; }
.seo-section p, .about-inner p { line-height: 1.76; }
.seo-section a, .about-inner a { color: var(--citrine); text-decoration: underline; text-underline-offset: 3px; }

.neighbour { border-radius: var(--r-md); font-weight: 500; }
.neighbour::before { color: var(--prism-1); }
.neighbour:hover { border-color: var(--prism-1); }

/* ---------- 12. Chat ---------- */

.expert-chat { border-radius: var(--r-xl); box-shadow: var(--sh-3); }
.chat-header { background: var(--surface); }
.chat-title { font-family: var(--font-display); font-weight: 650; letter-spacing: -0.02em; }
.chat-msg { border-radius: 20px; }
.chat-msg.from-user { background: var(--fill); color: var(--fill-on); border-bottom-right-radius: 7px; }
.chat-msg.from-expert { background: var(--surface-2); border: 1px solid var(--hairline); border-bottom-left-radius: 7px; }
.chat-input-row input { border-radius: var(--r-pill); }

/* ---------- 13. Pied de page ---------- */

.site-footer {
  border-top: 1px solid var(--hairline);
  background: linear-gradient(180deg, transparent, var(--surface));
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--citrine);
}

.footer-col a { font-size: 0.89rem; }
.footer-col ul a:hover { color: var(--prism-1); }
.footer-social a { background: var(--pierre); border: 1px solid var(--hairline); box-shadow: var(--sh-1); }
.footer-social a:hover { color: var(--prism-1); border-color: var(--prism-1); }

.theme-toggle {
  background: var(--pierre);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--sh-1);
}

.theme-toggle:hover { color: var(--prism-1); border-color: var(--prism-1); }

.footer-disclaimer, .footer-copy { font-size: 0.8rem; }

#back-top {
  background: var(--glass);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--sh-2);
}

#back-top:hover { color: var(--prism-1); border-color: var(--prism-1); }

/* ---------- 14. Composants d'outils ---------- */

.mohs-seg { border-radius: var(--r-xs); }
.mohs-seg.mohs-active { background: var(--fill); color: var(--fill-on); }
.mohs-info, .crit-results, .wm-info, .birth-result, .water-result, .calc-result,
.hue-results, .streak-result, .trio-result, .astro-result {
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--hairline);
}

.birth-btn, .geo-tab, .hue-swatch, .quiz-opt { border-radius: var(--r-sm); }
.birth-btn.birth-active, .geo-tab.geo-active, .quiz-opt.quiz-active {
  background: var(--fill);
  color: var(--fill-on);
}

.confidence-badge {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  border-radius: var(--r-pill);
}

.result-label {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--malachite-clair);
}

.result-head h2 { letter-spacing: -0.03em; }
.result-scientific { font-family: var(--font-serif); font-style: italic; font-size: 1rem; }
.world-map-wrap { border-radius: var(--r-lg); }
.collection-label { border-radius: var(--r-sm); }
.ebook-buy { border-radius: var(--r-md); }
.ebook-cover { border-radius: var(--r-sm); }
.gem3d-scene, .pleo-gem, .aster-gem { filter: drop-shadow(0 18px 30px rgba(15, 18, 22, 0.18)); }

/* ---------- 15. Gemmothèque ---------- */

.gem-hub-head h1 { font-size: clamp(2rem, 5vw, 3.2rem); letter-spacing: -0.042em; }
.gem-hub-head p { font-size: 1.02rem; line-height: 1.7; }

.gem-toolbar {
  border-radius: var(--r-xl);
  background: var(--glass);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-3);
  top: 84px;
}

.gem-search input { border-radius: var(--r-pill); font-size: 1rem; box-shadow: var(--sh-1); }
.gem-search svg { color: var(--quartz-mat); }
.gem-search-clear { background: var(--surface-2); }
.gem-search-clear:hover { color: var(--prism-1); }

.gem-filter-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.gem-chip {
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 0.42rem 0.85rem;
  border-radius: var(--r-pill);
  background: var(--pierre);
  border: 1px solid var(--hairline-2);
  box-shadow: var(--sh-1);
}

.gem-chip:hover { border-color: var(--prism-1); color: var(--quartz); }
.gem-chip.is-on { background: var(--fill); color: var(--fill-on); border-color: transparent; }
.gem-chip .gem-dot { width: 11px; height: 11px; border-color: rgba(15, 18, 22, 0.18); }

.gem-meta-row { font-family: var(--font-body); font-size: 0.8rem; font-weight: 500; }
.gem-count strong { color: var(--quartz); font-weight: 700; }

.gem-alpha button {
  border-radius: var(--r-xs);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  background: var(--pierre);
  border: 1px solid var(--hairline);
  box-shadow: var(--sh-1);
}

.gem-alpha button:hover:not(:disabled) { color: var(--prism-1); border-color: var(--prism-1); }
.gem-alpha button.is-on { background: var(--fill); color: var(--fill-on); border-color: transparent; }

/* Cartes de pierres : halo de la couleur de la gemme */
.gem-card-link { padding: 1.5rem 1.4rem 1.25rem; gap: 0.6rem; }

.gem-card-link::before {
  inset: -46% 38% 60% -40%;
  background: radial-gradient(circle, var(--gem-glow, rgba(122, 92, 224, 0.3)), transparent 66%);
  opacity: 0.34;
}

.gem-card-link:hover { transform: translateY(-6px); box-shadow: var(--sh-3); border-color: var(--hairline-2); }
.gem-card-link:hover::before { opacity: 0.62; }

.gem-card-name { font-size: 1.2rem; font-weight: 700; letter-spacing: -0.026em; }
.gem-card-tag { font-size: 0.87rem; line-height: 1.5; }

.gem-card-foot {
  font-family: var(--font-body);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0;
  border-top: 0;
  padding-top: 0.3rem;
}

.gem-pill {
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid transparent;
  padding: 0.28rem 0.66rem;
}

.gem-swatch { border-color: rgba(15, 18, 22, 0.12); }
.gem-empty { border-radius: var(--r-xl); }

/* Fiche pierre */
.gem-hero { padding: clamp(1.5rem, 3.4vw, 2.7rem); }
.gem-hero::before { opacity: 0.44; }
.gem-hero-text h1 { font-size: clamp(2rem, 5.2vw, 3.3rem); letter-spacing: -0.042em; }

.gem-hero-tag {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.1rem, 2.2vw, 1.35rem);
  color: var(--citrine);
}

.gem-hero-intro { font-size: 1rem; line-height: 1.72; }
.gem-badges .gem-pill { font-family: var(--font-body); font-size: 0.8rem; padding: 0.38rem 0.85rem; }

.gem-key { border-radius: var(--r-md); background: var(--pierre); border: 1px solid var(--hairline); box-shadow: var(--sh-1); }
.gem-key:hover { border-color: var(--prism-1); }

.gem-key dt {
  font-family: var(--font-body);
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gem-key dd { font-family: var(--font-display); font-size: 1.1rem; font-weight: 650; letter-spacing: -0.022em; }
.gem-gauge span { background: var(--grad-prism); }

.gem-block > h2 { font-size: 1.28rem; font-weight: 700; letter-spacing: -0.028em; }
.gem-block > h2::before { background: var(--grad-prism); border-radius: 3px; }
.gem-block h3 { font-size: 1.04rem; font-weight: 650; color: var(--citrine); letter-spacing: -0.02em; }
.gem-block p { line-height: 1.76; }

.gem-prop dt {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.gem-prop dd { font-size: 0.94rem; font-weight: 500; }

.gem-list li { border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline); }
.gem-list li:hover { border-color: var(--hairline-2); }
.gem-list.is-check li::before { color: var(--malachite-clair); }
.gem-list.is-warn li::before { color: var(--grenat); }
.gem-list.is-care li::before { content: "◆"; color: var(--prism-1); }

.gem-care-tile { border-radius: var(--r-md); background: var(--pierre); border: 1px solid var(--hairline); box-shadow: var(--sh-1); }
.gem-care-tile .gem-care-name { font-family: var(--font-body); font-size: 0.64rem; font-weight: 700; letter-spacing: 0.1em; }

.gem-fact {
  border-radius: var(--r-lg);
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--prism-1) 10%, transparent),
    color-mix(in srgb, var(--prism-2) 7%, transparent));
  border: 1px solid color-mix(in srgb, var(--prism-1) 24%, transparent);
}

.gem-fact::before { color: var(--prism-1); }

.gem-fact-label {
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  color: var(--citrine);
}

.gem-faq details { border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--hairline); }
.gem-faq details[open] { border-color: color-mix(in srgb, var(--prism-1) 32%, transparent); }
.gem-faq summary { font-weight: 600; }
.gem-faq summary:hover { color: var(--prism-1); }
.gem-faq summary::after { color: var(--prism-1); }

.gem-tradition { border-left: 3px solid var(--prism-2); font-family: var(--font-serif); font-style: italic; font-size: 1.04rem; }
.gem-disclaimer { font-family: var(--font-body); font-size: 0.78rem; letter-spacing: 0; }

.gem-cta {
  border-radius: var(--r-xl);
  background: linear-gradient(120deg,
    color-mix(in srgb, var(--prism-1) 7%, transparent),
    color-mix(in srgb, var(--prism-2) 5%, transparent));
  border: 1px solid color-mix(in srgb, var(--prism-1) 20%, transparent);
}

.gem-countries .gem-pill { font-size: 0.8rem; }

.gemmo-mini { border-radius: var(--r-md); background: var(--pierre); border: 1px solid var(--hairline); box-shadow: var(--sh-1); font-weight: 500; }
.gemmo-mini:hover { border-color: var(--prism-1); box-shadow: var(--sh-2); }

/* ---------- 16. Repli sans color-mix (navigateurs anciens) ---------- */

@supports not (color: color-mix(in srgb, red, blue)) {
  .drop-zone { border-color: var(--hairline-2); }
  .tool-card:not(.acc-collapsed) { border-color: var(--hairline-2); }
  .gem-fact, .gem-cta { background: var(--surface); border-color: var(--hairline-2); }
  .gem-faq details[open] { border-color: var(--hairline-2); }
  .tool-form input:focus, input:focus, select:focus { box-shadow: 0 0 0 3px rgba(122, 92, 224, 0.18); }
}

/* ---------- 17. Mobile ---------- */

@media (max-width: 900px) {
  .site-header { padding: 0.75rem 0.8rem; gap: 0.6rem; }
  .main-nav { padding: 0.26rem; }
  .nav-tab { font-size: 0.78rem; padding: 0.52rem 0.8rem; }
}

@media (max-width: 640px) {
  body::before { top: -160px; height: 560px; }
  .gem-toolbar { top: 0; border-radius: var(--r-lg); }
  .gem-card-link { padding: 1rem 0.95rem; border-radius: var(--r-lg); }
  .gem-card-name { font-size: 1.05rem; }
  .gem-hero { border-radius: var(--r-lg); }
  .gem-block, .seo-section, .about-inner { border-radius: var(--r-lg); }
}

/* ---------- 18. Cristal — retouches ---------- */

/* Dégradé plus soutenu quand il sert de couleur de texte sur fond clair */
[data-theme="light"] { --grad-prism-text: linear-gradient(94deg, #6742D2 0%, #1C9EBC 52%, #C4841F 100%); }
html:not([data-theme="light"]) { --grad-prism-text: var(--grad-prism); }
.hero h1 em, .gem-hub-head h1 em { background-image: var(--grad-prism-text); }

/* La loupe de recherche ne doit pas chevaucher le texte */
.gem-search input { padding: 0.85rem 2.8rem 0.85rem 2.8rem; }

/* Zone de dépôt : un seul contour, celui du pointillé */
.upload-section .specimen-frame {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}

/* Pastille de couleur des filtres : liseré adapté au thème */
html:not([data-theme="light"]) .gem-chip .gem-dot,
html:not([data-theme="light"]) .gem-swatch { border-color: rgba(255, 255, 255, 0.22); }

/* Le compteur de la vitrine reste lisible sur le remplissage */
html:not([data-theme="light"]) .nav-count { background: var(--prism-1); color: #0A0B10; }

/* Liens du texte éditorial : soulignement discret */
.seo-section a:hover, .about-inner a:hover { color: var(--prism-1); }

/* Les boutons-liens ne doivent pas être soulignés */
.btn, a.btn, .ebook-buy, .gemmo-mini, .neighbour, .gem-card-link, .nav-tab, .lang-toggle,
.tool-page-link, .footer-col a, .breadcrumb a, .neighbours-all a { text-decoration: none; }

/* En-tête au défilement : le contenu se dissout derrière la barre,
   la pilule de navigation garde son verre propre par-dessus. */
body.is-scrolled .site-header {
  background: color-mix(in srgb, var(--basalte) 84%, transparent);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
  backdrop-filter: blur(18px) saturate(1.35);
  border-bottom: 1px solid var(--hairline);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  body.is-scrolled .site-header { background: var(--glass); }
}

/* Cristal — respiration typographique sur petit écran */
@media (max-width: 640px) {
  .gem-hub-head p { font-size: 0.95rem; line-height: 1.62; }
  .gem-hub-head h1 { font-size: clamp(1.85rem, 8vw, 2.4rem); }
  .hero h1 { font-size: clamp(1.9rem, 8.4vw, 2.6rem); }
  .hero h1 em { font-size: clamp(1.4rem, 6.4vw, 1.9rem); }
  .hero-sub { font-size: 0.97rem; line-height: 1.66; }
  .main-nav { scroll-snap-type: x proximity; }
  .nav-tab { scroll-snap-align: center; }
}

/* Carte mondiale : les terres à gemmes gardent l'ambre du prisme —
   le texte du site parle de « pays dorés », et l'ambre fait partie de la palette. */
.wm-gem { fill: color-mix(in srgb, var(--prism-3) 34%, transparent); stroke: var(--prism-3); stroke-width: 0.7; }
.wm-gem:hover, .wm-gem.wm-selected { fill: var(--prism-3); }
.wm-country { fill: var(--surface-2); stroke: var(--basalte); }
.wm-tooltip { border-radius: var(--r-sm); background: var(--pierre); border: 1px solid var(--hairline-2); box-shadow: var(--sh-3); }

@supports not (color: color-mix(in srgb, red, blue)) {
  .wm-gem { fill: rgba(240, 178, 90, 0.34); }
}

/* Priorité sur .wm-country déclaré juste avant (même spécificité) */
.world-map .wm-gem { fill: color-mix(in srgb, var(--prism-3) 40%, transparent); stroke: var(--prism-3); }
.world-map .wm-gem:hover, .world-map .wm-gem.wm-selected { fill: var(--prism-3); }
.world-map .wm-country { fill: var(--surface-2); }

@supports not (color: color-mix(in srgb, red, blue)) {
  .world-map .wm-gem { fill: rgba(240, 178, 90, 0.4); }
}

/* Les tracés portent .wm-country ET .wm-gem : on remonte la spécificité
   du second (élément + classe) pour qu'il gagne quel que soit l'ordre. */
.world-map path.wm-gem { fill: color-mix(in srgb, var(--prism-3) 42%, transparent); stroke: var(--prism-3); stroke-width: 0.7; }
.world-map path.wm-gem:hover, .world-map path.wm-gem.wm-selected { fill: var(--prism-3); }

@supports not (color: color-mix(in srgb, red, blue)) {
  .world-map path.wm-gem { fill: rgba(240, 178, 90, 0.42); }
}


/* ==========================================================================
   DESIGN 3.2 · Bandeau de consentement, curseur prismatique,
                couleurs d'étiquettes
   ========================================================================== */

/* -------------------------------------------------- bandeau de consentement */

#consent-bar {
  position: fixed;
  left: 50%;
  bottom: 1.1rem;
  transform: translate(-50%, calc(100% + 2rem));
  z-index: 900;
  width: min(680px, calc(100vw - 2rem));
  display: flex;
  align-items: center;
  gap: 1.1rem;
  padding: 0.95rem 1.1rem 0.95rem 1.4rem;
  border: 1px solid var(--hairline-2);
  border-radius: var(--r-lg);
  background: var(--pierre);
  box-shadow: 0 18px 50px rgba(10, 11, 16, 0.16), 0 2px 8px rgba(10, 11, 16, 0.06);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
}

#consent-bar.is-in { transform: translate(-50%, 0); opacity: 1; }

#consent-bar p {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--quartz-mat);
}

#consent-bar .consent-actions {
  display: flex;
  gap: 0.55rem;
  flex: 0 0 auto;
}

#consent-bar .btn {
  padding: 0.5rem 1.05rem;
  font-size: 0.82rem;
  white-space: nowrap;
}

@media (max-width: 620px) {
  #consent-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.8rem;
    padding: 1rem 1.1rem;
    bottom: 0.6rem;
  }
  #consent-bar .consent-actions { justify-content: flex-end; }
}

@media print { #consent-bar { display: none !important; } }

/* -------------------------------------------------- curseur prismatique */

/* La boule et sa traînée ne sont montées que sur pointeur fin (souris),
   hors préférence de mouvement réduit. Sur tactile, rien n'est créé. */

#cursor-orb, .cursor-trail-dot {
  position: fixed;
  top: 0;
  left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  will-change: transform;
}

#cursor-orb {
  width: 13px;
  height: 13px;
  margin: -6.5px 0 0 -6.5px;
  background: var(--grad-prism);
  box-shadow:
    0 0 10px 2px color-mix(in srgb, var(--prism-1) 55%, transparent),
    0 0 26px 8px color-mix(in srgb, var(--prism-2) 30%, transparent),
    0 0 46px 18px color-mix(in srgb, var(--prism-3) 16%, transparent);
  transition: width 0.22s ease, height 0.22s ease, margin 0.22s ease, opacity 0.25s ease;
}

/* halo large, plus lent — il donne la sensation de lueur qui suit */
#cursor-orb::after {
  content: "";
  position: absolute;
  inset: -13px;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--prism-1) 34%, transparent);
  opacity: 0.7;
}

/* au survol d'un élément cliquable, la boule s'ouvre */
#cursor-orb.is-hot {
  width: 30px;
  height: 30px;
  margin: -15px 0 0 -15px;
  opacity: 0.72;
}

#cursor-orb.is-down { width: 9px; height: 9px; margin: -4.5px 0 0 -4.5px; }

.cursor-trail-dot {
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  background: var(--grad-prism);
  filter: blur(1.5px);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  #cursor-orb {
    box-shadow: 0 0 10px 2px rgba(122, 92, 224, 0.55),
                0 0 26px 8px rgba(56, 196, 222, 0.3),
                0 0 46px 18px rgba(240, 178, 90, 0.16);
  }
  #cursor-orb::after { border-color: rgba(122, 92, 224, 0.34); }
}

/* Le curseur natif est masqué seulement quand la boule est réellement active,
   pour ne jamais laisser une page sans curseur visible. */
body.has-orb,
body.has-orb a,
body.has-orb button,
body.has-orb summary,
body.has-orb label,
body.has-orb [role="button"] { cursor: none; }

/* on garde le curseur système là où il porte une information */
body.has-orb input,
body.has-orb textarea,
body.has-orb select,
body.has-orb [contenteditable="true"] { cursor: auto; }

@media (prefers-reduced-motion: reduce) {
  .cursor-trail-dot { display: none !important; }
}

@media print { #cursor-orb, .cursor-trail-dot { display: none !important; } }

/* -------------------------------------------------- couleurs d'étiquettes */

.label-palette {
  margin: 0 0 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.label-palette > span {
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--quartz-mat);
}

.label-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.label-swatch {
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--hairline-2);
  background: var(--sw, #fff);
  cursor: pointer;
  position: relative;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.label-swatch:hover { transform: translateY(-2px); border-color: var(--quartz-mat); }

.label-swatch[aria-pressed="true"] {
  border-color: var(--citrine);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--citrine) 22%, transparent);
}

.label-swatch[aria-pressed="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  margin: auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--dot, #0F1216);
}

@supports not (color: color-mix(in srgb, red, blue)) {
  .label-swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px rgba(122, 92, 224, 0.22); }
}

/* L'étiquette prend ses couleurs de variables, pilotées par data-lbl. */
.collection-label {
  background: var(--lb-bg);
  border: 1.5px solid var(--lb-border);
  color: var(--lb-ink);
}
.collection-label .cl-brand { color: var(--lb-accent); }
.collection-label .cl-name  { color: var(--lb-ink); border-bottom-color: var(--lb-rule); }
.collection-label .cl-line  { color: var(--lb-muted); }

.collection-label,
.collection-label[data-lbl="ivoire"] {
  --lb-bg: linear-gradient(160deg, #fdfaf3, #f0e9da);
  --lb-border: #b8963f; --lb-ink: #2a2418; --lb-muted: #5a5140;
  --lb-accent: #a07c33; --lb-rule: #d8c9a0;
}
.collection-label[data-lbl="cristal"] {
  --lb-bg: linear-gradient(160deg, #ffffff, #f2f4f9);
  --lb-border: #7A5CE0; --lb-ink: #0F1216; --lb-muted: #5A6472;
  --lb-accent: #5B45B8; --lb-rule: #dee2ea;
}
.collection-label[data-lbl="encre"] {
  --lb-bg: linear-gradient(160deg, #16181f, #0c0e13);
  --lb-border: #A78BFA; --lb-ink: #EEF0F5; --lb-muted: #98A1B3;
  --lb-accent: #B49CFB; --lb-rule: #2b303b;
}
.collection-label[data-lbl="amethyste"] {
  --lb-bg: linear-gradient(160deg, #f8f5fe, #eae2fb);
  --lb-border: #7A5CE0; --lb-ink: #241a3d; --lb-muted: #5b4c86;
  --lb-accent: #6b4fd0; --lb-rule: #d6c9f5;
}
.collection-label[data-lbl="aigue-marine"] {
  --lb-bg: linear-gradient(160deg, #f3fbfd, #e0f3f9);
  --lb-border: #38C4DE; --lb-ink: #10323a; --lb-muted: #3f6a76;
  --lb-accent: #1d8fa8; --lb-rule: #c0e5ee;
}
.collection-label[data-lbl="emeraude"] {
  --lb-bg: linear-gradient(160deg, #f3fbf6, #e1f5e9);
  --lb-border: #3EA96F; --lb-ink: #10301f; --lb-muted: #3d6b52;
  --lb-accent: #2b8a56; --lb-rule: #c3e5d1;
}
.collection-label[data-lbl="rubis"] {
  --lb-bg: linear-gradient(160deg, #fdf4f6, #f7e2e8);
  --lb-border: #C0455F; --lb-ink: #3a1620; --lb-muted: #7a4351;
  --lb-accent: #a8354c; --lb-rule: #eecbd5;
}
.collection-label[data-lbl="or-noir"] {
  --lb-bg: linear-gradient(160deg, #1b1813, #100e0a);
  --lb-border: #D9AE55; --lb-ink: #F3EBD9; --lb-muted: #b6a684;
  --lb-accent: #D9AE55; --lb-rule: #3b3223;
}


/* ==========================================================================
   DESIGN 3.4 · La barre de recherche et de filtres de la Gemmothèque
                ne suit plus le défilement
   --------------------------------------------------------------------------
   Elle était en position: sticky et restait collée sous l'en-tête. Elle
   défile désormais avec la page, comme le reste du contenu.
   ========================================================================== */

.gem-toolbar {
  position: static;
  top: auto;
  z-index: auto;
}

/* même comportement à toutes les largeurs : les couches précédentes
   repositionnaient le collage sous 640 px */
@media (max-width: 640px) {
  .gem-toolbar { position: static; top: auto; }
}

/* Le panneau de filtres dépliable sur mobile suit la barre, il n'a donc
   plus besoin d'un décalage de collage non plus. */
.gem-filter-panel,
.gem-filters { position: static; top: auto; }


/* ==========================================================================
   DESIGN 3.6 · Curseur monochrome
   --------------------------------------------------------------------------
   La boule était en dégradé prismatique (violet → cyan → ambre). Elle passe
   à une seule couleur, pilotée par UNE variable : change --curseur ci-dessous
   et la boule, son halo et sa traînée suivent.
   ========================================================================== */

:root { --curseur: #7A5CE0; }                      /* violet Lapidem, thème clair */
html:not([data-theme="light"]) { --curseur: #A78BFA; }   /* éclairci en sombre */

#cursor-orb {
  background: var(--curseur);
  box-shadow:
    0 0 10px 2px color-mix(in srgb, var(--curseur) 55%, transparent),
    0 0 26px 8px color-mix(in srgb, var(--curseur) 26%, transparent),
    0 0 46px 18px color-mix(in srgb, var(--curseur) 12%, transparent);
}

#cursor-orb::after {
  border-color: color-mix(in srgb, var(--curseur) 34%, transparent);
}

.cursor-trail-dot { background: var(--curseur); }

/* Repli pour les navigateurs sans color-mix : mêmes teintes, écrites en dur.
   Si tu changes --curseur, pense à ces trois valeurs rgba() — ou supprime
   simplement ce bloc, les navigateurs concernés étant devenus très rares. */
@supports not (color: color-mix(in srgb, red, blue)) {
  #cursor-orb {
    box-shadow: 0 0 10px 2px rgba(122, 92, 224, 0.55),
                0 0 26px 8px rgba(122, 92, 224, 0.26),
                0 0 46px 18px rgba(122, 92, 224, 0.12);
  }
  #cursor-orb::after { border-color: rgba(122, 92, 224, 0.34); }
}
