/* Default game palettes also power shared headers, navigation and entry cards. */
html[data-nexus-game="osrs"][data-nexus-variant="default"] {
  --theme-bg: #172019;
  --theme-surface: #263429;
  --theme-raised: #334438;
  --theme-text: #eee7cf;
  --theme-muted: #c8c3ad;
  --theme-line: #74816c;
  --theme-accent: #e0c384;
  --theme-on-accent: #282419;
}
html[data-nexus-game="ffxiv"][data-nexus-variant="default"] {
  --theme-bg: #f2ede3;
  --theme-surface: #fffaf0;
  --theme-raised: #e9e2d6;
  --theme-text: #423a49;
  --theme-muted: #685d70;
  --theme-line: #aea093;
  --theme-accent: #6d4d75;
  --theme-on-accent: #fff8fb;
}
html[data-nexus-game="eve"][data-nexus-variant="default"] {
  --theme-bg: #0b1521;
  --theme-surface: #142737;
  --theme-raised: #213b4d;
  --theme-text: #e1edf4;
  --theme-muted: #b0c5d2;
  --theme-line: #567283;
  --theme-accent: #91cdf0;
  --theme-on-accent: #112936;
}
html[data-nexus-game="palworld"][data-nexus-variant="default"] {
  --theme-bg: #102b34;
  --theme-surface: #163b43;
  --theme-raised: #254b50;
  --theme-text: #e5f4ec;
  --theme-muted: #b4d4cc;
  --theme-line: #638b82;
  --theme-accent: #90d9cd;
  --theme-on-accent: #123a34;
}
html[data-nexus-game="pokemon-go"][data-nexus-variant="default"] {
  --theme-bg: #f2f4e9;
  --theme-surface: #fffdf3;
  --theme-raised: #e3ebd8;
  --theme-text: #29483b;
  --theme-muted: #53634c;
  --theme-line: #91a184;
  --theme-accent: #315f4b;
  --theme-on-accent: #f6ffec;
}
/* Discovery and navigation own their layout; palette values come from the selected theme. */
.nexus-discovery {
  max-width: 1440px;
  margin: auto;
  color: var(--theme-text);
}
.page:has(.nexus-discovery) {
  max-width: 1504px;
  padding: 0 32px 48px;
}
.discovery-intro {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 48px;
  padding: 64px 0 44px;
}
.discovery-kicker {
  font:
    600 11px/1.5 system-ui,
    sans-serif;
  letter-spacing: 0.16em;
  color: var(--theme-accent);
  margin: 0 0 18px;
}
.nexus-discovery .discovery-intro h1 {
  font:
    500 clamp(42px, 5.5vw, 76px)/1.06 Georgia,
    serif;
  letter-spacing: -0.045em;
  margin: 0 0 24px;
  color: var(--theme-text);
}
.discovery-intro h1 em {
  color: var(--theme-accent);
  font-weight: 400;
}
.nexus-discovery .discovery-lead {
  color: var(--theme-muted);
  font:
    16px/1.8 system-ui,
    sans-serif;
  margin: 0;
}
.discovery-note {
  border-left: 1px solid var(--theme-line);
  padding: 8px 0 8px 32px;
  min-width: 210px;
}
.discovery-note > span {
  color: var(--theme-accent);
  font-size: 32px;
}
.discovery-note p {
  font:
    24px/1.35 Georgia,
    serif;
  margin: 14px 0;
}
.discovery-note small {
  color: var(--theme-muted);
  font:
    13px/1.7 system-ui,
    sans-serif;
}
.discovery-games {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 22px 0;
  border-block: 1px solid var(--theme-line);
  margin-bottom: 32px;
}
.discovery-games > span {
  font: 10px/1.5 system-ui;
  letter-spacing: 0.13em;
  color: var(--theme-muted);
  margin-right: auto;
}
.discovery-games a {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  border: 1px solid var(--theme-line);
  border-radius: 5px;
  color: var(--theme-text);
  font: 13px/1.4 system-ui;
  text-decoration: none;
}
.discovery-games a:hover {
  background: var(--theme-raised);
  border-color: var(--theme-accent);
}
.discovery-sections {
  display: grid;
  gap: 28px;
}
.discovery-game {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  overflow: clip;
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  background: var(--theme-surface);
  scroll-margin-top: 90px;
}
.discovery-art {
  position: relative;
  min-height: 400px;
  background: #111721;
}
.discovery-art > img {
  position: absolute;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.discovery-art:after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 25%,
    #090e18b3 76%,
    #090e18ed
  );
}
.discovery-art-label {
  position: absolute;
  bottom: 32px;
  left: 32px;
  right: 32px;
  z-index: 1;
  color: #fff;
}
.discovery-art-label > span {
  font: 11px/1.5 system-ui;
  letter-spacing: 0.18em;
  color: #e6e9ef;
}
.nexus-discovery .discovery-art-label h2 {
  color: #fff;
  font:
    500 clamp(28px, 3vw, 40px)/1.12 Georgia,
    serif;
  margin: 12px 0 0;
  max-width: 440px;
}
.discovery-copy {
  padding: 36px 40px;
  align-self: center;
}
.discovery-copy .discovery-kicker {
  margin-bottom: 12px;
}
.nexus-discovery .discovery-copy h3 {
  font:
    500 clamp(23px, 2.35vw, 32px)/1.18 Georgia,
    serif;
  letter-spacing: -0.025em;
  color: var(--theme-text);
  margin: 0 0 16px;
}
.discovery-copy > p:not(.discovery-kicker) {
  font: 14px/1.75 system-ui;
  color: var(--theme-muted);
  margin: 0 0 18px;
  max-width: 49ch;
}
.discovery-copy ul {
  padding: 0;
  margin: 0 0 24px;
  list-style: none;
  display: grid;
  gap: 9px;
}
.discovery-copy li {
  font: 13px/1.5 system-ui;
  color: var(--theme-text);
}
.discovery-copy li:before {
  content: "✓";
  color: var(--theme-accent);
  margin-right: 10px;
}
html[data-nexus-tone] .nexus-discovery a.discovery-primary {
  display: inline-flex;
  align-items: center;
  gap: 32px;
  min-height: 46px;
  box-sizing: border-box;
  padding: 12px 20px;
  border-radius: 5px;
  background: var(--theme-accent);
  color: var(--theme-on-accent);
  font: 650 14px/1.5 system-ui;
  text-decoration: none;
}
.discovery-primary:hover {
  filter: brightness(1.08);
}
.discovery-copy nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  margin-top: 18px;
}
.discovery-copy nav a {
  color: var(--theme-muted);
  font: 12px/1.6 system-ui;
  text-underline-offset: 4px;
  padding: 5px 0;
}
.discovery-copy nav a:hover {
  color: var(--theme-text);
}
.discovery-save {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  padding: 56px 8px 20px;
}
.discovery-save h2 {
  font:
    30px/1.2 Georgia,
    serif;
  color: var(--theme-text);
  margin: 0 0 14px;
}
.discovery-save p {
  max-width: 46ch;
  line-height: 1.75;
  color: var(--theme-muted);
}
.discovery-save [data-nexus-continue] {
  padding: 24px;
  border: 1px solid var(--theme-line);
  border-radius: 8px;
}
.hub-welcome > h1 {
  font-size: clamp(30px, 3.4vw, 46px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0 0 16px;
  max-width: 25ch;
}
.hub-task-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.hub-task:hover {
  border-color: var(--theme-accent);
  background: var(--theme-raised);
}
.hub-task > span:not(.hub-task-number) {
  color: var(--theme-muted);
  font: 14px/1.6 system-ui;
}
.hub-task small {
  margin-top: auto;
  padding-top: 8px;
  color: var(--theme-muted);
  font-size: 11px;
}
.game-hub > .work-heading {
  padding-block: 24px;
  border-top: 1px solid var(--theme-line);
}
.game-hub > .work-heading h1 {
  font-size: 24px;
  margin: 0;
}
.game-navigation {
  background: var(--theme-surface);
  border-bottom: 1px solid var(--theme-line);
  color: var(--theme-text);
}
.game-navigation .next-game-nav.next-game-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 8px 26px;
  padding: 0 32px;
  margin: auto;
  max-width: 1504px;
  min-height: 55px;
  background: transparent;
  border: 0;
  box-sizing: border-box;
}
.game-navigation .next-game-nav.next-game-nav > a {
  flex: 0 0 auto;
  margin: 0;
  color: var(--theme-muted);
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  font: 500 13px/1.4 system-ui;
  padding: 3px 0;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  box-sizing: border-box;
}
.game-navigation .next-game-nav.next-game-nav > a[aria-current="page"] {
  color: var(--theme-text);
  border-color: var(--theme-accent);
  font-weight: 700;
}
.game-sections {
  display: none;
}
.nexus-header .nexus-appearance {
  position: relative;
  flex: 0 0 auto;
  margin: 0;
}
.nexus-appearance > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  cursor: pointer;
  min-height: 40px;
  box-sizing: border-box;
  list-style: none;
  font: 20px/1 system-ui;
  color: var(--theme-text);
  border-radius: 5px;
}
.nexus-appearance > summary::-webkit-details-marker {
  display: none;
}
.nexus-appearance > summary > span {
  font: 12px/1.4 system-ui;
}
.nexus-header .nexus-appearance > .nexus-theme {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  padding: 18px;
  z-index: 100;
  min-width: 185px;
  background: var(--theme-surface);
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  box-shadow: 0 12px 32px #0004;
}
.nexus-header .nexus-appearance .nexus-theme select {
  width: 100%;
  max-width: none;
  min-height: 42px;
}
/* Paired surfaces and foregrounds repair the account and GO theme regressions. */
html[data-nexus-tone] body:has(.login.account-entry) {
  background: var(--theme-bg);
  color: var(--theme-text);
}
html[data-nexus-tone] .login.account-entry {
  background: var(--theme-surface);
  color: var(--theme-text);
  border: 1px solid var(--theme-line);
  border-radius: 12px;
  padding: 32px;
}
html[data-nexus-tone] .login.account-entry :is(h1, h2, label, .eyebrow) {
  color: var(--theme-text);
}
html[data-nexus-tone] .login.account-entry :is(p, small) {
  color: var(--theme-muted);
}
html[data-nexus-tone] .login.account-entry a {
  color: var(--theme-accent);
}
html[data-nexus-tone] .login.account-entry input {
  color: var(--theme-text);
  background: var(--theme-bg);
  border: 1px solid var(--theme-line);
}
html[data-nexus-tone] .login.account-entry .primary {
  color: var(--theme-on-accent);
  background: var(--theme-accent);
}
html[data-nexus-tone] .go-app .go-section-heading {
  background: var(--theme-surface);
  color: var(--theme-text);
  border: 1px solid var(--theme-line);
  border-radius: 8px;
  padding: 24px;
}
html[data-nexus-tone] .go-app .go-section-heading :is(h1, h2) {
  color: var(--theme-text);
}
html[data-nexus-tone] .go-app .go-section-heading :is(.go-eyebrow, a) {
  color: var(--theme-accent);
}
.go-app.go-app {
  display: block;
}
.go-app.go-app .go-main {
  margin: auto;
  max-width: 1300px;
  width: 100%;
  box-sizing: border-box;
}
.compact-coverage {
  padding: 12px 16px;
  border: 1px solid var(--theme-line);
  border-radius: 6px;
  margin: 16px 0;
  color: var(--theme-muted);
  font: 13px/1.6 system-ui;
}
.compact-coverage summary {
  cursor: pointer;
  color: var(--theme-text);
}
.compact-coverage p {
  margin-bottom: 0;
}
.compact-coverage a {
  color: var(--theme-accent);
}
.passive-picker {
  border: 1px solid var(--theme-line);
  padding: 16px;
  border-radius: 8px;
  margin: 16px 0;
}
.passive-picker legend {
  padding: 0 6px;
  font-weight: 600;
}
.passive-options {
  display: grid;
  gap: 4px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 12px;
}
.pw-page .passive-options label {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 8px;
  margin: 0;
  font-size: 14px;
}
.pw-page .passive-options input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
}
.passive-selected {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-block: 10px;
}
.passive-selected button {
  font-size: 12px;
  min-height: 36px;
}
.crafting-options {
  border: 1px solid var(--theme-line);
  padding: 16px;
  border-radius: 8px;
}
.crafting-options summary {
  cursor: pointer;
  font-weight: 600;
}
.crafting-options .form-grid {
  margin-top: 18px;
}
@media (max-width: 900px) {
  .discovery-copy {
    padding: 28px;
  }
  .discovery-games > span {
    width: 100%;
    margin-bottom: 8px;
  }
}
@media (max-width: 760px) {
  .page:has(.nexus-discovery) {
    padding: 0 16px 32px;
  }
  .discovery-intro {
    padding: 36px 4px 28px;
    gap: 0;
  }
  .discovery-note {
    display: none;
  }
  .nexus-discovery .discovery-intro h1 {
    font-size: 48px;
  }
  .nexus-discovery .discovery-lead {
    font-size: 14px;
  }
  .discovery-lead br {
    display: none;
  }
  .discovery-games {
    gap: 8px;
    margin-bottom: 24px;
    padding: 18px 0;
  }
  .discovery-games a {
    padding: 10px 12px;
    font-size: 12px;
    min-height: 44px;
    box-sizing: border-box;
  }
  .discovery-game {
    grid-template-columns: 1fr;
  }
  .discovery-art {
    min-height: 220px;
  }
  .discovery-art-label {
    bottom: 24px;
    left: 24px;
    right: 24px;
  }
  .discovery-copy {
    padding: 24px;
  }
  .discovery-copy h3 {
    font-size: 27px;
  }
  .discovery-save {
    grid-template-columns: 1fr;
    gap: 16px;
    padding-top: 40px;
  }
  .hub-task {
    display: grid;
    grid-template-columns: 24px 1fr;
    gap: 8px 12px;
    padding: 18px;
  }
  .hub-task > span:not(.hub-task-number),
  .hub-task small {
    padding: 0;
  }
  .game-navigation .next-game-nav.next-game-nav {
    display: none;
  }
  .game-sections {
    display: block;
    margin: 0;
    padding: 0 16px;
  }
  .game-sections > summary {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    gap: 12px;
    cursor: pointer;
    font: 600 13px/1.5 system-ui;
  }
  .game-sections > summary::-webkit-details-marker {
    display: none;
  }
  .game-sections > summary > span:last-child {
    color: var(--theme-muted);
    font-weight: 400;
  }
  .game-sections nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-bottom: 14px;
  }
  .game-sections nav a {
    padding: 12px;
    min-height: 44px;
    box-sizing: border-box;
    font: 13px/1.5 system-ui;
    text-decoration: none;
    color: var(--theme-text);
    border-radius: 5px;
  }
  .game-sections nav a[aria-current] {
    background: var(--theme-accent);
    color: var(--theme-on-accent);
  }
  .nexus-appearance > summary > span {
    display: none;
  }
  .nexus-header .nexus-appearance > .nexus-theme {
    right: 0;
  }
  .go-app.go-app .go-main {
    padding: 20px 16px;
  }
  .go-app .go-section-heading {
    align-items: flex-start;
    gap: 16px;
  }
  html[data-nexus-tone] .login.account-entry {
    margin: 24px 16px;
    padding: 24px;
    width: auto;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .discovery-games a,
  .discovery-primary {
    transition:
      background-color 0.15s,
      border-color 0.15s;
  }
}

