:root {
  color-scheme: light;
  --bg: #eeeade;
  --bg-deep: #e1dbc9;
  --surface: #fbfaf5;
  --surface-raised: #ffffff;
  --surface-soft: #f3f0e6;
  --surface-strong: #e7e1d1;
  --ink: #17231e;
  --ink-soft: #33443c;
  --muted: #637069;
  --faint: #7b857f;
  --line: #c6c2b3;
  --line-strong: #9ea69e;
  --forest: #195a47;
  --forest-strong: #104737;
  --forest-soft: #dce9df;
  --forest-wash: rgba(25, 90, 71, 0.1);
  --ochre: #a76527;
  --ochre-strong: #814b1d;
  --ochre-soft: #f2e2ca;
  --clay: #984c3a;
  --clay-soft: #f3dfda;
  --sky-soft: #dce9ec;
  --focus: #0b72b9;
  --success: #257451;
  --success-soft: #dcece3;
  --warning: #8a5a18;
  --warning-soft: #f3e5c6;
  --danger: #a23d36;
  --danger-soft: #f5dedb;
  --header-bg: rgba(251, 250, 245, 0.94);
  --shadow-sm: 0 1px 2px rgba(21, 35, 29, 0.08), 0 5px 18px rgba(21, 35, 29, 0.05);
  --shadow-md: 0 3px 8px rgba(21, 35, 29, 0.09), 0 16px 40px rgba(21, 35, 29, 0.08);
  --radius-sm: 0.4rem;
  --radius: 0.75rem;
  --radius-lg: 1.2rem;
  --content: 74rem;
  --reading: 47rem;
  --header-offset: 5.5rem;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: Georgia, "Times New Roman", serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

html[data-theme="light"] {
  color-scheme: light;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1714;
  --bg-deep: #09100e;
  --surface: #161f1b;
  --surface-raised: #1b2621;
  --surface-soft: #202a25;
  --surface-strong: #29342e;
  --ink: #ecf1ed;
  --ink-soft: #c6d1cb;
  --muted: #9eaea5;
  --faint: #819188;
  --line: #34463e;
  --line-strong: #53675d;
  --forest: #75b999;
  --forest-strong: #9dcdb5;
  --forest-soft: #213c30;
  --forest-wash: rgba(117, 185, 153, 0.12);
  --ochre: #d7a264;
  --ochre-strong: #efbc7e;
  --ochre-soft: #44331f;
  --clay: #dc8a76;
  --clay-soft: #442b27;
  --sky-soft: #21363a;
  --focus: #7ec8ff;
  --success: #72c79b;
  --success-soft: #1f3c2e;
  --warning: #e4b968;
  --warning-soft: #42351d;
  --danger: #f2948a;
  --danger-soft: #482925;
  --header-bg: rgba(22, 31, 27, 0.94);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 5px 20px rgba(0, 0, 0, 0.18);
  --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.3), 0 18px 46px rgba(0, 0, 0, 0.26);
}

@media (prefers-color-scheme: dark) {
  html[data-theme="system"] {
    color-scheme: dark;
    --bg: #0f1714;
    --bg-deep: #09100e;
    --surface: #161f1b;
    --surface-raised: #1b2621;
    --surface-soft: #202a25;
    --surface-strong: #29342e;
    --ink: #ecf1ed;
    --ink-soft: #c6d1cb;
    --muted: #9eaea5;
    --faint: #819188;
    --line: #34463e;
    --line-strong: #53675d;
    --forest: #75b999;
    --forest-strong: #9dcdb5;
    --forest-soft: #213c30;
    --forest-wash: rgba(117, 185, 153, 0.12);
    --ochre: #d7a264;
    --ochre-strong: #efbc7e;
    --ochre-soft: #44331f;
    --clay: #dc8a76;
    --clay-soft: #442b27;
    --sky-soft: #21363a;
    --focus: #7ec8ff;
    --success: #72c79b;
    --success-soft: #1f3c2e;
    --warning: #e4b968;
    --warning-soft: #42351d;
    --danger: #f2948a;
    --danger-soft: #482925;
    --header-bg: rgba(22, 31, 27, 0.94);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28), 0 5px 20px rgba(0, 0, 0, 0.18);
    --shadow-md: 0 4px 10px rgba(0, 0, 0, 0.3), 0 18px 46px rgba(0, 0, 0, 0.26);
  }
}

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

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-offset);
  background: var(--bg-deep);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  display: grid;
  grid-template-rows: auto 1fr auto;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 3%, var(--forest-wash) 0, transparent 27rem),
    radial-gradient(circle at 94% 9%, color-mix(in srgb, var(--ochre-soft) 46%, transparent) 0, transparent 24rem),
    linear-gradient(150deg, var(--bg) 0%, var(--bg) 65%, var(--bg-deep) 145%);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

