:root {
  --ink: #17231d;
  --muted: #657269;
  --paper: #f6f3eb;
  --surface: #fffdf8;
  --line: #dcd7ca;
  --forest: #244a36;
  --forest-light: #dce9df;
  --copper: #b9632d;
  --gold: #d7b95c;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; line-height: 1.55; }
a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

.site-header {
  min-height: 72px; padding: 12px max(24px, calc((100vw - 1180px) / 2));
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--surface); border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 1.18rem; text-decoration: none; letter-spacing: -.02em; }
.brand-mark { display: inline-grid; place-items: center; width: 34px; height: 34px; margin-right: 10px;
  border-radius: 50%; color: white; background: var(--forest); font-family: Georgia, serif; }
.header-search input { width: min(36vw, 430px); }
input, button { font: inherit; }
input { border: 1px solid #bdb8ab; border-radius: 8px; background: white; padding: 11px 13px; color: var(--ink); }
input:focus { outline: 3px solid rgba(185, 99, 45, .2); border-color: var(--copper); }
button { border: 0; border-radius: 8px; padding: 11px 19px; font-weight: 700; color: white; background: var(--forest); cursor: pointer; }
select { font: inherit; border: 1px solid #bdb8ab; border-radius: 8px; background: white; padding: 11px 13px; }

.hero { padding: clamp(64px, 10vw, 130px) max(24px, calc((100vw - 960px) / 2));
  background: radial-gradient(circle at 82% 20%, rgba(215,185,92,.35), transparent 25%), var(--forest); color: white; }
.hero h1, .detail-hero h1 { max-width: 780px; margin: 8px 0 15px; font: 700 clamp(2.7rem, 7vw, 5.7rem)/.98 Georgia, serif; letter-spacing: -.04em; }
.eyebrow { margin: 0; text-transform: uppercase; letter-spacing: .13em; font-size: .76rem; font-weight: 800; color: var(--copper); }
.hero .eyebrow { color: #edca73; }
.lead { max-width: 720px; font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); }
.hero .lead { color: #dce6df; }
.hero-search { display: flex; gap: 9px; max-width: 720px; margin-top: 32px; }
.hero-search input { flex: 1; min-width: 0; padding: 15px 16px; }
.hero-search button { background: var(--copper); }
.browse-nav { max-width: 1180px; margin: -24px auto 0; padding: 0 24px; display: grid;
  grid-template-columns: repeat(4, 1fr); gap: 10px; position: relative; }
.browse-nav a { padding: 18px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; box-shadow: 0 8px 25px rgba(35,45,37,.05); }
.browse-nav strong, .browse-nav span { display: block; }
.browse-nav span { margin-top: 3px; color: var(--muted); font-size: .82rem; }

.content-section { max-width: 1180px; margin: 0 auto; padding: 60px 24px; }
.compact-section { padding-top: 20px; }
.page-top { min-height: 65vh; padding-top: 80px; }
.page-top h1, .content-section h2 { font-family: Georgia, serif; letter-spacing: -.025em; }
.page-top h1 { margin: 7px 0; font-size: clamp(2.2rem, 5vw, 4rem); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.section-heading h2 { margin: 5px 0 0; font-size: 2rem; }
.freshness, .meta, .map-caption { color: var(--muted); font-size: .9rem; }

.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 15px; }
.entity-card { min-width: 0; padding: 22px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(35,45,37,.035); }
.card-topline { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.type-chip { font-size: .72rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--forest); }
.status-chip, .large-status { border-radius: 999px; padding: 4px 9px; background: #e9ece9; font-size: .76rem; font-weight: 750; }
.status-approved { color: #1e5a36; background: #dcecdf; }
.status-applied { color: #714e06; background: #f4e7b9; }
.status-rejected, .status-withdrawn { color: #812f27; background: #f1d8d4; }
.entity-card h2 { margin: 17px 0 5px; font: 700 1.45rem/1.16 Georgia, serif; }
.entity-card .holder { margin: 0 0 18px; font-weight: 650; }
.entity-card .minerals { min-height: 25px; margin: 0 0 10px; color: var(--copper); }
.entity-card .meta { margin: 0; }
.entity-card .deadline { margin: 16px 0 0; padding-top: 13px; border-top: 1px solid var(--line); color: var(--muted); }
.document-list { padding-left: 20px; }
.document-list li { margin-bottom: 12px; }
.auth-shell { max-width: 680px; }
.auth-form, .watch-form, .combined-watch-form { display: grid; gap: 9px; margin: 28px 0; }
.auth-form label, .watch-form label, .combined-watch-form label { margin-top: 8px; font-weight: 700; }
.form-error { padding: 12px 15px; border-left: 4px solid #a33b30; background: #f2dedb; }
.form-success { padding: 12px 15px; border-left: 4px solid var(--forest); background: var(--forest-light); }
.account-heading { display: flex; justify-content: space-between; align-items: start; gap: 20px; }
.account-panel { margin-top: 28px; padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.account-panel h2 { margin-top: 0; }
.watch-form { max-width: 700px; }
.combined-watch-form { max-width: 700px; }
.account-link { color: var(--ink); font-weight: 700; white-space: nowrap; }
.header-nav-link { font-weight: 700; white-space: nowrap; }
.detail-actions { display: grid; justify-items: end; gap: 14px; }
.follow-button { display: inline-block; border-radius: 8px; padding: 11px 19px; color: white;
  background: var(--copper); font-weight: 750; text-decoration: none; white-space: nowrap; }
.collection-heading { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: 28px; }
.profile-hero { padding: 68px max(24px, calc((100vw - 1180px) / 2)); display: flex;
  justify-content: space-between; align-items: end; gap: 30px; background: #e8e3d6; }
.profile-hero h1 { max-width: 900px; margin: 7px 0; font: 700 clamp(2.5rem, 6vw, 5rem)/1 Georgia, serif; }
.profile-content { padding-top: 34px; }
.stat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.stat-card { padding: 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
.stat-card strong { display: block; font: 700 2rem/1 Georgia, serif; }
.stat-card span { display: block; margin-top: 7px; color: var(--muted); font-size: .84rem; }
.related-section, .profile-section { margin-top: 42px; }
.related-section h2 { margin-bottom: 8px; }
.related-links { line-height: 2; }
.section-tabs { display: flex; gap: 18px; margin-bottom: 34px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.section-tabs a { font-weight: 700; }
.browse-filters { display: grid; grid-template-columns: repeat(5, 1fr) auto; gap: 9px;
  align-items: end; margin: 30px 0; padding: 18px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.browse-filters label { display: none; }
.pagination { display: flex; justify-content: center; align-items: center; gap: 16px; margin-top: 34px; }
.pagination .secondary-button { text-decoration: none; }
.directory-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 28px; }
.directory-card { padding: 20px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; text-decoration: none; }
.directory-card strong, .directory-card span, .directory-card small { display: block; }
.directory-card span, .directory-card small { margin-top: 5px; color: var(--muted); }
.watch-row { display: flex; justify-content: space-between; gap: 20px; padding: 15px 0; border-top: 1px solid var(--line); }
.watch-row span, .notification-list span { display: block; color: var(--muted); font-size: .88rem; }
.watch-actions { display: flex; gap: 8px; }
.secondary-button { background: #dfe5e0; color: var(--ink); }
.danger-button { background: #8b3b32; }
.notification-list li { margin-bottom: 12px; }
.danger-zone { border-color: #b7746b; }
.pricing-hero { min-height: 420px; }
.pricing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.pricing-card { padding: 30px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.pricing-card.featured { border: 2px solid var(--copper); }
.pricing-card h2 { margin-bottom: 5px; }
.pricing-card .price { margin: 5px 0 24px; font: 700 1.45rem/1.3 Georgia, serif; }
.pricing-card li { margin-bottom: 10px; }
.billing-account-list { display: grid; gap: 12px; }
.billing-account { border: 1px solid var(--line); border-radius: 10px; background: var(--background); }
.billing-account summary { cursor: pointer; padding: 18px; }
.billing-account summary span { display: block; margin-top: 4px; color: var(--muted); }
.billing-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 16px; padding: 18px; }
.billing-form label { align-self: end; font-size: .85rem; font-weight: 700; }
.billing-form textarea, .billing-form button { grid-column: 1 / -1; }
.activity-filters { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: end; gap: 10px; margin: 30px 0; padding: 20px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; }
.activity-filters label { display: none; }
.activity-list { display: grid; gap: 14px; }
.activity-section { margin-top: 42px; }
.activity-card { padding: 25px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.activity-card h2 { margin: 7px 0; font: 700 1.65rem/1.2 Georgia, serif; }
.activity-card .holder { margin: 0 0 10px; font-weight: 650; }
.activity-dates { display: flex; gap: 24px; margin: 16px 0 0; color: var(--muted); font-size: .88rem; }
.activity-dates div { display: flex; gap: 6px; }
.activity-dates dt { font-weight: 700; }
.activity-dates dd { margin: 0; }
.activity-links { margin-bottom: 0; }
.source-health-list { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 30px; }
.source-health-card { padding: 23px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; }
.source-health-card.source-degraded { border-color: #a85a4f; }
.source-health-heading { display: flex; justify-content: space-between; gap: 16px; align-items: start; }
.source-health-heading h2 { margin: 5px 0 14px; }
.health-indicator { padding: 4px 9px; border-radius: 999px; background: var(--forest-light); font-size: .78rem; font-weight: 750; }
.source-degraded .health-indicator { color: #812f27; background: #f1d8d4; }
.source-health-facts { margin: 0; }
.source-health-facts div { display: flex; justify-content: space-between; gap: 18px; padding: 7px 0; border-top: 1px solid var(--line); }
.source-health-facts dt { color: var(--muted); }
.source-health-facts dd { margin: 0; text-align: right; font-weight: 620; }
.source-health-warning { margin-bottom: 0; color: #812f27; }
.empty-state { padding: 40px; border: 1px dashed #aaa597; border-radius: 12px; background: rgba(255,255,255,.3); }

.detail-hero { padding: 68px max(24px, calc((100vw - 1180px) / 2)); display: flex; justify-content: space-between; align-items: end; gap: 30px; background: #e8e3d6; }
.detail-hero h1 { max-width: 900px; font-size: clamp(2.5rem, 6vw, 5rem); }
.detail-hero .lead { margin-bottom: 0; }
.large-status { padding: 8px 14px; white-space: nowrap; }
.detail-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(380px, 1.15fr); gap: 50px; }
.facts { display: grid; grid-template-columns: 1fr 1.5fr; margin: 20px 0; border-top: 1px solid var(--line); }
.fact { display: contents; }
.fact dt, .fact dd { margin: 0; padding: 10px 0; border-bottom: 1px solid var(--line); }
.fact dt { color: var(--muted); }
.fact dd { font-weight: 620; }
.entity-map { height: 530px; border-radius: 13px; border: 1px solid var(--line); background: #e3e5df; overflow: hidden; }
.map-error { display: grid; place-items: center; color: var(--muted); }
.source-note { margin-top: 28px; padding: 18px; border-left: 4px solid var(--copper); background: #eee9de; }
.source-note p { margin-bottom: 0; }
.timeline { border-left: 2px solid var(--line); padding-left: 22px; }
.timeline li { padding: 4px 0 18px 8px; }
.timeline span { display: block; color: var(--muted); font-size: .9rem; }

footer { padding: 34px max(24px, calc((100vw - 1180px) / 2)); color: #ced8d1; background: #17231d; font-size: .88rem; }
footer p { margin: 5px 0; }
.footer-links { margin-top: 12px; }
.prose-page { max-width: 820px; }
.prose-page h2 { margin-top: 38px; }
.prose-page p { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 850px) {
  .card-grid { grid-template-columns: 1fr 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .header-search { display: none; }
  .activity-filters { grid-template-columns: 1fr 1fr; }
  .source-health-list { grid-template-columns: 1fr; }
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .browse-nav { grid-template-columns: 1fr 1fr; }
  .browse-filters { grid-template-columns: 1fr 1fr; }
  .directory-grid { grid-template-columns: 1fr 1fr; }
  .pricing-grid, .billing-form { grid-template-columns: 1fr; }
}
@media (max-width: 570px) {
  .card-grid { grid-template-columns: 1fr; }
  .hero-search { display: grid; }
  .section-heading, .detail-hero, .collection-heading, .profile-hero { align-items: start; flex-direction: column; }
  .facts { grid-template-columns: 1fr; }
  .fact { display: block; border-bottom: 1px solid var(--line); padding: 8px 0; }
  .fact dt, .fact dd { border: 0; padding: 1px 0; }
  .entity-map { height: 370px; }
  .activity-filters { grid-template-columns: 1fr; }
  .activity-dates { display: grid; gap: 5px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .browse-nav, .browse-filters { grid-template-columns: 1fr; }
  .header-nav-link { display: none; }
  .directory-grid { grid-template-columns: 1fr; }
}
