/* ===========================================================================
   Beyond Bohemian — Crystal & Stone Identifier
   Premium, editorial, science-first. Matches the storefront design tokens.
   =========================================================================== */

:root {
  --cream: #f7f7f4;
  --cream-2: #f1f0ea;
  --charcoal: #413e46;
  --charcoal-soft: #5d5963;
  --green: #4a6741;
  --green-deep: #3a5233;
  --brown: #9a7248;
  --brown-soft: #b58e63;
  --line: #e3e1d8;
  --line-2: #d8d5ca;
  --white: #fffdf9;
  --terracotta: #b4633f;

  --shadow-sm: 0 1px 2px rgba(65, 62, 70, 0.04), 0 2px 8px rgba(65, 62, 70, 0.05);
  --shadow-md: 0 4px 14px rgba(65, 62, 70, 0.07), 0 12px 36px rgba(65, 62, 70, 0.06);
  --shadow-lg: 0 8px 30px rgba(65, 62, 70, 0.1), 0 24px 60px rgba(65, 62, 70, 0.08);

  --serif: "Libre Baskerville", Georgia, serif;
  --sans: "Karla", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --radius: 14px;
  --radius-lg: 20px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

/* The hidden attribute always wins, even over explicit display values */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
::selection { background: rgba(74, 103, 65, 0.18); }
:focus-visible { outline: 2px solid rgba(74, 103, 65, 0.55); outline-offset: 2px; border-radius: 4px; }

/* hide the hero meta row entirely unless a chip is actually showing */
.hero-meta:not(:has(.chip:not([hidden]))) { display: none; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--charcoal);
  background: var(--cream);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ░░ HERO ░░ */
.hero {
  background:
    radial-gradient(1200px 500px at 50% -10%, rgba(74, 103, 65, 0.06), transparent 60%),
    linear-gradient(180deg, var(--cream-2), var(--cream));
  border-bottom: 1px solid var(--line);
  padding: 30px 0 56px;
  text-align: center;
}
.brand { display: inline-block; margin-bottom: 32px; }
.brand:hover { text-decoration: none; }
.brand-logo { height: 36px; width: auto; display: block; }
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.22em; font-size: 12px;
  font-weight: 600; color: var(--brown); margin: 0 0 14px;
}
.hero-title {
  font-family: var(--serif); font-weight: 700;
  font-size: clamp(34px, 6vw, 56px); line-height: 1.06;
  margin: 0 auto 18px; color: var(--charcoal); max-width: 12ch;
}
.hero-sub {
  max-width: 60ch; margin: 0 auto; font-size: clamp(16px, 2.2vw, 19px);
  color: var(--charcoal-soft);
}
.hero-meta { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 26px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: var(--green-deep);
  background: rgba(74, 103, 65, 0.08); border: 1px solid rgba(74, 103, 65, 0.18);
  padding: 7px 14px; border-radius: 999px;
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.chip.demo { color: var(--brown); background: rgba(154, 114, 72, 0.1); border-color: rgba(154, 114, 72, 0.25); }
.chip.demo .dot { background: var(--brown); }

/* ░░ LAYOUT ░░ */
main.wrap { padding-top: 40px; padding-bottom: 40px; }
.view { animation: fade 0.45s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 28px;
}

/* ░░ UPLOADER ░░ */
.uploader { max-width: 720px; margin: 0 auto; }
.dropzone {
  border: 2px dashed var(--line-2);
  border-radius: var(--radius);
  background: var(--cream);
  padding: 46px 24px; text-align: center; cursor: pointer;
  transition: border-color 0.2s, background 0.2s, transform 0.1s;
  outline: none;
}
.dropzone:hover, .dropzone:focus-visible { border-color: var(--green); background: rgba(74, 103, 65, 0.04); }
.dropzone.drag { border-color: var(--green); background: rgba(74, 103, 65, 0.08); transform: scale(1.005); }
.dz-icon { width: 42px; height: 42px; color: var(--green); margin-bottom: 12px; }
.dz-title { font-family: var(--serif); font-size: 21px; margin: 0 0 6px; color: var(--charcoal); }
.dz-hint { margin: 0; color: var(--charcoal-soft); font-size: 15px; }
.dz-strong { color: var(--charcoal); font-weight: 600; }

.thumbs { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }
.thumb {
  position: relative; width: 96px; height: 96px; border-radius: 12px;
  overflow: hidden; border: 1px solid var(--line-2); box-shadow: var(--shadow-sm);
  background: var(--cream-2);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .rm {
  position: absolute; top: 4px; right: 4px; width: 24px; height: 24px;
  border-radius: 50%; border: none; cursor: pointer;
  background: rgba(65, 62, 70, 0.78); color: #fff; font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.thumb .rm:hover { background: var(--terracotta); }
.thumb.add {
  display: flex; align-items: center; justify-content: center;
  border-style: dashed; cursor: pointer; color: var(--green); font-size: 30px;
  background: var(--cream);
}
.thumb.add:hover { background: rgba(74, 103, 65, 0.06); }

/* details blocks */
details.tips, details.context-fields {
  margin-top: 18px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--cream); padding: 0 16px; overflow: hidden;
}
details summary {
  cursor: pointer; padding: 14px 0; font-weight: 600; color: var(--charcoal);
  list-style: none; display: flex; justify-content: space-between; align-items: center;
}
details summary::-webkit-details-marker { display: none; }
details summary::after { content: "+"; color: var(--green); font-size: 20px; font-weight: 400; }
details[open] summary::after { content: "–"; }
details.tips ul { margin: 0 0 16px; padding-left: 20px; color: var(--charcoal-soft); font-size: 15px; }
details.tips li { margin-bottom: 8px; }
details.tips li b, details.context-fields b { color: var(--charcoal); font-weight: 600; }
.optional { color: var(--charcoal-soft); font-weight: 400; font-size: 13px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 4px 0 18px; }
.field-grid label { font-size: 13px; font-weight: 600; color: var(--charcoal-soft); display: flex; flex-direction: column; gap: 6px; }
.field-grid input {
  font-family: var(--sans); font-size: 15px; color: var(--charcoal); font-weight: 400;
  border: 1px solid var(--line-2); border-radius: 9px; padding: 10px 12px; background: var(--white);
}
.field-grid input:focus { outline: 2px solid rgba(74, 103, 65, 0.4); border-color: var(--green); }

.actions { margin-top: 24px; text-align: center; }
.microcopy { font-size: 13px; color: var(--charcoal-soft); margin: 12px 0 0; }

/* ░░ BUTTONS ░░ */
.btn {
  font-family: var(--sans); font-weight: 700; font-size: 16px;
  border-radius: 999px; padding: 14px 30px; cursor: pointer; border: 1px solid transparent;
  transition: transform 0.08s, box-shadow 0.2s, background 0.2s, opacity 0.2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--green); color: #fff; box-shadow: 0 6px 18px rgba(74, 103, 65, 0.28); }
.btn-primary:hover { background: var(--green-deep); transform: translateY(-1px); box-shadow: 0 9px 24px rgba(74, 103, 65, 0.32); }
.btn-primary:disabled { background: var(--line-2); color: #fff; cursor: not-allowed; box-shadow: none; opacity: 0.8; }
.btn-ghost { background: transparent; color: var(--charcoal); border-color: var(--line-2); }
.btn-ghost:hover { background: var(--cream-2); }
.btn-outline { background: var(--white); color: var(--green-deep); border-color: rgba(74,103,65,0.4); font-size: 15px; padding: 11px 22px; }
.btn-outline:hover { background: rgba(74, 103, 65, 0.06); }

/* ░░ LOADING — the crystal draws itself while a fine arc orbits ░░ */
.loading { max-width: 560px; margin: 30px auto; text-align: center; padding: 50px 28px; }
.loader { position: relative; width: 96px; height: 96px; margin: 0 auto 22px; animation: breathe 3.6s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.04); } }
.loader-ring { position: absolute; inset: 0; animation: orbit 2.4s linear infinite; }
.loader-ring circle {
  fill: none; stroke: var(--green); stroke-width: 2; stroke-linecap: round; opacity: 0.85;
  stroke-dasharray: 58 200; /* a fine arc, most of the circle open */
}
@keyframes orbit { to { transform: rotate(360deg); } }
.loader-gem { position: absolute; inset: 22px 26px; color: var(--charcoal); }
.loader-gem .lg-line {
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round;
  stroke-dasharray: 130; stroke-dashoffset: 130;
  animation: draw 2.8s ease-in-out infinite;
}
.loader-gem .lg-soft { stroke-width: 0.9; opacity: 0.6; }
.loader-gem .lg-line:nth-child(2) { animation-delay: 0.25s; }
.loader-gem .lg-line:nth-child(3) { animation-delay: 0.4s; }
.loader-gem .lg-line:nth-child(4) { animation-delay: 0.55s; }
.loader-gem .lg-line:nth-child(5) { animation-delay: 0.7s; }
.loader-gem .lg-line:nth-child(6) { animation-delay: 0.85s; }
@keyframes draw {
  0% { stroke-dashoffset: 130; opacity: 0.3; }
  45%, 70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -130; opacity: 0.3; }
}
.loading-title { font-family: var(--serif); font-size: 22px; margin: 0 0 10px; }
.loading-tip { color: var(--charcoal-soft); font-size: 15px; min-height: 44px; max-width: 46ch; margin: 0 auto; transition: opacity 0.4s; }

