/* base.css — theme-agnostic layout & components.
   Reads design tokens (--bg-0, --text-0, --accent, etc.) defined per-theme
   in theme-terminal.css / theme-editorial.css. */

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

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-0);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-2); }

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 32px 20px 80px;
}

/* header */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}
.page-header h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  color: var(--text-0);
}

/* theme toggle */
.theme-toggle {
  display: flex;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
}
.theme-toggle button {
  background: var(--bg-2);
  border: 0;
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 7px 12px;
  cursor: pointer;
  transition: background .12s, color .12s;
}
.theme-toggle button + button { border-left: 1px solid var(--border-2); }
.theme-toggle button:hover { color: var(--text-0); background: var(--bg-3); }
.theme-toggle button.active {
  background: color-mix(in oklab, var(--accent) 16%, var(--bg-2));
  color: var(--accent);
}

/* dropzone */
.dropzone {
  border: 1.5px dashed var(--border-2);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.dropzone:hover, .dropzone.drag-over {
  border-color: var(--accent);
  background: color-mix(in oklab, var(--accent) 6%, var(--bg-1));
}
.dropzone .dz-title {
  font-family: var(--font-heading);
  font-size: 18px;
  color: var(--text-0);
  margin: 0 0 6px;
}
.dropzone .dz-sub {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 16px;
}
.dropzone input[type=file] { display: none; }

.dz-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  border: 1px solid var(--border-2);
  background: var(--bg-2);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .12s;
}
.btn:hover { background: var(--bg-3); border-color: var(--border-3); color: var(--text-0); }
.btn.primary {
  background: color-mix(in oklab, var(--accent) 16%, var(--bg-2));
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border-2));
  color: var(--accent);
}
.btn.primary:hover { background: color-mix(in oklab, var(--accent) 26%, var(--bg-2)); }
.btn.link {
  background: transparent;
  border-color: transparent;
  color: var(--accent-2);
  padding: 8px 4px;
}

/* Sits under the h1 in the page header, where the subtitle used to be. */
.privacy-note {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-3);
}
.privacy-note b { color: var(--text-2); }

/* status line */
.status {
  display: none;
  margin-top: 14px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-2);
  background: var(--bg-1);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-2);
}
.status.visible { display: block; }
.status.ok { color: var(--green); border-color: color-mix(in oklab, var(--green) 35%, var(--border-2)); }
.status.error { color: var(--red); border-color: color-mix(in oklab, var(--red) 35%, var(--border-2)); }

/* report */
.report { margin-top: 32px; display: none; }
.report.visible { display: block; }

.report-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border-1);
}
.totals { display: flex; gap: 36px; flex-wrap: wrap; align-items: flex-end; }
.report-header .grand-total-label {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 2px;
}
.report-header .grand-total {
  font-family: var(--font-heading);
  font-size: 36px;
  font-weight: 700;
  color: var(--text-0);
  line-height: 1.05;
}
.total-block.secondary .grand-total { font-size: 24px; color: var(--text-1); }
.report-header .grand-total .gp { font-size: 0.55em; color: var(--text-2); font-weight: 500; margin-left: 5px; }
.total-note {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--gold);
  margin-top: 3px;
}
.report-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.report-meta .warn { color: var(--gold); }

.report-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin: -6px 0 14px;
}
.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}
.source-strip:empty { display: none; }
.source-strip .src b {
  color: var(--text-2);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10.5px;
  margin-right: 5px;
}

.src-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-3);
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 6px;
  white-space: nowrap;
}

.category {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  margin-bottom: 10px;
  overflow: hidden;
}
.category-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.category-head:hover { background: var(--bg-2); }
.category-name {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--text-0);
  flex: none;
  min-width: 130px;
}
.category-bar {
  flex: 1;
  min-width: 80px;
  height: 12px;
  border-radius: 2px;
  background: var(--bg-3);
  border: 1px solid var(--border-1);
  overflow: hidden;
}
/* Width is the category's share of the grand total: 50% of the bank fills
   half the track. */
