:root {
  color-scheme: light dark;
  --bg: #faf7f0;
  --surface: #ffffff;
  --sidebar: #f3eee4;
  --text: #2b2520;
  --muted: #6b6158;
  --border: #e3dccf;
  --accent: #a0612a;
  --accent-soft: #f3e6d6;
  --danger: #c0392b;
  --sidebar-w: 16rem;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1714;
    --surface: #23201c;
    --sidebar: #15130f;
    --text: #ece5da;
    --muted: #a89d90;
    --border: #3a342d;
    --accent: #e0a060;
    --accent-soft: #3a2c1e;
    --danger: #e57368;
  }
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); }
a { color: var(--accent); }
h1, h2 { line-height: 1.25; }
h1 { margin: 0 0 .5rem; }
img { max-width: 100%; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--surface); padding: .5rem; z-index: 10; }

/* ------------------------------------------------------------------------
   App shell: sidebar pinned to the left edge, content column fills the rest,
   footer sits at the bottom of the window when content is short. */
.app { display: grid; grid-template-columns: var(--sidebar-w) minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 1.25rem .75rem; background: var(--sidebar); border-right: 1px solid var(--border);
}
.brand { display: block; padding: 0 .6rem 1rem; margin-bottom: .75rem; border-bottom: 1px solid var(--border); text-decoration: none; color: var(--text); }
.brand-game { display: block; font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.brand-wiki { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.sidebar ul { list-style: none; margin: 0; padding: 0; }
.sidebar nav a { display: block; padding: .35rem .6rem; border-radius: 6px; text-decoration: none; color: var(--text); }
.sidebar nav a:hover { background: var(--accent-soft); }
.sidebar nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.column { display: flex; flex-direction: column; min-width: 0; }
.topbar {
  display: flex; justify-content: flex-end; padding: .75rem 2.5rem;
  border-bottom: 1px solid var(--border); background: var(--surface);
}
.search { display: flex; gap: .4rem; width: min(100%, 28rem); }
.search input { flex: 1; min-width: 0; }
.search input, .search button {
  font: inherit; padding: .4rem .7rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text);
}
.search button { background: var(--accent); border-color: var(--accent); color: #fff; cursor: pointer; }
main { flex: 1; padding: 1.75rem 2.5rem 3rem; }
.site-footer { padding: 1.25rem 2.5rem; color: var(--muted); font-size: .875rem; border-top: 1px solid var(--border); }

@media (max-width: 860px) {
  .app { display: block; }
  .sidebar { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--border); padding: 1rem; }
  .brand { padding: 0 0 .75rem; }
  .sidebar nav ul { display: flex; flex-wrap: wrap; gap: .25rem; }
  .column { min-height: calc(100vh - 1px); }
  .topbar, main, .site-footer { padding-left: 1rem; padding-right: 1rem; }
  .search { width: 100%; }
}

/* ------------------------------------------------------------------------
   Common */
.lede { font-size: 1.1rem; color: var(--muted); margin-top: 0; max-width: 75ch; }
.prose p { max-width: 75ch; }
.empty { color: var(--muted); font-style: italic; }
.summary { font-weight: 400; color: var(--muted); font-size: .875rem; }
.entries .summary { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 60ch; }
.meta { color: var(--muted); font-size: .875rem; margin-top: 2rem; }
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0 0 1rem; font-size: .875rem; color: var(--muted); }
.crumbs li + li::before { content: "›"; margin-right: .4rem; }
.tag { font-size: .75rem; padding: .1rem .45rem; margin-left: .4rem; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.tier-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  padding: .1rem .45rem; border-radius: 4px; border: 1px solid var(--border); white-space: nowrap; margin-left: .4rem;
}
td .tier-badge { margin-left: 0; }
.tier-badge.tier-elite { color: #b8862b; border-color: #d4a24a; }
@media (prefers-color-scheme: dark) { .tier-badge.tier-elite { color: #e8c26a; border-color: #b8913f; } }

/* Rarity colors (guesses at the in-game palette; adjust to match). */
.rarity-common { color: #8f8f8f; }
.rarity-uncommon { color: #4f9a3c; }
.rarity-rare { color: #3a7fc8; }
.rarity-epic { color: #9a5fd0; }
.rarity-legendary { color: #d08a1e; }

/* ------------------------------------------------------------------------
   Home */
.hero h1 { font-size: 2.2rem; margin-bottom: 1.25rem; }
/* Home: the announcement key art behind the title and cards, fading into the page
   background further down. It bleeds to the edges of the content column. */
.home {
  margin: -1.75rem -2.5rem -3rem; padding: 9rem 2.5rem 4rem; min-height: calc(100vh - 4rem);
  background:
    linear-gradient(180deg, rgb(0 0 0 / .05) 0%, rgb(0 0 0 / .12) 35%, color-mix(in srgb, var(--bg) 45%, transparent) 72%, var(--bg) 100%),
    url("/images/home/key-art-1280.webp") center 58% / cover no-repeat;
}
@media (min-width: 1300px), (min-resolution: 1.5dppx) {
  .home { background-image:
    linear-gradient(180deg, rgb(0 0 0 / .05) 0%, rgb(0 0 0 / .12) 35%, color-mix(in srgb, var(--bg) 45%, transparent) 72%, var(--bg) 100%),
    url("/images/home/key-art-2400.webp"); }
}
.home .hero h1 { margin: 0 0 1.75rem; font-size: clamp(2.2rem, 4vw, 3.4rem); color: #fff; text-shadow: 0 2px 14px rgb(0 0 0 / .6), 0 1px 2px rgb(0 0 0 / .5); }
.home .card {
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  border-color: color-mix(in srgb, var(--border) 70%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.home .card:hover { border-color: var(--accent); }
@media (max-width: 860px) { .home { margin: -1.75rem -1rem -3rem; padding: 6rem 1rem 3rem; min-height: 0; } }
.card-grid { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 1rem; }
.card {
  display: block; height: 100%; padding: 1rem 1.1rem; background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; text-decoration: none; color: var(--text);
}
.card:hover { border-color: var(--accent); }
.card h2 { margin: 0 0 .3rem; font-size: 1.1rem; color: var(--accent); }
.count { font-size: .8rem; color: var(--muted); }

/* ------------------------------------------------------------------------
   Category page */
.title-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; }
.filters { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 1.5rem; margin: 0 0 1rem; }
.type-filter { display: flex; align-items: center; gap: .5rem; }
.type-filter label { font-size: .9rem; color: var(--muted); }
.type-filter select, .type-filter button {
  font: inherit; font-size: .9rem; padding: .3rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.tier-filter ul { list-style: none; display: flex; flex-wrap: wrap; gap: .4rem; padding: 0; margin: 0; }
.tier-filter a {
  display: inline-block; padding: .3rem .8rem; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); text-decoration: none; font-size: .9rem;
}
.tier-filter a:hover { border-color: var(--accent); }
.tier-filter a[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tier-filter a[aria-current="true"] .count { color: inherit; opacity: .85; }

.table-wrap { overflow-x: auto; }
table.entries { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--border); }
.entries th, .entries td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.entries thead th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); white-space: nowrap; }
.entries .num { text-align: right; font-variant-numeric: tabular-nums; }
.entries tbody tr:hover { background: var(--accent-soft); }
.name-cell { display: flex; align-items: center; gap: .75rem; }
.thumb { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 6px; object-fit: contain; background: #1c1d1c; border: 1px solid #4a4a4a; }
.thumb-blank { display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: #4a4c4a; }

/* ------------------------------------------------------------------------
   Entry page: text on the left, infobox / item panel on the right. */
.entry { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "main aside"; gap: 1.5rem 2.5rem; align-items: start; }
.entry-title { margin-bottom: 1rem; }
.entry-main { grid-area: main; min-width: 0; }
.entry-main > :first-child { margin-top: 0; }
.entry-aside { grid-area: aside; }
.related ul { padding-left: 1.2rem; }
@media (max-width: 1100px) {
  .entry { grid-template-columns: minmax(0, 1fr); grid-template-areas: "aside" "main"; }
}

.infobox { width: 20rem; max-width: 100%; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.infobox h2 { margin: 0 0 .75rem; font-size: 1.1rem; text-align: center; }
.infobox img { width: 100%; height: auto; border-radius: 6px; margin-bottom: .75rem; }
.infobox-noimg { display: grid; place-items: center; height: 9rem; margin-bottom: .75rem; font-size: 3.5rem; font-weight: 800; color: #3d3f3d; background: #1c1d1c; border: 1px solid var(--border); border-radius: 6px; }
.infobox dl { display: grid; grid-template-columns: auto 1fr; gap: .35rem .75rem; margin: 0; font-size: .925rem; }
.infobox dt { color: var(--muted); }
.infobox dd { margin: 0; }

/* ------------------------------------------------------------------------
   Item panel: mirrors the in-game item tooltip. Always dark, like the game UI. */
.item-panel {
  --ip-bg: #2a2c2a;
  --ip-text: #e4e4e2;
  --ip-muted: #8d8f8c;
  --ip-line: #454845;
  width: 30rem; max-width: 100%;
  color: var(--ip-text); background: linear-gradient(180deg, #303230 0%, var(--ip-bg) 60%, #262826 100%);
  border: 1px solid #1a1b1a; border-radius: 4px; box-shadow: 0 6px 24px rgba(0, 0, 0, .25);
  overflow: hidden;
}
.ip-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1.25rem; padding: 1.5rem 1.5rem 0; align-items: start; }
.ip-icon {
  width: 8rem; height: 8rem; display: grid; place-items: center;
  background: #141514; border: 1.5px solid #b9bab7; border-radius: 6px; overflow: hidden;
}
.ip-icon img { width: 100%; height: 100%; object-fit: contain; }
.ip-noimg { font-size: 2.5rem; font-weight: 800; color: #3d3f3d; }
.ip-title h2 {
  margin: .2rem 0 .6rem; font-size: 1.75rem; line-height: 1.1; font-weight: 900;
  text-transform: uppercase; letter-spacing: .02em; color: #fff;
}
.ip-tags { list-style: none; margin: 0; padding: 0; font-size: .82rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.ip-tags li { margin-bottom: .3rem; }
.ip-tags li::before { content: "•"; margin-right: .45rem; color: var(--ip-text); }
.ip-type { color: #fff; }
.ip-rarity.rarity-common { color: #a9aaa7; }
.ip-tier {
  padding-top: .35rem; border-top: 3px solid #d6d7d4; white-space: nowrap;
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
}
/* Quality tabs above the item card */
.qtabs { width: 30rem; max-width: 100%; }
.qt-radio { position: absolute; opacity: 0; pointer-events: none; }
.qt-bar { display: flex; gap: 2px; }
.qt-bar label {
  flex: 1; padding: .5rem .4rem; text-align: center; cursor: pointer; font-size: .78rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; background: #1a1b1a; border: 1px solid #1a1b1a; border-bottom: 0;
  border-radius: 4px 4px 0 0; opacity: .65;
}
.qt-bar label:hover { opacity: 1; }
.qt-bar .rarity-common { color: #a9aaa7; }
.qt-panel { display: none; }
.qt-panel .item-panel { width: 100%; border-top-left-radius: 0; border-top-right-radius: 0; }
#qt-0:checked ~ .qt-panels > .qt-panel:nth-child(1),
#qt-1:checked ~ .qt-panels > .qt-panel:nth-child(2),
#qt-2:checked ~ .qt-panels > .qt-panel:nth-child(3),
#qt-3:checked ~ .qt-panels > .qt-panel:nth-child(4),
#qt-4:checked ~ .qt-panels > .qt-panel:nth-child(5) { display: block; }
#qt-0:checked ~ .qt-bar > label:nth-child(1),
#qt-1:checked ~ .qt-bar > label:nth-child(2),
#qt-2:checked ~ .qt-bar > label:nth-child(3),
#qt-3:checked ~ .qt-bar > label:nth-child(4),
#qt-4:checked ~ .qt-bar > label:nth-child(5) { opacity: 1; background: #303230; border-color: #303230; }
.qt-radio:focus-visible ~ .qt-bar { outline: 2px solid var(--accent); outline-offset: 2px; }

.ip-tier-elite { color: #e8c26a; border-top-color: #e8c26a; }
.ip-desc { white-space: pre-line; margin: 1.5rem 1.5rem 0; font-size: 1.02rem; line-height: 1.55; color: #d2d3d0; }
.ip-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5rem; margin: 1rem 1.5rem 0; }
.ip-stats div { display: flex; justify-content: space-between; gap: 1rem; padding: .45rem .3rem; border-top: 1px solid var(--ip-line); border-bottom: 1px solid var(--ip-line); margin-top: -1px; }
.ip-stats dt { color: #dcdcda; }
.ip-stats dd { margin: 0; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; text-align: right; }
/* Damage by ammo */
.ip-ammo { margin: 1.1rem 1.5rem 0; }
.ip-sub { margin: 0 0 .35rem; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ip-muted); }
.ip-ammo ul { list-style: none; margin: 0; padding: 0; }
.ip-ammo li > a, .ip-ammo li > span {
  display: grid; grid-template-columns: 2rem minmax(0, 1fr) 5.5rem 3.2rem; align-items: center; gap: .6rem;
  padding: .3rem .3rem; border-top: 1px solid var(--ip-line); border-bottom: 1px solid var(--ip-line); margin-top: -1px;
  color: #dcdcda; text-decoration: none;
}
.ip-ammo li > a:hover { background: #262726; color: #fff; }
.ip-ammo-icon img { width: 2rem; height: 2rem; object-fit: contain; display: block; }
.ip-ammo-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ip-ammo-tier { margin-left: .3rem; font-size: .7rem; font-weight: 800; color: var(--ip-muted); }
.ip-ammo-bar { height: .4rem; background: #2c2d2c; border-radius: 2px; overflow: hidden; }
.ip-ammo-bar span { display: block; height: 100%; background: #c9cac6; }
.ip-ammo-dmg { text-align: right; font-weight: 800; color: #fff; font-variant-numeric: tabular-nums; }
.ip-durability { margin: 1.1rem 1.5rem 0; text-align: center; font-weight: 700; }
.ip-durability span { margin-right: .9rem; font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ip-muted); }
.ip-prices {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .5rem 2.25rem;
  margin-top: 1.5rem; padding: .8rem 1rem; background: #171817; border-top: 1px solid #0f100f;
}
.ip-price { display: flex; align-items: center; gap: .55rem; }
.ip-price-label { font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ip-muted); }
.ip-price .money { font-size: 1.35rem; font-weight: 800; color: #fff; gap: .45rem; }
.ip-price .money img { width: 1.9rem; height: 1.9rem; }
.ip-qty { color: var(--ip-muted); font-weight: 700; }
.item-panel > :last-child:not(.ip-prices) { margin-bottom: 1.5rem; }

/* Amount with currency icon, used in the panel and tables. */
.money { display: inline-flex; align-items: center; gap: .3rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.money img { width: 1.25rem; height: 1.25rem; object-fit: contain; }
@media (max-width: 520px) {
  .ip-head { grid-template-columns: auto 1fr; }
  .ip-tier { grid-column: 1 / -1; justify-self: start; }
  .ip-icon { width: 5.5rem; height: 5.5rem; }
  .ip-title h2 { font-size: 1.35rem; }
  .ip-stats { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------------------
   Search */
.results { list-style: none; padding: 0; max-width: 60rem; }
.results li { padding: .6rem 0; border-bottom: 1px solid var(--border); }
.results-head { margin: 1.8rem 0 .2rem; }
.legacy-results li { display: flex; align-items: center; gap: .8rem; }
.legacy-results .cp-legacy-icon { width: 2.8rem; height: 2.8rem; }

/* ------------------------------------------------------------------------
   Buttons & edit form */
.button, .edit-form button, .history button {
  display: inline-block; font: inherit; font-size: .925rem; padding: .4rem .9rem; border-radius: 6px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); text-decoration: none;
}
.button:hover, .edit-form button:hover, .history button:hover { border-color: var(--accent); }
.edit-form button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }

.edit-form { max-width: 60rem; }
.edit-form fieldset { border: 1px solid var(--border); border-radius: 10px; padding: .75rem 1rem 0; margin: 0 0 1.25rem; }
.edit-form legend { padding: 0 .4rem; font-weight: 600; }
.field { margin-bottom: 1.1rem; }
.field label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field input, .field textarea, .field select {
  width: 100%; font: inherit; padding: .5rem .6rem; border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface); color: var(--text);
}
.field textarea { resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.field.invalid input, .field.invalid textarea, .field.invalid select { border-color: var(--danger); }
.hint { margin: .3rem 0 0; font-size: .85rem; color: var(--muted); }
.field-error { margin: .3rem 0 0; font-size: .875rem; color: var(--danger); font-weight: 600; }
.stat-grid, .field-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 1rem; }
.actions { display: flex; align-items: center; gap: 1rem; margin-top: .5rem; }
.notice { padding: .75rem 1rem; margin: 0 0 1.25rem; border-radius: 8px; background: var(--accent-soft); border: 1px solid var(--accent); max-width: 60rem; }
.notice.error { background: transparent; border-color: var(--danger); color: var(--danger); }
.history form { margin: 0; }

/* ------------------------------------------------------------------------
   Crafting: recipe cards, "used in", "sold by". Dark like the game UI. */
.crafting { margin-top: 2rem; max-width: 56rem; }
.crafting > h2 {
  display: inline-block; margin: 0 0 1rem; padding-bottom: .4rem; font-size: 1.05rem;
  color: var(--accent); border-bottom: 2px solid var(--accent);
}
.recipe-card {
  --rc-gold: #d9b45a;
  position: relative; margin-bottom: 1rem; padding: 1.1rem 1.4rem .9rem; color: #e4e4e2;
  background: linear-gradient(180deg, #252826, #1d1f1d); border: 1px solid #3b3e3b; border-radius: 6px;
}
.recipe-card::before, .recipe-card::after {
  content: ""; position: absolute; width: 14px; height: 14px; border: 2px solid var(--rc-gold);
}
.recipe-card::before { top: 6px; left: 6px; border-right: 0; border-bottom: 0; }
.recipe-card::after { bottom: 6px; right: 6px; border-left: 0; border-top: 0; }
.recipe-card h3 { margin: 0 0 .5rem; font-size: 1.25rem; color: var(--rc-gold); }
.recipe-card h3 a { color: inherit; text-decoration: none; }
.recipe-card h3 a:hover { text-decoration: underline; }
.recipe-card h3 .tier-badge { vertical-align: middle; }
.stations {
  display: inline-block; margin: 0 0 .9rem; padding: .2rem .6rem; font-size: .78rem; font-weight: 800;
  letter-spacing: .05em; text-transform: uppercase; color: var(--rc-gold);
  background: #3a3423; border: 1px solid #7a6a3a; border-radius: 3px;
}
.recipe-flow { display: flex; flex-wrap: wrap; align-items: flex-start; gap: .75rem 1.25rem; }
.recipe-inputs { display: flex; flex-wrap: wrap; gap: .75rem; }
.recipe-arrow { align-self: center; margin-top: -1.4rem; font-size: 1.4rem; color: #8d8f8c; }
.recipe-card footer {
  display: flex; flex-wrap: wrap; gap: .4rem 1.75rem; margin-top: .9rem; padding-top: .7rem;
  border-top: 1px solid #3b3e3b; font-size: .92rem; color: #a3a5a1;
}
.recipe-card footer strong { color: #fff; font-weight: 600; }
.recipe-card footer a { color: var(--rc-gold); }

/* Item tiles */
.slot { display: flex; flex-direction: column; align-items: center; width: 5.25rem; text-align: center; text-decoration: none; color: #cfd0cd; }
a.slot:hover .tile { border-color: #d9b45a; }
a.slot:hover .tile-name { color: #fff; text-decoration: underline; }
.tile {
  position: relative; display: grid; place-items: center; width: 4.5rem; height: 4.5rem;
  background: #121312; border: 1.5px solid #5d605c; border-radius: 6px;
}
.tile img { width: 88%; height: 88%; object-fit: contain; }
.tile-blank { font-size: 1.6rem; font-weight: 800; color: #3d3f3d; }
.tile-output { border-color: #d9b45a; box-shadow: 0 0 0 1px #6f5d2c inset; }
.tile-qty { position: absolute; right: 4px; bottom: 1px; font-weight: 800; font-size: .95rem; color: #fff; text-shadow: 0 1px 2px #000, 0 0 3px #000; }
.tile-tier { position: absolute; right: 4px; top: 2px; font-weight: 800; font-size: .72rem; color: #4fd1c5; text-shadow: 0 1px 2px #000; }
.tile-tier-elite { color: #e8c26a; }
.tile-name { margin-top: .35rem; font-size: .82rem; line-height: 1.25; }
.tile-note { font-size: .72rem; color: #8d8f8c; }
.slot-any { display: flex; flex-direction: column; align-items: center; }
.slot-any .slot { width: 6rem; }
.slot-options { font-size: .75rem; color: #a3a5a1; }
.slot-options summary { cursor: pointer; }
.slot-options ul { margin: .25rem 0 0; padding: .4rem .6rem; list-style: none; background: #121312; border: 1px solid #3b3e3b; border-radius: 4px; text-align: left; }
.slot-options a { color: #d9b45a; }

/* Used in: a grid of result tiles (light/dark aware, outside the dark cards) */
.used-in { display: flex; flex-wrap: wrap; gap: .9rem; margin: 0; padding: 1rem; list-style: none; background: #1d1f1d; border: 1px solid #3b3e3b; border-radius: 6px; }

/* Sold by */
.sold-by .money-item { margin-left: .25rem; font-size: .85rem; }

/* Vendor stock grid */
.stock li { display: flex; flex-direction: column; align-items: center; gap: .2rem; }
.stock-price .money { color: #e4e4e2; font-size: .85rem; }
.stock-price .money-item { display: none; }
.crafting > .tag { vertical-align: top; margin-left: .5rem; }
details.advanced { margin: 0 0 1.25rem; }
details.advanced > summary { cursor: pointer; font-weight: 600; margin-bottom: .75rem; }

/* Repair line on the item card */
.ip-repair { display: grid; grid-template-columns: auto 1fr; gap: .2rem .9rem; align-items: center; margin: .9rem 1.5rem 0; }
.ip-repair-label { font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: var(--ip-muted); font-weight: 700; }
.ip-repair-costs { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; font-weight: 700; color: #fff; }
.ip-repair-costs .money img { width: 1.3rem; height: 1.3rem; }
.ip-or { color: var(--ip-muted); font-weight: 400; font-size: .85rem; }
.ip-mat-name { font-weight: 400; font-size: .85rem; color: #cfd0cd; }
.ip-repair-note { grid-column: 1 / -1; font-size: .78rem; color: var(--ip-muted); }

/* Vendor shop, after the in-game UI */
.vendor-shop {
  max-width: 34rem; padding: .25rem 0 .75rem; color: #e4e4e2;
  background: linear-gradient(180deg, #1f201e, #171816); border: 1px solid #3b3e3b; border-radius: 4px;
}
.vs-tab + .vs-tab { margin-top: .5rem; }
.vs-head {
  display: flex; align-items: center; gap: .8rem; margin: .9rem 1rem .5rem; font-size: .95rem; font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: #f1f1ef; font-family: Georgia, "Times New Roman", serif;
}
.vs-head::before, .vs-head::after { content: ""; flex: 1; height: 2px; background: linear-gradient(90deg, transparent, #8d8f8c); }
.vs-head::after { background: linear-gradient(90deg, #8d8f8c, transparent); }
.vs-note { margin: -.3rem 1rem .4rem; text-align: center; font-size: .78rem; color: #a3a5a1; }
.vs-rows { list-style: none; margin: 0; padding: 0; }
.vs-row {
  display: grid; grid-template-columns: 2.5rem 1fr 4rem 5rem; align-items: center; gap: .7rem;
  padding: .3rem 1rem; text-decoration: none; color: inherit; border-top: 1px solid #2b2d2b;
}
a.vs-row:hover { background: #2a2b27; }
a.vs-row:hover .vs-name { color: #fff; text-decoration: underline; }
.vs-icon {
  position: relative; display: grid; place-items: center; width: 2.4rem; height: 2.4rem;
  background: #111211; border: 1px solid #4a4c49; border-radius: 3px;
}
.vs-icon img { width: 90%; height: 90%; object-fit: contain; }
.vs-qty { position: absolute; left: 3px; bottom: 0; font-size: .7rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.vs-name { font-weight: 800; font-size: .98rem; color: #e9e9e6; }
.vs-stock { display: flex; flex-direction: column; align-items: center; line-height: 1.05; font-weight: 700; color: #e4e4e2; }
.vs-stock small { font-size: .62rem; letter-spacing: .08em; text-transform: uppercase; color: #a3a5a1; border-bottom: 1px solid #6d6f6c; margin-bottom: 2px; }
.vs-price { display: flex; align-items: center; justify-content: flex-end; gap: .4rem; font-weight: 800; font-size: 1.05rem; color: #fff; }
.vs-price img { width: 1.6rem; height: 1.6rem; object-fit: contain; }
.vs-cur { font-size: .75rem; color: #a3a5a1; }
.vs-sub { display: block; font-weight: 600; font-size: .78rem; color: #a3a5a1; }
.vs-name .tier-chip { vertical-align: 2px; }
.vs-tiers { margin: 0 0 1rem; }
.vs-tiers .hint { margin: 0 0 .6rem; }

/* Game UI glyphs: white-on-transparent PNGs used as masks, so they take the text color. */
.glyph { display: inline-block; background: currentColor; -webkit-mask: var(--glyph) center / contain no-repeat; mask: var(--glyph) center / contain no-repeat; }
.glyph-shoe { --glyph: url(/images/ui/horse-shoe.png); }
.glyph-up { --glyph: url(/images/ui/horse-trait-up.png); }
.glyph-down { --glyph: url(/images/ui/horse-trait-down.png); }
.glyph-plus { --glyph: url(/images/ui/plus.png); }

/* ------------------------------------------------------------------------
   Cookables (Kitchen Stove style: ingredient boxes -> meal) */
.section-title { font-size: 1.2rem; margin: 1.5rem 0 .6rem; }
.meals .meal-buff, .meals td:nth-child(4) { white-space: nowrap; }
.meals .meal-buff + .meal-buff { margin-top: .15rem; }
.ck-card {
  padding: .9rem 1.1rem 1rem; color: #ece6dc; border: 1px solid #3d3832; border-radius: 6px;
  background: radial-gradient(ellipse at top, #2a2521 0%, #1b1815 75%); box-shadow: 0 4px 14px rgba(0, 0, 0, .3);
}
.cookable-page .ck-card { max-width: 46rem; margin-bottom: 1.5rem; }
.ck-card header h3 { margin: 0; font: 700 1.15rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .03em; }
.ck-card header h3 a { color: #f4eee4; text-decoration: none; }
.ck-card header h3 a:hover { color: var(--accent); }
.ck-card header p { margin: .1rem 0 0; font-size: .78rem; color: #a59d92; }
.ck-flow { display: flex; align-items: flex-start; gap: .4rem; margin: .8rem 0 .4rem; }
.ck-inputs { display: flex; flex-wrap: wrap; gap: .35rem; }
.ck-cell { position: relative; width: 4.1rem; display: flex; flex-direction: column; align-items: center; }
/* × in the box's top-right corner to clear a picked ingredient */
.ck-clear {
  position: absolute; top: -.4rem; right: .05rem; z-index: 2; width: 1.15rem; height: 1.15rem; padding: 0;
  display: grid; place-items: center; font: 700 .8rem/1 system-ui, sans-serif; color: #ece6dc; cursor: pointer;
  background: #2b2622; border: 1px solid #6b6259; border-radius: 50%; box-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}
.ck-clear:hover { color: #fff; background: #8a3a2c; border-color: #c46a55; }
.ck-clear[hidden] { display: none; }
.ck-slot { display: flex; flex-direction: column; align-items: center; color: inherit; text-decoration: none; cursor: pointer; list-style: none; }
summary.ck-slot::-webkit-details-marker { display: none; }
.ck-box {
  position: relative; width: 3.3rem; height: 3.3rem; display: grid; place-items: center;
  background: #0f0e0d; border: 1px solid #4a453f; border-radius: 3px;
}
.ck-slot:hover .ck-box, .ck-any[open] .ck-box { border-color: #8d857a; }
.ck-box img { width: 88%; height: 88%; object-fit: contain; }
.ck-plus { border-color: #9c7a34; background: radial-gradient(circle, #3b2f18 0%, #17130c 80%); }
.ck-plus .glyph-plus { width: 1.55rem; height: 1.55rem; color: #e8b64c; }
.ck-slot:hover .ck-plus, .ck-any[open] .ck-plus { border-color: #e8b64c; }
.ck-out { border-color: #c9a25a; box-shadow: inset 0 0 0 1px rgba(201, 162, 90, .35); }
.ck-qty { position: absolute; right: 3px; bottom: 1px; font-size: .72rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.ck-name { margin-top: .3rem; font-size: .72rem; line-height: 1.2; text-align: center; color: #d6cfc4; }
.ck-name small { display: block; color: #958d82; }
.ck-optional .ck-box { border-style: dashed; }
.ck-arrow { align-self: center; margin-top: -1.6rem; font-size: 1.3rem; color: #958d82; }
.ck-any { position: relative; }
.ck-pop {
  position: absolute; z-index: 30; top: 4.4rem; left: 0; width: 18rem; padding: .3rem;
  background: #151311; border: 1px solid #5a5148; border-radius: 4px; box-shadow: 0 10px 24px rgba(0, 0, 0, .55);
}
.ck-pop-head { margin: .2rem .3rem .3rem; font-size: .8rem; font-weight: 700; color: #ece6dc; }
.ck-pop-head span { float: right; font-weight: 400; color: #958d82; }
.ck-req { margin: 0 .3rem .35rem; padding: .3rem .45rem; font-size: .75rem; color: #e8c98a; background: #2a2214; border: 1px solid #5b4720; border-radius: 3px; }
.ck-req a { color: #f0b860; }
.ck-options { max-height: 19rem; overflow: auto; margin: 0; padding: 0; list-style: none; }
.ck-options li > a { display: grid; grid-template-columns: 2rem 1fr; align-items: center; gap: .55rem; }
.ck-options .ck-none { width: 100%; padding: .35rem .3rem; text-align: left; font: inherit; font-size: .85rem; color: #c9c1b5; background: none; border: 0; cursor: pointer; }
.ck-options .ck-none:hover { color: var(--accent); }
.ck-options .ck-selected strong, .ck-options .ck-none.ck-selected { color: var(--accent); }
.ck-box.ck-picked { border-style: solid; }
.ck-pick-img { width: 88%; height: 88%; object-fit: contain; }
.ck-box > * { grid-area: 1 / 1; }
.ck-box .glyph[hidden], .ck-box img[hidden] { display: none; }
.ck-options li { padding: .25rem .3rem; border-bottom: 1px solid #2a2724; }
.ck-options li:last-child { border-bottom: 0; }
.ck-options li > a { color: #ece6dc; text-decoration: none; }
.ck-options li > a:hover strong { color: var(--accent); }
.ck-options img, .ck-noimg { width: 2rem; height: 2rem; object-fit: contain; }
.ck-options strong { display: block; font-size: .85rem; }
.ck-options small { display: block; font-size: .72rem; color: #a59d92; }
.ck-results { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0 1.5rem; margin: .5rem 0 0; font-size: .85rem; }
.ck-results div { display: flex; justify-content: space-between; gap: .6rem; padding: .28rem 0; border-top: 1px solid #33302b; }
.ck-results dt { color: #b9b1a5; }
.ck-results dd { margin: 0; font-weight: 700; color: #fff; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ck-foot { margin: .45rem 0 0; font-size: .75rem; color: #958d82; }
.ck-foot a { color: #e0a060; }
.ck-sub { margin: 1.1rem 0 .4rem; font-size: 1rem; }
/* Meal page: the live card and what it comes out as, side by side on wide screens */
.cookable-top { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.25rem; margin: 0 0 1.75rem; }
.cookable-top .ck-card { flex: 1 1 27rem; max-width: 40rem; }
.cookable-top .ck-result { flex: 1 1 20rem; width: auto; max-width: 26rem; }
.ck-result .ip-icon { width: 5.5rem; height: 5.5rem; }
.ck-result .ip-title h2 { font-size: 1.35rem; }
.ck-made { font-size: .92rem; color: #b9bab6; }
.ck-result .ip-stats { grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
.ck-use { margin: 1rem 1.5rem 0; font-weight: 700; color: #f0b860; }
.ck-use span { color: #fff; }
.ck-bonus { margin: .8rem 1.5rem 0; }
.ck-bonus p { margin: 0 0 .25rem; font-weight: 700; color: #f0a048; }
.ck-bonus ul { margin: 0; padding-left: 1.1rem; color: #dcdcda; }
.ck-bonus li { margin: .15rem 0; }
.ck-bonus b { color: #f0b860; white-space: nowrap; }
/* Equipment with an optional ingredient (craft-options.ts): the meal card's look, plus a quality select. */
.craft-live { margin: 0 0 1.75rem; }
.craft-live .ck-card { max-width: 40rem; }
.co-card .ck-flow[hidden] { display: none; }
.co-card header { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 0 1rem; }
.co-card header p { grid-column: 1; }
.co-quality { grid-column: 2; grid-row: 1 / span 2; display: flex; align-items: center; gap: .45rem; font-size: .78rem; color: #a59d92; }
.co-quality select { font: inherit; font-size: .85rem; padding: .2rem .4rem; color: #f4eee4; background: #1a1b1a; border: 1px solid #4a4c4a; border-radius: 4px; }
.ip-craft-bonus { padding-top: .2rem; }
/* A stat changed by the crafting choices: the same gold as the bonus values. */
.item-panel .ip-modified { color: #f0b860; }
/* Kitchen craft / fuel / table */
.ck-cond { display: flex; flex-wrap: wrap; gap: .5rem .9rem; margin: .7rem 0 0; padding-top: .7rem; border-top: 1px solid #33302b; }
.ck-cond[hidden] { display: none; }
.ck-cond label { display: flex; flex-direction: column; gap: .2rem; font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #a59d92; }
.ck-cond select, .ck-cond input { font: inherit; font-size: .85rem; letter-spacing: 0; text-transform: none; padding: .3rem .4rem; color: #ece6dc; background: #0f0e0d; border: 1px solid #4a453f; border-radius: 3px; }
.ck-cond input { width: 4.5rem; }
.ck-cond input:disabled { opacity: .5; }
.ck-tips { padding-left: 1.2rem; max-width: 60rem; }
.ck-tips li { margin: .45rem 0; }
@media (max-width: 640px) {
  .ck-options { width: 15rem; }
}
.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; }

/* ------------------------------------------------------------------------
   Horse card (in-game style) */
.horse-card {
  --hc-orange: #f0913a; --hc-dim: #57514a; --hc-text: #ece6dc; --hc-muted: #a59d92; --hc-line: #3b3631;
  max-width: 46rem; margin: 0 0 1.5rem; padding: 1.4rem 1.75rem 1.6rem; color: var(--hc-text);
  background: radial-gradient(ellipse at top, #2b2622 0%, #1c1916 70%); border: 1px solid #3d3832; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .35);
}
.hc-kicker { margin: 0; text-align: center; font-size: .72rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--hc-muted); font-variant: small-caps; }
.hc-name { margin: .25rem 0 .2rem; text-align: center; font: 700 2rem/1.1 Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .02em; color: #f4eee4; }
.hc-sub { margin: 0; text-align: center; color: #bdb5a9; }
.hc-head { display: flex; align-items: center; gap: .7rem; margin: 1.25rem 0 .9rem; font: 700 1.05rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .04em; color: #efe8dc; }
.hc-head::before, .hc-head::after { content: ""; flex: 1; height: 1px; background: linear-gradient(90deg, transparent, var(--hc-line)); }
.hc-head::after { background: linear-gradient(90deg, var(--hc-line), transparent); }
.hc-head span::before, .hc-head span::after { content: "◆"; margin: 0 .5rem; font-size: .5rem; vertical-align: .25em; color: var(--hc-muted); }
.hc-hint { margin: -.4rem 0 .6rem; text-align: center; font-size: .8rem; color: var(--hc-muted); }

/* Bond track: numbered diamonds on a line */
.hc-bond { display: flex; justify-content: space-between; max-width: 28rem; margin: 0 auto; padding: 0; list-style: none; position: relative; }
.hc-bond::before { content: ""; position: absolute; left: .9rem; right: .9rem; top: 50%; height: 3px; margin-top: -1.5px; background: var(--hc-orange); }
.hc-bond li { position: relative; width: 1.55rem; height: 1.55rem; transform: rotate(45deg); border: 2px solid var(--hc-orange); background: #1d1a17; border-radius: 3px; display: grid; place-items: center; cursor: help; }
.hc-bond li span { transform: rotate(-45deg); font-size: .72rem; font-weight: 800; color: #fff; }
.hc-rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr)); gap: .15rem 1.5rem; max-width: 40rem; margin: 1rem auto 0; font-size: .85rem; }
.hc-rewards div { display: flex; gap: .6rem; padding: .2rem 0; }
.hc-rewards dt { flex: none; width: 4.2rem; color: var(--hc-orange); font-weight: 700; }
.hc-rewards dd { margin: 0; color: #d6cfc4; }

/* Stats: label, horseshoes (radio labels), values of the selected roll */
.hc-stats { display: grid; gap: 0; }
.hc-stat { display: grid; grid-template-columns: 6.5rem auto 1fr; align-items: center; gap: .3rem 1rem; padding: .5rem .2rem; border-bottom: 1px solid var(--hc-line); position: relative; }
.hc-r { position: absolute; opacity: 0; pointer-events: none; }
.hc-label { font-size: 1.02rem; }
.hc-shoes { display: inline-flex; gap: .3rem; }
.hc-shoe { display: inline-block; width: 1.55rem; height: 1.55rem; color: var(--hc-dim); cursor: pointer; transition: color .1s; }
.hc-shoe .glyph { width: 100%; height: 100%; }
.hc-shoe:hover { color: #ffb470; }
.hc-r1:checked ~ .hc-shoes .hc-shoe:nth-child(-n+1),
.hc-r2:checked ~ .hc-shoes .hc-shoe:nth-child(-n+2),
.hc-r3:checked ~ .hc-shoes .hc-shoe:nth-child(-n+3),
.hc-r4:checked ~ .hc-shoes .hc-shoe:nth-child(-n+4),
.hc-r5:checked ~ .hc-shoes .hc-shoe:nth-child(-n+5) { color: var(--hc-orange); }
.hc-stat:has(.hc-r:focus-visible) .hc-shoes { outline: 2px solid var(--hc-orange); outline-offset: 3px; border-radius: 3px; }
.hc-v { display: none; flex-wrap: wrap; align-items: baseline; gap: .1rem .9rem; font-size: .88rem; color: #d6cfc4; }
.hc-v b { color: #fff; font-variant-numeric: tabular-nums; }
.hc-v small { color: var(--hc-muted); font-size: .78rem; }
.hc-r1:checked ~ .hc-vals .hc-v1, .hc-r2:checked ~ .hc-vals .hc-v2, .hc-r3:checked ~ .hc-vals .hc-v3,
.hc-r4:checked ~ .hc-vals .hc-v4, .hc-r5:checked ~ .hc-vals .hc-v5 { display: flex; }

/* Traits: good on the left, bad on the right */
.hc-traits { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2rem; }
.hc-traitcol h4 { margin: 0 0 .3rem; font-size: .75rem; letter-spacing: .12em; text-transform: uppercase; }
.hc-traitcol h4 span { color: var(--hc-muted); font-weight: 600; margin-left: .3rem; }
.hc-traitcol h4.hc-good { color: #4cc293; }
.hc-traitcol h4.hc-bad { color: #e2625a; }
.hc-traitcol ul { list-style: none; margin: 0; padding: 0; }
.hc-traitcol li { display: grid; grid-template-columns: 1.4rem 1fr; gap: .6rem; padding: .55rem 0; border-bottom: 1px solid var(--hc-line); }
.hc-traitcol strong { display: block; color: #f4eee4; }
.hc-desc { display: block; font-size: .85rem; color: var(--hc-muted); line-height: 1.35; }
.hc-chev { width: 1.3rem; height: 1.3rem; margin-top: .15rem; }
.hc-chev .glyph { width: 100%; height: 100%; }
.hc-chev.hc-good { color: #37b985; }
.hc-chev.hc-bad { color: #d9483f; }
@media (max-width: 640px) {
  .horse-card { padding: 1.1rem 1rem 1.2rem; }
  .hc-traits { grid-template-columns: 1fr; }
  .hc-stat { grid-template-columns: 1fr auto; }
  .hc-vals { grid-column: 1 / -1; }
}
.hc-table th[scope="row"] { font-weight: 600; text-align: left; }

/* Zone tier chips (vendor stock, sold by) */
.tier-links { display: inline-flex; flex-wrap: wrap; gap: .25rem; }
.tier-chip {
  display: inline-block; padding: 0 .4rem; margin-left: .3rem; border-radius: 4px; font-size: .72rem; font-weight: 800;
  line-height: 1.5; letter-spacing: .03em; background: var(--accent-soft); color: var(--accent); text-decoration: none; white-space: nowrap;
}
.tier-links .tier-chip { margin-left: 0; }
a.tier-chip:hover { background: var(--accent); color: #fff; }
.muted { color: var(--muted); }
.row-note { display: block; font-size: .8rem; color: var(--muted); }
.drops td { vertical-align: middle; }

/* Section tabs (Base Building: Build mode / Prefabs) */
.view-tabs { display: flex; gap: .25rem; margin: 0 0 1rem; border-bottom: 2px solid var(--border); }
.view-tabs a {
  padding: .5rem 1rem; margin-bottom: -2px; text-decoration: none; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent;
}
.view-tabs a:hover { color: var(--text); }
.view-tabs a[aria-current="page"] { color: var(--accent); border-bottom-color: var(--accent); }

/* Tabs that wrap onto more lines (crafting stations, challenge sets) */
.view-tabs-wrap { flex-wrap: wrap; row-gap: .1rem; }
.view-tabs-wrap a { white-space: nowrap; }

/* Company challenge tier milestones */
.milestones { margin: 0 0 1rem; padding: .7rem 1rem; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--accent); border-radius: 6px; }
.milestones p { margin: .2rem 0; }
.thumb-inline { width: 1.5rem; height: 1.5rem; vertical-align: middle; margin: 0 .3rem 0 .15rem; }

/* Crafting: ingredient chips */
.ings { display: flex; flex-wrap: wrap; gap: .3rem .45rem; }
.ing { display: inline-flex; align-items: center; gap: .3rem; padding: .1rem .45rem .1rem .15rem; font-size: .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: 999px; white-space: nowrap; }
.ing img, .ing-blank { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.ing-optional { border-style: dashed; opacity: .85; }

/* Challenges */
.reward-for { padding-left: 1.2rem; }
.reward-for li { margin: .25rem 0; }
.objectives td:first-child { font-weight: 600; white-space: nowrap; }
/* ------------------------------------------------------------------------
   Challenges: the game's progress window */
.cp {
  --cp-teal: #3fb08a; --cp-teal-bg: #1d4337; --cp-line: #313834; --cp-text: #e6e8e4; --cp-muted: #9aa39d;
  max-width: 76rem; padding: 1.2rem 1.5rem 1.4rem; color: var(--cp-text);
  background: radial-gradient(ellipse at top, #1f2422 0%, #141716 75%); border: 1px solid #2c322f; border-radius: 6px;
  box-shadow: 0 6px 22px rgba(0, 0, 0, .35);
}
.cp-title { margin: 0 0 .6rem; text-align: center; font: 700 1.5rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .04em; color: #f1efe9; }
.cp-title::before, .cp-title::after { content: "✦"; margin: 0 .6rem; font-size: .7rem; vertical-align: .3em; color: var(--cp-teal); }
.cp-mode { display: flex; justify-content: center; gap: 2.5rem; margin: 0 0 .7rem; }
.cp-mode a { padding: .2rem .2rem .35rem; font-size: .8rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.cp-mode a[aria-current="page"] { color: var(--cp-teal); border-bottom-color: var(--cp-teal); }
.cp-tabs { display: flex; flex-wrap: wrap; gap: 2px; margin: 0 0 1rem; }
.cp-tabs a {
  flex: 1 1 auto; padding: .45rem .55rem; text-align: center; font-size: .72rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; white-space: nowrap;
  color: var(--cp-muted); text-decoration: none; background: #181c1a; border: 1px solid var(--cp-line);
}
.cp-tabs a:hover { color: var(--cp-text); }
.cp-tabs a[aria-current="page"] { color: #eafff6; background: var(--cp-teal-bg); border-color: #2f7a62; }
.cp-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.5rem; }
.cp-list { padding-right: 1.2rem; border-right: 2px solid #3a413d; }
.cp-search { width: 100%; margin: 0 0 .5rem; padding: .4rem .6rem; font: inherit; font-size: .9rem; color: var(--cp-text); background: #0f1211; border: 1px solid #4a524d; border-radius: 2px; }
.cp-search[hidden] { display: none; }
.cp-group { display: flex; justify-content: space-between; margin: 0 0 .2rem; padding: 0 .6rem; font-size: .72rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--cp-muted); }
.cp-list ul { list-style: none; margin: 0; padding: 0; max-height: 30rem; overflow: auto; }
.cp-list li[hidden] { display: none; }
.cp-list a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .6rem; color: var(--cp-text); text-decoration: none; border-bottom: 1px solid #222826; }
.cp-list a:hover { background: #1a201e; }
.cp-list a[aria-current="true"] { background: var(--cp-teal-bg); }
.cp-count { color: var(--cp-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.cp-detail { min-width: 0; }
.cp-tiers { display: flex; justify-content: center; gap: 1.6rem; margin: .2rem 0 .5rem; }
.cp-tiers a { font: 700 1.3rem Georgia, "Times New Roman", serif; color: var(--cp-muted); text-decoration: none; }
.cp-tiers a[aria-current="page"] { color: var(--cp-teal); }
.cp-name { margin: .3rem 0 .4rem; text-align: center; font: 700 1.15rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .03em; }
.cp-name a { color: #f1efe9; text-decoration: none; }
.cp-name a:hover { color: var(--cp-teal); }
.cp-desc { margin: 0 0 .5rem; text-align: center; font-size: .85rem; color: var(--cp-muted); }
.cp-objectives { list-style: none; margin: .6rem 0 0; padding: .4rem 0 0; border-top: 1px solid var(--cp-line); }
.cp-objectives li { display: flex; justify-content: space-between; gap: 1rem; padding: .35rem .3rem; cursor: help; }
.cp-objectives li span:last-child { color: var(--cp-text); font-variant-numeric: tabular-nums; }
.cp-head { display: flex; align-items: center; gap: .7rem; margin: 1.4rem 0 .6rem; font: 700 .95rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .05em; color: #f1efe9; }
.cp-head::before, .cp-head::after { content: ""; flex: 1; height: 1px; background: var(--cp-line); }
.cp-rewards { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; }
.cp-reward { position: relative; width: 3rem; height: 3rem; display: grid; place-items: center; background: #0f1211; border: 1px solid #5a625d; border-radius: 3px; }
.cp-reward img { width: 88%; height: 88%; object-fit: contain; }
.cp-qty { position: absolute; right: 3px; bottom: 0; font-size: .68rem; font-weight: 800; color: #fff; text-shadow: 0 1px 2px #000; }
.cp-legacy { margin: .9rem 0 0; padding: .4rem .8rem .7rem; text-align: center; background: linear-gradient(180deg, #1f4a3d 0%, #173328 100%); border: 1px solid #2f6b57; border-radius: 3px; }
.cp-legacy-head { margin: -.9rem 0 .4rem; }
.cp-legacy-head span { display: inline-block; padding: .1rem .9rem; font: 700 .8rem Georgia, "Times New Roman", serif; font-variant: small-caps; letter-spacing: .05em; color: #cfeee2; background: #23594a; border: 1px solid #3a8a70; }
.cp-legacy ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .4rem; margin: 0; padding: 0; list-style: none; text-align: left; }
.cp-legacy li > a, .cp-legacy li > .cp-legacy-icon { text-decoration: none; }
.cp-legacy li > a, .cp-legacy li { display: flex; align-items: center; gap: .55rem; color: #e9f6f0; }
.cp-legacy li > a:hover .cp-legacy-text > span { text-decoration: underline; }
.cp-legacy-icon { flex: none; width: 3rem; height: 3rem; display: grid; place-items: center; background: #0f1d18; border: 1px solid #3a8a70; border-radius: 3px; overflow: hidden; }
.cp-legacy-icon img { width: 92%; height: 92%; object-fit: contain; }
.cp-legacy-icon > span { font: 700 1.2rem Georgia, "Times New Roman", serif; color: #8fd3b9; }
.cp-legacy-text { display: flex; flex-direction: column; min-width: 0; font-size: .88rem; line-height: 1.25; }
.cp-legacy-text small { font-size: .7rem; letter-spacing: .06em; text-transform: uppercase; color: #9cc9b8; }
/* On an entry page the box sits on the normal page background. */
.entry-main .legacy-section { margin-top: 2.2rem; }
.entry-main .cp-legacy { max-width: 46rem; }
.cp-more { margin: .9rem 0 0; text-align: center; font-size: .8rem; }
.cp-more a { color: var(--cp-teal); }
.cp-progress { margin-top: .6rem; }
.cp-progress ul { list-style: none; margin: 0; padding: 0; }
.cp-progress li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .4rem .3rem; border-bottom: 1px solid var(--cp-line); }
.cp-progress .cp-rewards { justify-content: flex-end; }
@media (max-width: 760px) {
  .cp { padding: 1rem; }
  .cp-body { grid-template-columns: 1fr; }
  .cp-list { padding-right: 0; border-right: 0; border-bottom: 2px solid #3a413d; padding-bottom: 1rem; margin-bottom: 1rem; }
}
/* ------------------------------------------------------------------------
   Link preview card (/_card/...): screenshotted at 1200x630 by scripts/build-og.mjs.
   Reuses the item card (.item-panel, .ip-*) at a size that reads in a chat embed. */
.og-body { margin: 0; overflow: hidden; background: #262826; }
.og-card.item-panel {
  width: 100%; height: 100%; box-sizing: border-box; display: grid; grid-template-columns: 26rem 1fr; gap: 3.2rem;
  align-content: center; align-items: start; padding: 3rem 3.8rem; border: 0; border-radius: 0; box-shadow: none;
}
.og-icon.ip-icon { width: 26rem; height: 26rem; border-width: 3px; border-radius: 10px; }
.og-icon .ip-noimg { font-size: 9rem; }
/* Icon with the site name under it; the text column starts level with the icon's top. */
.og-side { display: flex; flex-direction: column; align-items: center; gap: 1.1rem; }
.og-main { min-width: 0; display: flex; flex-direction: column; }
.og-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 2rem; }
.og-name {
  /* Pull the line box up by the font's internal top space so the capitals line up with the icon's top edge. */
  margin: -.21em 0 0; font-size: 4rem; line-height: 1.02; font-weight: 900; text-transform: uppercase; letter-spacing: .01em; color: #fff;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
/* Long names get smaller rather than cut off. */
.og-name-l { font-size: 3.2rem; }
.og-name-xl { font-size: 2.6rem; -webkit-line-clamp: 3; }
.og-tier.ip-tier { margin-top: 0; font-size: 1.35rem; border-top-width: 5px; }
.og-tags.ip-tags { margin: 1.4rem 0 0; font-size: 1.5rem; }
.og-tags.ip-tags li { margin-bottom: .4rem; }
.og-desc {
  margin: 1.6rem 0 0; font-size: 1.75rem; line-height: 1.45; color: #d2d3d0; white-space: pre-line;
  display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden;
}
.og-site { margin: 0; font-size: 1.25rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: #e0a060; }