:root {
  color-scheme: dark;
  /* Game-authentic warm dark obsidian palette (removed green tint) */
  --bg: #131110;
  --bar: #1a1715;
  --rail: #161412;
  --surface: #1e1a17;
  --surface-2: #241f1b;
  --field: #29231f;
  --line: #3a322b;
  --line-soft: rgba(92, 78, 66, .42);
  --ink: #efe9dc;
  --muted: #b7ada0;
  --faint: #8e8478;
  /* Wartales in-game semantic colors */
  --amber: #e2b86b;
  --gold: #ecc46e;
  --green: #74c95c;
  --red: #e06a62;
  --purple: #d874f2;
  --purple-border: #623c70;
  --rare-border: #7d6238;
  --blue-meta: #729ec9;
  --text: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  --number: "Bahnschrift", "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background-color: var(--bg);
  background-image: linear-gradient(rgba(19, 17, 16, .84), rgba(19, 17, 16, .88)), var(--tex-board, none);
  background-size: auto, 960px auto;
  background-attachment: fixed;
  color: var(--ink);
  font: 15px/1.55 var(--text);
}
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled, select:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
[hidden] { display: none !important; }
p, h1, h2, h3, h4, figure { margin: 0; }
h1 { font-size: 34px; line-height: 1.15; font-weight: 720; letter-spacing: .01em; }
h2 { font-size: 21px; line-height: 1.3; font-weight: 680; }
h3 { font-size: 16px; line-height: 1.35; }

/* Top toolbar */
.toolbar {
  position: sticky; top: 0; z-index: 6; min-height: 60px; padding: 0 28px;
  display: flex; align-items: center; gap: 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(24, 21, 18, .96);
  backdrop-filter: blur(6px);
}
.wordmark { width: 170px; flex: none; font: 700 16px var(--number); letter-spacing: .12em; color: var(--amber); }
.wordmark span { margin-left: 9px; color: var(--muted); font: 13px var(--text); letter-spacing: 0; white-space: nowrap; }
.save-control, .tools { display: flex; align-items: center; gap: 12px; }
.save-control { min-width: 0; }
.save-control label { color: var(--muted); font-size: 13px; white-space: nowrap; }
.tools { margin-left: auto; }
.search-wrap { position: relative; }
.search-results {
  position: absolute; z-index: 8; top: calc(100% + 7px); right: 0;
  width: min(370px, 92vw); max-height: min(56vh, 450px); overflow: auto;
  background: var(--bar); border: 1px solid var(--line); box-shadow: 0 10px 28px rgba(0, 0, 0, .6);
}
.search-result { display: grid; width: 100%; gap: 3px; text-align: left; color: var(--ink); background: none; border: 0; border-bottom: 1px solid var(--line); padding: 9px 13px; }
.search-result:hover, .search-result:focus-visible { background: var(--field); }
.search-result strong { font-size: 14px; }
.search-result span, .search-empty { color: var(--muted); font-size: 13px; }
.search-empty { padding: 13px; }
select, #search, #rescan, .icon-btn {
  height: 35px; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 3px; font-size: 13px;
}
select { max-width: min(335px, 28vw); min-width: 175px; padding: 0 10px; }
#search { width: 214px; padding: 0 10px; }
#search::placeholder { color: var(--faint); }
#rescan, .icon-btn { padding: 0 11px; white-space: nowrap; }
#rescan:hover, .icon-btn:hover { border-color: var(--amber); color: var(--amber); }
.icon-btn { color: var(--muted); background: var(--bar); }
.toggle { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; cursor: pointer; }
.toggle input { accent-color: var(--amber); margin: 0; inline-size: 16px; block-size: 16px; }

/* Published catalogue: import is optional. Keep the desktop app's toolbar unchanged. */
.static-import { display: none; }
[data-site-mode="static"] :is(#setup-view, #open-save-dir, #rescan, .local-note) { display: none !important; }
[data-site-mode="static"] .static-import { display: flex; align-items: center; gap: 12px; }
[data-site-mode="static"] .toolbar { gap: 16px; }
[data-site-mode="static"] #save-select { min-width: 0; width: clamp(140px, 18vw, 290px); }
#static-choose { color: var(--ink); }
.static-link, .static-help summary {
  border: 0; background: none; color: var(--muted); font: 13px/1.5 var(--text);
  padding: 6px 0; cursor: pointer; white-space: nowrap;
}
.static-link:hover, .static-help summary:hover, .static-help[open] summary { color: var(--amber); }
.static-help { position: relative; }
.static-help summary { list-style: none; }
.static-help summary::-webkit-details-marker { display: none; }
.static-help-body {
  position: absolute; z-index: 8; top: calc(100% + 10px); right: 0; width: min(340px, 86vw);
  background: var(--bar); color: var(--ink); border: 1px solid var(--line);
  padding: 14px 16px; font-size: 13px; line-height: 1.65;
}
.static-help-body p + p { margin-top: 8px; color: var(--muted); }
.static-help-body button { margin-top: 6px; }

/* Main layout shell */
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: calc(100vh - 60px); }
.sidebar {
  background: rgba(21, 18, 16, .95); border-right: 1px solid var(--line);
  padding: 20px 14px 30px;
}
.nav-world { padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.nav-heading { color: var(--faint); font-size: 12px; letter-spacing: .08em; margin: 0 10px 8px; text-transform: uppercase; }
.nav-heading-top { margin-top: 0; }
.region-link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  background: transparent; border: 0; border-inline-start: 2px solid transparent; text-align: left;
  color: var(--muted); font-size: 13.5px; padding: 8px 10px; margin: 2px 0; border-radius: 0 3px 3px 0;
}
.region-link:hover { background: var(--surface); color: var(--ink); }
.region-link[aria-current="page"] { border-color: var(--amber); color: var(--ink); background: var(--surface-2); font-weight: 600; }
.region-link .remaining { color: var(--amber); font: 700 15px var(--number); }
.region-link-name { display: inline-flex; align-items: center; gap: 6px; min-width: 0; }
.region-here-ico { width: 14px; height: 14px; object-fit: contain; flex: none; filter: drop-shadow(0 0 4px rgba(114, 158, 201, .75)); }
.world-link-label { display: inline-flex; align-items: center; gap: 9px; font-weight: 600; }
.world-link .heading-ico { width: 22px; height: 22px; }
.topic-badge { color: var(--faint); font: 600 12.5px var(--number); white-space: nowrap; }
.local-note { color: var(--faint); font-size: 12.5px; margin: 22px 10px 0; border-top: 1px solid var(--line); padding-top: 12px; }

