:root {
  color-scheme: dark;
  --background: #18191d;
  --background-deep: #111216;
  --surface: #202126;
  --surface-raised: #27282e;
  --surface-soft: #1d1e23;
  --border: rgba(246, 239, 229, 0.1);
  --border-strong: rgba(246, 239, 229, 0.18);
  --ink: #f6efe5;
  --ink-soft: #d5cec5;
  --muted: #918f8d;
  --orange: #f08a43;
  --orange-light: #ffbc68;
  --orange-dark: #ad4e24;
  --gold: #f5bd56;
  --red: #e26255;
  --green: #7fb886;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--background);
  scroll-behavior: smooth;
}

body {
  position: relative;
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background:
    linear-gradient(rgba(255, 255, 255, 0.012) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.009) 1px, transparent 1px),
    var(--background);
  background-size: 42px 42px;
  font-family: "Space Grotesk", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  color: inherit;
}

button,
a,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--orange-light);
  outline-offset: 3px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ambient {
  position: absolute;
  z-index: -1;
  width: 700px;
  height: 700px;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(2px);
}

.ambient-one {
  top: -380px;
  left: -260px;
  background: radial-gradient(circle, rgba(173, 78, 36, 0.19), transparent 68%);
}

.ambient-two {
  top: 360px;
  right: -470px;
  background: radial-gradient(circle, rgba(240, 138, 67, 0.09), transparent 66%);
}

.topbar {
  width: min(100% - 48px, 1180px);
  height: 82px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.brand b {
  margin: 0 2px;
  color: var(--orange);
  font-weight: 400;
}

.brand-mark {
  position: relative;
  width: 28px;
  height: 28px;
  border: 2px solid var(--orange);
  transform: rotate(45deg);
  box-shadow: 0 0 22px rgba(240, 138, 67, 0.14);
}

.brand-mark::before,
.brand-mark::after,
.brand-mark span::before,
.brand-mark span::after {
  position: absolute;
  content: "";
  background: var(--ink);
}

.brand-mark::before {
  width: 2px;
  height: 22px;
  top: 1px;
  left: 11px;
  transform: rotate(-44deg);
}

.brand-mark::after {
  width: 22px;
  height: 2px;
  top: 11px;
  left: 1px;
  transform: rotate(-44deg);
}

.feed-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font: 10px/1 "DM Mono", monospace;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.feed-status i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 4px rgba(245, 189, 86, 0.08);
}

.feed-status.is-ready i {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(127, 184, 134, 0.08);
}

.feed-status.is-error i {
  background: var(--red);
}

main,
footer {
  width: min(100% - 48px, 1180px);
  margin-inline: auto;
}

.hero {
  max-width: 780px;
  padding: 82px 0 42px;
}

.eyebrow,
.section-kicker {
  margin: 0 0 12px;
  color: var(--orange);
  font: 500 10px/1 "DM Mono", monospace;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

h1,
h2,
p {
  text-wrap: pretty;
}

h1 {
  max-width: 740px;
  margin: 0;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 500;
  letter-spacing: -0.064em;
  line-height: 0.98;
}

.hero-copy {
  max-width: 610px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.65;
}

.search-section {
  position: relative;
  z-index: 20;
  max-width: 780px;
  margin-bottom: 34px;
}

.search-shell {
  position: relative;
  display: flex;
  align-items: center;
  height: 66px;
  border: 1px solid var(--border-strong);
  background: rgba(37, 38, 44, 0.94);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease;
  backdrop-filter: blur(16px);
}

.search-shell:focus-within {
  border-color: rgba(240, 138, 67, 0.7);
  background: var(--surface-raised);
  box-shadow: 0 0 0 3px rgba(240, 138, 67, 0.09), 0 20px 55px rgba(0, 0, 0, 0.25);
}

.search-icon {
  position: relative;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-left: 22px;
  border: 2px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -6px;
  bottom: -4px;
  width: 8px;
  height: 2px;
  content: "";
  background: var(--muted);
  transform: rotate(45deg);
  transform-origin: left center;
}

#item-search {
  min-width: 0;
  height: 100%;
  flex: 1;
  padding: 0 20px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

#item-search::placeholder {
  color: #777674;
}

.search-shortcut,
.text-button kbd,
.search-help kbd {
  border: 1px solid var(--border-strong);
  background: #1a1b1f;
  color: var(--muted);
  font: 9px/1 "DM Mono", monospace;
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, 0.04);
}

.search-shortcut {
  margin-right: 16px;
  padding: 7px 8px;
}

.search-help {
  margin: 10px 0 0 2px;
  color: #72716f;
  font-size: 11px;
}

.search-help kbd {
  display: inline-block;
  margin-left: 4px;
  padding: 3px 4px;
}

.search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: -1px;
  left: -1px;
  max-height: min(476px, 58vh);
  padding: 7px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  background: rgba(31, 32, 37, 0.98);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.48);
  backdrop-filter: blur(20px);
}

.search-results[hidden] {
  display: none;
}