/* ===========================================================================
   RESULTS
   =========================================================================== */
.quality-banner {
  display: flex; gap: 12px; align-items: flex-start;
  border-radius: 12px; padding: 14px 18px; margin-bottom: 18px; font-size: 14.5px;
  background: rgba(154, 114, 72, 0.09); border: 1px solid rgba(154, 114, 72, 0.22); color: #6f5126;
}
.quality-banner.good { background: rgba(74, 103, 65, 0.08); border-color: rgba(74, 103, 65, 0.2); color: var(--green-deep); }
.quality-banner b { font-weight: 700; }
.quality-banner ul { margin: 6px 0 0; padding-left: 18px; }

/* hero result card */
.result-hero { padding: 0; overflow: hidden; }
.result-hero .rh-top {
  display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center;
  padding: 30px; background: linear-gradient(180deg, var(--cream-2), var(--white));
  border-bottom: 1px solid var(--line);
}

/* confidence rating ring — five qualitative segments, not a score */
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; overflow: visible; }
.ring .seg {
  fill: none; stroke: var(--line); stroke-width: 9; stroke-linecap: round;
  transform-origin: 66px 66px;
}
.ring .seg-on { animation: seg-in 0.5s ease both; }
@keyframes seg-in { from { opacity: 0.15; } to { opacity: 1; } }
.ring .ring-num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 0 16px;
}
.ring .band-word { font-family: var(--serif); font-size: 19px; font-weight: 700; line-height: 1.05; }
.ring .band-sub { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.18em; font-weight: 700; color: var(--charcoal-soft); }

