:root {
  color-scheme: dark;
  --void: #02070b;
  --space: #06131b;
  --space-2: #0a2029;
  --panel: rgba(8, 28, 36, 0.9);
  --panel-strong: rgba(9, 34, 43, 0.97);
  --text: #f7f8ed;
  --cream: #fff0bd;
  --muted: #b3c6c2;
  --muted-2: #7f9692;
  --teal: #65ede0;
  --gold: #f4c15a;
  --coral: #ff8068;
  --green: #99d989;
  --border: rgba(183, 232, 218, 0.22);
  --border-hot: rgba(244, 193, 90, 0.62);
  --shadow: 0 18px 48px rgba(0, 0, 0, 0.4);
  --radius: 9px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  min-width: 320px;
  background: var(--void);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font);
  background:
    repeating-linear-gradient(0deg, rgba(255, 240, 189, 0.016) 0 1px, transparent 1px 4px),
    radial-gradient(circle at 82% 10%, rgba(244, 193, 90, 0.1), transparent 27%),
    radial-gradient(circle at 12% 28%, rgba(101, 237, 224, 0.07), transparent 31%),
    linear-gradient(180deg, #071720, var(--void) 68%);
}

button,
input,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 9px 12px;
  color: #081318;
  background: var(--cream);
  transform: translateY(-150%);
}

.skip-link:focus {
  transform: none;
}

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

.app-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: grid;
  grid-template-columns: minmax(230px, 1fr) auto;
  align-items: center;
  gap: 18px;
  min-height: 72px;
  padding: 10px 22px;
  border-bottom: 1px solid rgba(255, 240, 189, 0.2);
  background: rgba(3, 13, 19, 0.94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 11px;
  padding: 0;
  border: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.brand-emblem {
  position: relative;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  flex: 0 0 42px;
  border: 1px solid rgba(244, 193, 90, 0.5);
  border-radius: 50%;
  box-shadow: inset 0 0 18px rgba(101, 237, 224, 0.12);
}

.brand-emblem::before,
.brand-emblem::after,
.brand-emblem i {
  position: absolute;
  border: 1px solid var(--teal);
  border-radius: 50%;
  content: "";
}

.brand-emblem::before {
  inset: 9px 4px;
  transform: rotate(32deg);
}

.brand-emblem::after {
  inset: 4px 9px;
  transform: rotate(-32deg);
}

.brand-emblem i {
  width: 7px;
  height: 7px;
  border: 0;
  background: var(--gold);
  box-shadow: 0 0 12px rgba(244, 193, 90, 0.7);
}

.brand strong {
  display: block;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.brand small {
  display: block;
  margin-top: 3px;
  color: var(--muted-2);
  font-size: 0.7rem;
}

.data-status {
  justify-self: end;
  padding: 7px 12px;
  border: 1px solid rgba(101, 237, 224, 0.25);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(8, 31, 38, 0.72);
  font-size: 0.72rem;
  font-weight: 800;
}

.data-status.error {
  border-color: rgba(255, 128, 104, 0.45);
  color: var(--coral);
}

#mainContent {
  width: min(1800px, 100%);
  margin: 0 auto;
  padding: 17px;
}

.page-hero {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid rgba(244, 193, 90, 0.26);
  border-radius: var(--radius);
  background:
    linear-gradient(105deg, rgba(7, 31, 40, 0.98), rgba(8, 22, 29, 0.9)),
    radial-gradient(circle at 80% 20%, rgba(244, 193, 90, 0.18), transparent 38%);
  box-shadow: var(--shadow);
}

.page-hero > div:first-child {
  position: relative;
  z-index: 2;
  max-width: 820px;
}

.eyebrow {
  margin: 0;
  color: var(--teal);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-hero h1,
.material-heading h1 {
  margin: 7px 0 11px;
  color: var(--cream);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 500;
  line-height: 1.02;
}

.page-hero h1 {
  max-width: 700px;
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

.page-hero p:last-child,
.material-heading > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.hero-orbit {
  position: absolute;
  right: clamp(20px, 7vw, 110px);
  top: 50%;
  width: 180px;
  height: 180px;
  border: 1px solid rgba(101, 237, 224, 0.18);
  border-radius: 50%;
  transform: translateY(-50%);
}

.hero-orbit::before,
.hero-orbit::after {
  position: absolute;
  border: 1px solid rgba(244, 193, 90, 0.22);
  border-radius: 50%;
  content: "";
}

.hero-orbit::before {
  inset: 26px -24px;
  transform: rotate(24deg);
}

.hero-orbit::after {
  inset: -15px 48px;
  transform: rotate(-31deg);
}

.hero-orbit i {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 16px rgba(244, 193, 90, 0.74);
}

.hero-orbit i:nth-child(1) { left: 8px; top: 68px; }
.hero-orbit i:nth-child(2) { right: 20px; top: 20px; background: var(--teal); }
.hero-orbit i:nth-child(3) { right: 55px; bottom: -17px; }

.recipe-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(180px, 260px) auto;
  align-items: end;
  gap: 12px;
  margin: 15px 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 21, 28, 0.88);
}

.recipe-controls label {
  display: grid;
  gap: 6px;
}

.recipe-controls label > span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}