/* Keep the two first decisions visible; advanced settings follow them. */
.workshop-page > .tool-form > fieldset {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.workshop-page .workshop-targets {
  grid-column: 1;
  grid-row: 1 / 4;
}
.workshop-page .workshop-sourcing {
  grid-column: 2;
  grid-row: 1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.workshop-page .workshop-sourcing h2 {
  grid-column: 1 / -1;
  margin-top: 0;
}
.workshop-page .workshop-sourcing :is(label, input, select) {
  min-width: 0;
  width: 100%;
}
.workshop-page .crafting-options {
  grid-column: 2;
  grid-row: 2;
}
.workshop-page .workshop-trays {
  grid-column: 1 / -1;
  grid-row: 4;
}
.workshop-page .workshop-note {
  grid-column: 1 / -1;
  grid-row: 5;
}
.workshop-page .workshop-actions {
  grid-column: 2;
  grid-row: 3;
}
@media (max-width: 800px) {
  .workshop-page .workshop-sourcing {
    grid-template-columns: minmax(0, 1fr);
  }
  .workshop-page > .tool-form > fieldset {
    display: flex;
    flex-direction: column;
  }
  .workshop-page > .tool-form > fieldset > * {
    width: 100%;
    box-sizing: border-box;
  }
}

html[data-nexus-tone] .go-main .go-topline {
  color: var(--theme-muted);
  font-size: 11px;
}
html[data-nexus-tone] .go-main .go-topline label {
  color: var(--theme-muted);
  font-size: 12px;
}
html[data-nexus-tone] .go-main .go-empty {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-line);
}
html[data-nexus-tone] .go-main .go-empty p {
  color: var(--theme-muted);
}
html[data-nexus-tone] .go-main input::placeholder {
  color: var(--theme-muted);
  opacity: 1;
}

.go-main .go-filters > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.go-main .go-filters button {
  min-height: 44px;
}
.go-main .go-topline {
  flex-wrap: wrap;
  gap: 12px;
}
.go-main .go-topline > span {
  white-space: nowrap;
}

.pw-page.page-workspace .pw-hero {
  padding: 20px;
  margin: 0 0 16px;
}
.pw-page.page-workspace .pw-hero .lede {
  margin-bottom: 0;
}
.pw-page .pw-planner-switch {
  margin: 16px 0;
}
.pw-page .pw-planner-switch > summary {
  cursor: pointer;
  padding: 12px 0;
}
.pw-page .pw-calculate {
  margin: 16px 0;
}
.workshop-page .workshop-trays > summary {
  cursor: pointer;
  padding: 12px 0;
}