.rh-id .kicker { text-transform: uppercase; letter-spacing: 0.2em; font-size: 11.5px; font-weight: 700; color: var(--brown); margin: 0 0 6px; }
.rh-id h2 { font-family: var(--serif); font-size: clamp(28px, 5vw, 40px); margin: 0 0 6px; line-height: 1.05; }
.rh-id .aka { color: var(--charcoal-soft); font-size: 14.5px; margin: 0 0 12px; }
.rh-id .facts { display: flex; flex-wrap: wrap; gap: 8px; }
.fact-pill {
  font-size: 12.5px; font-weight: 600; background: var(--cream); border: 1px solid var(--line-2);
  border-radius: 8px; padding: 5px 10px; color: var(--charcoal-soft);
}
.fact-pill b { color: var(--charcoal); font-weight: 700; }

.rh-body { padding: 26px 30px 30px; }
.section-label {
  font-family: var(--sans); text-transform: uppercase; letter-spacing: 0.16em;
  font-size: 12px; font-weight: 700; color: var(--brown); margin: 0 0 12px;
  display: flex; align-items: center; gap: 10px;
}
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.reasoning { font-size: 16.5px; color: var(--charcoal); margin: 0 0 24px; }

/* observed properties grid */
.props { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 26px; }
.prop { background: var(--white); padding: 14px 16px; }
.prop .k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brown); font-weight: 700; margin: 0 0 3px; }
.prop .v { font-size: 15px; color: var(--charcoal); margin: 0; }

/* educational blocks */
.edu-grid { display: grid; gap: 14px; margin-bottom: 8px; }
.edu {
  border-left: 3px solid var(--green); background: var(--cream); border-radius: 0 12px 12px 0;
  padding: 16px 18px;
}
.edu.fun { border-left-color: var(--brown); }
.edu.meta { border-left-color: var(--line-2); }
.edu h4 { margin: 0 0 5px; font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--charcoal-soft); font-weight: 700; }
.edu p { margin: 0; font-size: 15.5px; }
.edu.meta p { font-style: italic; color: var(--charcoal-soft); }

.safety {
  display: flex; gap: 10px; align-items: flex-start; margin-top: 16px;
  background: rgba(180, 99, 63, 0.08); border: 1px solid rgba(180, 99, 63, 0.25);
  color: #8a4124; border-radius: 12px; padding: 13px 16px; font-size: 14.5px;
}

/* CTA row */
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }

/* ░░ generic result section card ░░ */
.rcard { margin-top: 22px; }
.rcard > h3 {
  font-family: var(--serif); font-size: 23px; margin: 0 0 4px;
}
.rcard > .rcard-sub { color: var(--charcoal-soft); font-size: 15px; margin: 0 0 18px; }