.category-bar-fill {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 1px;
  transition: width .2s ease;
}
.category-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  min-width: 42px;
  text-align: right;
}
.category-total {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-0);
  min-width: 110px;
  text-align: right;
}
.category-caret {
  font-size: 11px;
  color: var(--text-3);
  transition: transform .12s;
  flex: none;
}
.category.open .category-caret { transform: rotate(90deg); }

.category-items { display: none; border-top: 1px solid var(--border-1); }
.category.open .category-items { display: block; }

.item-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 8px 24px;
  font-size: 13.5px;
}
.item-row + .item-row { border-top: 1px solid var(--border-1); }
.item-name { color: var(--text-1); flex: 1; }
.item-qty {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  min-width: 70px;
  text-align: right;
}
.item-unit {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  min-width: 90px;
  text-align: right;
}
.item-total {
  font-family: var(--font-mono);
  font-size: 13.5px;
  color: var(--text-0);
  min-width: 100px;
  text-align: right;
}

.tier-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 6px;
  border-radius: 3px;
  flex: none;
  min-width: 74px;
  text-align: center;
}
.tier-market { color: var(--green); background: color-mix(in oklab, var(--green) 16%, transparent); }
.tier-bid { color: var(--blue); background: color-mix(in oklab, var(--blue) 16%, transparent); }
.tier-ask { color: var(--gold); background: color-mix(in oklab, var(--gold) 18%, transparent); }
.tier-dose { color: var(--blue); background: color-mix(in oklab, var(--blue) 14%, transparent); }
.tier-cloth { color: var(--blue); background: color-mix(in oklab, var(--blue) 14%, transparent); }
.tier-stale { color: var(--text-2); background: var(--bg-3); }
.tier-charge { color: var(--blue); background: color-mix(in oklab, var(--blue) 14%, transparent); }
.tier-enchant { color: var(--blue); background: color-mix(in oklab, var(--blue) 14%, transparent); }
.tier-fixed { color: var(--teal); background: color-mix(in oklab, var(--teal) 16%, transparent); }
.tier-noted { color: var(--text-2); background: var(--bg-3); }
.tier-alch { color: var(--gold); background: color-mix(in oklab, var(--gold) 16%, transparent); }
.tier-unfinished { color: var(--green); background: color-mix(in oklab, var(--green) 12%, transparent); }
.tier-recipe { color: var(--green); background: color-mix(in oklab, var(--green) 12%, transparent); }
.tier-bulk { color: var(--gold); background: color-mix(in oklab, var(--gold) 16%, transparent); }
.tier-capped { color: var(--gold); background: color-mix(in oklab, var(--gold) 16%, transparent); }
.tier-junk { color: var(--text-3); background: var(--bg-3); }
.tier-vendor { color: var(--text-3); background: var(--bg-3); }
.tier-untradeable { color: var(--text-3); background: var(--bg-3); }
.tier-unknown { color: var(--red); background: color-mix(in oklab, var(--red) 14%, transparent); }

.category-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  min-width: 26px;
  text-align: right;
  flex: none;
}
.category.is-rare .category-bar-fill { background: var(--gold); }
.category.is-rare .category-name { color: var(--gold); }

.unpriced-panel {
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  font-size: 13px;
  color: var(--text-2);
}
.unpriced-panel h3 {
  font-family: var(--font-heading);
  font-size: 14px;
  color: var(--text-0);
  margin: 0 0 8px;
}
.unpriced-panel ul { margin: 0; padding-left: 18px; }
.unpriced-panel li { margin-bottom: 3px; }

footer.site-footer {
  margin-top: 48px;
  padding-top: 20px;
  border-top: 1px solid var(--border-1);
  font-size: 12px;
  color: var(--text-3);
  text-align: center;
}