.search-result {
  width: 100%;
  min-height: 62px;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  padding: 7px 13px 7px 7px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.search-result:hover,
.search-result.is-active {
  background: rgba(240, 138, 67, 0.095);
}

.search-result.is-active {
  box-shadow: inset 2px 0 var(--orange);
}

.item-image-wrap {
  position: relative;
  width: 100%;
  height: 100%;
  display: block;
  overflow: hidden;
}

.search-result > .item-image-wrap {
  width: 60px;
  height: 44px;
}

.search-result img,
.search-result .item-fallback {
  width: 100%;
  height: 100%;
}

.result-copy {
  min-width: 0;
}

.result-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.result-meta {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font: 9px/1 "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.result-price,
.catalog-price,
.slot-price {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font: 500 11px/1 "DM Mono", monospace;
}

.no-search-results {
  margin: 0;
  padding: 25px 18px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.workbench {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 0.8fr);
  gap: 16px;
  align-items: stretch;
  margin-bottom: 92px;
}

.panel {
  border: 1px solid var(--border);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 35%),
    rgba(31, 32, 37, 0.9);
  box-shadow: var(--shadow);
}

.inventory-card {
  padding: 30px;
}

.panel-heading,
.catalog-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.panel-heading {
  margin-bottom: 25px;
}

.panel-heading h2,
.catalog-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.035em;
}

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 17px;
}

.text-button {
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 11px;
  cursor: pointer;
  transition: color 150ms ease;
}

.text-button:hover:not(:disabled) {
  color: var(--orange-light);
}

.text-button.danger:hover:not(:disabled) {
  color: #f28b81;
}

.text-button:disabled {
  color: #595957;
  cursor: not-allowed;
}

.text-button kbd {
  margin-left: 5px;
  padding: 4px 5px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.inventory-slot {
  position: relative;
  min-width: 0;
  height: 146px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 239, 229, 0.08);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.025), transparent 38%),
    #18191f;
  color: inherit;
  user-select: none;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease, opacity 150ms ease;
}

.inventory-slot::after {
  position: absolute;
  inset: 4px;
  border: 1px solid rgba(255, 255, 255, 0.025);
  content: "";
  pointer-events: none;
}

.inventory-slot.is-empty {
  display: grid;
  place-items: center;
}

.inventory-slot.is-empty:hover {
  border-color: rgba(240, 138, 67, 0.25);
  background: #1b1c21;
}

.empty-slot-copy {
  color: #555657;
  font: 9px/1 "DM Mono", monospace;
  letter-spacing: 0.11em;
  text-align: center;
  text-transform: uppercase;
}

.empty-slot-copy::before {
  width: 24px;
  height: 24px;
  margin: 0 auto 10px;
  display: grid;
  place-items: center;
  border: 1px solid #3e3f43;
  border-radius: 50%;
  content: "+";
  color: #696a6d;
  font: 16px/1 "Space Grotesk", sans-serif;
}

.slot-number {
  position: absolute;
  z-index: 3;
  top: 8px;
  left: 9px;
  color: rgba(246, 239, 229, 0.35);
  font: 9px/1 "DM Mono", monospace;
}

.slot-item {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto;
  cursor: grab;
  touch-action: none;
}

.slot-item:active {
  cursor: grabbing;
}

.slot-visual {
  position: relative;
  min-height: 0;
  overflow: hidden;
  background: #121317;
}

.slot-visual::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(to top, rgba(17, 18, 22, 0.94), transparent 52%);
  pointer-events: none;
}

.slot-visual img,
.slot-visual .item-fallback {
  width: 100%;
  height: 100%;
}

.slot-visual img {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  image-rendering: auto;
  transform: scale(1.04);
  transition: transform 220ms ease, filter 220ms ease;
}

.inventory-slot:hover .slot-visual img {
  transform: scale(1.09);
  filter: brightness(1.08);
}

.slot-details {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 9px;
  left: 10px;
  min-width: 0;
}

.slot-name {
  display: block;
  overflow: hidden;
  color: white;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.15;
  text-overflow: ellipsis;
  text-shadow: 0 2px 8px black;
  white-space: nowrap;
}

.slot-price {
  margin-top: 5px;
  font-size: 9px;
  text-shadow: 0 1px 6px black;
}

.slot-quality {
  height: 4px;
  background: var(--quality-color, var(--orange));
  box-shadow: 0 0 13px color-mix(in srgb, var(--quality-color, var(--orange)) 50%, transparent);
}

.remove-item {
  position: absolute;
  z-index: 5;
  top: 7px;
  right: 7px;
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.17);
  border-radius: 50%;
  opacity: 0;
  background: rgba(13, 14, 17, 0.78);
  color: var(--ink);
  cursor: pointer;
  font-size: 0;
  line-height: 1;
  transform: translateY(-3px);
  transition: opacity 150ms ease, transform 150ms ease, background 150ms ease;
  backdrop-filter: blur(5px);
}

.remove-item::before,
.remove-item::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 1px;
  content: "";
  background: currentColor;
  transform-origin: center;
}

.remove-item::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.remove-item::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.inventory-slot:hover .remove-item,
.remove-item:focus-visible {
  opacity: 1;
  transform: translateY(0);
}

.remove-item:hover {
  border-color: rgba(226, 98, 85, 0.6);
  background: rgba(116, 41, 37, 0.88);
}