/* alternatives */
.alt { border: 1px solid var(--line); border-radius: 12px; padding: 16px 18px; margin-bottom: 12px; background: var(--white); }
.alt-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 8px; }
.alt-name { font-family: var(--serif); font-size: 18px; }
.alt-bar { flex: 1; max-width: 180px; height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.alt-bar i { display: block; height: 100%; background: var(--brown-soft); border-radius: 99px; }
.alt-pct { font-weight: 700; font-size: 14px; color: var(--charcoal-soft); min-width: 38px; text-align: right; }
.alt p { margin: 4px 0 0; font-size: 14.5px; }
.alt .rule { color: var(--charcoal-soft); }
.alt .rule b { color: var(--green-deep); }

/* at-home tests */
.test { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.test-head {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; background: var(--cream);
  cursor: pointer; user-select: none;
}
.test-head .tnum {
  width: 28px; height: 28px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; flex-shrink: 0;
}
.test-head .tname { font-weight: 700; font-size: 16px; flex: 1; }
.test-head .tdiff { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 700; color: var(--green-deep); background: rgba(74,103,65,0.1); padding: 3px 9px; border-radius: 99px; }
.test-head .tdiff.moderate { color: var(--brown); background: rgba(154,114,72,0.12); }
.test-head .caret { color: var(--charcoal-soft); transition: transform 0.2s; }
.test.open .caret { transform: rotate(180deg); }
.test-body { padding: 0 18px; max-height: 0; overflow: hidden; transition: max-height 0.3s ease, padding 0.3s ease; }
.test.open .test-body { padding: 16px 18px 18px; max-height: 600px; }
.test-body .tb-row { margin-bottom: 12px; }
.test-body .tb-row:last-child { margin-bottom: 0; }
.test-body .tb-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brown); font-weight: 700; margin: 0 0 3px; }
.test-body .tb-v { margin: 0; font-size: 15px; }
.test-body .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 7px; }
.tag.in { color: var(--green-deep); background: rgba(74,103,65,0.1); }
.tag.out { color: #8a4124; background: rgba(180,99,63,0.1); }
.test-caution { display: flex; gap: 8px; font-size: 13.5px; color: var(--charcoal-soft); background: var(--cream); border-radius: 9px; padding: 9px 12px; margin-top: 4px; }

/* ░░ REFINE PANEL ░░ */
.refine { margin-top: 22px; border: 1.5px solid rgba(74,103,65,0.3); background: rgba(74,103,65,0.035); }
.refine h3 { color: var(--green-deep); }
.refine .refine-tests { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 16px; }
.refine .rt {
  display: flex; align-items: flex-start; gap: 10px; padding: 11px 14px;
  border: 1px solid var(--line-2); border-radius: 10px; background: var(--white); cursor: pointer;
}
.refine .rt:hover { border-color: var(--green); }
.refine .rt input { margin-top: 4px; accent-color: var(--green); width: 16px; height: 16px; }
.refine .rt .rt-label { font-size: 14.5px; }
.refine .rt .rt-label b { display: block; color: var(--charcoal); }
.refine textarea {
  width: 100%; font-family: var(--sans); font-size: 15px; color: var(--charcoal);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; min-height: 78px; resize: vertical;
  background: var(--white);
}
.refine textarea:focus { outline: 2px solid rgba(74,103,65,0.35); border-color: var(--green); }
.refine .refine-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 16px; align-items: center; }
.refine-thumbs { display: flex; gap: 10px; flex-wrap: wrap; margin: 10px 0 0; }

.changed-note {
  background: rgba(74,103,65,0.08); border: 1px solid rgba(74,103,65,0.2); color: var(--green-deep);
  border-radius: 10px; padding: 11px 15px; font-size: 14.5px; margin-bottom: 16px; font-weight: 600;
}

/* summary callout */
.summary-box {
  background: var(--charcoal); color: var(--cream); border-radius: var(--radius);
  padding: 22px 24px; margin-top: 22px;
}
.summary-box .section-label { color: var(--brown-soft); }
.summary-box .section-label::after { background: rgba(255,255,255,0.15); }
.summary-box p { margin: 0; font-size: 17px; }

.results-footer { text-align: center; margin-top: 30px; }

/* not-a-stone */
.notstone { text-align: center; max-width: 520px; margin: 30px auto; padding: 44px 28px; }
.notstone .ns-emoji { font-size: 40px; }
.notstone h2 { font-family: var(--serif); font-size: 26px; margin: 14px 0 10px; }
.notstone p { color: var(--charcoal-soft); }