a {
  color: var(--forest);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--forest-strong);
}

img,
svg {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p,
dl,
dd,
figure {
  margin-top: 0;
}

h1,
h2,
h3 {
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.1;
  text-wrap: balance;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(2.15rem, 6vw, 4.65rem);
  letter-spacing: -0.035em;
}

h2 {
  margin-bottom: 0.75rem;
  font-size: clamp(1.55rem, 3.5vw, 2.45rem);
  letter-spacing: -0.025em;
}

h3 {
  margin-bottom: 0.45rem;
  font-size: clamp(1.15rem, 2vw, 1.4rem);
}

p {
  margin-bottom: 1rem;
  color: var(--ink-soft);
}

code,
pre,
.mineral-formula,
.price {
  font-family: var(--mono);
}

code {
  padding: 0.08em 0.3em;
  border: 1px solid var(--line);
  border-radius: 0.25rem;
  background: var(--surface-soft);
  font-size: 0.9em;
}

::selection {
  color: var(--surface-raised);
  background: var(--forest);
}

:focus {
  outline: none;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  inset-block-start: 0.65rem;
  inset-inline-start: 0.65rem;
  padding: 0.65rem 0.9rem;
  border: 2px solid var(--focus);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
  font-weight: 750;
  text-decoration: none;
  transform: translateY(-180%);
  transition: transform 150ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  z-index: 100;
  top: 0;
  min-height: 4.75rem;
  display: grid;
  grid-template-columns: minmax(13rem, 1fr) auto minmax(13rem, 1fr);
  align-items: center;
  gap: 1.25rem;
  padding: 0.7rem max(1rem, calc((100vw - var(--content)) / 2));
  border-bottom: 1px solid var(--line);
  background: var(--header-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
}

.brand {
  min-width: 0;
  display: inline-flex;
  justify-self: start;
  align-items: center;
  gap: 0.7rem;
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  color: var(--ink);
}

.brand-mark {
  width: 2.65rem;
  height: 2.65rem;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  clip-path: polygon(48% 0%, 91% 18%, 100% 66%, 68% 100%, 21% 91%, 0% 47%, 17% 13%);
  color: #fffdf6;
  background: linear-gradient(145deg, var(--forest), var(--forest-strong) 60%, var(--ochre-strong));
  font-family: var(--serif);
  font-size: 1.38rem;
  font-weight: 700;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.brand-copy {
  min-width: 0;
  display: grid;
  line-height: 1.05;
}

.brand-name {
  overflow: hidden;
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-tagline {
  margin-top: 0.24rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.primary-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.22rem;
  padding: 0.24rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
}

.primary-nav a {
  padding: 0.42rem 0.72rem;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 720;
  text-decoration: none;
  transition: color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.primary-nav a:hover {
  color: var(--ink);
  background: var(--surface-raised);
}

.primary-nav a[aria-current="page"],
.primary-nav a.active {
  color: #fffdf7;
  background: var(--forest-strong);
  box-shadow: 0 1px 3px rgba(8, 49, 37, 0.25);
}

.site-preferences {
  display: flex;
  justify-self: end;
  align-items: center;
  gap: 0.45rem;
}

.site-preferences select,
.theme-toggle {
  min-height: 2.35rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-raised);
  font-size: 0.78rem;
  font-weight: 680;
}

.site-preferences select {
  max-width: 8.5rem;
  padding: 0.38rem 1.8rem 0.38rem 0.7rem;
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.38rem 0.72rem;
}

.site-preferences select:hover,
.theme-toggle:hover {
  border-color: var(--forest);
  color: var(--forest-strong);
  background: var(--forest-soft);
}

#app-main {
  width: 100%;
  min-height: min(70vh, 48rem);
}

#app-main:focus {
  outline: none;
}

.view,
.loading-view {
  width: min(100%, var(--content));
  margin-inline: auto;
  padding: clamp(2.2rem, 6vw, 5.2rem) max(1rem, env(safe-area-inset-left)) clamp(3.5rem, 7vw, 6.5rem) max(1rem, env(safe-area-inset-right));
}

.view > :last-child,
.loading-view > :last-child {
  margin-bottom: 0;
}

.loading-view {
  min-height: 60vh;
  display: grid;
  align-content: center;
  justify-items: start;
}

.loading-view h1 {
  max-width: 13ch;
}

.loading-view p:last-child {
  max-width: 42rem;
}

.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
  color: var(--ochre-strong);
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.115em;
  line-height: 1.3;
  text-transform: uppercase;
}

.eyebrow::before {
  width: 1.8rem;
  height: 0.18rem;
  content: "";
  background: currentColor;
}

.hero {
  position: relative;
  isolation: isolate;
  min-height: 26rem;
  display: grid;
  align-content: center;
  overflow: hidden;
  padding: clamp(2rem, 7vw, 5rem);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(115deg, var(--surface-raised) 0%, var(--surface) 68%, var(--forest-soft) 100%);
  box-shadow: var(--shadow-md);
}

.hero::before,
.hero::after {
  position: absolute;
  z-index: -1;
  content: "";
  opacity: 0.75;
  pointer-events: none;
}

.hero::before {
  width: clamp(12rem, 31vw, 25rem);
  aspect-ratio: 1;
  inset-block-start: -24%;
  inset-inline-end: -4%;
  clip-path: polygon(50% 0, 91% 17%, 100% 63%, 67% 100%, 20% 89%, 0 43%, 18% 10%);
  background: linear-gradient(145deg, var(--forest-soft), color-mix(in srgb, var(--forest) 27%, transparent));
}

.hero::after {
  width: clamp(8rem, 20vw, 15rem);
  aspect-ratio: 1.25;
  inset-block-end: -17%;
  inset-inline-end: 17%;
  clip-path: polygon(8% 15%, 75% 0, 100% 52%, 70% 100%, 0 79%);
  background: linear-gradient(150deg, var(--ochre-soft), color-mix(in srgb, var(--clay) 20%, transparent));
}

.hero h1,
.hero > p {
  max-width: 45rem;
}

.hero > p:not(.eyebrow) {
  font-size: clamp(1.04rem, 2vw, 1.25rem);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.7rem;
  margin-top: 1.45rem;
}

.primary-button,
.secondary-button,
.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.62rem 1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 140ms ease, color 140ms ease, background 140ms ease, border-color 140ms ease, box-shadow 140ms ease;
}