.inventory-slot.is-dragging {
  opacity: 0.35;
  transform: scale(0.97);
}

.inventory-slot.is-drag-target {
  border-color: var(--orange-light);
  background: rgba(240, 138, 67, 0.12);
  box-shadow: inset 0 0 0 2px rgba(240, 138, 67, 0.16);
}

.drag-ghost {
  position: fixed;
  z-index: 999;
  width: 150px;
  height: 104px;
  overflow: hidden;
  border: 1px solid var(--orange-light);
  opacity: 0.9;
  pointer-events: none;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.48);
  transform: translate(-50%, -50%) rotate(2deg);
}

.drag-ghost img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.drag-hint {
  margin: 17px 0 0;
  color: #6d6d6d;
  font-size: 10px;
  text-align: center;
}

.drag-icon {
  margin-right: 5px;
  color: #8e8b86;
}

.total-card {
  min-height: 100%;
  padding: 31px 30px 27px;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(circle at 92% 8%, rgba(240, 138, 67, 0.11), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.026), transparent 42%),
    rgba(31, 32, 37, 0.94);
}

.gold-total {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 9px;
  color: var(--orange-light);
}

.gold-total output {
  font: 500 clamp(42px, 5vw, 66px)/1 "DM Mono", monospace;
  letter-spacing: -0.075em;
  text-shadow: 0 0 28px rgba(255, 156, 69, 0.12);
}

.gold-total.is-updated output {
  animation: total-pop 280ms cubic-bezier(0.18, 0.88, 0.27, 1);
}

.gold-icon {
  width: 23px;
  height: 23px;
  border: 3px solid var(--gold);
  transform: rotate(45deg);
  box-shadow: inset 0 0 0 3px rgba(245, 189, 86, 0.13), 0 0 18px rgba(245, 189, 86, 0.14);
}

.gold-icon::after {
  width: 5px;
  height: 5px;
  margin: 6px;
  display: block;
  content: "";
  background: var(--gold);
}

.total-caption {
  min-height: 38px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.total-rule {
  height: 1px;
  margin: 20px 0;
  background: var(--border);
}

.build-stats {
  margin: 0 0 27px;
}

.build-stats > div {
  min-height: 25px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 1.4fr);
  align-items: center;
  gap: 12px;
}

.build-stats dt {
  color: var(--muted);
  font-size: 10px;
}

.build-stats dd {
  margin: 0;
  overflow: hidden;
  color: var(--ink-soft);
  font: 10px/1.4 "DM Mono", monospace;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.share-button {
  min-height: 48px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid var(--orange);
  background: var(--orange);
  color: #261d17;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
}

.share-button:hover {
  border-color: var(--orange-light);
  background: var(--orange-light);
  transform: translateY(-2px);
}

.share-button.is-copied {
  border-color: #9aca9f;
  background: #9aca9f;
}

.link-icon {
  position: relative;
  width: 15px;
  height: 15px;
}

.link-icon::before,
.link-icon::after {
  position: absolute;
  width: 9px;
  height: 5px;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  content: "";
  transform: rotate(-42deg);
}

.link-icon::before {
  top: 2px;
  right: 0;
}

.link-icon::after {
  bottom: 2px;
  left: 0;
}

.share-note {
  margin: 9px 0 0;
  color: #646462;
  font-size: 9px;
  text-align: center;
}

.catalog {
  padding-bottom: 88px;
}

.catalog-heading {
  padding-top: 4px;
}

.catalog-controls,
.filter-tabs {
  display: flex;
  align-items: center;
}

.catalog-controls {
  gap: 14px;
}

.filter-tabs {
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--border);
  background: rgba(24, 25, 29, 0.65);
}

.filter-tabs button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.filter-tabs button:hover {
  color: var(--ink-soft);
}

.filter-tabs button.is-active {
  background: var(--surface-raised);
  color: var(--orange-light);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.18);
}

.sort-control {
  position: relative;
}

.sort-control::after {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 6px;
  height: 6px;
  border-right: 1px solid var(--muted);
  border-bottom: 1px solid var(--muted);
  content: "";
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

#item-sort {
  height: 40px;
  padding: 0 34px 0 13px;
  border: 1px solid var(--border);
  border-radius: 0;
  appearance: none;
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 10px;
}

.catalog-result-count {
  margin: 22px 0 13px;
  color: #6e6d6a;
  font: 9px/1 "DM Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.catalog-item {
  position: relative;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 239, 229, 0.075);
  background: #1d1e23;
  color: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease, background 150ms ease;
}

.catalog-item:hover {
  z-index: 1;
  border-color: rgba(240, 138, 67, 0.5);
  background: #23242a;
  transform: translateY(-3px);
}

.catalog-item:active {
  transform: translateY(-1px);
}

.catalog-item.is-added {
  animation: item-added 360ms ease;
}

.catalog-visual {
  position: relative;
  aspect-ratio: 88 / 64;
  overflow: hidden;
  background: #121317;
}

.catalog-visual::after {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  content: "";
  background: linear-gradient(transparent, rgba(17, 18, 22, 0.45));
  pointer-events: none;
}

.catalog-visual img,
.catalog-visual .item-fallback {
  width: 100%;
  height: 100%;
}