input,
select {
  width: 100%;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid rgba(183, 232, 218, 0.26);
  border-radius: 5px;
  outline: none;
  color: var(--text);
  background: rgba(1, 10, 14, 0.82);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

.clear-filters,
.secondary-action {
  min-height: 42px;
  padding: 9px 14px;
  border: 1px solid rgba(101, 237, 224, 0.3);
  border-radius: 5px;
  color: var(--teal);
  background: rgba(101, 237, 224, 0.06);
  font-size: 0.75rem;
  font-weight: 900;
}

.recipe-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  align-items: start;
  gap: 15px;
}

.recipe-browser {
  min-width: 0;
}

.recipe-results-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.recipe-results-summary {
  margin: 0;
  color: var(--muted-2);
  font: 700 0.72rem/1.4 var(--mono);
}

.recipe-results-summary:focus {
  outline: none;
}

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

.recipe-pagination[hidden] {
  display: none;
}

.recipe-pagination-bottom {
  margin-top: 16px;
}

.pagination-pages {
  display: flex;
  align-items: center;
  gap: 4px;
}

.recipe-pagination button {
  min-width: 34px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid rgba(101, 237, 224, 0.28);
  border-radius: 5px;
  color: var(--teal);
  background: rgba(101, 237, 224, 0.055);
  font: 900 0.68rem var(--mono);
}

.recipe-pagination button:hover:not(:disabled),
.recipe-pagination button.is-current {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(244, 193, 90, 0.12);
}

.recipe-pagination button:disabled {
  cursor: default;
  opacity: 0.38;
}

.pagination-step {
  min-width: 72px !important;
}

.pagination-ellipsis {
  min-width: 20px;
  color: var(--muted);
  text-align: center;
}

.recipe-grid,
.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
}

.recipe-card,
.item-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(183, 232, 218, 0.18);
  border-radius: 7px;
  background: linear-gradient(180deg, rgba(255, 240, 189, 0.035), transparent 42%), rgba(6, 24, 31, 0.92);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25);
}

.recipe-card {
  transition: border-color 140ms ease, transform 140ms ease;
}

.recipe-card:hover,
.recipe-card.selected {
  border-color: var(--border-hot);
  transform: translateY(-2px);
}

.recipe-card > button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  text-align: left;
  text-decoration: none;
}

.card-image-wrap {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  border-bottom: 1px solid rgba(183, 232, 218, 0.14);
  background: radial-gradient(circle, rgba(101, 237, 224, 0.12), rgba(2, 10, 14, 0.94));
}

.card-image,
.detail-image,
.item-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image.is-pending {
  opacity: 0;
  transition: opacity 160ms ease;
}

.card-image.is-loaded {
  opacity: 1;
}

.image-placeholder {
  display: grid;
  place-items: center;
  color: rgba(255, 240, 189, 0.72);
  background:
    repeating-linear-gradient(135deg, rgba(101, 237, 224, 0.035) 0 8px, transparent 8px 16px),
    radial-gradient(circle, rgba(101, 237, 224, 0.1), transparent 68%);
  font: 500 2.6rem Georgia, serif;
}

.output-quantity {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(244, 193, 90, 0.46);
  border-radius: 999px;
  color: #171106;
  background: rgba(244, 193, 90, 0.94);
  font: 900 0.68rem var(--mono);
}


.recipe-card-copy {
  display: grid;
  gap: 5px;
  min-height: 104px;
  padding: 12px 13px 14px;
}