@media (max-width: 640px) {
  .wrap { padding: 20px 14px 60px; }
  .page-header { flex-direction: column; }
  .page-header h1 { font-size: 22px; }
  .totals { gap: 18px; }
  .report-header .grand-total { font-size: 26px; }
  .total-block.secondary .grand-total { font-size: 19px; }
  .category-name { min-width: 0; flex: 1; font-size: 14px; }
  .category-bar, .category-count { display: none; }
  .category-total { min-width: 0; }
  .item-unit { display: none; }
  .tier-badge { min-width: 0; }
}

.caveat {
  margin: 0 0 18px;
  padding: 10px 14px;
  border-left: 3px solid var(--gold);
  background: color-mix(in oklab, var(--gold) 7%, var(--bg-1));
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: 12.5px;
  color: var(--text-2);
}
.caveat b { color: var(--gold); }

/* untradeable rows are hidden by default — they're worth 0 and just add noise */
.item-row.is-hidden-row { display: none; }
.report.show-untradeable .item-row.is-hidden-row { display: flex; opacity: 0.7; }

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--accent-2);
  cursor: pointer;
  text-decoration: underline dotted;
}
.linkish:hover { color: var(--accent); }

.dose-equiv {
  display: block;
  font-size: 10.5px;
  opacity: 0.75;
}

.variant-note {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  margin-left: 6px;
}

.category-controls {
  display: flex;
  gap: 8px;
  margin: 0;
  margin-left: auto;   /* right edge of the toolbar, even with no source strip */
}
.btn.tiny {
  font-size: 10.5px;
  padding: 4px 9px;
  letter-spacing: 0.04em;
}

/* ---------------------------------------------------------------------------
   tabs — Value / XP. Two framings of the same parse, so the strip only
   appears once there is something to frame.
   --------------------------------------------------------------------------- */
.tabs {
  display: none;
  gap: 2px;
  margin-top: 28px;
  border-bottom: 1px solid var(--border-1);
}
.tabs.visible { display: flex; }
.tabs button {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-2);
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.tabs button:hover { color: var(--text-0); }
.tabs button.active {
  color: var(--text-0);
  border-bottom-color: var(--accent);
}
.tabs .tab-sub {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-3);
  margin-left: 6px;
}
.tabs button.active .tab-sub { color: var(--text-2); }

/* the report panes sit directly under the strip */
.tabs.visible ~ .report { margin-top: 24px; }
.report[hidden] { display: none; }

/* ---------------------------------------------------------------------------
   banked XP
   --------------------------------------------------------------------------- */
.xp-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-1);
}
.xp-lede {
  max-width: 60ch;
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
}
.xp-lede b { color: var(--text-1); }
.xp-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
}
.xp-toggle input { accent-color: var(--accent); cursor: pointer; }
.xp-meta {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
  margin: 12px 0 16px;
}
.xp-meta .warn { color: var(--gold); }

.xp-skill {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  background: var(--bg-1);
  margin-bottom: 10px;
  overflow: hidden;
}
.xp-skill-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}
.xp-skill-head:hover { background: var(--bg-2); }
.xp-skill .category-caret {
  color: var(--text-3);
  transition: transform .15s;
  flex-shrink: 0;
}
.xp-skill.open .category-caret { transform: rotate(90deg); }
.xp-skill-name {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 600;
  color: var(--text-0);
  flex-shrink: 0;
}
.xp-level {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  flex-shrink: 0;
}
.xp-level b { color: var(--green); }
.xp-level .arrow { color: var(--text-3); }
.xp-level-note, .xp-level-unknown {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
}
.xp-skill-total {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-0);
  text-align: right;
  min-width: 116px;
  flex-shrink: 0;
}
.xp-skill-total .unit {
  font-size: 10px;
  color: var(--text-3);
  margin-left: 4px;
}