/* ░░ TABS (sticky) ░░ */
.tabbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; justify-content: center;
  padding: 10px 16px;
  background: color-mix(in srgb, var(--cream) 86%, transparent);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.tabs {
  display: inline-flex; gap: 6px;
  background: var(--white); border: 1px solid var(--line); border-radius: 999px; padding: 5px;
  box-shadow: var(--shadow-sm);
}
.tab {
  font-family: var(--sans); font-size: 15px; font-weight: 700; color: var(--charcoal-soft);
  background: transparent; border: none; border-radius: 999px; padding: 10px 22px; cursor: pointer;
  transition: background 0.2s, color 0.2s;
}
.tab:hover { color: var(--charcoal); }
.tab.active { background: var(--green); color: #fff; box-shadow: 0 3px 10px rgba(74,103,65,0.3); }

/* ░░ ID LEVEL BADGE ░░ */
.kicker .lvl {
  margin-left: 10px; font-size: 10.5px; letter-spacing: 0.08em; padding: 3px 10px; border-radius: 99px;
  vertical-align: middle; font-weight: 700;
}
.lvl-species { background: rgba(74,103,65,0.12); color: var(--green-deep); }
.lvl-variety { background: rgba(74,103,65,0.12); color: var(--green-deep); }
.lvl-family  { background: rgba(154,114,72,0.14); color: #6f5126; }
.family-line { margin: -2px 0 8px; color: var(--charcoal-soft); font-size: 15px; font-style: italic; }
.lvl-note { margin: 12px 0 0; font-size: 13.5px; color: #6f5126; background: rgba(154,114,72,0.09); border-radius: 9px; padding: 8px 12px; }

/* ░░ SIGNALS (how we got this) ░░ */
.signals { margin: 0 0 26px; }
.signal-row { display: flex; flex-wrap: wrap; gap: 8px; }
.signal {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600;
  background: var(--cream); border: 1px solid var(--line-2); color: var(--charcoal);
  border-radius: 99px; padding: 7px 14px;
}
.signal i { font-style: normal; }
.signal.pending {
  color: var(--brown); border-color: rgba(154, 114, 72, 0.3); background: rgba(154, 114, 72, 0.07);
  animation: pending-pulse 1.6s ease-in-out infinite;
}
@keyframes pending-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.55; } }
.signal .agree { color: var(--green-deep); font-weight: 700; }
.signal .differ { color: #6f5126; font-weight: 700; }
.evidence-detail { margin-top: 10px; font-size: 14px; color: var(--charcoal-soft); }
.evidence-detail summary { cursor: pointer; font-weight: 600; color: var(--green-deep); padding: 4px 0; }
.evidence-detail ul { margin: 8px 0 4px; padding-left: 20px; }
.evidence-detail li { margin-bottom: 4px; }
.evidence-note { font-size: 12.5px; margin: 6px 0 0; }

/* ░░ REFERENCE CARD ░░ */
.refcard {
  margin-top: 26px; background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px 20px;
}
.refcard.nodata { background: transparent; border: none; padding: 12px 0 0; }
.ref-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 22px; margin: 4px 0 12px; }
.ref-row { display: flex; justify-content: space-between; gap: 12px; border-bottom: 1px dashed var(--line-2); padding: 6px 0; font-size: 14.5px; }
.ref-k { color: var(--charcoal-soft); font-weight: 600; }
.ref-v { color: var(--charcoal); text-align: right; }
.ref-diag { font-size: 14.5px; margin: 10px 0 0; }
.ref-fake { font-size: 14.5px; margin: 10px 0 0; color: #8a4124; }
.ref-more { margin: 10px 0 0; }
.ref-links { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; margin-top: 14px; font-size: 13.5px; color: var(--charcoal-soft); }
.ref-links a { font-weight: 700; }
.linklike {
  background: none; border: none; padding: 0; cursor: pointer; font-family: var(--sans);
  color: var(--green); font-size: 14px; font-weight: 700;
}
.linklike:hover { text-decoration: underline; }
.alt .linklike { margin-top: 8px; }

/* ░░ EXPLORE (ENCYCLOPEDIA) ░░ */
.explore-head { text-align: center; }
.explore-title { font-family: var(--serif); font-size: clamp(26px, 4vw, 34px); margin: 6px 0 8px; }
.explore-sub { color: var(--charcoal-soft); max-width: 62ch; margin: 0 auto 20px; font-size: 15.5px; }
.explore-controls { max-width: 640px; margin: 0 auto; }
#exploreSearch {
  width: 100%; font-family: var(--sans); font-size: 16px; color: var(--charcoal);
  border: 1.5px solid var(--line-2); border-radius: 999px; padding: 13px 22px; background: var(--cream);
}
#exploreSearch:focus { outline: 2px solid rgba(74,103,65,0.35); border-color: var(--green); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 14px; }
.filter-chip {
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--charcoal-soft);
  background: var(--white); border: 1px solid var(--line-2); border-radius: 99px; padding: 8px 16px; cursor: pointer;
  transition: all 0.15s;
}
.filter-chip:hover { border-color: var(--green); color: var(--green-deep); }
.filter-chip.active { background: var(--green); border-color: var(--green); color: #fff; }
.explore-count { text-align: center; color: var(--charcoal-soft); font-size: 13.5px; margin: 18px 0 14px; }
.explore-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.entry-card {
  font-family: var(--sans); text-align: left; background: var(--white); border: 1px solid var(--line);
  border-radius: 14px; padding: 16px; cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--shadow-sm); transition: transform 0.12s, box-shadow 0.2s, border-color 0.2s;
}
.entry-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: rgba(74,103,65,0.4); }
.entry-cat {
  align-self: flex-start; font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; font-weight: 700;
  padding: 3px 9px; border-radius: 99px; background: rgba(74,103,65,0.1); color: var(--green-deep);
}
.entry-cat.rock { background: rgba(154,114,72,0.13); color: #6f5126; }
.entry-cat.mineraloid { background: rgba(79,107,150,0.12); color: #41577a; }
.entry-cat.organic { background: rgba(125,95,67,0.13); color: #66503a; }
.entry-cat.man-made { background: rgba(180,99,63,0.12); color: #8a4124; }
.entry-name { font-family: var(--serif); font-size: 17.5px; color: var(--charcoal); margin-top: 3px; }
.entry-group { font-size: 12.5px; color: var(--charcoal-soft); }
.entry-meta { display: flex; align-items: center; justify-content: space-between; margin-top: 6px; }
.entry-mohs { font-size: 11.5px; font-weight: 700; color: var(--charcoal-soft); background: var(--cream); border: 1px solid var(--line-2); border-radius: 7px; padding: 2px 8px; }
.entry-colors { display: inline-flex; gap: 4px; }
.cdot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; border: 1px solid rgba(65,62,70,0.18); }
.explore-empty { text-align: center; color: var(--charcoal-soft); margin-top: 14px; }

/* ░░ ENTRY MODAL ░░ */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(65, 62, 70, 0.45); z-index: 80;
  display: flex; align-items: flex-start; justify-content: center; padding: 4vh 16px;
  backdrop-filter: blur(3px); animation: fade 0.25s ease both;
}
.modal-card {
  position: relative; background: var(--white); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg);
  max-width: 660px; width: 100%; max-height: 92vh; overflow-y: auto; padding: 30px 30px 26px;
  animation: rise 0.3s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.modal-close {
  position: sticky; top: 0; float: right; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--line-2); background: var(--white); color: var(--charcoal); font-size: 20px;
  cursor: pointer; z-index: 2; line-height: 1;
}
.modal-close:hover { background: var(--cream-2); }
.modal-title { font-family: var(--serif); font-size: 30px; margin: 4px 0 4px; }
.modal-diag { font-size: 16px; color: var(--charcoal); margin: 10px 0 16px; }
.modal-row { font-size: 14.5px; margin: 10px 0 0; color: var(--charcoal); }
.modal-row .cdot { vertical-align: middle; margin-left: 2px; }
.modal-h { font-family: var(--sans); font-size: 13px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--brown); margin: 18px 0 8px; }
.modal-list { margin: 0; padding-left: 20px; font-size: 14.5px; }
.modal-list li { margin-bottom: 7px; }
.modal-card .edu { margin-top: 14px; }
.modal-card .ref-grid { margin-top: 10px; }
.modal-card .safety { margin-top: 14px; }