.station-label {
  color: var(--teal);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.recipe-card-copy strong {
  color: var(--cream);
  font: 500 1.08rem/1.2 Georgia, serif;
}

.recipe-card-copy small {
  align-self: end;
  color: var(--muted-2);
  line-height: 1.35;
}
.recipe-card-copy .recipe-card-unlock {
  align-self: start;
  color: var(--gold);
  font: 700 0.58rem/1.4 var(--mono);
}


.panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.recipe-detail {
  position: sticky;
  top: 89px;
  max-height: calc(100vh - 106px);
  overflow: auto;
  padding: 18px;
  scrollbar-color: rgba(101, 237, 224, 0.3) transparent;
}

.detail-empty,
.empty-results {
  display: grid;
  place-items: center;
  gap: 7px;
  min-height: 280px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}

.detail-empty strong,
.empty-results strong {
  color: var(--cream);
  font: 500 1.35rem Georgia, serif;
}

.detail-empty p,
.empty-results p {
  margin: 0;
  line-height: 1.5;
}

.empty-glyph {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(101, 237, 224, 0.3);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244, 193, 90, 0.28) 0 9%, transparent 10%);
}

.detail-hero {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  align-items: center;
  gap: 15px;
  padding-bottom: 17px;
  border-bottom: 1px solid rgba(183, 232, 218, 0.14);
}

.detail-hero.has-item-link {
  cursor: pointer;
  transition: background 140ms ease;
}

.detail-hero.has-item-link:hover {
  background: rgba(101, 237, 224, 0.045);
}

.detail-hero-hitbox {
  position: absolute;
  inset: -8px;
  z-index: 2;
  border-radius: 8px;
}

.detail-hero.has-item-link > :not(.detail-hero-hitbox) {
  position: relative;
  z-index: 1;
  pointer-events: none;
}

.detail-image {
  aspect-ratio: 1;
  border: 1px solid rgba(244, 193, 90, 0.3);
  border-radius: 6px;
  background: #061018;
}

.detail-hero h2 {
  margin: 5px 0 9px;
  color: var(--cream);
  font: 500 1.65rem/1.05 Georgia, serif;
}

.taxonomy-chips,
.category-tags,
.relation-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.detail-section {
  padding: 15px 0;
  border-bottom: 1px solid rgba(183, 232, 218, 0.12);
}

