:root {
  color-scheme: dark;
  --back: #15120f;
  --panel: #211c18;
  --panel-hover: #30251d;
  --field: #191612;
  --line: #42352a;
  --ink: #fbefdf;
  --muted: #c2ae99;
  --accent: #ffb768;
  --green: #81deb1;
  --red: #ff9c91;
  font: 16px/1.5 Inter, "PingFang TC", "Noto Sans KR", "Microsoft JhengHei", system-ui, sans-serif;
  color: var(--ink);
  background: var(--back);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, .import, summary { cursor: pointer; }
button { color: inherit; }
button:disabled { opacity: .44; cursor: default; }
a { color: var(--accent); }
:focus-visible { outline: 2px solid #ffcb87; outline-offset: 3px; }
.wrap { width: min(1520px, calc(100% - 52px)); margin-inline: auto; }
.top { background: #1e1814; border-bottom: 1px solid var(--line); }
.top-inner, .top-actions, .brand, .top nav, .language {
  display: flex; align-items: center; gap: 12px;
}
.top-inner { gap: 34px; min-height: 68px; }
.top-actions { margin-left: auto; gap: 14px; }
.brand { color: var(--ink); font-weight: 780; text-decoration: none; line-height: 1.25; white-space: nowrap; }
.brand small { display: block; font-size: .79rem; color: var(--muted); font-weight: 500; }
.mark {
  display: grid; place-items: center; width: 36px; height: 36px;
  color: #ffb65d; background: #40271b; border: 1px solid #765030; border-radius: 10px;
}
.top nav { align-self: stretch; gap: 4px; }
.nav {
  align-self: stretch; background: transparent; border: 0;
  border-bottom: 2px solid transparent; padding: 0 13px; color: var(--muted);
}
.nav.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 720; }
.language { gap: 8px; color: var(--muted); font-size: .88rem; white-space: nowrap; }
.language select { width: auto; }
.secondary, .source button, .chip {
  border: 1px solid var(--line); border-radius: 7px;
  background: var(--panel); color: var(--ink); padding: 7px 11px;
  font-size: .87rem; white-space: nowrap;
}
.nav:hover, .secondary:hover, .source button:hover, .chip:hover { background-color: var(--panel-hover); }

.hero {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  position: relative; isolation: isolate; overflow: hidden; margin-top: 23px;
  min-height: 150px; padding: 23px 26px; border-radius: 14px; border: 1px solid #6a4129;
  background: radial-gradient(ellipse at 82% 98%, #8d4723 0%, transparent 44%),
    linear-gradient(105deg, #291b14, #4b2b1c 75%, #38251b);
}
.hero h1 { margin: 0 0 5px; letter-spacing: -.035em; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.15; }
.hero p { color: #e0bda2; margin: 0; }
.orbit {
  position: absolute; right: 14%; top: 8%; z-index: -1; opacity: .38; pointer-events: none;
  width: 265px; height: 146px; display: grid; place-items: center;
  background: repeating-radial-gradient(ellipse at 50% 63%, transparent 0 28px, #e7a56165 29px 30px, transparent 31px 45px);
  transform: rotate(-19deg);
}
.orbit b { color: #f5bf68; font-size: 4rem; font-weight: 400; }
.orbit span, .orbit i { position: absolute; font-size: 1.35rem; color: #ffce88; }
.orbit span { left: 15%; top: 24%; }
.orbit i { right: 17%; bottom: 12%; font-style: normal; }
.source {
  min-width: 159px; align-self: end; padding: 10px 12px;
  border: 1px solid #a3714f; border-radius: 9px; background: #201612e8; font-weight: 700; font-size: .88rem;
}
.source small { display: block; color: #e0c4ad; font-size: .79rem; font-weight: 500; }
.source button { margin-top: 6px; padding: 3px 8px; }
.notice {
  background: #2c231a; border: 1px solid #503a2a; border-radius: 8px; color: #ead0ae;
  padding: 7px 13px; margin: 12px 0; font-size: .88rem;
}
.notice:empty { display: none; }
.card { min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.filters { margin: 13px 0; padding: 9px 15px; }
.filter-line { display: flex; align-items: baseline; gap: 11px; margin: 5px 0; }
.filter-label { flex: 0 0 78px; color: var(--muted); font-size: .88rem; font-weight: 650; }
.chips { display: flex; flex-wrap: wrap; gap: 5px; }
.chip { padding: 4px 9px; background: var(--field); }
.chip.active { color: #ffd195; background: #4e301c; border-color: #ac6c3a; font-weight: 730; }
.layout { display: grid; gap: 14px; }
.section-head {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  padding: 13px 15px 10px;
}
h2 { margin: 0; font-size: 1.13rem; line-height: 1.35; }
#count { margin-left: 4px; font-size: .83rem; font-weight: 550; color: var(--accent); white-space: nowrap; }
.text-button { background: transparent; border: 0; color: var(--accent); font-size: .88rem; padding: 5px; }
.text-button:not(:disabled):hover { text-decoration: underline; }
.controls { max-width: 420px; padding: 0 15px 13px; }
.controls label { display: grid; gap: 3px; color: var(--muted); font-size: .87rem; font-weight: 620; }
input, select {
  width: 100%; min-height: 36px; border: 1px solid #564334; border-radius: 7px;
  padding: 6px 9px; background-color: var(--field); color: var(--ink); font-size: .87rem;
}
input::placeholder { color: #aa9580; }
select {
  appearance: none; padding-right: 25px; background-repeat: no-repeat;
  background-image: linear-gradient(45deg, transparent 50%, #e0bd9e 50%), linear-gradient(135deg, #e0bd9e 50%, transparent 50%);
  background-position: calc(100% - 13px) 15px, calc(100% - 8px) 15px; background-size: 5px 5px;
}
.filter-line select { width: auto; min-width: 145px; }
#official-status { margin-inline: 14px; }

.scroll { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: .92rem; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: #2d241c; color: #ead8c0; font-size: .85rem; white-space: nowrap; }
th small, .muted { color: var(--muted); font-size: .82rem; }
td:not(:first-child) { font-variant-numeric: tabular-nums; }
tr:last-child td { border-bottom: 0; }
tbody tr.selected td { background: #35271e; }
tbody tr:hover td { background: #2b221a; }
#equipment-table .listing-properties { width: 32%; }
#equipment-table .listing-potentials { min-width: 165px; width: 22%; }
#equipment-table :is(#delta-heading,.listing-average) { width: 1%; padding-inline: 8px; }
#equipment-table :is(#work-heading,.listing-processing) { text-align: center; white-space: nowrap; }
.listing-processing span { color: #e4c29f; }
.listing-processing span.muted { color: var(--muted); }
.listing-processing small { display: none; }
#equipment-table.has-no-stats :is(#stat-heading,.listing-properties) { display: none; }
#equipment-table th:first-child, .listing-name { min-width: 185px; }
#equipment-table th:first-child, #equipment-table .listing-name { position: sticky; left: 0; z-index: 1; }
#equipment-table .listing-name { background: var(--panel); }
#equipment-table .selected .listing-name { background: #35271e; }
#equipment-table tr:hover .listing-name { background: #2b221a; }
.listing-price, .listing-average { white-space: nowrap; }
.listing-price small { display: block; margin-top: 3px; font-size: .77rem; font-weight: 500; }
.listing-average { color: var(--muted); font-size: .78rem; }
.listing-average small { display: block; margin-top: 3px; font-weight: 740; font-size: inherit; }
.average-value { cursor: help; }
.price { font-weight: 760; }
.empty { text-align: center; padding: 25px 12px; color: var(--muted); white-space: normal; }
.item {
  display: flex; align-items: center; gap: 8px; width: 100%; border: 1px solid transparent;
  background: transparent; text-align: left; padding: 5px 6px; border-radius: 7px;
  font-weight: 750; min-height: 44px; line-height: 1.22;
}
.item small { display: block; margin-top: 3px; color: #ddc9b4; font-size: .75rem; font-weight: 500; }
.item-work { color: #e4c29f; white-space: nowrap; font-size: .86em; }
.glyph {
  display: grid; place-items: center; flex: 0 0 35px; height: 35px; border: 1px solid transparent;
  border-radius: 2px; color: #eec49f; background: transparent;
}
.glyph img { width: 28px; height: 28px; object-fit: contain; image-rendering: pixelated; }
.grade-1 { --potential-color: #76cfff; --potential-frame: #76cfff45; }
.grade-2 { --potential-color: #c591ff; --potential-frame: #c591ff45; }
.grade-3 { --potential-color: #ffcd69; --potential-frame: #ffcd6952; }
.glyph[class*="grade-"] { border-color: var(--potential-color); box-shadow: inset 0 0 0 1px var(--potential-frame); }
.stat-grid {
  display: grid; grid-template-columns: var(--stat-tracks);
  gap: 5px; align-items: center;
}
.stat-grid span { text-align: center; font-weight: 700; }
.stat-value small { display: none; }
.stat-head span { color: #efd4b6; font-size: .78rem; font-weight: 650; white-space: normal; line-height: 1.18; }
.stat-head .attack-sort {
  display: flex; flex-wrap: wrap; gap: 2px; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 5px; color: #efd4b6;
  padding: 4px; font-size: .78rem; font-weight: 650; line-height: 1.18;
}
.stat-head .attack-arrow { color: inherit; }
.stat-head .attack-sort:is(:hover,[aria-pressed="true"]) { color: var(--accent); border-color: var(--line); }
.potential-sort { width: auto; max-width: 100%; min-height: 30px; padding-block: 3px; background-position: calc(100% - 13px) 12px, calc(100% - 8px) 12px; }
.stat-grid .missing-stat { color: var(--muted); }
.potential-panel { display: grid; justify-items: start; gap: 3px; }
.potential-primary { color: var(--potential-color,#dfd4cd); font-size: 1rem; }
.potential-panel .listing-potential { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; line-height: 1.25; }
.potential-panel .listing-potential span { color: #e6cafa; border: 1px solid #594764; overflow-wrap: anywhere; }
.listing-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; font-size: .78rem; }
.listing-tags span { padding: 2px 6px; background: #33293a; color: #e6cafa; border-radius: 4px; }
.listing-stats span { background: #392b20; color: #f2d5b4; }
.aged { color: #f4c284; }
.equipment-tooltip {
  position: fixed; z-index: 20; width: min(314px, calc(100vw - 16px)); max-height: calc(100vh - 16px);
  overflow: auto; padding: 13px 14px; pointer-events: none;
  border: 1px solid var(--tooltip-border,#69717b); border-radius: 9px; background: var(--tooltip-background,#252930);
  color: #fff; box-shadow: 0 9px 28px #0009; font-size: .84rem;
}
.equipment-tooltip.grade-1 { --tooltip-background: #163545; --tooltip-border: #6da7bd; }
.equipment-tooltip.grade-2 { --tooltip-background: #372651; --tooltip-border: #a68aca; }
.equipment-tooltip.grade-3 { --tooltip-background: #493719; --tooltip-border: #ba9857; }
.equipment-tooltip * { color: inherit; }
.tooltip-item-title { display: block; font-size: 1.1rem; text-align: center; }
.tooltip-type { margin: 2px 0 10px; text-align: center; }
.tooltip-identity { display: grid; grid-template-columns: 80px 1fr; gap: 12px; align-items: center; }
.tooltip-identity .glyph { height: 74px; background: #c6d6e8; border-radius: 6px; }
.tooltip-identity .glyph img { width: 44px; height: 44px; }
.tooltip-identity .line-items { display: grid; gap: 3px; }
.tooltip-identity .line-items dt { color: inherit; }
.tooltip-jobs { margin: 9px 0 0; }
.tooltip-section, .equipment-tooltip .listing-tags, .tooltip-footer { margin: 8px 0 0; padding-top: 7px; border-top: 1px solid #ffffff4d; }
.equipment-tooltip .listing-tags { display: grid; gap: 3px; }
.equipment-tooltip .listing-tags span { padding: 0; background: transparent; color: inherit; }
.tooltip-footer small { display: block; }
.group-high-potential button { padding: 0; font-weight: 700; }
.group-high-potential small { display: block; margin-top: 2px; }
.group-high-potential div + div { margin-top: 6px; }
.comparisons { display: grid; gap: 3px; }
.comparison-line { display: flex; align-items: baseline; gap: 9px; justify-content: space-between; }
.compare-stat { color: var(--muted); font-size: .78rem; }
.deal-better-1 { color: #abe3c7; }
.deal-better-2 { color: #83e7b2; }
.deal-better-3 { color: #4df5a0; }
.deal-worse-1 { color: #ffbdb3; }
.deal-worse-2 { color: #ffa094; }
.deal-worse-3 { color: #ff807d; }
.deal-better-3, .deal-worse-3 { font-weight: 840; }

.detail { padding: 14px 15px; }
.detail-label, .detail > p { margin: 2px 0 6px; }
.detail-title { display: flex; align-items: center; gap: 7px; width: fit-content; padding: 4px 0; }
.detail section { border-top: 1px solid var(--line); margin-top: 11px; padding-top: 8px; }
.detail h3 { margin: 0 0 6px; font-size: .94rem; }
.bench { padding: 8px 10px; border-radius: 7px; background: #2d231c; }
.bench p { margin: 0 0 5px; }
.bench .comparison-line { justify-content: start; flex-wrap: wrap; }
.line-items { display: flex; gap: 10px 18px; flex-wrap: wrap; margin: 0; }
.line-items div { display: flex; align-items: baseline; gap: 6px; font-size: .89rem; }
.line-items dt { color: var(--muted); }
.line-items dd { margin: 0; font-weight: 700; }
.potential-list { margin: 0; padding-left: 18px; }
.equipment-history { margin-top: 12px; }
.equipment-history summary { color: var(--accent); }
.history-events { max-height: 440px; overflow: auto; }
.history-events details { margin: 5px 0; border-top: 1px solid var(--line); padding: 5px; }
.history-offer { display: grid; gap: 3px; padding: 6px; border-bottom: 1px solid var(--line); }
footer { display: flex; justify-content: space-between; gap: 12px; padding: 16px 0; color: var(--muted); font-size: .84rem; }
#sales { margin-top: 14px; }
#official-history { padding: 0 15px 12px; }

@media (max-width: 900px) {
  .wrap { width: calc(100% - 30px); }
  .top-inner { gap: 14px; }
}
@media (max-width: 620px) {
  .wrap { width: calc(100% - 22px); }
  .top-inner { flex-wrap: wrap; row-gap: 1px; padding-top: 9px; }
  .top nav { order: 3; width: 100%; }
  .nav { padding: 7px 8px; }
  .language > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .top-actions { gap: 6px; }
  .import { padding-inline: 6px; }
  .hero { margin-top: 13px; padding: 13px; flex-direction: column; align-items: start; }
  .source { align-self: start; }
  .hero p { font-size: .92rem; }
  .filter-label { flex-basis: 56px; }
  .chip { padding-inline: 6px; }
  .comparison-line { justify-content: start; }
  #equipment-table, #equipment-table thead, #equipment-table tbody { display: block; }
  #equipment-table tr { display: grid; grid-template-columns: minmax(96px, 1.2fr) minmax(61px, .75fr) minmax(72px, .95fr); border-bottom: 1px solid var(--line); }
  #equipment-table tr > :is(#work-heading,.listing-processing) { grid-column: 1 / -1; grid-row: 2; text-align: left; }
  #equipment-table tr > :is(#stat-heading,.listing-properties) { grid-column: 1 / -1; grid-row: 3; width: auto; }
  #equipment-table tr > :is(#potential-heading,.listing-potentials) { grid-column: 1 / -1; grid-row: 4; width: auto; min-width: 0; }
  #equipment-table tr > :is(#delta-heading,.listing-average) { grid-column: 2; grid-row: 1; }
  #equipment-table :is(#delta-heading,.listing-average) { width: auto; }
  #equipment-table tr > :is(#ask-heading,.listing-price) { grid-column: 3; grid-row: 1; }
  #equipment-table thead tr > :is(#work-heading,#stat-heading,#potential-heading) { display: none; }
  #equipment-table .listing-processing:empty { display: none; }
  #equipment-table .listing-processing small { display: inline; margin-right: 6px; }
  #equipment-table.has-attack-order thead #stat-heading, #equipment-table.has-potential-order thead #potential-heading { display: block; }
  #equipment-table.has-attack-order .stat-head > span { visibility: hidden; }
  #equipment-table.has-potential-order .potential-sort { width: 100%; }
  #equipment-table th, #equipment-table td { border-bottom: 0; min-width: 0; padding: 6px; white-space: normal; }
  #equipment-table th:first-child, #equipment-table .listing-name { position: static; min-width: 0; }
  #equipment-table .listing-name .glyph { flex-basis: 26px; height: 26px; }
  #equipment-table .glyph img { width: 21px; height: 21px; }
  #equipment-table .item { gap: 4px; padding: 4px; font-size: .82rem; }
  #equipment-table .item small, #equipment-table .listing-price small { font-size: .68rem; }
  #equipment-table th, #equipment-table .listing-average, #equipment-table .listing-price { font-size: .77rem; }
  #equipment-table .compare-stat { font-size: .68rem; }
  #equipment-table .comparison-line { flex-wrap: wrap; gap: 0 4px; }
  #equipment-table .stat-grid { grid-template-columns: var(--mobile-stat-tracks); min-width: 0; gap: 3px; }
  #equipment-table .stat-head .attack-sort { padding-inline: 0; }
  #equipment-table .stat-value small { display: block; font-size: .69rem; color: var(--muted); line-height: 1.2; }
  #equipment-table .stat-head span { font-size: .68rem; }
  #equipment-table .empty { grid-column: 1 / -1; }
}