/* ░░ VARIETIES & LOCALITIES ░░ */
.varieties {
  margin-top: 26px; border-top: 1px dashed var(--line-2); padding-top: 20px;
}
.variety-occ { font-size: 14.5px; margin: 0 0 12px; }
.variety-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 12px; }
.variety-k { font-size: 13px; font-weight: 700; color: var(--charcoal-soft); margin-right: 2px; }
.variety-chip {
  font-family: var(--sans); font-size: 13px; font-weight: 600; color: var(--green-deep);
  background: rgba(74,103,65,0.07); border: 1px solid rgba(74,103,65,0.22); border-radius: 99px;
  padding: 6px 14px; cursor: pointer; transition: background 0.15s, transform 0.1s;
}
.variety-chip:hover { background: rgba(74,103,65,0.14); transform: translateY(-1px); }
.variety-links { font-size: 13.5px; color: var(--charcoal-soft); margin: 0; }

/* ░░ FEEDBACK ░░ */
.feedback-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 12px 16px; background: var(--cream); border-radius: 12px;
  font-size: 14px;
}
.fb-q { font-weight: 700; color: var(--charcoal-soft); }
.fb-btn {
  font-family: var(--sans); font-size: 13.5px; font-weight: 700; color: var(--green-deep);
  background: var(--white); border: 1px solid rgba(74,103,65,0.3); border-radius: 99px;
  padding: 7px 16px; cursor: pointer; transition: background 0.15s;
}
.fb-btn:hover { background: rgba(74,103,65,0.08); }
.fb-input {
  flex: 1; min-width: 160px; font-family: var(--sans); font-size: 14px; color: var(--charcoal);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 8px 12px; background: var(--white);
}
.fb-thanks { color: var(--green-deep); font-weight: 600; }