.section-label {
  margin: 0 0 8px;
  color: var(--muted-2);
  font-size: 0.61rem;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.output-line {
  display: grid;
  gap: 3px;
}

.output-line strong {
  color: var(--gold);
  font: 900 0.9rem var(--mono);
}

.output-line span {
  color: var(--muted-2);
  font: 0.62rem var(--mono);
}

.recipe-unlock-list {
  display: grid;
  gap: 9px;
}

.recipe-unlock-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.recipe-unlock-step {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 7px;
  border: 1px solid rgba(101, 237, 224, 0.24);
  border-radius: 5px;
  color: var(--cream);
  background: rgba(101, 237, 224, 0.07);
  font: 800 0.65rem/1.2 var(--mono);
  text-decoration: none;
}

.recipe-unlock-skill-link {
  cursor: pointer;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.recipe-unlock-skill-link:hover,
.recipe-unlock-skill-link:focus-visible {
  border-color: var(--gold);
  color: var(--cream);
  background: rgba(244, 193, 90, 0.15);
  transform: translateY(-1px);
}

.recipe-unlock-link-icon {
  color: var(--teal);
  font-size: 0.72rem;
}

.recipe-unlock-path .recipe-unlock-step:last-child {
  border-color: rgba(244, 193, 90, 0.46);
  color: var(--gold);
  background: rgba(244, 193, 90, 0.08);
}

.recipe-unlock-arrow {
  color: var(--teal);
  font: 900 0.72rem var(--mono);
}

.ingredient-set-unlock {
  display: grid;
  gap: 7px;
  padding: 9px;
  border: 1px solid rgba(101, 237, 224, 0.16);
  border-radius: 6px;
  background: rgba(1, 11, 15, 0.46);
}

.ingredient-set-unlock > span {
  color: var(--muted-2);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.description-copy {
  margin: 0;
  color: var(--text);
  line-height: 1.65;
}

.ingredient-note {
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.input-token,
.description-copy kbd {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  margin: 0 3px;
  padding: 2px 7px;
  border: 1px solid rgba(101, 237, 224, 0.42);
  border-radius: 4px;
  color: var(--teal);
  background: rgba(101, 237, 224, 0.08);
  font: 900 0.7rem var(--mono);
}

.ingredient-sets,
.ingredient-set {
  display: grid;
  gap: 8px;
}

.ingredient-set + .ingredient-set {
  margin-top: 8px;
}

.ingredient-set-title {
  color: var(--gold);
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.ingredient-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(183, 232, 218, 0.14);
  border-radius: 5px;
  background: rgba(1, 12, 17, 0.52);
}

.ingredient-identity {
  display: grid;
  justify-items: start;
  gap: 2px;
}

.ingredient-identity small {
  color: var(--muted-2);
  font-size: 0.57rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.ingredient-identity strong,
.category-link {
  color: var(--cream);
  font-size: 0.82rem;
}

.category-link {
  padding: 0;
  border: 0;
  border-bottom: 1px dotted rgba(101, 237, 224, 0.62);
  color: var(--teal);
  background: transparent;
  font-weight: 800;
  text-align: left;
}

.ingredient-row > b {
  color: var(--gold);
  font: 800 0.68rem var(--mono);
  white-space: nowrap;
}

.taxonomy-chips {
  margin-top: 13px;
}

.taxonomy-chips button,
.taxonomy-chips a,
.category-tags button,
.relation-links button {
  padding: 5px 8px;
  border: 1px solid rgba(183, 232, 218, 0.18);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(1, 11, 15, 0.46);
  font-size: 0.6rem;
  font-weight: 800;
}

.taxonomy-chips button:hover,
.taxonomy-chips a:hover,
.category-tags button:hover,
.relation-links button:hover {
  border-color: rgba(101, 237, 224, 0.48);
  color: var(--teal);
}

.forge-action {
  display: grid;
  width: 100%;
  min-height: 44px;
  margin-top: 15px;
  place-items: center;
  border: 1px solid rgba(244, 193, 90, 0.52);
  border-radius: 5px;
  color: #171106;
  background: linear-gradient(135deg, #f8e3a2, #d8a948);
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
  text-transform: uppercase;
}

.detail-actions {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 9px;
  margin-top: 15px;
}

.detail-actions .secondary-action,
.detail-actions .forge-action {
  display: grid;
  width: 100%;
  min-height: 44px;
  margin: 0;
  place-items: center;
  text-decoration: none;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  margin-bottom: 13px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.breadcrumbs button,
.breadcrumbs a {
  padding: 2px 0;
  border: 0;
  color: var(--teal);
  background: transparent;
}

.breadcrumbs i {
  color: rgba(183, 232, 218, 0.32);
  font-style: normal;
}

.material-heading {
  padding: 20px 24px;
  border: 1px solid rgba(244, 193, 90, 0.28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 0, rgba(101, 237, 224, 0.12), transparent 34%),
    linear-gradient(115deg, rgba(8, 36, 45, 0.97), rgba(6, 20, 27, 0.94));
  box-shadow: var(--shadow);
}

.material-heading-compact h1 {
  margin: 2px 0 0;
  font-size: clamp(2rem, 4vw, 3rem);
}

.material-browser {
  margin-top: 12px;
}

.material-controls {
  display: grid;
  grid-template-columns:
    minmax(150px, 1fr)
    minmax(150px, 1fr)
    minmax(140px, 0.8fr)
    minmax(190px, 1.2fr)
    auto;
  align-items: end;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 21, 28, 0.9);
}

.material-controls label {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.material-controls label > span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.material-controls select:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.clear-filters:disabled {
  cursor: default;
  opacity: 0.42;
}

.material-results {
  margin-top: 13px;
}

.material-results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  padding: 0 3px;
}

.material-results-heading h2 {
  margin: 1px 0 0;
  color: var(--cream);
  font: 500 clamp(1.35rem, 3vw, 2rem) Georgia, serif;
}

.material-results-heading > strong {
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(101, 237, 224, 0.25);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(4, 23, 29, 0.82);
  font: 800 0.68rem var(--mono);
}

.material-results .item-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}

.material-results .item-card {
  position: relative;
  display: grid;
  min-height: 0;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto;
  align-items: start;
  cursor: pointer;
  transition: border-color 140ms ease, transform 140ms ease;
}

.item-card:hover,
.item-card:focus-within {
  border-color: var(--border-hot);
  transform: translateY(-2px);
}

.item-card-visual {
  aspect-ratio: 1;
  align-self: start;
  min-height: 0;
  overflow: hidden;
  border-right: 1px solid rgba(183, 232, 218, 0.14);
  background: radial-gradient(circle, rgba(101, 237, 224, 0.1), rgba(2, 10, 14, 0.94));
}

.item-card-copy {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 7px;
  padding: 11px 12px;
}

.item-card-copy h3 {
  overflow: hidden;
  margin: 0;
  color: var(--cream);
  font: 500 1.02rem Georgia, serif;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-card-copy p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.material-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.material-badges span {
  padding: 3px 6px;
  border: 1px solid rgba(183, 232, 218, 0.16);
  border-radius: 999px;
  color: var(--muted-2);
  background: rgba(1, 11, 15, 0.48);
  font-size: 0.55rem;
  font-weight: 800;
}

.item-actions {
  position: relative;
  z-index: 2;
  display: flex;
  margin-top: auto;
}

.item-actions a {
  min-height: 30px;
  padding: 6px 8px;
  border: 1px solid rgba(244, 193, 90, 0.3);
  border-radius: 4px;
  color: var(--gold);
  font-size: 0.62rem;
  font-weight: 900;
  text-decoration: none;
}

.material-start,
.material-results > .empty-results {
  display: grid;
  min-height: 180px;
  place-items: center;
  border: 1px dashed rgba(183, 232, 218, 0.2);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(3, 17, 22, 0.56);
}

.material-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 0 3px;
  color: var(--muted-2);
  font: 700 0.66rem var(--mono);
}

.material-more button {
  min-height: 38px;
  padding: 7px 13px;
  border: 1px solid rgba(101, 237, 224, 0.35);
  border-radius: 5px;
  color: var(--teal);
  background: rgba(101, 237, 224, 0.07);
  font-size: 0.7rem;
  font-weight: 900;
}

.item-card-title {
  border-bottom: 1px dotted rgba(101, 237, 224, 0.56);
  color: inherit;
  text-decoration: none;
}

.item-card-title:hover {
  color: var(--gold);
}

.item-actions {
  flex-wrap: wrap;
  gap: 6px;
}

.item-actions a {
  display: inline-grid;
  place-items: center;
}

.item-actions .item-card-primary {
  border-color: rgba(101, 237, 224, 0.34);
  color: var(--teal);
  background: rgba(101, 237, 224, 0.05);
}

.material-detail {
  min-width: 0;
}

.material-profile {
  display: grid;
  grid-template-columns: minmax(190px, 270px) minmax(0, 1fr);
  align-items: center;
  gap: clamp(22px, 4vw, 52px);
  overflow: hidden;
  padding: clamp(20px, 3.5vw, 42px);
  border: 1px solid rgba(244, 193, 90, 0.3);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 88% 10%, rgba(244, 193, 90, 0.13), transparent 32%),
    radial-gradient(circle at 8% 90%, rgba(101, 237, 224, 0.1), transparent 35%),
    linear-gradient(118deg, rgba(8, 36, 45, 0.98), rgba(4, 17, 24, 0.97));
  box-shadow: var(--shadow);
}

.material-profile-visual {
  aspect-ratio: 1;
  overflow: hidden;
  border: 1px solid rgba(244, 193, 90, 0.42);
  border-radius: 10px;
  background: radial-gradient(circle, rgba(101, 237, 224, 0.12), rgba(1, 9, 13, 0.96));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
}

.material-profile-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.material-profile-copy {
  min-width: 0;
}

.material-profile-copy h1 {
  margin: 5px 0 10px;
  color: var(--cream);
  font: 500 clamp(2.4rem, 5vw, 4.8rem)/0.98 Georgia, "Times New Roman", serif;
}


.material-profile-description {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(0.88rem, 1.4vw, 1.04rem);
  line-height: 1.65;
}

.material-profile-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.material-profile-badges a,
.material-profile-badges span {
  padding: 5px 9px;
  border: 1px solid rgba(101, 237, 224, 0.25);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(1, 13, 17, 0.46);
  font-size: 0.65rem;
  font-weight: 900;
  text-decoration: none;
}

.material-profile-badges a:hover {
  border-color: rgba(244, 193, 90, 0.58);
  color: var(--gold);
}

.material-profile-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 680px;
  margin: 18px 0 0;
}

.material-profile-stats > div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid rgba(183, 232, 218, 0.16);
  border-radius: 6px;
  background: rgba(1, 11, 15, 0.52);
}

.material-profile-stats dt {
  color: var(--muted-2);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.material-profile-stats dd {
  margin: 4px 0 0;
  color: var(--cream);
  font: 800 0.76rem var(--mono);
}

.material-profile-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 18px;
}

.material-profile-actions .secondary-action,
.material-profile-actions .forge-action {
  display: inline-grid;
  width: auto;
  min-width: 160px;
  min-height: 44px;
  margin: 0;
  padding: 9px 15px;
  place-items: center;
  text-decoration: none;
}

.material-relation-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.72fr) minmax(0, 1.55fr);
  align-items: start;
  gap: 13px;
  margin-top: 13px;
}