main { min-width: 0; width: 100%; max-width: 1440px; padding: 28px clamp(22px, 3.6vw, 56px) 56px; }
.read-error { border-inline-start: 2px solid var(--amber); background: var(--surface); padding: 9px 14px; margin-bottom: 18px; color: var(--amber); }

/* Headers & enlarged icon summary strip */
.region-title { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 35%); align-items: center; gap: 26px; }
.region-en { color: var(--amber); font: 600 12.5px var(--number); letter-spacing: .16em; margin-bottom: 6px; text-transform: uppercase; }
.subtitle { color: var(--muted); font-size: 13px; }
#save-meta, #topic-meta, #world-meta { margin-top: 7px; }
.region-title img { width: 100%; height: 118px; object-fit: cover; object-position: center 46%; border: 1px solid var(--line); filter: saturate(.84); }
.summary {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr));
  border-block: 1px solid var(--line); background: rgba(26, 22, 19, .86);
  margin-top: 18px;
}
.metric {
  display: flex; align-items: center; gap: 11px; padding: 11px 13px; min-width: 0;
}
.metric + .metric { border-left: 1px solid var(--line); }
.metric.filterable {
  border: 0; background: transparent; text-align: left; color: inherit; cursor: pointer;
  border-bottom: 2px solid rgba(200, 155, 92, .22); transition: background .12s ease, border-color .12s ease;
}
.metric + .metric.filterable, .metric.filterable + .metric { border-left: 1px solid var(--line); }
.metric.filterable:hover { background: var(--surface-2); border-bottom-color: rgba(200, 155, 92, .65); }
.metric.filterable[aria-pressed="true"] { background: var(--surface-2); border-bottom-color: var(--amber); }
.metric.filterable[aria-pressed="true"] .metric-label { color: var(--amber); font-weight: 600; }
.metric-ico-box {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center;
}
.metric-ico { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .65)); }
.metric-body { display: grid; gap: 1px; min-width: 0; }
.metric-label { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.metric strong { white-space: nowrap; font: 700 22px/1.15 var(--number); font-variant-numeric: tabular-nums; color: var(--ink); }
.metric[data-done="true"] strong { color: var(--green); }
.ui-ico { display: inline-block; object-fit: contain; flex: none; }
.heading-with-icon { display: inline-flex; align-items: center; gap: 9px; }
.heading-icon { display: inline-flex; align-items: center; }
.heading-ico { width: 24px; height: 24px; opacity: .95; }

/* Map section (region + 4K world map) */
.map { margin-top: 22px; }
.map-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin: 0 0 10px; }
.map-heading span { color: var(--faint); font-size: 13px; }
.map-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.map-toggle { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; cursor: pointer; user-select: none; }
.map-toggle input { accent-color: var(--amber); margin: 0; inline-size: 15px; block-size: 15px; }
.layer-switch, .zoom-controls {
  display: inline-flex; align-items: center; background: var(--bar);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
}
.layer-btn, .zoom-controls button {
  height: 31px; padding: 0 11px; border: 0; background: transparent;
  color: var(--muted); font-size: 12.5px; white-space: nowrap;
}
.layer-btn + .layer-btn, .zoom-controls button + button { border-left: 1px solid var(--line); }
.layer-btn[aria-pressed="true"] { background: var(--field); color: var(--amber); font-weight: 600; }
.layer-btn:hover:not(:disabled), .zoom-controls button:hover { color: var(--ink); background: var(--surface-2); }
.layer-btn:disabled { opacity: .4; }
.zoom-controls span { padding: 0 8px; color: var(--ink); font: 600 12.5px var(--number); border-left: 1px solid var(--line); }
.map-body { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--line); background: var(--surface); }
.map-plot { min-width: 0; }
.map-plot svg { width: 100%; height: auto; display: block; }
.map-canvas { fill: #1b1714; }
.town-anchor { pointer-events: none; user-select: none; fill: #f2ead8; }
.town-anchor circle { opacity: .72; stroke: #1a1613; stroke-width: 1.2; }
.town-anchor text { font-size: 14px; fill-opacity: .85; stroke: #1a1613; stroke-opacity: .9; stroke-width: 3.2px; stroke-linejoin: round; paint-order: stroke; }
.landmark-pin { opacity: .9; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .92)); cursor: pointer; }
.landmark-pin:hover, .world-lm-pin:hover { opacity: 1; filter: drop-shadow(0 0 5px rgba(226, 184, 107, .95)); }
.map-plot { position: relative; min-width: 0; }
.map-float-tip {
  position: absolute; z-index: 7; pointer-events: none;
  padding: 6px 10px; background: rgba(18, 15, 13, .95);
  border: 1px solid var(--amber); border-radius: 3px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .7);
  max-width: 240px; transform: translate(-50%, calc(-100% - 14px));
}
.map-float-tip.pinned { pointer-events: auto; }
.map-float-tip strong { display: block; font-size: 13.5px; color: var(--ink); line-height: 1.3; }
.map-float-tip span { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.map-float-tip .tip-jump {
  margin-top: 6px; padding: 2px 8px; font-size: 12px; color: var(--amber);
  background: var(--field); border: 1px solid var(--line); border-radius: 2px;
}
.map-float-tip .tip-jump:hover { border-color: var(--amber); }
.tip-goals { display: grid; gap: 4px; margin-top: 5px; }
.tip-goal-row {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--ink); line-height: 1.35; white-space: nowrap;
}
.tip-goal-row[data-done="false"] { color: #f2dfb6; }
.tip-goal-ico { width: 15px; height: 15px; object-fit: contain; flex: none; }
.lm-badge-ico { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .95)); pointer-events: none; }
.pin { cursor: pointer; color: var(--amber); }
.pin[data-done="true"] { color: var(--faint); }
.pin[data-known="false"] { color: var(--muted); }
.pin-badge > circle { fill: rgba(20, 17, 15, .92); stroke: currentColor; stroke-width: 2.3; }
.pin[data-done="false"] .pin-badge > circle { fill: rgba(34, 26, 16, .95); }
.pin-badge text { fill: currentColor; font: 700 13px var(--number); }
.pin-tag rect { fill: rgba(20, 17, 15, .88); stroke: rgba(226, 184, 107, .62); stroke-width: 1.1; }
.pin[data-done="true"] .pin-tag rect { fill: rgba(20, 17, 15, .78); stroke: rgba(142, 132, 120, .42); }
.pin-tag .pin-dot { fill: var(--amber); }
.pin[data-done="true"] .pin-tag .pin-dot { fill: var(--green); }
.pin-tag text { fill: var(--ink); font-size: 12.5px; font-weight: 600; }
.pin[data-done="true"] .pin-tag text { fill: var(--muted); font-weight: 400; }
.pin:hover .pin-badge > circle, .pin:focus-visible .pin-badge > circle { stroke: var(--ink); }
.pin:hover .pin-tag rect, .pin:focus-visible .pin-tag rect { stroke: var(--ink); fill: rgba(28, 24, 20, .98); }
.pin:hover .pin-tag text, .pin:focus-visible .pin-tag text { fill: var(--ink); }
.map-legend { display: flex; flex-wrap: wrap; gap: 6px 10px; padding: 10px 14px; border-top: 1px solid var(--line); background: var(--bar); }
.map-chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 3px;
  color: var(--ink); font-size: 13px;
}
.map-chip[data-done="false"] { border-color: rgba(226, 184, 107, .48); }
.map-chip:hover, .map-chip:focus-visible { border-color: var(--amber); background: var(--field); }
.chip-ico { width: 18px; height: 18px; }
.chip-name { font-weight: 600; }
.map-chip .state { font-size: 12px; }