/* ░░ MOTION ░░ */
.reveal { animation: rise-in 0.5s cubic-bezier(.2,.7,.3,1) both; }
.entry-card { animation: rise-in 0.45s cubic-bezier(.2,.7,.3,1) both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.alt-pct { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.06em; }

/* ░░ ENTRY & MODAL VISUALS ░░ */
.entry-card { padding: 0; overflow: hidden; }
.entry-photo {
  width: 100%; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cream-2);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.entry-photo.grad { transition: filter 0.3s ease; }
.entry-card:hover .entry-photo.grad { filter: saturate(1.15) brightness(1.03); }
.entry-photo.grad::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,253,249,0) 70%, rgba(65,62,70,0.07));
}
.entry-body { display: flex; flex-direction: column; gap: 5px; padding: 13px 15px 15px; }

.modal-photo {
  width: calc(100% + 60px); margin: -30px -30px 18px; aspect-ratio: 21 / 9; overflow: hidden;
  display: flex; align-items: center; justify-content: center; background: var(--cream-2); position: relative;
}
.modal-photo.grad::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(255,253,249,0) 72%, rgba(65,62,70,0.06));
}

/* ░░ RESULT HERO PHOTO ░░ */
.rh-photo {
  width: 132px; height: 132px; border-radius: 18px; overflow: hidden; flex-shrink: 0;
  border: 1px solid var(--line-2); box-shadow: var(--shadow-md); background: var(--cream-2);
  transform: rotate(-2deg);
}
.rh-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rh-top.has-photo { grid-template-columns: auto auto 1fr; }

/* ░░ MOHS SCALE ░░ */
.mohs-scale { margin: 4px 0 22px; }
.mohs-scale .tb-k { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--brown); font-weight: 700; margin: 0 0 10px; }
.mohs-track {
  position: relative; height: 10px; border-radius: 99px; background: var(--line);
  margin: 18px 0 6px;
}
.mohs-fill {
  display: block; height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--brown-soft), var(--green));
}
.mohs-marker {
  position: absolute; top: -26px; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; color: var(--charcoal); background: var(--white);
  border: 1px solid var(--line-2); border-radius: 7px; padding: 2px 8px; box-shadow: var(--shadow-sm);
  white-space: nowrap;
}
.mohs-marker::after {
  content: ""; position: absolute; left: 50%; bottom: -4px; transform: translateX(-50%) rotate(45deg);
  width: 7px; height: 7px; background: var(--white); border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2);
}
.mohs-refs { position: relative; height: 48px; }
.mohs-ref {
  position: absolute; transform: translateX(-50%); top: 0; text-align: center;
  font-size: 10.5px; color: var(--charcoal-soft); white-space: nowrap;
}
.mohs-ref i { display: block; width: 1px; height: 7px; background: var(--line-2); margin: 0 auto 3px; }
/* stagger the close-together references onto a second row */
.mohs-ref:nth-child(2) { top: 22px; }
.mohs-ref:nth-child(2) i { height: 29px; margin-bottom: 3px; }

/* ░░ EMAIL GATE ░░ */
.gate { max-width: 560px; margin: 22px auto 0; text-align: center; border: 1.5px solid rgba(74,103,65,0.35); }
.gate-icon { color: var(--green); width: 44px; margin: 4px auto 12px; }
.gate-icon svg { width: 100%; height: auto; }
.gate h3 { font-family: var(--serif); font-size: 24px; margin: 0 0 10px; }
.gate-sub { color: var(--charcoal-soft); font-size: 15.5px; margin: 0 0 18px; }
.gate-sub b { color: var(--green-deep); }
.gate-form { display: flex; gap: 10px; max-width: 440px; margin: 0 auto; }
.gate-form input {
  flex: 1; font-family: var(--sans); font-size: 16px; color: var(--charcoal);
  border: 1.5px solid var(--line-2); border-radius: 999px; padding: 12px 18px; background: var(--cream); min-width: 0;
}
.gate-form input:focus { outline: 2px solid rgba(74,103,65,0.35); border-color: var(--green); }
.gate-consent {
  display: flex; gap: 9px; align-items: flex-start; text-align: left; max-width: 440px;
  margin: 14px auto 0; font-size: 13px; color: var(--charcoal-soft); cursor: pointer;
}
.gate-consent input { margin-top: 2px; accent-color: var(--green); flex-shrink: 0; }
.gate-error { color: var(--terracotta); font-weight: 600; font-size: 14px; margin: 12px 0 0; }
.gate .microcopy { margin-top: 16px; }