.catalog-visual img {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  transition: transform 220ms ease, filter 220ms ease;
}

.catalog-item:hover img {
  transform: scale(1.055);
  filter: brightness(1.07);
}

.catalog-copy {
  min-height: 67px;
  padding: 10px 10px 9px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.catalog-name {
  display: -webkit-box;
  min-height: 28px;
  overflow: hidden;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.3;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.catalog-price {
  font-size: 9px;
}

.item-type {
  overflow: hidden;
  color: #686867;
  font: 8px/1 "DM Mono", monospace;
  letter-spacing: 0.07em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.coin-dot {
  width: 7px;
  height: 7px;
  display: inline-block;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}

.item-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 40%, rgba(240, 138, 67, 0.16), transparent 45%),
    #17181c;
  color: rgba(246, 239, 229, 0.35);
  font: 500 18px/1 "DM Mono", monospace;
  letter-spacing: -0.08em;
  text-transform: uppercase;
}

img.is-broken {
  display: none;
}

.catalog-empty,
.catalog-loading {
  grid-column: 1 / -1;
  min-height: 220px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--border);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

footer {
  min-height: 95px;
  padding: 26px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  border-top: 1px solid var(--border);
  color: #686765;
  font-size: 9px;
  line-height: 1.6;
}

footer p {
  margin: 0;
}

footer p:last-child {
  text-align: right;
}

footer a {
  color: var(--muted);
  text-underline-offset: 3px;
}

footer a:hover {
  color: var(--orange-light);
}

/* Reusable header support icon; markup lives beside #help-toggle in index.html. */
.header-support-link {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  color: var(--muted);
  font: 15px/1 sans-serif;
  text-decoration: none;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.header-support-link:hover,
.header-support-link:focus-visible {
  border-color: var(--orange);
  background: rgba(240, 138, 67, 0.08);
  color: var(--orange-light);
}

.toast {
  position: fixed;
  z-index: 1000;
  right: 24px;
  bottom: 24px;
  max-width: min(360px, calc(100% - 48px));
  padding: 13px 16px;
  border: 1px solid rgba(240, 138, 67, 0.35);
  opacity: 0;
  background: rgba(28, 29, 34, 0.97);
  color: var(--ink-soft);
  font-size: 11px;
  pointer-events: none;
  transform: translateY(12px);
  transition: opacity 170ms ease, transform 170ms ease;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.38);
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes total-pop {
  0% { transform: translateY(5px); opacity: 0.55; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes item-added {
  0%, 100% { box-shadow: none; }
  45% { border-color: var(--orange-light); box-shadow: 0 0 0 3px rgba(240, 138, 67, 0.14); }
}

@media (max-width: 1020px) {
  .workbench {
    grid-template-columns: minmax(0, 1.55fr) minmax(260px, 0.85fr);
  }

  .inventory-card {
    padding: 25px;
  }

  .inventory-slot {
    height: 134px;
  }

  .item-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .hero {
    padding-top: 64px;
  }

  .workbench {
    grid-template-columns: 1fr;
  }

  .total-card {
    min-height: 300px;
  }

  .item-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .catalog-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .catalog-controls {
    width: 100%;
    justify-content: space-between;
  }
}

@media (max-width: 620px) {
  .topbar,
  main,
  footer {
    width: min(100% - 30px, 1180px);
  }

  .topbar {
    height: 70px;
  }

  .feed-status {
    max-width: 128px;
    justify-content: flex-end;
    line-height: 1.35;
    text-align: right;
  }

  .hero {
    padding: 55px 0 35px;
  }

  h1 {
    font-size: clamp(42px, 13.5vw, 66px);
  }

  .search-shell {
    height: 60px;
  }

  .search-shortcut span {
    display: none;
  }

  .search-shortcut::before {
    content: "⌘";
  }

  .search-help {
    display: none;
  }

  .inventory-card,
  .total-card {
    padding: 22px 18px;
  }

  .panel-heading {
    align-items: flex-start;
  }

  .inventory-actions {
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .text-button kbd {
    display: none;
  }

  .slot-grid {
    gap: 6px;
  }

  .inventory-slot {
    height: 128px;
  }

  .slot-details {
    right: 7px;
    bottom: 7px;
    left: 7px;
  }

  .slot-name {
    font-size: 10px;
  }

  .remove-item {
    opacity: 1;
    transform: none;
  }

  .catalog-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .filter-tabs button {
    padding-inline: 7px;
  }

  #item-sort {
    width: 100%;
  }

  .item-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .catalog-copy {
    min-height: 63px;
    padding: 8px;
  }

  .catalog-name {
    font-size: 10px;
  }

  .item-type {
    display: none;
  }

  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  footer p:last-child {
    text-align: left;
  }
}

@media (max-width: 390px) {
  .brand {
    font-size: 11px;
  }

  .brand-mark {
    width: 24px;
    height: 24px;
  }

  .brand-mark::before {
    height: 18px;
    left: 9px;
  }

  .brand-mark::after {
    width: 18px;
    top: 9px;
  }

  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-slot {
    height: 132px;
  }

  .item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Always-visible inventory comparison */
.header-actions {
  display: flex;
  align-items: center;
  gap: 13px;
}

.help-button {
  width: 25px;
  height: 25px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: 500 10px/1 "DM Mono", monospace;
}

.help-button:hover {
  border-color: var(--orange);
  color: var(--orange-light);
}

.help-dialog {
  width: min(100% - 32px, 470px);
  padding: 0;
  border: 1px solid var(--border-strong);
  background: #202126;
  color: var(--ink);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}

.help-dialog::backdrop {
  background: rgba(9, 10, 12, 0.76);
  backdrop-filter: blur(4px);
}

.help-dialog-heading {
  min-height: 54px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.help-dialog-heading h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
}

.help-dialog-heading button {
  width: 28px;
  height: 28px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
}

.help-dialog ul {
  margin: 0;
  padding: 18px 24px 21px 37px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.7;
}

.help-dialog li + li {
  margin-top: 6px;
}

.help-dialog kbd {
  padding: 2px 4px;
  border: 1px solid var(--border-strong);
  background: var(--background-deep);
  color: var(--orange-light);
  font: 8px/1 "DM Mono", monospace;
}

.inventory-toolbar {
  width: min(100%, 1180px);
  min-height: 38px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.inventory-toolbar .add-build-button,
.inventory-toolbar .all-builds-button {
  height: 34px;
}

.inventory-toolbar .all-builds-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.inventory-toolbar .build-hotkey-hint {
  margin-left: 8px;
}

.inventory-comparison {
  width: min(100%, 1180px);
  margin: 0 auto 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(330px, 360px));
  justify-content: center;
  align-items: start;
  gap: 12px;
}

.comparison-card.inventory-card {
  position: relative;
  width: 100%;
  padding: 34px 13px 12px;
  border-color: var(--border);
  transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
}

.comparison-card.is-active {
  border-color: rgba(240, 138, 67, 0.82);
  box-shadow: 0 0 0 2px rgba(240, 138, 67, 0.08), 0 15px 42px rgba(0, 0, 0, 0.28);
}

.inventory-card-tools {
  position: absolute;
  z-index: 8;
  top: 7px;
  right: 8px;
  left: 9px;
  height: 21px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

.inventory-card-tools kbd {
  margin-right: auto;
  padding: 3px 5px;
  border: 1px solid var(--border);
  background: #18191d;
  color: #777573;
  font: 7px/1 "DM Mono", monospace;
}

.comparison-card.is-active .inventory-card-tools kbd {
  border-color: rgba(240, 138, 67, 0.35);
  color: var(--orange-light);
}

.card-icon-button {
  width: 21px;
  height: 21px;
  padding: 0;
  display: grid;
  place-items: center;
  border: 1px solid transparent;
  background: transparent;
  color: #777573;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
}

.card-icon-button:hover {
  border-color: var(--border-strong);
  color: var(--orange-light);
}

.card-icon-button.danger:hover {
  border-color: rgba(226, 98, 85, 0.4);
  color: #f28b81;
}

.comparison-card .slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.comparison-card .inventory-slot {
  height: 82px;
}

.comparison-card .inventory-slot.is-backpack {
  height: 39px;
  border-color: rgba(246, 239, 229, 0.055);
  background: #15161a;
}

.comparison-card .is-backpack .slot-visual {
  height: 39px;
  filter: grayscale(1) brightness(0.58);
}

.comparison-card .is-backpack .item-image-wrap,
.comparison-card .is-backpack .slot-visual img {
  height: 82px;
}

.comparison-card .is-backpack .slot-visual img {
  object-fit: cover;
  object-position: center center;
  transform: none;
}

.comparison-card .is-backpack:hover .slot-visual img {
  transform: none;
  filter: none;
}

.comparison-card .is-backpack .slot-name {
  display: none;
}

.comparison-card .is-backpack .slot-details {
  bottom: 4px;
}

.comparison-card .is-backpack .slot-price {
  margin-top: 0;
  color: #b4afa7;
}

.comparison-card .is-backpack .empty-slot-copy::before {
  width: 15px;
  height: 15px;
  font-size: 10px;
}

.consumed-upgrades {
  margin-top: 7px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
}

.consumed-upgrade {
  position: relative;
  height: 34px;
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(246, 239, 229, 0.07);
  background: #15161a;
  cursor: pointer;
}

.consumed-upgrade .item-image-wrap,
.consumed-upgrade img {
  width: 100%;
  height: 100%;
}

.consumed-upgrade .item-fallback {
  color: transparent;
}

.consumed-upgrade img {
  position: relative;
  z-index: 1;
  display: block;
  object-fit: cover;
  opacity: 0.2;
  filter: grayscale(1);
  transition: opacity 140ms ease, filter 140ms ease;
}

.consumed-upgrade:hover img {
  opacity: 0.42;
}

.consumed-upgrade.is-owned {
  border-color: rgba(240, 138, 67, 0.6);
}

.consumed-upgrade.is-owned img {
  opacity: 0.9;
  filter: none;
}

.upgrade-status {
  position: absolute;
  z-index: 3;
  right: 3px;
  bottom: 3px;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(10, 11, 13, 0.84);
  color: var(--muted);
  font: 9px/1 "DM Mono", monospace;
}

.consumed-upgrade.is-owned .upgrade-status {
  background: rgba(59, 98, 63, 0.92);
  color: #c3e2c6;
}

.comparison-card .inventory-summary {
  min-height: 48px;
  margin-top: 8px;
  padding-top: 8px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: 1fr;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
}

.comparison-card .total-label {
  color: var(--orange);
  font: 500 8px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.comparison-card .inventory-summary .gold-total {
  margin: 0;
  display: flex;
  grid-column: 2;
  grid-row: 1;
  gap: 8px;
}

.comparison-card .inventory-summary .gold-total output {
  font-size: 27px;
}

.search-result img {
  position: relative;
  z-index: 2;
  display: block;
  object-fit: cover;
}

.catalog-item.is-consumable {
  box-shadow: inset 0 0 0 1px rgba(245, 189, 86, 0.22);
}

@media (max-width: 760px) {
  .inventory-toolbar {
    flex-wrap: wrap;
  }

  .inventory-toolbar .build-hotkey-hint {
    width: 100%;
    margin: 2px 0 0;
    text-align: center;
  }

  .inventory-comparison {
    grid-template-columns: minmax(0, 360px);
  }
}

@media (max-width: 390px) {
  .comparison-card.inventory-card {
    padding: 32px 9px 9px;
  }

  .comparison-card .inventory-slot {
    height: 76px;
  }

  .comparison-card .inventory-slot.is-backpack,
  .comparison-card .is-backpack .slot-visual {
    height: 37px;
  }

  .comparison-card .is-backpack .item-image-wrap,
  .comparison-card .is-backpack .slot-visual img {
    height: 76px;
  }

  .inventory-toolbar .all-builds-button {
    padding-inline: 8px;
  }
}

/* Centered multi-inventory comparator */
.search-section {
  width: min(100%, 780px);
  max-width: none;
  margin: 14px auto 9px;
}

.build-switcher {
  width: min(100%, 780px);
  min-height: 42px;
  margin: 0 auto 9px;
  display: flex;
  align-items: center;
  gap: 5px;
}

.build-tabs {
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.build-tab,
.add-build-button,
.all-builds-button {
  height: 38px;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  background: var(--surface-soft);
  color: var(--muted);
  cursor: pointer;
  font-size: 9px;
  transition: border-color 140ms ease, background 140ms ease, color 140ms ease;
}

.build-tab {
  min-width: 94px;
  padding: 5px 9px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  text-align: left;
}

.build-tab strong {
  color: var(--gold);
  font: 500 8px/1 "DM Mono", monospace;
}

.build-tab:hover,
.add-build-button:hover,
.all-builds-button:hover {
  border-color: rgba(240, 138, 67, 0.45);
  color: var(--ink-soft);
}

.build-tab.is-active {
  border-color: var(--orange);
  background: rgba(240, 138, 67, 0.1);
  color: var(--orange-light);
  box-shadow: inset 0 -2px var(--orange);
}

.add-build-button,
.all-builds-button {
  padding: 0 11px;
}

.add-build-button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.all-builds-button {
  border-color: rgba(240, 138, 67, 0.38);
  color: var(--orange-light);
}

.all-builds-button.is-copied {
  border-color: var(--green);
  color: #b5d8b9;
}

.build-hotkey-hint {
  margin-left: auto;
  flex: 0 0 auto;
  color: #686765;
  font-size: 8px;
  white-space: nowrap;
}

.build-hotkey-hint kbd {
  padding: 2px 4px;
  border: 1px solid var(--border);
  background: var(--background-deep);
  color: var(--muted);
  font: 8px/1 "DM Mono", monospace;
}

.workbench {
  width: min(100%, 390px);
  max-width: 390px;
  margin: 0 auto 22px;
  display: block;
}

.inventory-card {
  width: 100%;
  padding: 14px;
}

.inventory-card .panel-heading {
  min-height: 27px;
  margin-bottom: 9px;
}

.inventory-card .panel-heading > div:first-child {
  gap: 7px;
}

.inventory-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 10px;
}

.slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.inventory-slot {
  height: 78px;
}

.slot-name {
  font-size: 10px;
}

.slot-price {
  font-size: 8px;
}

.inventory-summary {
  margin-top: 10px;
  padding-top: 10px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 3px 12px;
  border-top: 1px solid var(--border);
}

.inventory-total {
  min-width: 0;
  grid-column: 1;
  grid-row: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-total > span {
  color: var(--orange);
  font: 500 8px/1 "DM Mono", monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.inventory-summary .gold-total {
  margin: 0;
  display: flex;
  grid-column: auto;
  grid-row: auto;
  gap: 8px;
}

.inventory-summary .gold-total output {
  font-size: 25px;
}

.inventory-summary .build-stats {
  min-width: 0;
  margin: 0;
  grid-column: 1;
  grid-row: 2;
}

.inventory-summary .share-button {
  width: 126px;
  height: 52px;
  min-height: 52px;
  margin: 0;
  padding: 0 8px;
  grid-column: 2;
  grid-row: 1 / 3;
  font-size: 8px;
}

.item-grid {
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 4px;
}

.catalog-item,
.catalog-visual {
  width: 64px;
  height: 47px;
}

.catalog-price {
  font-size: 6.5px;
}

@media (max-width: 820px) {
  .build-switcher {
    flex-wrap: wrap;
  }

  .build-tabs {
    max-width: 100%;
    flex: 1 1 100%;
    order: 1;
  }

  .add-build-button {
    order: 2;
  }

  .all-builds-button {
    order: 3;
  }

  .build-hotkey-hint {
    order: 4;
  }
}

@media (max-width: 620px) {
  .workbench {
    width: min(100%, 390px);
  }

  .inventory-actions {
    flex-direction: row;
    align-items: center;
  }

  .inventory-slot {
    height: 74px;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, 60px);
  }

  .catalog-item,
  .catalog-visual {
    width: 60px;
    height: 44px;
  }
}

@media (max-width: 390px) {
  .build-hotkey-hint {
    display: none;
  }

  .inventory-card {
    padding: 10px;
  }

  .inventory-slot {
    height: 70px;
  }

  .inventory-summary {
    grid-template-columns: minmax(0, 1fr) 110px;
  }

  .inventory-summary .share-button {
    width: 110px;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, 56px);
  }

  .catalog-item,
  .catalog-visual {
    width: 56px;
    height: 41px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* Compact utility layout */
.topbar,
main,
footer {
  width: min(100% - 32px, 1380px);
}

.topbar {
  height: 54px;
}

.brand {
  gap: 9px;
  font-size: 11px;
}

.brand-mark {
  width: 23px;
  height: 23px;
}

.brand-mark::before {
  height: 17px;
  top: 1px;
  left: 8px;
}

.brand-mark::after {
  width: 17px;
  top: 8px;
  left: 1px;
}

.search-section {
  max-width: 978px;
  margin: 14px 0 8px;
}

.search-shell {
  height: 46px;
}

.search-icon {
  width: 14px;
  height: 14px;
  margin-left: 17px;
}

#item-search {
  padding: 0 16px;
  font-size: 13px;
}

.search-shortcut {
  margin-right: 10px;
  padding: 5px 7px;
}

.workbench {
  grid-template-columns: minmax(560px, 680px) 290px;
  justify-content: start;
  gap: 8px;
  margin-bottom: 12px;
}

.panel {
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.2);
}

.inventory-card {
  padding: 12px;
}

.panel-heading {
  min-height: 24px;
  margin-bottom: 8px;
  align-items: center;
}

.inventory-card .panel-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 9px;
}

.section-kicker,
.inventory-card .section-kicker {
  margin-bottom: 0;
  font-size: 8px;
}

.panel-heading h2,
.catalog-heading h2 {
  font-size: 14px;
  letter-spacing: -0.02em;
}

.inventory-actions {
  gap: 13px;
}

.text-button {
  font-size: 9px;
}

.text-button kbd {
  padding: 3px 4px;
  font-size: 8px;
}

.slot-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 4px;
}

.inventory-slot {
  height: 60px;
}

.slot-number {
  top: 4px;
  left: 5px;
  font-size: 7px;
}

.empty-slot-copy {
  font-size: 0;
}

.empty-slot-copy::before {
  width: 18px;
  height: 18px;
  margin: 0;
  font-size: 12px;
}

.slot-details {
  right: 5px;
  bottom: 5px;
  left: 5px;
}

.slot-name {
  font-size: 9px;
}

.slot-price {
  margin-top: 3px;
  font-size: 7px;
}

.slot-quality {
  height: 2px;
}

.remove-item {
  top: 4px;
  right: 4px;
  width: 19px;
  height: 19px;
  font-size: 0;
}

.total-card {
  min-height: 0;
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  grid-template-rows: auto auto 1fr;
  column-gap: 11px;
  align-items: center;
}

.total-card > .section-kicker {
  grid-column: 1;
  grid-row: 1;
}

.gold-total {
  grid-column: 1;
  grid-row: 2;
  gap: 9px;
  margin-top: 5px;
}

.gold-total output {
  font-size: 29px;
  letter-spacing: -0.06em;
}

.gold-icon {
  width: 14px;
  height: 14px;
  border-width: 2px;
}

.gold-icon::after {
  width: 3px;
  height: 3px;
  margin: 3.5px;
}

.build-stats {
  grid-column: 1;
  grid-row: 3;
  min-width: 0;
  margin: 4px 0 0;
}

.build-stats > div {
  min-height: 16px;
  display: block;
}

.build-stats dt {
  display: none;
}

.build-stats dd {
  text-align: left;
  font-size: 8px;
}

.build-stats dd::before {
  content: "Top: ";
  color: var(--muted);
}

.share-button {
  min-width: 0;
  min-height: 0;
  height: 100%;
  margin: 0;
  grid-column: 2;
  grid-row: 1 / 4;
  padding: 0 9px;
  gap: 7px;
  font-size: 9px;
}

.link-icon {
  width: 12px;
  height: 12px;
}

.catalog {
  padding-bottom: 40px;
}

.catalog-heading {
  min-height: 37px;
  padding: 0;
  align-items: center;
}

.catalog-heading > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.catalog-controls {
  gap: 7px;
}

.filter-tabs {
  gap: 2px;
  padding: 2px;
}

.filter-tabs button {
  min-height: 27px;
  padding: 0 10px;
  font-size: 8px;
}

#item-sort {
  height: 33px;
  padding-left: 10px;
  font-size: 8px;
}

.catalog-result-count {
  margin: 5px 0 7px;
  font-size: 8px;
}

.item-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, 52px);
  gap: 3px;
  align-items: start;
}

.catalog-item {
  width: 52px;
  height: 38px;
  overflow: visible;
}

.catalog-item:hover {
  z-index: 30;
  transform: translateY(-1px);
}

.catalog-visual {
  width: 52px;
  height: 38px;
  aspect-ratio: auto;
  border-bottom: 1px solid var(--quality-color, var(--orange));
}

.catalog-copy {
  position: absolute;
  z-index: 3;
  inset: 0;
  min-height: 0;
  padding: 0;
  display: block;
  overflow: visible;
  pointer-events: none;
}

.catalog-name {
  position: absolute;
  z-index: 10;
  top: calc(100% + 5px);
  left: 50%;
  width: max-content;
  max-width: 190px;
  min-height: 0;
  padding: 6px 8px;
  display: block;
  overflow: hidden;
  border: 1px solid var(--border-strong);
  opacity: 0;
  background: rgba(21, 22, 26, 0.98);
  color: var(--ink);
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
  transform: translate(-50%, -3px);
  transition: opacity 100ms ease, transform 100ms ease;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.45);
  -webkit-box-orient: initial;
  -webkit-line-clamp: initial;
}

.catalog-item:hover .catalog-name,
.catalog-item:focus-visible .catalog-name {
  opacity: 1;
  transform: translate(-50%, 0);
}

.catalog-meta {
  position: absolute;
  right: 1px;
  bottom: 2px;
  left: 1px;
  display: block;
}

.catalog-price {
  padding: 2px 3px;
  gap: 3px;
  background: rgba(10, 11, 13, 0.82);
  color: #ffd276;
  font-size: 6px;
  text-shadow: 0 1px 4px black;
}

.catalog-price .coin-dot {
  width: 4px;
  height: 4px;
}

.item-type {
  display: none;
}

footer {
  min-height: 58px;
  padding: 14px 0;
  font-size: 8px;
}

@media (max-width: 1020px) {
  .search-section {
    max-width: none;
  }

  .workbench {
    grid-template-columns: minmax(0, 1fr) 280px;
  }
}

@media (max-width: 760px) {
  .workbench {
    grid-template-columns: 1fr;
  }

  .total-card {
    min-height: 82px;
  }

  .catalog-heading,
  .catalog-controls {
    width: 100%;
  }

  .catalog-heading {
    align-items: stretch;
    flex-direction: column;
    gap: 7px;
  }

  .catalog-controls {
    align-items: center;
    flex-direction: row;
    justify-content: space-between;
  }
}

@media (max-width: 620px) {
  .topbar,
  main,
  footer {
    width: min(100% - 20px, 1380px);
  }

  .topbar {
    height: 48px;
  }

  .feed-status {
    font-size: 8px;
  }

  .search-section {
    margin-top: 9px;
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-slot {
    height: 58px;
  }

  .inventory-actions {
    flex-direction: row;
    align-items: center;
  }

  .filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    flex: 1;
  }

  #item-sort {
    width: auto;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, 52px);
    gap: 3px;
  }

  .catalog-item,
  .catalog-visual {
    width: 52px;
    height: 38px;
  }

  footer {
    gap: 4px;
  }
}