/* 4K World map stage */
.world-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 16px; }
.world-stage {
  position: relative; margin-top: 16px; height: min(74vh, 740px); min-height: 500px;
  overflow: hidden; background: #191613; border: 1px solid var(--line);
  cursor: grab; user-select: none; touch-action: none;
}
.world-stage.dragging { cursor: grabbing; }
.world-viewport { position: absolute; top: 0; left: 0; transform-origin: 0 0; will-change: transform; }
.world-viewport svg { display: block; }
.world-pin-inner, .world-plate-inner, .world-lm-inner {
  transform: scale(var(--inv-scale, 1)); transform-box: fill-box; transform-origin: center;
}
.world-landmarks, .world-plates { transition: opacity .18s ease; }
.world-stage[data-zoom-lod="far"] .world-landmarks { opacity: 0; pointer-events: none; }
.world-stage[data-zoom-lod="near"] .world-plates { opacity: 0; pointer-events: none; }
.world-lm-pin { opacity: .9; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .92)); cursor: pointer; }
.world-region-poly {
  fill: rgba(236, 196, 110, 0); stroke: rgba(242, 236, 224, .86);
  stroke-linecap: round; stroke-linejoin: round;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .82));
  cursor: pointer; transition: fill .14s ease, stroke .14s ease;
}
.world-region-polys[data-borders="false"] .world-region-poly { stroke: none; filter: none; }
.world-stage[data-zoom-lod="near"] .world-region-poly { stroke-dasharray: 24 14; stroke-opacity: .76; }
.world-region-poly:hover { fill: rgba(236, 196, 110, .14); stroke: #fff5d6; }
.world-region-polys[data-borders="false"] .world-region-poly:hover { stroke: none; }
.player-pin { cursor: pointer; }
.player-pin-ring {
  fill: rgba(74, 148, 224, .22); stroke: #7fc1ff; stroke-width: 2;
  filter: drop-shadow(0 0 6px rgba(100, 178, 255, .85));
}
.player-pin-tag rect { fill: rgba(18, 24, 32, .9); stroke: #7fc1ff; stroke-width: 1.1; }
.player-pin-tag text { fill: #e8f3ff; font-size: 12px; font-weight: 700; }

/* Gear icons directly on region & 4K world maps */
.gear-leader { stroke: rgba(203, 111, 232, .52); stroke-width: 1.3; stroke-linecap: round; pointer-events: none; }
.gear-leader[data-done="true"] { stroke: rgba(107, 166, 92, .42); }
.gear-map-pin { cursor: pointer; transition: opacity .15s ease; }
.gear-map-pin[data-done="true"] { opacity: .48; }
.gear-map-pin:hover { opacity: 1; }
.gear-map-pin rect {
  fill: rgba(24, 17, 28, .92); stroke: #cb6fe8; stroke-width: 1.5;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, .88));
}
.gear-map-pin[data-done="true"] rect { stroke: #6ba65c; }
.gear-map-pin:hover rect { stroke: #f2a8ff; stroke-width: 2; }
.gear-stack-badge rect { fill: #2c1736; stroke: #e08cff; stroke-width: 1.2; }
.gear-stack-badge text { fill: #f6dcff; font: 700 10.5px var(--number); }
.map-float-list { display: grid; gap: 3px; margin-top: 6px; max-height: 220px; overflow: auto; }
.map-float-list button {
  display: flex; align-items: center; gap: 6px; width: 100%; border: 0; background: rgba(255, 255, 255, .04);
  color: var(--purple); font-size: 12px; padding: 3px 6px; border-radius: 2px; text-align: left; cursor: pointer;
}
.map-float-list button[data-done="true"] { color: var(--muted); }
.map-float-list button:hover { background: rgba(216, 116, 242, .18); color: #fff; }
.map-float-list img { width: 18px; height: 18px; object-fit: contain; flex: none; }

/* Map jump beacon & target icon flash */
.map-beacon-ring {
  fill: rgba(245, 210, 118, .22); stroke: #ffe08a; stroke-width: 2.5;
  transform-box: fill-box; transform-origin: center;
  animation: beaconPulse 0.9s ease-out 4;
}
.map-beacon-core { fill: #fff2c4; stroke: #24190d; stroke-width: 1.5; }
@keyframes beaconPulse {
  0% { transform: scale(.55); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}
.map-pin-flash { animation: pinFlash 0.6s ease-in-out 5; }
@keyframes pinFlash {
  0%, 100% { filter: drop-shadow(0 0 2px rgba(0, 0, 0, .9)); }
  50% { filter: drop-shadow(0 0 11px #ffe28c) brightness(1.45); }
}
.setup-view { max-width: 680px; padding-top: 12px; }
.setup-view code { font-family: Consolas, monospace; font-size: 13px; color: var(--amber); background: var(--surface-2); padding: 1px 5px; }
.setup-form { display: grid; gap: 14px; margin-top: 22px; }
.setup-form label { display: grid; gap: 6px; font-size: 13.5px; color: var(--muted); }
.setup-form input {
  height: 38px; padding: 0 12px; background: var(--field); color: var(--ink);
  border: 1px solid var(--line); border-radius: 3px; font-size: 14px;
}
.setup-actions { display: flex; align-items: center; gap: 14px; margin-top: 4px; }
#setup-submit {
  height: 36px; padding: 0 18px; background: var(--surface-2); color: var(--amber);
  border: 1px solid var(--amber); border-radius: 3px; font-weight: 600;
}
#setup-submit:hover { background: var(--field); }
.setup-hints { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); display: grid; gap: 10px; font-size: 13px; color: var(--muted); }
.setup-hints strong { color: var(--ink); }
.drop-overlay {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center;
  background: rgba(14, 12, 10, .82); backdrop-filter: blur(3px); pointer-events: none;
}
.drop-box {
  display: grid; gap: 8px; text-align: center; padding: 36px 52px;
  background: var(--bar); border: 2px dashed var(--amber); border-radius: 4px;
}
.drop-box strong { font-size: 18px; color: var(--amber); }
.drop-box span { font-size: 13px; color: var(--muted); }
.world-region-plate { cursor: pointer; }
.world-region-plate .plate-name {
  fill: #f0ebe1; font-size: 19px; font-weight: 700; letter-spacing: .04em;
  paint-order: stroke; stroke: rgba(14, 11, 9, .92); stroke-width: 4.5px; stroke-linejoin: round;
  transition: fill .14s ease;
}
.world-region-plate .plate-sub {
  fill: #cac1b2; font-size: 12.5px; font-weight: 600; letter-spacing: .03em;
  paint-order: stroke; stroke: rgba(14, 11, 9, .9); stroke-width: 3.2px; stroke-linejoin: round;
}
.world-region-plate:hover .plate-name { fill: #f7da96; }
.world-region-plate:hover .plate-sub { fill: #efe4cc; }
.world-hint {
  position: absolute; left: 12px; bottom: 10px; padding: 4px 10px;
  background: rgba(20, 17, 15, .86); border: 1px solid var(--line); border-radius: 3px;
  color: var(--muted); font-size: 12px; pointer-events: none;
}

/* Status badges */
.state { font-size: 12.5px; font-weight: 600; white-space: nowrap; color: var(--amber); }
.state[data-done="true"] { color: var(--green); }
.state[data-code="unknown"] { color: var(--muted); }
.state[data-code="held"] { color: var(--ink); }
.state[data-code="missing"] { color: var(--red); }
.state::before { content: "○"; margin-right: 5px; }
.state[data-done="true"]::before { content: "●"; }
.state[data-code="unknown"]::before { content: "?"; }

/* Section heading */
.guide-section { margin-top: 28px; }
.section-heading { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.section-heading p { font-size: 13px; color: var(--faint); }

/* =========================================================
   IN-GAME TOOLTIP STYLE GEAR CARDS (Purple Legendary / Gold Rare)
   ========================================================= */
.gear-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }
.gear-entry {
  display: flex; flex-direction: column;
  background: #191514;
  border: 1px solid var(--purple-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.gear-entry.gear-showcase-card {
  display: grid; grid-template-columns: 112px minmax(0, 1fr);
}
.gear-entry.bounty-card { border-color: var(--rare-border); }
.gear-entry.recipe-card, .gear-entry.member-card, .gear-entry.job-ref-card {
  border-color: var(--line); background: var(--surface);
}
.gear-showcase {
  display: grid; place-items: center; padding: 14px 10px;
  background-color: #161119;
  background-image: radial-gradient(circle at 50% 48%, rgba(186, 96, 218, .22), rgba(16, 12, 18, .96) 76%), var(--tex-rarity, none);
  background-size: auto, cover;
  border-right: 1px solid rgba(154, 96, 176, .28);
  color: var(--muted); font-size: 12px; text-align: center;
}
.bounty-card .gear-showcase {
  background-color: #191510;
  background-image: radial-gradient(circle at 50% 48%, rgba(224, 176, 86, .22), rgba(18, 15, 11, .96) 76%), var(--tex-rarity, none);
  border-right-color: rgba(212, 166, 86, .28);
}
.gear-showcase img {
  display: block; width: 86px; height: 86px; object-fit: contain;
  filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .82));
}
.gear-main { display: flex; flex-direction: column; min-width: 0; }
.gear-banner {
  display: block;
  padding: 11px 14px 10px;
  background-color: #291a2e;
  background-image: linear-gradient(95deg, rgba(64, 30, 74, .76), rgba(26, 20, 28, .92) 72%), var(--tex-rarity, none);
  background-size: auto, cover;
  border-bottom: 1px solid rgba(154, 96, 176, .34);
}
.bounty-card .gear-banner {
  background-color: #2c2317;
  background-image: linear-gradient(95deg, rgba(84, 59, 25, .74), rgba(28, 23, 18, .92) 72%), var(--tex-rarity, none);
  border-bottom-color: rgba(212, 166, 86, .34);
}
.item-icon {
  width: 62px; height: 62px; display: grid; place-items: center; flex: none;
  background: radial-gradient(circle at center, rgba(216, 116, 242, .22), rgba(20, 16, 22, .85) 75%);
  border: 1px solid rgba(216, 116, 242, .4); color: var(--muted); font-size: 12px; text-align: center;
}
.bounty-card .item-icon {
  background: radial-gradient(circle at center, rgba(236, 196, 110, .22), rgba(24, 20, 15, .85) 75%);
  border-color: rgba(236, 196, 110, .42);
}
.item-icon img { display: block; width: 54px; height: 54px; object-fit: contain; }
.gear-meta { min-width: 0; }
.gear-title-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.gear-title-group { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; min-width: 0; }
.gear-name { font-weight: 720; font-size: 17px; line-height: 1.25; color: var(--purple); }
.bounty-card .gear-name { color: var(--gold); }
.recipe-card .gear-name, .member-card .gear-name, .job-ref-card .gear-name { color: var(--ink); font-size: 16px; }
.gear-en { color: var(--faint); font: 12px/1.3 var(--number); }
.gear-head-right { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.gear-price-weight { display: inline-flex; align-items: center; gap: 8px; font: 600 13px var(--number); }
.pw-chip { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.pw-chip.gold-val { color: var(--gold); }
.gear-type { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 4px; color: var(--blue-meta); font-size: 12.5px; }
.gear-route-tag { color: var(--muted); }
.gear-route-link {
  display: inline-flex; align-items: center; gap: 5px; border: 0; background: none; padding: 0;
  color: #dfd4c2; font-size: 12.5px; cursor: pointer; text-align: left;
  transition: color .12s ease;
}
.gear-route-link:hover { color: var(--amber); text-decoration: underline; }
.route-src-ico { width: 16px; height: 16px; object-fit: contain; flex: none; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
.gear-body { display: flex; flex-direction: column; gap: 10px; padding: 12px 15px; flex: 1; }
.gear-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.stat-chip { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); font-size: 13.5px; font-weight: 600; }
.stat-val { color: var(--green); font-weight: 700; }
.stat-ico { width: 17px; height: 17px; object-fit: contain; flex: none; }
.stat-svg { stroke: var(--amber); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.gear-effect { display: grid; gap: 10px; }
.skill-block { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 11px; align-items: start; }
.skill-block.no-ico { grid-template-columns: minmax(0, 1fr); }
.skill-ico-wrap {
  width: 40px; height: 40px; display: grid; place-items: center;
  background-color: #211c19; background-image: var(--tex-skill, none); background-size: cover;
  border: 1px solid var(--line);
}
.skill-ico { width: 34px; height: 34px; object-fit: contain; }
.skill-body h4 { font-size: 15px; font-weight: 700; margin: 0 0 3px; color: var(--green); }
.skill-body p, .gear-lore { font-size: 13.5px; color: #d5cfc3; line-height: 1.52; overflow-wrap: anywhere; }
.gear-lore { color: var(--muted); }
.skill-body p.skill-meta-tags { margin-top: 5px; font-size: 12.5px; color: var(--blue-meta); font-weight: 600; }
.hl-num { color: #ffffff; font-weight: 700; }
.hl-buff { color: var(--green); font-weight: 600; }
.hl-debuff { color: var(--red); font-weight: 600; }
.hl-term { color: #f6eedf; font-weight: 700; }

/* Applied oil block (matches in-game oil bottle + green name + effect) */
.oil-list { display: grid; gap: 7px; padding-top: 9px; border-top: 1px solid var(--line-soft); }
.oil-row { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 9px; align-items: start; }
.oil-bottle { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .75)); }
.oil-name { font-size: 13.5px; font-weight: 700; color: var(--green); }
.oil-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; margin-top: 1px; }

.wiki-route { font-size: 12.5px; color: var(--amber); padding-top: 6px; border-top: 1px dashed var(--line-soft); }
.basis {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 15px; border-top: 1px solid var(--line-soft);
  background: rgba(15, 13, 12, .55); color: var(--faint); font-size: 12.5px;
}
.basis-text { display: inline-flex; align-items: center; gap: 6px; min-width: 0; color: var(--muted); }
.wiki-link {
  margin-left: auto; color: var(--amber); font-size: 12.5px; white-space: nowrap;
  text-decoration: underline; text-underline-offset: 2px;
}
.wiki-link:hover { color: var(--ink); }
.empty-line { color: var(--faint); padding: 14px 0; }
#gear-review { border-bottom: 1px solid var(--line); color: var(--muted); padding: 14px 0 10px; }
#gear-review > summary { width: max-content; max-width: 100%; cursor: pointer; font-size: 14px; }
#gear-review > summary:hover { color: var(--ink); }

/* Landmarks, tombs, codices */
#site-list { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
.site-row { min-width: 0; padding: 13px 0 10px; border-bottom: 1px solid var(--line); }
.site-heading { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; column-gap: 8px; }
.site-title-wrap { display: flex; align-items: flex-start; gap: 10px; min-width: 0; }
.site-ico { width: 24px; height: 24px; margin-top: 1px; }
.site-hint { color: var(--muted); margin: 6px 0 3px; font-size: 13.5px; }
.site-row .codex-row:last-child { border-bottom: 0; }
#other-place { padding: 12px 10px; border-bottom: 1px solid var(--line); }
.focus-target { box-shadow: inset 3px 0 var(--amber); background: var(--surface-2); }
.codex-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 9px; align-items: center; min-height: 50px; border-bottom: 1px solid var(--line-soft); }
.codex-row img { width: 34px; height: 34px; object-fit: contain; }
.codex-row .codex-name { font-size: 13.5px; }
.topology { margin-top: 24px; }
.topology-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); }
.room-map { display: block; width: 100%; min-width: 690px; height: auto; direction: ltr; }
.room-map[data-cols="5"] { min-width: 790px; }
.swipe-hint { display: none; }
.room rect { fill: #26211d; stroke: #574a3f; }
.room text { fill: var(--ink); text-anchor: middle; font-size: 19px; font-weight: 620; }
.room-map[data-tomb="done"] .room rect { stroke: var(--line); }
.room-map[data-tomb="done"] .room text { fill: var(--faint); }
.room-paths { stroke: var(--amber); stroke-width: 2; fill: none; }
.room-map[data-tomb="done"] .room-paths { stroke: #766a5e; }
.trail-secret { stroke-dasharray: 6 5; }
.secret-key { width: 19px; border-top: 2px dashed var(--muted); }
.room-lock rect { fill: var(--surface); stroke: var(--amber); }
.room-map[data-tomb="done"] .room-lock rect { stroke: var(--line); }
.room.relic[data-done="false"] rect { stroke: var(--purple); }
.room.relic[data-done="false"] text { fill: var(--purple); }
.room-caption { display: flex; flex-wrap: wrap; column-gap: 16px; row-gap: 5px; padding-top: 9px; }
.room-icon { stroke: currentColor; fill: none; stroke-width: 1.55; stroke-linecap: round; stroke-linejoin: round; }
.room-symbol { color: var(--green); fill: var(--green); stroke: none; }
.room-codex { color: var(--blue-meta); }
.room-chest, .room-lock > .room-icon { color: var(--amber); }
.room-relic { color: var(--purple); }
.mark-key { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.ruin-route { margin-top: 7px; color: var(--muted); font-size: 13px; }
.tips { border-top: 1px solid var(--line); padding-top: 17px; }
.tips p { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tips strong { color: var(--ink); }
.tips a, .ruin-route a { margin-left: 9px; color: var(--amber); text-decoration: underline; text-underline-offset: 2px; white-space: nowrap; }
[id^="point-"] { scroll-margin-top: 80px; }
[id^="point-"]:focus-visible { outline-offset: 4px; }

/* Topic pages (Recipes / Bounty / Troop) */
.topic-header { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 14px; }
.help-tip {
  font-size: 12.5px; color: var(--muted); padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 3px; background: var(--bar); cursor: help;
}
.help-tip:hover { color: var(--amber); border-color: var(--amber); }
.topic-controls { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.topic-controls-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px; }
.pill-group { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.pill-btn {
  height: 32px; padding: 0 13px; border: 1px solid var(--line); border-radius: 3px;
  background: var(--bar); color: var(--muted); font-size: 13px; white-space: nowrap;
}
.pill-btn:hover { color: var(--ink); border-color: var(--faint); }
.pill-btn[aria-pressed="true"] { background: var(--field); border-color: var(--amber); color: var(--amber); font-weight: 600; }
.topic-search, .topic-select {
  height: 32px; padding: 0 10px; background: var(--field); border: 1px solid var(--line);
  border-radius: 3px; color: var(--ink); font-size: 13px;
}
.topic-search { width: min(280px, 100%); margin-left: auto; }
.topic-search::placeholder { color: var(--faint); }
.topic-count-bar { margin: 14px 0 4px; color: var(--faint); font-size: 13px; }

/* =========================================================
   IN-GAME COMPENDIUM RECIPES (Figure 1, 2, 4, 5, 6 - ZERO boxes inside boxes)
   ========================================================= */
.station-bar {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 4px 0 8px;
}
.station-shield {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 10px; border: 0; background: transparent; color: var(--muted);
  opacity: .72; transition: opacity .15s ease, transform .15s ease;
}
.station-shield:hover { opacity: .96; transform: translateY(-1px); color: var(--ink); }
.station-shield[aria-pressed="true"] { opacity: 1; color: var(--ink); }
.station-ico {
  width: 52px; height: 52px; object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .75));
}
.station-shield[aria-pressed="true"] .station-ico {
  filter: drop-shadow(0 0 8px rgba(240, 224, 186, .55)) drop-shadow(0 2px 5px rgba(0, 0, 0, .8));
}
.station-name { font-size: 13px; font-weight: 600; white-space: nowrap; }
.station-shield[aria-pressed="true"] .station-name { color: var(--amber); }
.station-count { font: 600 12px var(--number); color: var(--faint); }

.comp-group-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
  margin: 20px 0 12px; padding: 6px 12px;
  background: rgba(24, 20, 17, .92); border-left: 2px solid var(--amber);
}
.comp-group-head h3 { font-size: 15px; font-weight: 640; color: var(--ink); }
.comp-group-cnt { font-size: 12.5px; color: var(--faint); }

.comp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.comp-card {
  display: grid; grid-template-columns: 92px minmax(0, 1fr);
  min-height: 96px; background: #141210; border: 1px solid #3c332b;
  cursor: pointer; transition: border-color .14s ease, background .14s ease;
}
.comp-card:hover, .comp-card:focus-visible { border-color: var(--amber); background: #1a1714; outline: none; }
.comp-card[data-known="false"] .comp-prod-ico { opacity: .62; filter: saturate(.75); }
.comp-card[data-known="false"]:hover .comp-prod-ico { opacity: .95; filter: saturate(1); }
.comp-well {
  position: relative; display: grid; place-items: center; padding: 8px;
  background: linear-gradient(180deg, #24211e 0%, #191a1c 100%);
}
.comp-shield {
  position: absolute; top: 4px; left: 4px; width: 22px; height: 22px; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .85));
}
.comp-prod-ico {
  width: 58px; height: 58px; object-fit: contain;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, .75));
}
.comp-body {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px;
  padding: 10px 12px; min-width: 0;
}
.comp-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.comp-name { font-size: 15.5px; font-weight: 680; color: var(--ink); line-height: 1.25; }
.comp-card[data-rarity="uncommon"] .comp-name { color: #d5cfc3; }
.comp-card[data-rarity="rare"] .comp-name { color: var(--gold); }
.comp-card[data-rarity="legendary"] .comp-name { color: var(--purple); }
.comp-food { display: inline-flex; align-items: center; gap: 3px; font: 700 13px var(--number); flex: none; }
.comp-food-ico { width: 15px; height: 15px; object-fit: contain; }
.comp-effect {
  font-size: 12.5px; color: var(--muted); line-height: 1.35;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.comp-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.comp-ings { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bare-ing { position: relative; display: inline-flex; align-items: flex-end; gap: 1px; }
.bare-ing-ico { width: 26px; height: 26px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
.bare-ing-cnt {
  font: 700 13.5px/1 var(--number); color: var(--green);
  text-shadow: 0 1px 2px #000, 0 0 3px #000; margin-left: -4px;
}
.bare-unlock { display: inline-flex; align-items: center; gap: 3px; flex: none; font: 700 12.5px var(--number); }
.bare-unlock.know { color: var(--blue-meta); }
.bare-uk-ico { width: 18px; height: 18px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }

/* Native floating Game Tooltip for Recipes (Figure 1 & 5) */
.game-tooltip {
  position: fixed; z-index: 30; width: 344px; max-width: calc(100vw - 28px);
  background: #141210; border: 1px solid #594e3f;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .82); pointer-events: auto;
}
.game-tooltip[data-rarity="uncommon"] { border-color: #4f5980; }
.game-tooltip[data-rarity="rare"] { border-color: var(--rare-border); }
.game-tooltip[data-rarity="legendary"] { border-color: var(--purple-border); }
.gt-head {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 10px 14px;
  background-color: #25221c;
  background-image: linear-gradient(95deg, rgba(64, 59, 44, .62), rgba(24, 21, 18, .92) 72%), var(--tex-rarity, none);
  background-size: auto, cover;
  border-bottom: 1px solid rgba(130, 118, 92, .35);
}
.game-tooltip[data-rarity="uncommon"] .gt-head {
  background-image: linear-gradient(95deg, rgba(56, 66, 106, .74), rgba(21, 21, 29, .94) 72%), var(--tex-rarity, none);
  border-bottom-color: rgba(108, 122, 174, .38);
}
.game-tooltip[data-rarity="rare"] .gt-head {
  background-image: linear-gradient(95deg, rgba(84, 67, 29, .68), rgba(24, 21, 18, .92) 72%), var(--tex-rarity, none);
}
.game-tooltip[data-rarity="legendary"] .gt-head {
  background-image: linear-gradient(95deg, rgba(72, 34, 84, .74), rgba(24, 20, 26, .92) 72%), var(--tex-rarity, none);
}
.gt-name { font-size: 17px; font-weight: 700; color: var(--ink); }
.game-tooltip[data-rarity="uncommon"] .gt-name { color: #a4b3f6; }
.game-tooltip[data-rarity="rare"] .gt-name { color: var(--gold); }
.game-tooltip[data-rarity="legendary"] .gt-name { color: var(--purple); }
.gt-pw { display: inline-flex; align-items: center; gap: 9px; font: 700 13.5px var(--number); flex: none; }
.gt-body { display: grid; gap: 9px; padding: 12px 14px; }
.gt-flavor { font-size: 13px; color: var(--muted); line-height: 1.48; }
.gt-effect { font-size: 13.5px; color: var(--ink); line-height: 1.5; }
.gt-effect strong { color: #ffffff; }
.gt-food { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--ink); }
.gt-diet { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 13.5px; font-weight: 600; color: var(--ink); }
.gt-diet-opt { display: inline-flex; align-items: center; gap: 4px; }
.gt-food-ico { width: 18px; height: 18px; object-fit: contain; }
.gt-mats { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 10px; font-size: 12.5px; color: var(--muted); }
.gt-mats-label { color: var(--faint); }
.gt-mat-item { display: inline-flex; align-items: center; gap: 4px; color: var(--ink); }
.gt-mat-ico { width: 18px; height: 18px; object-fit: contain; }
.gt-unlock { font-size: 12.5px; color: var(--amber); }
.gt-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding-top: 8px; border-top: 1px solid var(--line-soft); font-size: 12.5px;
}
.gt-type { color: var(--blue-meta); font-weight: 600; }
.gt-state { color: var(--faint); }
.gt-state[data-done="true"] { color: var(--green); }

/* Keep job-ref-card head helper */
.recipe-head { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 12px; align-items: start; }
.recipe-icon { width: 52px; height: 52px; background: #26211d; border: 1px solid var(--line); }
.recipe-icon img { width: 44px; height: 44px; }
.recipe-desc { font-size: 13px; color: var(--muted); line-height: 1.5; }
.bounty-story { font-size: 12.5px; color: var(--faint); line-height: 1.45; }
.inline-jump { border: 0; background: none; padding: 0; color: var(--amber); font-size: 12.5px; white-space: nowrap; }
.inline-jump:hover { text-decoration: underline; }

/* Troop Roster (Companion Bar + Portrait Plates + Job Icon Chips) */
.roster-strip {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; padding: 12px 14px;
  background: var(--bar); border: 1px solid var(--line);
}
.roster-avatar {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 4px;
  width: 78px; padding: 6px 4px; background: transparent; border: 1px solid transparent; border-radius: 3px; color: var(--ink);
}
.roster-avatar:hover { background: var(--surface-2); border-color: var(--amber); }
.portrait-frame {
  position: relative; width: 58px; height: 58px; display: grid; place-items: center;
  background-color: #26211d; background-image: var(--tex-portrait, none); background-size: cover;
  border: 1px solid #574a3e;
}
.portrait-main-ico { width: 46px; height: 46px; object-fit: contain; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .8)); }
.portrait-sub-ico {
  position: absolute; right: 2px; bottom: 2px; width: 22px; height: 22px; object-fit: contain;
  background: rgba(18, 15, 13, .85); border: 1px solid var(--line); padding: 1px;
}
.rank-crown {
  position: absolute; top: -7px; left: -5px; width: 22px; height: 22px; object-fit: contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .9));
}
.roster-avatar-name { font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 72px; }
.sub-section-title { margin: 18px 0 6px; font-size: 14.5px; color: var(--muted); font-weight: 600; }
.member-card { padding: 14px 16px; gap: 11px; border-top: 2px solid var(--line); }
.member-card.has-rank { border-top-color: var(--gold); }
.member-head { display: grid; grid-template-columns: 60px minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.member-id { min-width: 0; }
.member-name-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 8px; }
.rank-badge {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; color: var(--gold);
}
.rank-badge img { width: 18px; height: 18px; object-fit: contain; }
.member-class-row { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.class-ico-sm { width: 19px; height: 19px; object-fit: contain; }
.member-spec { color: var(--amber); font-weight: 600; }
.title-pill { font-size: 12.5px; color: var(--gold); font-weight: 500; }
.title-pill::before { content: "· "; color: var(--faint); }
.member-job { display: inline-flex; align-items: center; gap: 8px; flex: none; }
.job-ico-lg { width: 32px; height: 32px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .7)); }
.job-meta { display: grid; line-height: 1.25; }
.job-meta strong { font-size: 13px; color: var(--ink); }
.job-meta span { font-size: 12px; color: var(--muted); }

/* Equipped gear: bare original icons with subtle rarity underline (NO boxes inside boxes) */
.equipped-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; padding-top: 2px; }
.eq-slot {
  position: relative; display: inline-flex; align-items: center; gap: 6px;
  padding-bottom: 3px; border-bottom: 2px solid var(--line); color: var(--muted); font-size: 12.5px; cursor: default;
}
.eq-slot[data-rarity="legendary"] { border-bottom-color: var(--purple); color: var(--purple); }
.eq-slot[data-rarity="rare"] { border-bottom-color: var(--gold); color: var(--gold); }
.eq-slot[data-rarity="uncommon"] { border-bottom-color: var(--green); color: #cde2c9; }
.eq-slot img { width: 28px; height: 28px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }

/* Traits: flat color-coded inline stream (zero borders) */
.trait-chips { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; line-height: 1.45; }
.trait-chip { color: var(--muted); cursor: default; }
.trait-chip[data-polarity="positive"] { color: var(--green); font-weight: 500; }
.trait-chip[data-polarity="negative"] { color: var(--red); font-weight: 600; }

/* Other trained jobs: bare original shield icons + green level count (matches recipes) */
.other-jobs-row { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.other-jobs-label { font-size: 12px; color: var(--faint); }
.bare-job { display: inline-flex; align-items: flex-end; gap: 1px; cursor: default; }
.bare-job img { width: 22px; height: 22px; object-fit: contain; filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .8)); }
.bare-job span { font: 700 12.5px/1 var(--number); color: var(--green); text-shadow: 0 1px 2px #000; margin-left: -3px; }

.title-prog-list { display: grid; gap: 5px; padding-top: 8px; border-top: 1px dashed var(--line-soft); }
.title-prog-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; font-size: 12.5px; }
.prog-name { color: var(--ink); font-weight: 600; }
.prog-metric { color: var(--muted); text-align: right; font-variant-numeric: tabular-nums; }
.prog-badge { font-size: 12px; font-weight: 600; color: var(--faint); white-space: nowrap; }
.prog-badge[data-state="current"] { color: var(--gold); }
.prog-badge[data-state="reached"] { color: var(--green); }

.trait-ref-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; margin-top: 10px; }
.trait-ref-card { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px; background: var(--surface); border: 1px solid var(--line); }
.trait-ref-card[data-polarity="positive"] { border-inline-start: 2px solid var(--green); }
.trait-ref-card[data-polarity="negative"] { border-inline-start: 2px solid var(--red); }
.title-ref-card[data-worn="true"] { border-inline-start: 2px solid var(--gold); }
.trait-ref-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.trait-ref-title { display: inline-flex; align-items: center; gap: 7px; font-size: 14.5px; }
.trait-ico-sm { width: 22px; height: 22px; object-fit: contain; }
.pol-tag { font-size: 11px; padding: 0 5px; border-radius: 2px; border: 1px solid var(--line); }
.pol-tag[data-polarity="positive"] { color: var(--green); border-color: rgba(116, 201, 92, .5); }
.pol-tag[data-polarity="negative"] { color: var(--red); border-color: rgba(224, 106, 98, .55); }
.owner-tag { font-size: 11.5px; color: var(--green); white-space: nowrap; }
.trait-attr { font-size: 12.5px; color: var(--amber); line-height: 1.45; }
.trait-desc { font-size: 12.5px; color: var(--muted); line-height: 1.45; }
.job-ref-card { padding: 13px 15px; gap: 10px; }
.job-levels { padding-top: 8px; border-top: 1px dashed var(--line-soft); }

@media (max-width: 1160px) {
  .summary { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .metric:nth-child(n+5) { border-top: 1px solid var(--line); }
  .metric:nth-child(5) { border-left: 0; }
  .trait-ref-grid, .comp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .toolbar { padding-inline: 18px; gap: 13px; }
  .wordmark { width: auto; }
  .save-control label { display: none; }
  .shell { grid-template-columns: 188px minmax(0, 1fr); }
  main { padding-inline: 24px; }
  .swipe-hint { display: inline; }
}
@media (max-width: 1020px) {
  .gear-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .toolbar { flex-wrap: wrap; gap: 8px; padding: 8px 14px; }
  .wordmark { width: 100%; padding-top: 3px; }
  select { max-width: min(360px, 90vw); }
  .tools { flex-wrap: wrap; margin-left: 0; }
  #search { width: 148px; }
  .search-results { right: auto; left: -60px; }
  .shell { display: block; }
  .sidebar { padding: 6px 10px; border-right: 0; border-bottom: 1px solid var(--line); }
  .sidebar nav { display: flex; overflow-x: auto; }
  .region-link { flex: none; width: auto; }
  .nav-heading, .local-note { display: none; }
  main { padding: 18px 14px 32px; }
  .region-title { grid-template-columns: 1fr 32%; gap: 10px; }
  .region-title img { height: 80px; }
  h1 { font-size: 28px; }
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(odd) { border-left: 0; }
  .metric:nth-child(n+3) { border-top: 1px solid var(--line); }
  #site-list, .trait-ref-grid { grid-template-columns: 1fr; }
  .member-head { grid-template-columns: 54px minmax(0, 1fr); }
  .member-job { grid-column: 1 / -1; }
  [id^="point-"] { scroll-margin-top: 138px; }
}

@media (max-width: 1150px) {
  [data-site-mode="static"] .toolbar { gap: 12px; padding-inline: 16px; }
  [data-site-mode="static"] .wordmark { width: auto; }
  [data-site-mode="static"] .save-control label { display: none; }
  [data-site-mode="static"] #search { width: clamp(140px, 17vw, 185px); }
  /* Desktop sets the column count inline. Let verified tallies reflow on small screens. */
  [data-site-mode="static"] :is(#summary, #world-summary) { grid-template-columns: repeat(4, minmax(0, 1fr)) !important; }
}
@media (max-width: 920px) {
  [data-site-mode="static"] .toolbar { flex-wrap: wrap; padding-block: 8px; gap: 6px 14px; }
  [data-site-mode="static"] .static-import { margin-inline-start: auto; }
  [data-site-mode="static"] .tools { flex: 1 1 100%; justify-content: flex-end; }
  [data-site-mode="static"] :is(#summary, #world-summary) { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}
@media (max-width: 620px) {
  [data-site-mode="static"] .toolbar { padding-inline: 12px; }
  [data-site-mode="static"] .save-control { flex: 1 1 100px; }
  [data-site-mode="static"] #save-select { width: 100%; max-width: none; }
  [data-site-mode="static"] .static-import { flex: 1 1 100%; margin: 0; gap: 12px; }
  [data-site-mode="static"] .static-help { position: static; margin-inline-start: auto; }
  [data-site-mode="static"] .static-help-body { left: 12px; right: 12px; top: 100%; width: auto; }
  [data-site-mode="static"] .tools { justify-content: flex-start; }
  [data-site-mode="static"] .search-wrap { flex: 1; min-width: 0; }
  [data-site-mode="static"] #search { width: 100%; }
  [data-site-mode="static"] .metric { padding: 8px; gap: 7px; }
  [data-site-mode="static"] .metric strong { font-size: 18px; }
}
