:root {
  --bg: #16181d;
  --panel: #1f2229;
  --panel-2: #272b34;
  --line: #343a46;
  --text: #e8e6df;
  --muted: #9aa0ab;
  --accent: #6cc04a;
  --accent-ink: #10230a;
  --gold: #f2c14e;
  --warn: #e8825a;
  --sky: #2a3442;
  --radius: 6px;
  --mono: "Cascadia Mono", Consolas, "Courier New", monospace;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0; display: flex; background: var(--bg); color: var(--text);
  font: 15px/1.55 "Segoe UI", system-ui, sans-serif;
}
a { color: var(--accent); }
h1, h2, h3 { line-height: 1.2; margin: 0; text-wrap: balance; }

/* ── Sidebar ── */
#sidebar {
  width: 232px; flex: none; background: var(--panel); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; padding: 18px 14px; position: sticky; top: 0; height: 100vh;
}
.brand { display: flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; font: 700 15px/1.15 var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.brand-mark {
  width: 36px; height: 36px; flex: none; image-rendering: pixelated;
  background:
    linear-gradient(#6cc04a 0 0) 0 0 / 100% 34% no-repeat,
    linear-gradient(#4f9a35 0 0) 0 30% / 34% 14% no-repeat,
    linear-gradient(#4f9a35 0 0) 66% 30% / 22% 22% no-repeat,
    #7a5230;
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.28), inset 3px 3px 0 rgba(255,255,255,.12);
}
#search {
  width: 100%; padding: 8px 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
#search:focus-visible, button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#nav { display: flex; flex-direction: column; gap: 2px; }
#nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius);
  color: var(--muted); text-decoration: none; font-weight: 600;
}
#nav a:hover { background: var(--panel-2); color: var(--text); }
#nav a.active { background: var(--accent); color: var(--accent-ink); }
#nav .swatch { width: 12px; height: 12px; flex: none; box-shadow: inset -2px -2px 0 rgba(0,0,0,.3); }
#link-status {
  margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line); color: var(--muted); text-decoration: none; font-size: 13px;
}
#link-status .dot { width: 10px; height: 10px; border-radius: 50%; background: #666; flex: none; }
#link-status.on { color: var(--text); border-color: var(--accent); }
#link-status.on .dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }

/* ── Main ── */
#main { flex: 1; min-width: 0; padding: 28px clamp(16px, 4vw, 44px) 60px; outline: none; }
.page { max-width: 1060px; margin: 0 auto; }
.page > header { margin-bottom: 22px; }
.eyebrow { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 6px; }
h1 { font-size: clamp(24px, 3.2vw, 34px); }
.lede { color: var(--muted); max-width: 68ch; margin: 10px 0 0; font-size: 16px; }
.loading, .empty { color: var(--muted); }