/* ░░ QUOTA PILL + GEO ░░ */
.quota-pill {
  display: inline-block; margin: 12px 0 0; font-size: 12.5px; font-weight: 700;
  color: var(--green-deep); background: rgba(74,103,65,0.08);
  border: 1px solid rgba(74,103,65,0.18); border-radius: 99px; padding: 5px 14px;
}
.btn-sm { font-size: 14px; padding: 9px 18px; }
.geo-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 4px 0 2px; }
.geo-status { font-size: 13.5px; color: var(--green-deep); font-weight: 600; }
.geo-note { font-size: 12.5px; color: var(--charcoal-soft); margin: 8px 0 16px; }
.geo-on { background: rgba(74,103,65,0.1); border-color: var(--green); }
#turnstileMount { display: flex; justify-content: center; margin-bottom: 12px; }

/* ░░ MY FINDS ░░ */
.finds-count {
  background: var(--brown); color: #fff; font-size: 11px; border-radius: 99px;
  padding: 1px 7px; margin-left: 4px; vertical-align: middle;
}
.tab.active .finds-count { background: rgba(255,255,255,0.25); }
.finds-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-top: 18px; }
.find-card {
  display: flex; gap: 14px; align-items: center; background: var(--white);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px; box-shadow: var(--shadow-sm);
}
.find-thumb { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; flex-shrink: 0; border: 1px solid var(--line-2); }
.find-thumb-blank { display: flex; align-items: center; justify-content: center; background: var(--cream); color: var(--brown); font-size: 24px; }
.find-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.find-name { font-family: var(--serif); font-size: 17px; color: var(--charcoal); }
.find-meta { font-size: 12.5px; color: var(--charcoal-soft); }
.find-actions { display: flex; gap: 14px; margin-top: 4px; }
.find-rm { color: var(--terracotta); }

/* ░░ ERROR ░░ */
.errorbox {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: var(--terracotta); color: #fff; padding: 13px 20px; border-radius: 12px;
  box-shadow: var(--shadow-lg); font-size: 15px; max-width: 90vw; z-index: 50;
  animation: pop 0.3s ease both;
}
@keyframes pop { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translateX(-50%); } }

/* ░░ FOOTER ░░ */
.site-foot { border-top: 1px solid var(--line); margin-top: 30px; padding: 30px 0 50px; }
.foot-disclaimer { font-size: 13px; color: var(--charcoal-soft); max-width: 70ch; margin: 0 auto 14px; text-align: center; }
.foot-brand { text-align: center; font-size: 14px; color: var(--charcoal-soft); margin: 0; }

/* ░░ EMBEDDED MODE — running inside the storefront page ░░ */
/* The site supplies brand and context; the app becomes seamless content. */
.embedded .brand { display: none; }
.embedded .hero { padding-top: 40px; border-bottom-color: transparent; }
.embedded .hero-title { font-size: clamp(32px, 5vw, 48px); }
.embedded .tabbar { top: 0; }
.embedded .foot-brand { display: none; }
.embedded .site-foot { margin-top: 12px; padding: 22px 0 30px; border-top-color: var(--line); }
.embedded main.wrap { padding-bottom: 8px; }

/* ░░ RESPONSIVE ░░ */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .card { padding: 20px; border-radius: 16px; }
  .field-grid { grid-template-columns: 1fr; }
  .result-hero .rh-top { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: 18px; padding: 26px 20px; }
  .rh-id .facts { justify-content: center; }
  .rh-body { padding: 22px 20px 26px; }
  .props { grid-template-columns: 1fr; }
  .cta-row .btn, .cta-row { width: 100%; }
  .cta-row .btn { width: 100%; text-align: center; }
  .hero { padding: 22px 0 40px; }
  .tabs { width: 100%; }
  .tab { flex: 1; padding: 10px 6px; font-size: 13.5px; }
  .gate-form { flex-direction: column; }
  .finds-grid { grid-template-columns: 1fr; }
  .mohs-ref { font-size: 9px; }
  .mohs-ref:nth-child(2) { display: none; }
  .modal-photo { width: calc(100% + 36px); margin: -22px -18px 16px; }
  .rh-photo { transform: none; }
  .ref-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 9px; }
  .entry-card { padding: 13px; }
  .modal-card { padding: 22px 18px; }
  .kicker .lvl { display: inline-block; margin: 6px 0 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