.material-relation-panel {
  min-width: 0;
  padding: 17px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(5, 22, 29, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.25);
}

.relationship-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(183, 232, 218, 0.13);
}

.relationship-heading h2 {
  margin: 2px 0 0;
  color: var(--cream);
  font: 500 clamp(1.45rem, 3vw, 2rem) Georgia, serif;
}

.relationship-heading > span,
.station-relation-heading > span {
  display: grid;
  min-width: 30px;
  height: 30px;
  padding: 0 8px;
  place-items: center;
  border: 1px solid rgba(101, 237, 224, 0.28);
  border-radius: 999px;
  color: var(--teal);
  background: rgba(2, 17, 22, 0.72);
  font: 800 0.65rem var(--mono);
}

.relationship-intro {
  margin: 11px 0 14px;
  color: var(--muted-2);
  font-size: 0.72rem;
  line-height: 1.5;
}

.relationship-empty {
  margin: 0;
  padding: 18px;
  border: 1px dashed rgba(183, 232, 218, 0.2);
  border-radius: 6px;
  color: var(--muted);
  background: rgba(1, 11, 15, 0.38);
  line-height: 1.5;
  text-align: center;
}

.producer-recipe-list,
.producer-ingredient-sets {
  display: grid;
  gap: 10px;
}