@media (max-width: 390px) {
  .item-grid {
    grid-template-columns: repeat(auto-fill, 48px);
  }

  .catalog-item,
  .catalog-visual {
    width: 48px;
    height: 35px;
  }
}

/* Final multi-inventory sizing overrides the earlier single-row compact layout. */
.search-section {
  width: min(100%, 780px);
  max-width: none;
  margin: 14px auto 9px;
}

.workbench {
  width: min(100%, 390px);
  max-width: 390px;
  margin: 0 auto 22px;
  display: block;
}

.inventory-card {
  width: 100%;
  padding: 14px;
}

.slot-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 5px;
}

.inventory-slot {
  height: 78px;
}

.slot-name {
  font-size: 10px;
}

.slot-price {
  font-size: 8px;
}

.item-grid {
  grid-template-columns: repeat(auto-fill, 64px);
  gap: 4px;
}

.catalog-item,
.catalog-visual {
  width: 64px;
  height: 47px;
}

@media (max-width: 620px) {
  .workbench {
    width: min(100%, 390px);
  }

  .slot-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .inventory-slot {
    height: 74px;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, 60px);
  }

  .catalog-item,
  .catalog-visual {
    width: 60px;
    height: 44px;
  }
}

@media (max-width: 390px) {
  .inventory-card {
    padding: 10px;
  }

  .inventory-slot {
    height: 70px;
  }

  .item-grid {
    grid-template-columns: repeat(auto-fill, 56px);
  }

  .catalog-item,
  .catalog-visual {
    width: 56px;
    height: 41px;
  }
}