.xp-skill-body { display: none; padding: 0 16px 14px; }
.xp-skill.open .xp-skill-body { display: block; }

.xp-gp {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-2);
  padding: 10px 0 12px;
  border-top: 1px solid var(--border-1);
}
.xp-gp b { color: var(--text-1); font-weight: 500; }
.xp-gp .arrow { color: var(--text-3); }
.xp-gp-delta { margin-left: auto; }
.xp-gp-delta.up { color: var(--green); }
.xp-gp-delta.down { color: var(--gold); }

.xp-caveat, .xp-contested, .xp-tools {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  border-left: 2px solid var(--border-3);
  padding: 7px 0 7px 11px;
  margin: 12px 0 0;
}
.xp-caveat { border-left-color: var(--gold); }
.xp-contested { border-left-color: var(--accent); }
.xp-contested b, .xp-tools b { color: var(--text-1); font-weight: 500; }
.xp-contested .rival { color: var(--text-3); }

.xp-step {
  display: grid;
  grid-template-columns: 1fr auto 78px 104px;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-1);
  font-size: 13px;
}
.xp-step:last-child { border-bottom: 0; }
.xp-step.is-above { opacity: 0.62; }
.xp-step-label { color: var(--text-1); }
.xp-step-times, .xp-step-each {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  text-align: right;
}
.xp-step-total {
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--text-0);
  text-align: right;
}
.xp-step-note {
  grid-column: 1 / -1;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-3);
  padding-bottom: 2px;
}
.xp-badge {
  font-family: var(--font-mono);
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 4px;
  margin-left: 7px;
  white-space: nowrap;
}
.xp-badge.above { color: var(--gold); border-color: color-mix(in oklab, var(--gold) 35%, var(--border-2)); }
.xp-badge.chance { color: var(--text-3); }

.xp-more { margin: 10px 0 0; }
.xp-empty { padding: 28px 0; }
.xp-empty h3 {
  font-family: var(--font-heading);
  font-size: 17px;
  color: var(--text-0);
  margin: 0 0 8px;
}
.xp-empty p { max-width: 62ch; color: var(--text-2); font-size: 13.5px; margin: 0; }

@media (max-width: 640px) {
  .xp-step { grid-template-columns: 1fr auto 92px; }
  .xp-step-each { display: none; }
  .xp-skill-head { flex-wrap: wrap; }
  .xp-skill-head .category-bar { order: 5; flex-basis: 100%; }
}

/* Roads not taken: what the same limiting stock would pay through the recipes
   that lost the tie-break. Wraps, since a runecrafter has nine of them. */
.xp-alts {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding-top: 2px;
}
/* A road not taken is a button: clicking it pins that recipe to the item it
   was measured against and re-runs the walk. Styled to stay a quiet chip
   rather than announce itself as a control in a list of nine of them. */
.xp-alt {
  white-space: nowrap;
  border: 0;
  border-left: 2px solid var(--border-2);
  border-radius: 0;
  background: none;
  font: inherit;
  color: inherit;
  padding: 0 0 0 6px;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.xp-alt:hover, .xp-alt:focus-visible {
  color: var(--text-0);
  border-left-color: var(--accent);
}
.xp-alt:hover b { color: var(--text-0); }
.xp-alt b { color: var(--text-2); font-weight: 500; }
.xp-alt.is-above { opacity: 0.6; }
.xp-alt.is-above i { font-style: normal; color: var(--gold); }
.xp-alt-more { color: var(--text-3); }

/* Shop stock the plan assumes you buy — battlestaves, mostly. Gold, like the
   other "this costs you something" notes. */
.xp-shopping {
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-2);
  border-left: 2px solid var(--gold);
  padding: 7px 0 7px 11px;
  margin: 12px 0 0;
}
.xp-shopping b { color: var(--text-1); font-weight: 500; }
.xp-buy b { color: var(--gold); font-weight: 500; }