.producer-recipe-card {
  padding: 13px;
  border: 1px solid rgba(183, 232, 218, 0.17);
  border-radius: 7px;
  background: rgba(1, 13, 18, 0.58);
}

.producer-recipe-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.producer-recipe-card h3,
.relation-card-copy h4 {
  margin: 3px 0 0;
  color: var(--cream);
  font: 500 1.02rem/1.2 Georgia, serif;
}

.producer-recipe-card h3 a,
.relation-card-copy h4 a {
  text-decoration: none;
}

.producer-recipe-card h3 a:hover,
.relation-card-copy h4 a:hover {
  color: var(--gold);
}

.producer-recipe-card > header > strong {
  flex: 0 0 auto;
  max-width: 50%;
  overflow-wrap: anywhere;
  color: var(--gold);
  font: 800 0.65rem var(--mono);
  text-align: right;
}

.producer-ingredient-set h4 {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.producer-ingredient-set ul,
.relation-match-list {
  display: grid;
  gap: 6px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.producer-ingredient-set li,
.relation-match-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 8px 9px;
  border: 1px solid rgba(183, 232, 218, 0.12);
  border-radius: 5px;
  background: rgba(1, 9, 13, 0.52);
}

.producer-ingredient-set li > span,
.relation-match-list li > span {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.producer-ingredient-set li small,
.relation-match-list li strong {
  color: var(--muted-2);
  font-size: 0.56rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.producer-ingredient-set li a,
.producer-ingredient-set li strong {
  overflow-wrap: anywhere;
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 800;
}

.producer-ingredient-set li b,
.relation-match-list li b {
  color: var(--gold);
  font: 800 0.61rem var(--mono);
  white-space: nowrap;
}

.relation-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.relation-actions a {
  min-height: 30px;
  padding: 6px 9px;
  border: 1px solid rgba(101, 237, 224, 0.25);
  border-radius: 4px;
  color: var(--teal);
  font-size: 0.61rem;
  font-weight: 900;
  text-decoration: none;
}

.station-relation-group + .station-relation-group {
  margin-top: 15px;
}

.station-relation-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.station-relation-heading h3 {
  margin: 0;
  color: var(--teal);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.station-relation-heading > span {
  height: 24px;
  min-width: 24px;
  font-size: 0.58rem;
}

.consumer-recipe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px;
}

.relation-recipe-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(183, 232, 218, 0.16);
  border-radius: 7px;
  background: rgba(1, 13, 18, 0.62);
}

.relation-card-image-wrap {
  min-height: 100%;
  overflow: hidden;
  border-right: 1px solid rgba(183, 232, 218, 0.13);
  background: radial-gradient(circle, rgba(101, 237, 224, 0.1), rgba(1, 8, 12, 0.94));
}

.relation-card-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 76px;
  object-fit: cover;
}

.relation-card-copy {
  min-width: 0;
  padding: 10px;
}

.relation-card-copy h4 {
  font-size: 0.98rem;
}

.relation-output {
  margin: 5px 0 8px;
  color: var(--muted-2);
  font-size: 0.62rem;
}

.relation-output strong {
  color: var(--gold);
  font-family: var(--mono);
}

.relation-match-list li {
  padding: 6px 7px;
}

.relation-match-list li small {
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.35;
}

.relationship-overflow {
  margin-top: 9px;
  border-top: 1px solid rgba(183, 232, 218, 0.12);
}

.relationship-overflow > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 3px;
  color: var(--teal);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 900;
}