.primary-button {
  color: #fffdf7;
  border-color: var(--forest-strong);
  background: var(--forest-strong);
  box-shadow: 0 3px 9px rgba(10, 64, 48, 0.2);
}

.primary-button:hover {
  color: #fff;
  background: var(--forest);
  transform: translateY(-1px);
}

.secondary-button,
.button {
  color: var(--forest-strong);
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.secondary-button:hover,
.button:hover {
  color: var(--forest-strong);
  border-color: var(--forest);
  background: var(--forest-soft);
  transform: translateY(-1px);
}

.primary-button:active,
.secondary-button:active,
.button:active {
  transform: translateY(0);
}

.search-form {
  max-width: 55rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.7rem;
  margin: 1.5rem 0 0.8rem;
}

.search-form label {
  grid-column: 1 / -1;
  color: var(--ink-soft);
  font-size: 0.82rem;
  font-weight: 760;
  letter-spacing: 0.025em;
}

.search-form input,
.search-form select,
.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 2.85rem;
  padding: 0.68rem 0.82rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  background: var(--surface-raised);
  box-shadow: inset 0 1px 2px rgba(21, 35, 29, 0.04);
}

.search-form input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: var(--faint);
  opacity: 1;
}

.search-form input:hover,
.search-form select:hover,
.field input:hover,
.field select:hover,
.field textarea:hover {
  border-color: var(--forest);
}