/* The "what to make" pickers. */
.xp-choices {
  margin: 14px 0 4px;
  padding: 11px 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.xp-choices-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-2);
  max-width: 78ch;
}
.xp-choices-head b { color: var(--text-1); font-weight: 500; }
.xp-choice-reset {
  margin-left: auto;
  flex: none;
  padding: 4px 9px;
  font-size: 10px;
}
.xp-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 10px;
}
.xp-choice {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 210px;
  flex: 1 1 240px;
}
.xp-choice-item {
  font-family: var(--font-mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.xp-choice-item i { font-style: normal; text-transform: none; letter-spacing: 0; }
.xp-choice select {
  width: 100%;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 5px 7px;
  cursor: pointer;
}
.xp-choice.is-pinned .xp-choice-item { color: var(--accent); }
.xp-choice.is-pinned select { border-color: color-mix(in oklab, var(--accent) 45%, var(--border-2)); }
.xp-choice-delta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  margin-top: 10px;
  color: var(--text-2);
}
.xp-choice-delta b { font-weight: 500; }
.xp-choice-delta.up { color: var(--green); }
.xp-choice-delta.down { color: var(--gold); }

/* An item dropped out of the plan: the control stays, greyed, so there is
   always a way back. */
.xp-choice.is-off .xp-choice-item { color: var(--text-3); text-decoration: line-through; }
.xp-choice.is-off select { color: var(--text-3); border-style: dashed; }
.xp-dropped {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-3);
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
}
.xp-dropped b { color: var(--text-2); font-weight: 500; }

/* Chips you click to take an item out of the plan (or put it back). Quiet
   until hovered — there can be ten of them under one alchemy step. */
.xp-drop-chip, .xp-eat {
  font: inherit;
  color: var(--text-3);
  background: none;
  border: 1px solid var(--border-2);
  border-radius: 3px;
  padding: 1px 5px;
  cursor: pointer;
  white-space: nowrap;
  transition: color .12s, border-color .12s;
}
.xp-drop-chip .x, .xp-eat .x { color: var(--text-3); margin-left: 2px; }
.xp-drop-chip:hover, .xp-eat:hover,
.xp-drop-chip:focus-visible, .xp-eat:focus-visible {
  color: var(--text-0);
  border-color: var(--red);
}
.xp-drop-chip:hover .x, .xp-eat:hover .x { color: var(--red); }
/* Restoring is the friendly direction, so it does not borrow the warning red. */
.xp-drop-chip:hover, .xp-drop-chip:focus-visible { border-color: var(--accent); }
.xp-drop-chip:hover .x { color: var(--accent); }
.xp-eats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 6px;
}
.xp-eat-coins { color: var(--gold); }
.xp-kit b { color: var(--text-2); font-weight: 500; }
.xp-badge.quest { color: var(--violet); border-color: color-mix(in oklab, var(--violet) 35%, var(--border-2)); }
.xp-badge.prep { color: var(--blue); border-color: color-mix(in oklab, var(--blue) 35%, var(--border-2)); }
.xp-fee { color: var(--gold); }

/* How many alchs to cast. The count is the real control over an alchemy plan,
   because the runes — not anything worth alching — are what set it. */
.xp-casts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 14px 0 4px;
  padding: 9px 13px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-2);
}
.xp-casts label { display: flex; align-items: center; gap: 7px; }
.xp-cast-input {
  width: 8em;
  border: 1px solid var(--border-2);
  border-radius: var(--radius-sm);
  background: var(--bg-1);
  color: var(--text-1);
  font-family: var(--font-mono);
  font-size: 11.5px;
  padding: 4px 7px;
}
.xp-casts-of { color: var(--text-3); }
.xp-cast-preset { padding: 3px 8px; font-size: 9.5px; }
.xp-casts-note {
  flex-basis: 100%;
  color: var(--text-3);
  font-size: 10.5px;
  line-height: 1.5;
}