.cat-title { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin: 26px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); color: var(--text); text-decoration: none; transition: border-color .12s, transform .12s;
}
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card h3 { font-size: 16px; }
.card p { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; font: 600 11px var(--mono); padding: 2px 7px; border-radius: 3px; background: var(--panel-2); color: var(--muted); align-self: flex-start; }
.badge.Easy { background: #23401a; color: #9be07a; }
.badge.Medium { background: #45390f; color: var(--gold); }
.badge.Hard { background: #4a2416; color: var(--warn); }
.planned { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.planned li { padding: 4px 10px; border: 1px dashed var(--line); border-radius: 3px; color: var(--muted); font-size: 13px; }

/* ── Guide page ── */
.back { display: inline-block; margin-bottom: 14px; color: var(--muted); text-decoration: none; font-size: 13px; }
.back:hover { color: var(--text); }
.meta { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; color: var(--muted); font-size: 14px; }
.sendbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 18px 0 4px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.sendbar span { color: var(--muted); font-size: 13px; margin-right: 4px; }
button, .btn {
  font: 600 13px/1 "Segoe UI", system-ui, sans-serif; padding: 8px 12px; border-radius: 4px; border: 1px solid var(--line);
  background: var(--panel-2); color: var(--text); cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.guide-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 28px; margin-top: 22px; align-items: start; }
.guide-grid.single { grid-template-columns: minmax(0, 72ch); }
section.block { margin-bottom: 26px; }
section.block h2 { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
section.block ul, section.block ol { margin: 0; padding-left: 20px; }
section.block li { margin-bottom: 7px; }
ol.steps { list-style: none; padding: 0; counter-reset: step; }
ol.steps li { counter-increment: step; display: grid; grid-template-columns: 30px 1fr; gap: 10px; margin-bottom: 10px; }
ol.steps li::before {
  content: counter(step); width: 26px; height: 26px; display: grid; place-items: center; font: 700 13px var(--mono);
  background: var(--panel-2); color: var(--gold); box-shadow: inset -2px -2px 0 rgba(0,0,0,.35);
}
ul.tips li::marker { color: var(--gold); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); padding: 8px 10px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg); }
td { padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
td.name { font-weight: 600; white-space: nowrap; }
td.lvl { font-family: var(--mono); color: var(--gold); }
td.note { color: var(--muted); }
.table-wrap { overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }

/* ── Diagrams ── */
.diagram { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin: 0 0 16px; }
[hidden] { display: none !important; }
.diagram-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 10px; }
.diagram-head h3 { font-size: 15px; }
.diagram-head .view { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); white-space: nowrap; }
.diagram-canvas { background: var(--sky); border-radius: 4px; padding: 12px; overflow-x: auto; text-align: center; }
.diagram-canvas svg { max-width: 100%; height: auto; min-width: 180px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 6px; margin: 0; }
section.block ul.legend { padding: 0; }
.legend svg { flex: none; }
.diagram .note { margin: 10px 0 0; font-size: 13px; color: var(--muted); }

/* ── Plotter ── */
.controls { display: flex; flex-wrap: wrap; gap: 12px 18px; align-items: end; padding: 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.controls label { display: flex; flex-direction: column; gap: 4px; font: 600 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.controls input[type=number], .controls select { font: 15px "Segoe UI", sans-serif; padding: 6px 8px; min-width: 110px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.controls input[type=range] { width: 220px; accent-color: var(--accent); }
.plot-wrap { margin-top: 14px; background: var(--sky); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; overflow: auto; max-height: 72vh; text-align: center; }
.plot-wrap canvas { image-rendering: pixelated; cursor: crosshair; }
.plot-info { display: flex; flex-wrap: wrap; gap: 6px 22px; margin-top: 12px; color: var(--muted); font-size: 14px; }
.plot-info b { color: var(--text); font-family: var(--mono); }
.rows { margin-top: 10px; font: 13px/1.7 var(--mono); color: var(--text); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; word-spacing: 2px; }

/* ── Game Link ── */
.connect-box { padding: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 18px; }
.connect-box.on { border-color: var(--accent); }
code, .cmd { font-family: var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: 4px; padding: 2px 7px; color: var(--gold); }
.cmd.big { display: inline-block; font-size: 18px; padding: 8px 12px; margin: 4px 8px 4px 0; user-select: all; }
#log { font: 12.5px/1.6 var(--mono); background: #0e1013; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; height: 200px; overflow-y: auto; white-space: pre-wrap; color: var(--muted); }

#toast {
  position: fixed; bottom: 22px; left: 50%; transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--panel-2); border: 1px solid var(--accent); color: var(--text); padding: 10px 16px; border-radius: var(--radius);
  transition: opacity .15s, transform .15s; max-width: 90vw;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  body { flex-direction: column; }
  #sidebar { width: auto; height: auto; position: static; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .brand br { display: none; }
  #search { order: 3; flex: 1 1 160px; width: auto; }
  #nav { order: 4; flex: 1 1 100%; flex-direction: row; overflow-x: auto; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
  #nav a { white-space: nowrap; }
  #link-status { margin: 0 0 0 auto; }
  .guide-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ── Recipes ── */
.big-search { width: 100%; max-width: 560px; padding: 12px 14px; font: 17px "Segoe UI", sans-serif; background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { padding: 5px 11px; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; color: var(--text); text-decoration: none; font-size: 14px; }
.chips a:hover { border-color: var(--accent); }
.recipe { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.recipe-head { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; margin-bottom: 12px; }
.station { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--gold); }
.hint { font-size: 12px; color: var(--muted); }
.recipe-body { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.craft-grid { display: grid; grid-template-columns: repeat(3, 78px); gap: 4px; padding: 6px; background: var(--sky); border-radius: 4px; }
.flow { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 6px; background: var(--sky); border-radius: 4px; }
.plus, .arrow { color: var(--muted); font-size: 20px; }
.slot {
  width: 78px; height: 78px; display: grid; place-items: center; text-align: center; padding: 4px; overflow: hidden;
  font: 600 11.5px/1.2 "Segoe UI", sans-serif; color: var(--text); text-decoration: none; overflow-wrap: anywhere;
  background: hsl(var(--h) 30% 26%); border-bottom: 4px solid hsl(var(--h) 55% 55%);
  box-shadow: inset 2px 2px 0 rgba(255,255,255,.12), inset -2px 0 0 rgba(0,0,0,.3);
}
a.slot:hover { outline: 2px solid var(--accent); }
.slot.empty { background: rgba(0,0,0,.22); border-bottom: 4px solid transparent; box-shadow: inset 2px 2px 0 rgba(0,0,0,.25); }
.result { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.makes { font: 600 12px var(--mono); color: var(--gold); }
.needs { margin: 12px 0 0; font-size: 13.5px; color: var(--muted); }
.controls.qty { margin-bottom: 18px; }
ol.steps em { color: var(--muted); font-style: normal; }
td.name a { color: var(--text); }

/* ── Recipes: top search and pinned recipe ── */
.r-top { margin-bottom: 18px; }
.r-top .back { display: block; }
#r-found .cat-title { margin-top: 14px; }
.pin { position: sticky; top: 0; z-index: 5; margin-bottom: 22px; background: var(--panel); border: 1px solid var(--gold); border-radius: var(--radius); box-shadow: 0 8px 24px rgba(0,0,0,.45); }
.pin-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 10px 14px; }
.pin-tag { font: 700 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-ink); background: var(--gold); padding: 3px 7px; border-radius: 3px; }
.pin-title { font-weight: 700; font-size: 16px; color: var(--text); text-decoration: none; }
.pin-title:hover { color: var(--gold); }
.pin-progress { color: var(--muted); font-size: 13px; }
.pin-actions { margin-left: auto; display: flex; gap: 6px; }
a.btn { text-decoration: none; display: inline-block; }
.pin-body { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); gap: 18px; padding: 4px 14px 14px; max-height: 44vh; overflow-y: auto; border-top: 1px solid var(--line); padding-top: 12px; }
.pin-body h3 { font: 600 11px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.craft-grid.mini { grid-template-columns: repeat(3, 58px); }
.mini .slot { width: 58px; height: 58px; font-size: 9.5px; padding: 2px; border-bottom-width: 3px; }
.checks { list-style: none; margin: 0; padding: 0; font-size: 14px; }
.checks li { display: flex; align-items: center; gap: 8px; padding: 3px 6px; border-radius: 3px; }
.checks label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checks input { accent-color: var(--accent); width: 16px; height: 16px; flex: none; }
.checks a { color: var(--text); }
.checks b { color: var(--gold); font-family: var(--mono); font-weight: 600; }
.checks li.done span, .checks li.done a, .checks li.done b { color: var(--muted); text-decoration: line-through; }
.checks li.here { background: rgba(242,193,78,.12); }
.checks li em { margin-left: auto; font: 600 10px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-style: normal; }
.controls.qty { align-items: center; }
.controls.qty .hint { flex: 1 1 100%; }
@media (max-width: 900px) { .pin-body { grid-template-columns: minmax(0, 1fr); } .pin { position: static; } }

/* ── Item icons (optional; see tools/build-icons.js) ── */
.ico { image-rendering: pixelated; object-fit: cover; object-position: top; vertical-align: middle; flex: none; }
.slot.has-icon { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; background: #2b303b; font-size: 10px; line-height: 1.1; }
.slot.has-icon span { max-height: 2.2em; overflow: hidden; }
.mini .slot.has-icon { font-size: 8.5px; gap: 1px; }
.mini .slot.has-icon .ico { width: 28px; height: 28px; }
.chips a, .checks a, td.name a, ol.steps a { display: inline-flex; align-items: center; gap: 6px; }
h1 .ico { margin-right: 12px; vertical-align: -6px; }
.checks a, ol.steps a { vertical-align: middle; }

/* ── Hover label for diagram blocks ── */
#tip { position: fixed; left: 0; top: 0; z-index: 20; pointer-events: none; background: #0e1013; color: var(--text); border: 1px solid var(--gold); border-radius: 4px; padding: 4px 9px; font-size: 13px; font-weight: 600; white-space: nowrap; box-shadow: 0 4px 14px rgba(0,0,0,.5); }
.diagram-canvas [data-tip] { cursor: help; }
.diagram-canvas g[data-tip]:hover polygon { stroke: var(--gold); stroke-width: 2; }

/* ── Java Edition note ── */
.java { margin: 18px 0 4px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #e8825a; border-radius: var(--radius); max-width: 80ch; }
.java h2 { font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: #e8825a; margin-bottom: 6px; }
.java p { margin: 0; }
.brand { font-size: 13px; }

/* ── Guide icons, diagram caption, plotter hint ── */
.g-icons { display: flex; gap: 6px; align-items: center; }
header .g-icons { margin-bottom: 10px; gap: 8px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 28px; }
.diagram-head { display: block; }
.diagram-head .view { display: block; margin-top: 2px; font: 13px "Segoe UI", system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--muted); }
.plot-hint { margin: 10px 2px 0; color: var(--muted); font-size: 14px; }
.g-icons .ico { background: #3d4555; padding: 3px; border-radius: 4px; box-sizing: content-box; }

/* ── My Servers and the server chip ── */
#server-chip { margin-top: auto; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border-radius: var(--radius); background: var(--bg); border: 1px solid var(--line); color: var(--text); text-decoration: none; font-size: 13.5px; }
#server-chip:hover { border-color: var(--accent); }
#server-chip .chip-label { font: 600 10px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
#server-chip .chip-ed { color: var(--muted); font-size: 12.5px; }
#link-status { margin-top: 0; }
.banner { margin: 0 0 18px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); max-width: 80ch; }
.banner.ed-java { border-left-color: var(--warn); }
.badge.ed-bedrock { background: #23401a; color: #9be07a; }
.badge.ed-java { background: #4a2416; color: var(--warn); }
.badge.playing { background: var(--gold); color: var(--accent-ink); }
.srv-list { display: grid; gap: 10px; margin-bottom: 16px; }
.srv { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 14px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.srv.active { border-color: var(--gold); }
.srv.on-edit { display: block; padding: 0; margin-bottom: 16px; }
.srv-main { flex: 1 1 260px; min-width: 0; }
.srv-main h3 { font-size: 17px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.srv-main p { margin: 8px 0 0; }
.srv-main .note { color: var(--muted); font-size: 14px; }
.srv-main .cmd { user-select: all; }
.srv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.srv-form { border: 0; }
.srv-form input, .srv-form select { font: 15px "Segoe UI", sans-serif; padding: 6px 8px; min-width: 130px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.srv-form label.wide { flex: 1 1 100%; }
.srv-form label.wide input { width: 100%; }
.srv-buttons { display: flex; gap: 8px; flex: 1 1 100%; }
.java.mine { border-color: var(--warn); background: #2b211c; }
.java .small { margin-top: 6px; font-size: 13px; color: var(--muted); }

.tested { margin: 12px 0 0; font-size: 14px; color: var(--muted); }
.tested b { color: var(--accent); }

/* ── Shopping List ── */
.wanted { list-style: none; margin: 12px 0 0; padding: 0; }
section.block ul.wanted, section.block ul.checks { padding: 0; }
.wanted li { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-bottom: 1px solid var(--line); margin: 0; }
.wanted li a { flex: 1; min-width: 0; display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 600; }
.wanted li a:hover { color: var(--accent); }
.wanted input { width: 84px; font: 15px var(--mono); padding: 5px 6px; background: var(--bg); color: var(--gold); border: 1px solid var(--line); border-radius: 4px; }
.wanted li.empty { border: 0; padding-left: 0; }
button.x { padding: 4px 8px; margin-left: auto; color: var(--muted); background: none; border-color: transparent; }
button.x:hover { color: var(--warn); border-color: var(--warn); }
#shop-found { margin-top: 8px; }
.shop-from { font-size: 14px; margin: 14px 0 4px; color: var(--text); }
.shop-note { display: flex; gap: 8px; margin-top: 12px; }
.shop-note input { flex: 1; min-width: 0; font: inherit; padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.shop-buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-progress { margin: 0 0 14px; font: 600 13px var(--mono); color: var(--gold); }
.checks.tall li { flex-wrap: wrap; padding: 5px 6px; }
.checks li small { flex: 1 1 100%; padding-left: 24px; color: var(--muted); font-size: 12.5px; }
.checks li i { color: var(--muted); font-style: normal; }
.checks li { margin: 0; }
@media (max-width: 900px) { #server-chip { margin: 0 0 0 auto; flex-direction: row; gap: 8px; align-items: baseline; } }

/* ── Diagram build playback ── */
.anim { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.anim button { padding: 6px 10px; }
.anim-status { flex: 1 1 100%; margin-top: 4px; font-size: 13.5px; color: var(--text); min-height: 1.5em; }
.diagram-canvas g.placing polygon:first-of-type, .diagram-canvas g.placing image + polygon { stroke: var(--gold); stroke-width: 2.5; }

/* ── World Notebook and Portal Calculator ── */
.place { align-items: flex-start; }
.place .badge.kind { flex: none; min-width: 78px; text-align: center; margin-top: 2px; background: var(--panel-2); color: var(--text); }
.place .badge.kind-base { background: #23401a; color: #9be07a; }
.place .badge.kind-farm { background: #3d3513; color: var(--gold); }
.place .badge.kind-portal { background: #35204a; color: #c79bf0; }
.place .badge.kind-village { background: #40301c; color: #e0b98a; }
.place .badge.kind-spawner { background: #4a2416; color: var(--warn); }
.place .badge.kind-structure { background: #1c3440; color: #8ad0e0; }
.place-other { margin-left: 10px; color: var(--muted); font-size: 14px; white-space: nowrap; }
.place-other b { color: var(--text); font-family: var(--mono); }
.place-form label.grow { flex: 1 1 200px; }
.place-form label.grow input { width: 100%; }
.place-form input[type=number] { width: 110px; min-width: 0; }
.place-form .hint { align-self: center; color: var(--muted); font-size: 13px; }
.place-form .hint b { font-family: var(--mono); color: var(--text); }
.srv-buttons { flex-wrap: wrap; }
section.block > .place-form { padding: 0; background: none; }
#place-filter { margin-bottom: 4px; }
.portal-calc { align-items: center; }
.portal-calc fieldset { display: flex; gap: 10px; margin: 0; padding: 8px 12px 12px; border: 1px solid var(--line); border-radius: var(--radius); min-width: 0; }
.portal-calc legend { padding: 0 6px; font: 600 12px var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); }
.portal-calc input[type=number] { width: 120px; min-width: 0; font: 17px var(--mono); color: var(--gold); }
.portal-arrows { font-size: 22px; color: var(--muted); }
.portal-out { margin: 14px 0 22px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid #9a5cc6; border-radius: var(--radius); max-width: 80ch; }
.portal-out b { font-family: var(--mono); color: var(--gold); }
.portal-links { list-style: none; }
section.block ul.portal-links { padding: 0; }
.portal-links li { padding: 8px 0; border-bottom: 1px solid var(--line); margin: 0; }
.portal-links .note { color: var(--muted); font-size: 14px; }

/* ── Guide progress ── */
.progress-bar { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 0 0 18px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.progress-bar .prog-text { flex: 1 1 260px; min-width: 0; color: var(--muted); }
.progress-bar .prog-text b { color: var(--text); }
.badge.built { background: var(--accent); color: var(--accent-ink); }
.badge.doing { background: #45390f; color: var(--gold); }
.card-top .badge.built, .card-top .badge.doing { margin-left: auto; margin-right: 6px; align-self: flex-start; }
.card-top .badge.built + .badge, .card-top .badge.doing + .badge { margin-left: 0; }
ol.steps.ticks label { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
ol.steps.ticks input { accent-color: var(--accent); width: 17px; height: 17px; flex: none; margin: 4px 0 0; }
ol.steps.ticks li.done span { color: var(--muted); text-decoration: line-through; }
ol.steps.ticks li.done::before { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.checks.mats { font-size: inherit; }
.checks.mats li { padding: 4px 0; align-items: flex-start; }
.checks.mats label { align-items: flex-start; }
.checks.mats input { margin-top: 4px; }

/* ── Which farm makes an item, and what a farm's items are used for ── */
.farm-note { color: var(--muted); }
ol.steps em.farm-note { display: block; }
.checks:not(.tall) li:has(small) { flex-wrap: wrap; }
.farm-note a, .farm-line a { color: var(--accent); }
.farm-note .badge, .farm-line .badge { vertical-align: middle; }
td .farm-note { display: block; margin-top: 2px; }
.uses-item { font-size: 15px; margin: 14px 0 6px; }
.uses-item:first-of-type { margin-top: 0; }
.uses-item a { display: inline-flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; }
.uses-item a:hover { color: var(--accent); }
.chips.small { gap: 6px; }
.chips.small a { padding: 3px 8px; font-size: 13.5px; }
.chips a.more { color: var(--muted); border-style: dashed; }

/* ── Villager Trading ── */
.trade-prof h2 { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: baseline; font-size: 14px; }
.trade-prof h2 .job { font: 13px "Segoe UI", system-ui, sans-serif; letter-spacing: 0; text-transform: none; color: var(--muted); }
.trade-prof h2 .job a { color: var(--text); display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
table.trades td a { color: var(--text); display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
table.trades td a:hover { color: var(--accent); }
table.trades td b { font-family: var(--mono); color: var(--gold); font-weight: 600; }
table.trades td.emerald b { color: var(--accent); }
table.trades td small { display: block; margin-top: 3px; color: var(--muted); font-size: 12.5px; max-width: 46ch; }
table.trades td.pick { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
table.trades td { border-bottom-color: transparent; padding-top: 5px; padding-bottom: 5px; }
table.trades tr.slot-start td { border-top: 1px solid var(--line); }
table.trades tr.lvl-start td { border-top: 2px solid var(--line); }
.trade-prof.filtered tr td { border-top: 1px solid var(--line); }
.badge.lvl-1 { background: #3a3d44; color: #c9ccd3; }
.badge.lvl-2 { background: #4b4f58; color: #f1f1f1; }
.badge.lvl-3 { background: #45390f; color: var(--gold); }
.badge.lvl-4 { background: #153d27; color: #6fe39a; }
.badge.lvl-5 { background: #123a44; color: #7fe3f0; }
.trade-jump { margin: 12px 0 22px; }
.trade-prof { scroll-margin-top: 12px; }
td .note, p.note { color: var(--muted); font-size: 13px; }
table.farm-trades td { border-bottom: 1px solid var(--line); padding-top: 7px; padding-bottom: 7px; }
table.farm-trades td:first-child { white-space: nowrap; }
table.farm-trades td:last-child a { color: var(--accent); display: inline; }

/* ── World map ── */
.map-tabs { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
.map-ghost { display: inline-flex; gap: 6px; align-items: center; color: var(--muted); font-size: 14px; margin-left: 6px; }
.map-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.world-map { display: block; width: 100%; min-width: 620px; height: auto; font: 13px "Segoe UI", system-ui, sans-serif; }
.world-map .ground.overworld { fill: #1d2a1f; }
.world-map .ground.nether { fill: #2a1a1a; }
.world-map .ground.end { fill: #23223a; }
.world-map .grid { stroke: rgba(255,255,255,.07); }
.world-map .axis { stroke: rgba(255,255,255,.22); stroke-dasharray: 4 4; }
.world-map .gl { fill: rgba(255,255,255,.4); font: 11px var(--mono); }
.world-map .mark { cursor: pointer; }
.world-map .mark text, .world-map .ghost text { fill: var(--text); paint-order: stroke; stroke: rgba(10,12,14,.85); stroke-width: 3.5px; stroke-linejoin: round; }
.world-map .mark circle, .world-map .mark rect { stroke: rgba(10,12,14,.8); stroke-width: 2; }
.world-map .mark:hover text, .world-map .mark:focus text { fill: var(--gold); }
.world-map .mark.on circle, .world-map .mark.on rect { stroke: #fff; stroke-width: 3; }
.world-map .mark:focus { outline: none; }
.world-map .ghost { opacity: .45; }
.world-map .ghost text { font-size: 11.5px; }
.world-map .route { stroke: var(--gold); stroke-width: 2.5; stroke-dasharray: 8 6; }
.world-map .north path { fill: var(--text); }
.world-map .north text, .world-map .scalebar text { fill: var(--muted); font: 600 12px var(--mono); }
.world-map .scalebar line { stroke: var(--muted); stroke-width: 3; }
.map-route { margin: 10px 0 4px; }
.map-route b { color: var(--gold); }
details.bring { margin: 0 0 18px; }
details.bring summary { cursor: pointer; font: 600 12px var(--mono); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }
details.bring p { max-width: 80ch; }
details.bring textarea { flex: 1; min-width: 0; font: 14px var(--mono); padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; resize: vertical; }

/* ── Reference: brewing, ores, beacons ── */
a.btn { display: inline-block; padding: 7px 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); color: var(--text); text-decoration: none; font-weight: 600; }
a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.ref-tabs { margin: 0 0 20px; }
table.brew td.name { white-space: nowrap; }
table.brew td a, .brew-steps a { color: var(--text); display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
table.brew td .farm-note { display: block; font-size: 12.5px; margin-top: 2px; }
table.brew .none { color: var(--muted); }
.brew-steps { list-style: none; padding: 0; }
section.block ul.brew-steps { padding: 0; }
.brew-steps li { margin: 0 0 10px; display: grid; grid-template-columns: 12em 1fr; gap: 10px; align-items: baseline; }
.brew-steps .step-item { font-weight: 600; }
.ore-chart { display: block; width: 100%; min-width: 620px; height: auto; background: #181b20; font: 13px "Segoe UI", system-ui, sans-serif; }
.ore-chart .grid { stroke: rgba(255,255,255,.06); }
.ore-chart .axis { stroke: rgba(255,255,255,.25); stroke-dasharray: 4 4; }
.ore-chart .gl { fill: rgba(255,255,255,.45); font: 11px var(--mono); }
.ore-chart .ore-name { fill: var(--text); font-weight: 600; }
.ore-chart .band { stroke: rgba(0,0,0,.5); }
.ore-chart .best { fill: var(--gold); stroke: #000; stroke-width: 1; }
.ore-chart .best-y { fill: var(--gold); font: 600 11px var(--mono); }
.ore-chart line.mark-deep { stroke: #8a8f9a; stroke-dasharray: 2 4; }
.ore-chart line.mark-sea { stroke: #4f8ef2; stroke-dasharray: 2 4; }
.ore-chart text.mark-deep { fill: #8a8f9a; }
.ore-chart text.mark-sea { fill: #6f9cf2; }
.ore-y input[type=number] { width: 120px; }

/* ── Slime chunks ── */
.world-map .chunk { fill: transparent; stroke: rgba(255,255,255,.05); }
.world-map .chunk.slime { fill: rgba(127,214,90,.42); stroke: rgba(127,214,90,.7); }
.slime-map .chunk { cursor: pointer; }
.slime-map .chunk:hover { stroke: var(--gold); stroke-width: 2; }
.world-map .chunk.picked { stroke: #fff; stroke-width: 3; }
.world-map .slime-you circle { fill: none; stroke: #fff; stroke-width: 2.5; }
.world-map .slime-you circle + circle { fill: #fff; }
.slime-form { align-items: flex-end; }
.slime-list { list-style: none; padding: 0; margin: 0; }
.slime-list li { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.slime-list li button { margin-left: auto; }
#slime-pick button { margin-left: 6px; }
.world-map .slime-layer .chunk.slime { fill: rgba(127,214,90,.2); stroke: none; }

/* ── Mob drops ── */
table.mob-drops td { vertical-align: top; }
table.mob-drops td.name { white-space: nowrap; }
table.mob-drops .drop + .drop { margin-top: 4px; }
table.mob-drops .note { min-width: 13em; }
table.mob-drops td:nth-child(3) { min-width: 15em; }
table.mob-drops td.xp { color: var(--gold); font-size: 13px; min-width: 6em; }
table.mob-drops em { color: var(--muted); font-style: normal; }
table.mob-drops td a { color: var(--text); display: inline-flex; align-items: center; gap: 5px; vertical-align: middle; }
table.mob-drops .none { color: var(--muted); }

/* ── You are here ── */
.here-bar { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 18px; background: rgba(255,255,255,.02); }
.here-now { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.here-text { flex: 1 1 18em; min-width: 0; }
.here-text b { color: var(--gold); font-family: var(--mono); }
.here-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.here-dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: var(--muted); opacity: .6; }
.here-dot.live { background: #6cc04a; opacity: 1; box-shadow: 0 0 0 0 rgba(108,192,74,.6); animation: here-pulse 1.8s infinite; }
@keyframes here-pulse { 70% { box-shadow: 0 0 0 9px rgba(108,192,74,0); } 100% { box-shadow: 0 0 0 0 rgba(108,192,74,0); } }
@media (prefers-reduced-motion: reduce) { .here-dot.live { animation: none; } }
.here-form { display: flex; gap: 8px; margin-top: 10px; }
.here-form input { flex: 1 1 auto; min-width: 0; font: 14px var(--mono); padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.here-bar .note { margin: 8px 0 0; }
.here-msg:empty { display: none; }
.world-map .you .you-ring { fill: none; stroke: #fff; stroke-width: 3; }
.world-map .you .you-dot { fill: #fff; }
.world-map .you text { fill: #fff; font-weight: 700; paint-order: stroke; stroke: rgba(10,12,14,.85); stroke-width: 3.5px; stroke-linejoin: round; }
.world-map .you.ghost { opacity: .5; }
.from-you:empty { display: none; }
.from-you b { color: var(--text); }
.map-empty { border: 1px dashed var(--line); border-radius: var(--radius); padding: 48px 20px; text-align: center; }
button.armed { border-color: #e0352b; color: #ff8a80; }
.move-text, .move-form textarea { width: 100%; font: 13px var(--mono); padding: 7px 9px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; resize: vertical; margin-top: 10px; }
.move-form { display: flex; gap: 8px; align-items: flex-start; }
.move-form textarea { flex: 1; min-width: 0; margin-top: 10px; }
.move-form button { margin-top: 10px; }
.move-data { margin-top: 32px; }

/* ── Anvil order ── */
.anvil-grid { align-items: start; }
.anvil-books { display: grid; grid-template-columns: repeat(auto-fill, minmax(15em, 1fr)); gap: 6px 14px; }
.anvil-book { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 4px 0; }
.anvil-book select { font: 14px "Segoe UI", sans-serif; padding: 2px 4px; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.anvil-book.blocked { color: var(--muted); }
.anvil-book small { flex-basis: 100%; color: var(--muted); font-size: 12.5px; margin-left: 26px; }
.anvil-cost { margin-left: 4px; }
.anvil-cost { white-space: nowrap; font-family: var(--mono); color: var(--gold); }
.anvil-cost.too { color: #ff8a80; }

/* ── Farm rates ── */
.rate-box { margin: 0 0 18px; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.rate-box h2 { margin-top: 0; }
.rate-form { display: flex; flex-wrap: wrap; gap: 8px 10px; align-items: center; margin: 8px 0; }
.rate-form label, .rate-need label { display: inline-flex; gap: 6px; align-items: center; }
.rate-form input, .rate-form select, .rate-need input { font: 15px "Segoe UI", sans-serif; padding: 5px 8px; width: 7em; background: var(--bg); color: var(--text); border: 1px solid var(--line); border-radius: 4px; }
.rate-form select { width: auto; }
.rate-need b { color: var(--gold); }
.rate-note { color: var(--muted); font-size: .92em; }

/* ── Links that look like buttons (add-on download), and the website's "saved in this browser" line ── */
a.btn { display: inline-block; text-decoration: none; line-height: 1.2; }
a.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
a.btn:hover { filter: brightness(1.08); }
#server-chip .chip-local { color: var(--muted); font-size: 11.5px; margin-top: 4px; }
@media (max-width: 900px) { #server-chip .chip-local { display: none; } }
.move-files { margin-top: 10px; }
/* The sidebar scrolls on its own when the window is too short for every entry; short windows get tighter rows. */
@media (min-width: 901px) {
  #sidebar { overflow-y: auto; scrollbar-width: thin; }
  #sidebar > * { flex-shrink: 0; }
}
@media (min-width: 901px) and (max-height: 940px) {
  #sidebar { gap: 10px; }
  #nav a { padding: 6px 10px; }
}