.search-form input:focus,
.search-form select:focus,
.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent);
}

.search-summary {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.mineral-grid,
.offer-grid,
.fact-grid,
.stats-grid,
.home-grid {
  display: grid;
  gap: 1rem;
}

.mineral-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mineral-card {
  position: relative;
  min-height: 13.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 1.2rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.mineral-card::before {
  width: 4.2rem;
  height: 0.27rem;
  margin-bottom: 1rem;
  border-radius: 99px;
  content: "";
  background: linear-gradient(90deg, var(--forest), var(--ochre));
}

.mineral-card:hover,
.mineral-card:focus-within {
  border-color: var(--forest);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.mineral-card h2,
.mineral-card h3 {
  font-size: 1.45rem;
}

.mineral-card p {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-link {
  color: var(--ink);
  text-decoration: none;
}

.card-link:hover {
  color: var(--forest-strong);
}

.card-link::after {
  position: absolute;
  inset: 0;
  content: "";
}

.mineral-card a:not(.card-link),
.mineral-card button,
.mineral-card .badge {
  position: relative;
  z-index: 1;
}

.mineral-formula {
  margin-bottom: 0.8rem;
  color: var(--ochre-strong);
  font-size: 0.92rem;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.badge-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
  margin-top: auto;
  padding: 0;
  list-style: none;
}

.badge {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  padding: 0.22rem 0.48rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-soft);
  background: var(--surface-soft);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.badge[data-tone="verified"],
.badge.success {
  color: var(--success);
  border-color: color-mix(in srgb, var(--success) 45%, var(--line));
  background: var(--success-soft);
}

.badge[data-tone="warning"],
.badge.warning {
  color: var(--warning);
  border-color: color-mix(in srgb, var(--warning) 45%, var(--line));
  background: var(--warning-soft);
}

.pager,
.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  margin-top: 2rem;
}

.pager p,
.pagination p {
  margin: 0;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
}

.detail-header {
  position: relative;
  padding: clamp(1.5rem, 5vw, 3.5rem);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(120deg, var(--surface-raised), var(--surface) 65%, var(--ochre-soft));
  box-shadow: var(--shadow-sm);
}

.detail-header::after {
  position: absolute;
  width: 9rem;
  aspect-ratio: 1;
  inset-block-start: -3.5rem;
  inset-inline-end: -2.5rem;
  clip-path: polygon(50% 0, 100% 28%, 87% 84%, 25% 100%, 0 37%);
  content: "";
  background: color-mix(in srgb, var(--forest) 15%, transparent);
  pointer-events: none;
}

.detail-header h1 {
  max-width: 18ch;
  font-size: clamp(2.35rem, 7vw, 5rem);
  overflow-wrap: anywhere;
}

.detail-header .mineral-formula {
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.detail-layout,
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
  align-items: start;
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.detail-main,
.detail-aside,
.content-main,
.content-aside {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin: 2.6rem 0 1rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}

.section-heading h2,
.section-heading h3,
.section-heading p {
  margin-bottom: 0;
}

.section-heading p {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
}

.fact-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.fact-card,
.stat-card,
.release-card {
  min-width: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.fact-card dt,
.stat-card dt,
.data-list dt {
  margin-bottom: 0.3rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 750;
  letter-spacing: 0.055em;
  line-height: 1.35;
  text-transform: uppercase;
}

.fact-card dd,
.stat-card dd {
  margin: 0;
  color: var(--ink);
  font-weight: 670;
  overflow-wrap: anywhere;
}

.stats-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 1.5rem 0;
}

.stat-card dd {
  font-family: var(--serif);
  font-size: clamp(1.5rem, 3vw, 2.3rem);
}

.data-list,
.property-list,
.json-list {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.data-list > div,
.property-list > div,
.json-list > div,
.data-row {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(8.5rem, 0.85fr) minmax(0, 2fr);
  gap: 1rem;
  padding: 0.72rem 0.9rem;
  border-bottom: 1px solid var(--line);
}

.data-list > div:last-child,
.property-list > div:last-child,
.json-list > div:last-child,
.data-row:last-child {
  border-bottom: 0;
}

.data-list dd,
.property-list dd,
.json-list dd {
  min-width: 0;
  margin: 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.json-value,
.property-value {
  font-family: var(--mono);
  font-size: 0.84rem;
  white-space: pre-wrap;
  word-break: break-word;
}

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

.evidence-card,
.offer-card {
  min-width: 0;
  padding: 1.05rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--shadow-sm);
}

.evidence-card {
  border-inline-start: 0.3rem solid var(--ochre);
}

.evidence-card h3,
.offer-card h3 {
  overflow-wrap: anywhere;
}

.evidence-card p:last-child,
.offer-card p:last-child {
  margin-bottom: 0;
}

.source-meta,
.offer-meta {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.73rem;
  line-height: 1.5;
}

.offer-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.offer-card {
  display: flex;
  flex-direction: column;
}

.offer-card .actions {
  margin-top: auto;
  padding-top: 0.6rem;
}

.price {
  margin: 0.35rem 0 0.85rem;
  color: var(--forest-strong);
  font-size: 1.35rem;
  font-weight: 800;
}

.notice,
.error-panel,
.loading-panel,
.empty-panel {
  max-width: var(--reading);
  margin: 1.5rem auto;
  padding: clamp(1.1rem, 3vw, 1.6rem);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  background: var(--surface);
}

.notice > :last-child,
.error-panel > :last-child,
.loading-panel > :last-child,
.empty-panel > :last-child {
  margin-bottom: 0;
}

.notice {
  border-inline-start: 0.35rem solid var(--forest);
  background: var(--forest-soft);
}

.error-panel {
  border-color: color-mix(in srgb, var(--danger) 55%, var(--line));
  border-inline-start: 0.35rem solid var(--danger);
  background: var(--danger-soft);
}

.error-panel h1,
.error-panel h2,
.error-panel h3 {
  color: var(--danger);
}

.loading-panel {
  position: relative;
  padding-inline-start: 3.7rem;
}

.loading-panel::before {
  position: absolute;
  width: 1.4rem;
  aspect-ratio: 1;
  inset-block-start: 1.45rem;
  inset-inline-start: 1.35rem;
  border: 0.18rem solid var(--line);
  border-top-color: var(--forest);
  border-radius: 50%;
  content: "";
  animation: spin 800ms linear infinite;
}

.empty-panel {
  text-align: center;
  background: var(--surface-soft);
}

.empty-panel::before {
  width: 3.6rem;
  aspect-ratio: 1;
  display: block;
  margin: 0 auto 1rem;
  clip-path: polygon(50% 0, 95% 23%, 85% 79%, 34% 100%, 0 58%, 13% 14%);
  content: "";
  background: linear-gradient(145deg, var(--surface-strong), var(--line));
}

.map-shell {
  min-height: 0;
  display: block;
  overflow: visible;
}

.map-container,
#catalog-map-root {
  position: relative;
  width: 100%;
  min-height: 0;
  overflow: visible;
  isolation: isolate;
  background: transparent;
}

.map-fallback,
.map-container > .loading-panel,
#catalog-map-root > .loading-panel,
.map-container > .error-panel,
#catalog-map-root > .error-panel {
  position: absolute;
  z-index: 2;
  inset: 50% auto auto 50%;
  width: min(calc(100% - 2rem), 34rem);
  margin: 0;
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-md);
}

.site-footer {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1.2rem max(1rem, calc((100vw - var(--content)) / 2));
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: var(--bg-deep);
}

.site-footer p {
  margin: 0;
  color: inherit;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}

.site-footer p:last-child {
  text-align: end;
}

@keyframes spin {
  to {
    transform: rotate(1turn);
  }
}

@media (max-width: 66rem) {
  :root {
    --header-offset: 8.5rem;
  }

  .site-header {
    grid-template-columns: 1fr auto;
    gap: 0.55rem 1rem;
  }

  .primary-nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-self: center;
  }

  .site-preferences {
    grid-row: 1;
    grid-column: 2;
  }

  .mineral-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 46rem) {
  :root {
    --header-offset: 10.5rem;
  }

  .site-header {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    padding-block: 0.55rem;
  }

  .brand-tagline {
    display: none;
  }

  .brand-mark {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.15rem;
  }

  .brand-name {
    font-size: 0.96rem;
  }

  .site-preferences {
    gap: 0.3rem;
  }

  .site-preferences select {
    width: 4.85rem;
    padding-inline: 0.42rem;
  }

  .theme-toggle {
    min-width: 2.35rem;
    padding-inline: 0.52rem;
  }

  .theme-toggle [data-theme-label] {
    display: none;
  }

  .primary-nav {
    width: 100%;
    justify-content: stretch;
    overflow-x: auto;
  }

  .primary-nav a {
    flex: 1 0 auto;
    text-align: center;
  }

  .view,
  .loading-view {
    padding-block-start: 2.2rem;
  }

  .hero {
    min-height: 24rem;
    padding: 1.45rem;
  }

  .hero::before {
    inset-block-start: -11%;
    opacity: 0.5;
  }

  .search-form {
    grid-template-columns: 1fr;
  }

  .search-form label {
    grid-column: auto;
  }

  .search-form .primary-button,
  .search-form button {
    width: 100%;
  }

  .mineral-grid,
  .offer-grid,
  .fact-grid,
  .stats-grid,
  .home-grid {
    grid-template-columns: 1fr;
  }

  .mineral-card {
    min-height: 12rem;
  }

  .detail-layout,
  .content-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside,
  .content-aside {
    order: -1;
  }

  .data-list > div,
  .property-list > div,
  .json-list > div,
  .data-row {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
    gap: 0.25rem;
  }

  .map-shell {
    min-height: 0;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer p:last-child {
    text-align: start;
  }
}

@media (max-width: 25rem) {
  .brand-copy {
    display: none;
  }

  .primary-nav a {
    padding-inline: 0.5rem;
    font-size: 0.75rem;
  }

  .actions {
    align-items: stretch;
    flex-direction: column;
  }

  .actions > .primary-button,
  .actions > .secondary-button,
  .actions > .button {
    width: 100%;
  }
}

[dir="rtl"] .eyebrow::before {
  order: 1;
}

[dir="rtl"] .brand-mark,
[dir="rtl"] .mineral-formula,
[dir="rtl"] .price,
[dir="rtl"] code {
  direction: ltr;
  unicode-bidi: isolate;
}

[dir="rtl"] .evidence-card {
  border-inline-start: 0.3rem solid var(--ochre);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .brand-mark,
  .hero::before,
  .hero::after,
  .empty-panel::before {
    forced-color-adjust: none;
  }

  .primary-button,
  .primary-nav a[aria-current="page"] {
    border-color: ButtonText;
  }
}

@media print {
  :root {
    --bg: #fff;
    --surface: #fff;
    --surface-raised: #fff;
    --surface-soft: #fff;
    --ink: #000;
    --ink-soft: #111;
    --muted: #333;
    --line: #777;
  }

  body {
    display: block;
    background: #fff;
  }

  .site-header,
  .site-footer,
  .actions,
  .pager,
  .pagination,
  .map-shell {
    display: none !important;
  }

  .view,
  .loading-view {
    width: 100%;
    padding: 0;
  }

  .hero,
  .detail-header,
  .mineral-card,
  .evidence-card,
  .offer-card {
    break-inside: avoid;
    box-shadow: none;
  }

  a {
    color: #000;
  }
}