.relationship-overflow[open] > summary {
  margin-bottom: 8px;
}

.material-chain {
  margin-top: 13px;
  border: 1px solid rgba(244, 193, 90, 0.25);
  border-radius: var(--radius);
  background: rgba(5, 21, 28, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.material-chain > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 15px 18px;
  color: var(--cream);
  cursor: pointer;
  list-style: none;
}
.material-chain > summary::-webkit-details-marker {
  display: none;
}

.material-chain > summary::after {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  flex: 0 0 28px;
  border: 1px solid rgba(244, 193, 90, 0.34);
  border-radius: 50%;
  color: var(--gold);
  content: "+";
  font: 900 1rem var(--mono);
}

.material-chain[open] > summary::after {
  content: "-";
}


.material-chain > summary > span {
  display: inline-grid;
  gap: 3px;
  margin-right: auto;
}

.material-chain > summary small {
  color: var(--teal);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.material-chain > summary strong {
  font: 500 1.22rem Georgia, serif;
}

.material-chain > summary > b {
  flex: 0 0 auto;
  color: var(--gold);
  font: 800 0.68rem var(--mono);
}

.material-chain[open] > summary {
  border-bottom: 1px solid rgba(183, 232, 218, 0.13);
}

.material-chain-body {
  padding: 16px;
}

.chain-step + .chain-step {
  margin-top: 18px;
}

.chain-step > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--teal);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.chain-step > header strong {
  color: var(--muted-2);
  font: 700 0.61rem var(--mono);
  letter-spacing: 0;
  text-transform: none;
}

.chain-rows {
  display: grid;
  gap: 7px;
}

.chain-row {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 18px minmax(150px, 0.8fr) 18px minmax(170px, 0.9fr);
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(183, 232, 218, 0.14);
  border-radius: 6px;
  background: rgba(1, 11, 15, 0.5);
}

.chain-inputs,
.chain-recipe,
.chain-output {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.chain-inputs > small,
.chain-recipe > small,
.chain-output > small {
  color: var(--muted-2);
  font-size: 0.54rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.chain-inputs > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.chain-inputs > span + span {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dotted rgba(183, 232, 218, 0.15);
}

.chain-row a {
  overflow-wrap: anywhere;
  color: var(--teal);
  font-size: 0.72rem;
  font-weight: 800;
}

.chain-inputs em {
  overflow-wrap: anywhere;
  color: var(--muted-2);
  font: 0.56rem/1.35 var(--mono);
  font-style: normal;
}

.chain-output strong {
  overflow-wrap: anywhere;
  color: var(--gold);
  font: 800 0.64rem/1.35 var(--mono);
}

.chain-arrow {
  color: rgba(244, 193, 90, 0.48);
  font-style: normal;
  text-align: center;
}

.material-missing {
  display: grid;
  min-height: 360px;
  padding: 32px;
  place-items: center;
  align-content: center;
  gap: 9px;
  text-align: center;
}

.material-missing h1 {
  margin: 0;
  color: var(--cream);
  font: 500 2rem Georgia, serif;
}

.material-missing p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.material-missing a {
  min-height: 42px;
  margin-top: 8px;
  padding: 10px 14px;
  border: 1px solid rgba(101, 237, 224, 0.3);
  border-radius: 5px;
  color: var(--teal);
  font-weight: 900;
  text-decoration: none;
}

@media (max-width: 1180px) {
  .material-relation-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .material-profile {
    grid-template-columns: minmax(140px, 190px) minmax(0, 1fr);
    gap: 18px;
  }

  .material-profile-copy h1 {
    font-size: clamp(2rem, 8vw, 3rem);
  }

  .consumer-recipe-grid {
    grid-template-columns: 1fr;
  }

  .chain-row {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .chain-arrow {
    display: none;
  }
}

@media (max-width: 620px) {
  .material-detail {
    padding-bottom: 76px;
  }

  .material-profile {
    grid-template-columns: 1fr;
    padding: 17px;
  }

  .material-profile-visual {
    width: min(150px, 54vw);
    justify-self: center;
  }

  .material-profile-copy {
    text-align: center;
  }

  .material-profile-copy h1 {
    overflow-wrap: anywhere;
  }

  .material-profile-badges,
  .material-profile-actions {
    justify-content: center;
  }

  .material-profile-stats {
    max-width: none;
  }

  .material-profile-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .material-profile-actions .secondary-action,
  .material-profile-actions .forge-action {
    width: 100%;
  }

  .material-relation-panel,
  .material-chain-body {
    padding: 13px;
  }

  .producer-recipe-card > header {
    display: grid;
  }

  .producer-recipe-card > header > strong {
    text-align: left;
  }

  .relation-recipe-card {
    grid-template-columns: 68px minmax(0, 1fr);
  }

  .relation-card-image {
    min-height: 68px;
  }

  .material-chain > summary {
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 7px 12px;
    padding: 14px;
  }

  .material-chain > summary > b {
    margin-left: 18px;
  }

  .relation-actions a,
  .item-actions a {
    display: inline-grid;
    min-height: 44px;
    place-items: center;
  }
}
@media (max-width: 1080px) {
  .material-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-controls .clear-filters {
    grid-column: 1 / -1;
  }
}

@media (max-width: 620px) {
  .material-heading {
    padding: 17px;
  }

  .material-controls {
    grid-template-columns: 1fr;
  }

  .material-controls .clear-filters {
    grid-column: auto;
  }

  .material-results .item-grid {
    grid-template-columns: 1fr;
  }

  .material-results .item-card {
    min-height: 132px;
    grid-template-columns: 88px minmax(0, 1fr);
  }

  .detail-actions {
    grid-template-columns: 1fr;
  }
}
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  max-width: 1766px;
  margin: 20px auto 0;
  padding: 18px 22px 26px;
  border-top: 1px solid rgba(183, 232, 218, 0.13);
  color: var(--muted-2);
  font-size: 0.7rem;
}

.site-footer span {
  color: var(--teal);
  font-weight: 900;
  text-transform: uppercase;
}

.site-footer p {
  margin: 0;
}

@media (max-width: 1050px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }


  .data-status {
    grid-column: 2;
  }

  .recipe-layout {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 350px);
  }
}

@media (max-width: 820px) {
  .site-header {
    position: static;
    grid-template-columns: 1fr;
    padding: 12px 14px;
  }

  .brand,
  .data-status {
    justify-self: stretch;
  }

  .data-status {
    grid-column: auto;
    text-align: center;
  }


  #mainContent {
    padding: 10px;
  }

  .hero-orbit {
    right: -46px;
    opacity: 0.5;
  }

  .recipe-controls {
    grid-template-columns: 1fr 1fr;
  }

  .clear-filters {
    grid-column: 1 / -1;
  }

  .recipe-layout {
    display: flex;
    flex-direction: column;
  }

  .recipe-results-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .recipe-detail {
    position: static;
    order: 0;
    width: 100%;
    max-height: none;
  }

  .recipe-detail.has-selection {
    order: -1;
  }


}

@media (max-width: 520px) {
  .brand strong {
    font-size: 0.82rem;
  }

  .brand small {
    font-size: 0.64rem;
  }


  .page-hero {
    min-height: 0;
    padding: 23px 17px;
  }

  .page-hero h1 {
    font-size: 2.25rem;
  }

  .hero-orbit {
    display: none;
  }

  .recipe-controls {
    grid-template-columns: 1fr;
  }

  .clear-filters {
    grid-column: auto;
  }

  .recipe-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .recipe-pagination {
    width: 100%;
    flex-wrap: wrap;
  }

  .pagination-step {
    flex: 1;
  }

  .item-grid {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .recipe-card-copy {
    min-height: 96px;
    padding: 10px;
  }

  .recipe-card-copy strong {
    font-size: 0.98rem;
  }


  .detail-hero {
    grid-template-columns: 84px minmax(0, 1fr);
  }

  .detail-hero h2 {
    font-size: 1.35rem;
  }

  .ingredient-row {
    grid-template-columns: 1fr;
  }

  .ingredient-row > b {
    white-space: normal;
  }



  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding-inline: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

.item-card-title::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
