:root {
  --core-black: #0c1017;
  --bg: #11141c;
  --panel: #171b24;
  --panel-2: #1c212c;
  --panel-3: #232936;
  --border: #2b3341;
  --border-soft: #435064;
  --muted: #8a93a3;
  --muted-2: #b0bac8;
  --metal: #c8d0db;
  --text: #f4f7fb;
  --positive: #75d66b;
  --amber: #ffd166;
  --red: #ff5f6d;
  --blue: #2f80ed;
  --blue-2: #3b8cff;
  --orange: #ff8a3d;
  --radius: 8px;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(59, 140, 255, 0.045), transparent 260px),
    radial-gradient(circle at 72% -18%, rgba(47, 128, 237, 0.13), transparent 360px),
    var(--bg);
  color: var(--text);
  font-family: Inter, Satoshi, Manrope, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 0 22px;
  border-bottom: 1px solid var(--border);
  background: rgba(17, 20, 28, 0.94);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
  min-width: 0;
}

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

.brand-word {
  font-size: 21px;
  font-weight: 760;
  white-space: nowrap;
}

.brand-word span {
  color: var(--metal);
}

.nav-tabs,
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-tabs {
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar {
  display: none;
}

.nav-tab,
.ghost-btn,
.steam-btn,
.icon-btn,
.primary-btn,
.secondary-btn,
.tiny-btn {
  min-height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #1b202b;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 150ms ease;
}

.nav-tab {
  padding: 0 13px;
  color: var(--muted-2);
  font-size: 13px;
  font-weight: 700;
}

.nav-tab:hover,
.ghost-btn:hover,
.secondary-btn:hover,
.tiny-btn:hover {
  border-color: var(--border-soft);
  background: #141a22;
}

.nav-tab.is-active {
  color: var(--text);
  border-color: #4b5664;
  background: #222938;
}

.ghost-btn,
.steam-btn {
  padding: 0 13px;
  font-size: 13px;
  font-weight: 740;
  white-space: nowrap;
}

.ghost-btn {
  color: #c9d0d8;
}

.steam-btn,
.primary-btn {
  border-color: #2f80ed;
  background: var(--blue);
  color: #ffffff;
  font-weight: 800;
}

.steam-btn.profile-btn {
  position: relative;
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 46px;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-color: var(--border-soft);
  border-radius: 8px;
  padding: 0;
  background: #1b202b;
}

.steam-btn.profile-btn img,
.avatar-fallback {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.steam-btn.profile-btn span:not(.avatar-fallback) {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.avatar-fallback {
  display: grid;
  place-items: center;
  color: var(--text);
  background: #202833;
  font-size: 18px;
  font-weight: 850;
}

.workspace {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr) 360px;
  gap: 16px;
  padding: 16px;
}

.sidebar,
.details-panel,
.content {
  min-width: 0;
}

.sidebar,
.details-panel {
  position: sticky;
  top: 88px;
  height: calc(100vh - 104px);
  overflow: auto;
}

.sidebar,
.details-panel,
.panel,
.flow-card,
.stat-card,
.item-card,
.table-panel,
.builder-panel,
.inventory-row,
.mechanic-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(28, 33, 44, 0.92);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.18);
}

.sidebar {
  padding: 14px;
}

.filter-block {
  display: grid;
  gap: 8px;
  padding: 0 0 15px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--border);
}

.label,
.eyebrow {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.search-wrap {
  position: relative;
}

.search-wrap svg {
  position: absolute;
  left: 11px;
  top: 50%;
  width: 16px;
  height: 16px;
  fill: var(--muted);
  transform: translateY(-50%);
  pointer-events: none;
}

input,
select {
  width: 100%;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171c26;
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: #566272;
}

input[type="search"] {
  padding: 0 12px 0 34px;
}

select {
  padding: 0 11px;
}

input[type="range"] {
  height: 26px;
  accent-color: var(--metal);
}

.range-head,
.scale-row,
.price-row,
.meta-line,
.detail-kv,
.table-head,
.table-row,
.modal-row,
.drawer-head,
.view-head,
.basket-total,
.portfolio-top,
.sell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.range-head output,
.scale-row {
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.flow-card {
  padding: 14px;
  box-shadow: none;
}

.flow-card h2 {
  margin: 0 0 10px;
  font-size: 15px;
}

.flow-card ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #c5cedb;
  font-size: 13px;
  line-height: 1.42;
}

.view-head {
  margin-bottom: 14px;
}

.view-head h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.1;
}

.view-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.stat-card {
  padding: 14px;
  box-shadow: none;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.stat-card strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
}

.market-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.item-card {
  display: grid;
  grid-template-rows: 126px auto;
  min-height: 292px;
  padding: 11px;
  cursor: pointer;
  box-shadow: none;
}

.item-card:hover,
.item-card.is-selected {
  border-color: var(--blue);
  background: #202735;
}

.skin-art {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(238, 242, 246, 0.08);
  border-radius: 7px;
  background:
    linear-gradient(135deg, var(--art-a), var(--art-b) 48%, var(--art-c)),
    #141a22;
}

.skin-art::before,
.skin-art::after {
  position: absolute;
  content: "";
  inset: 18% 12%;
  border-radius: 8px;
  background: rgba(238, 242, 246, 0.1);
  transform: skewX(-18deg);
}

.skin-art::after {
  inset: auto 12% 20% 32%;
  height: 26px;
  background: rgba(9, 13, 18, 0.28);
}

.has-skin-image {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 50% 20%, rgba(59, 140, 255, 0.13), transparent 45%),
    linear-gradient(145deg, #202734, #171c26 48%, #211e2a);
}

.has-skin-image::before,
.has-skin-image::after {
  display: none;
}

.has-skin-image img {
  width: 94%;
  height: 94%;
  object-fit: contain;
  filter: drop-shadow(0 18px 26px rgba(0, 0, 0, 0.35));
}

.item-body {
  display: grid;
  gap: 10px;
  padding-top: 11px;
}

.item-title {
  display: grid;
  gap: 3px;
}

.item-title h2 {
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 680;
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.badge {
  min-height: 24px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 8px;
  color: #d4dbe6;
  background: #171c26;
  font-size: 11px;
  font-weight: 760;
}

.badge.good {
  color: #c3f3bd;
  border-color: rgba(127, 182, 133, 0.42);
}

.badge.warn {
  color: #ffd9b3;
  border-color: rgba(255, 138, 61, 0.46);
}

.price-row strong {
  font-size: 19px;
}

.change-up {
  color: var(--positive);
}

.change-down {
  color: var(--red);
}

.meta-line {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.details-panel {
  padding: 14px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  border: 1px dashed var(--border-soft);
  border-radius: var(--radius);
  padding: 24px;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.45;
}

.detail-art {
  height: 172px;
  margin-bottom: 14px;
  border-radius: var(--radius);
}

.detail-title h2 {
  margin: 0;
  font-size: 22px;
}

.detail-title p {
  margin: 5px 0 0;
  color: var(--muted);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.detail-kv {
  min-height: 60px;
  align-items: start;
  flex-direction: column;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171c26;
}

.detail-kv span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
  text-transform: uppercase;
}

.detail-kv strong {
  font-size: 15px;
}

.float-gauge {
  margin: 15px 0;
}

.gauge-track {
  position: relative;
  height: 9px;
  border-radius: 999px;
  background: linear-gradient(90deg, #20c95a 0 7%, #98d83e 7% 15%, #f0c94a 15% 38%, #f38b45 38% 45%, #ff4d5e 45% 100%);
}

.gauge-pin {
  position: absolute;
  top: -5px;
  width: 4px;
  height: 19px;
  border-radius: 99px;
  background: var(--text);
  box-shadow: 0 0 0 4px rgba(238, 242, 246, 0.08);
}

.detail-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.detail-actions.vertical {
  grid-template-columns: 1fr;
}

.primary-btn,
.secondary-btn,
.tiny-btn {
  padding: 0 13px;
}

.secondary-btn {
  background: #1b202b;
  color: #d8e0eb;
  font-weight: 760;
}

.tiny-btn {
  min-height: 32px;
  color: #cbd3dc;
  font-size: 12px;
  font-weight: 760;
}

.table-panel,
.builder-panel,
.mechanic-block {
  padding: 14px;
  box-shadow: none;
}

.table-panel h2,
.builder-panel h2,
.mechanic-block h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 0.5fr 0.6fr 0.5fr;
  gap: 12px;
  align-items: center;
  min-height: 38px;
}

.table-head {
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.table-row {
  color: #e0e6ee;
  border-bottom: 1px solid rgba(37, 45, 55, 0.58);
  font-size: 13px;
}

.table-row:last-child {
  border-bottom: 0;
}

.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 14px;
}

.exchange-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(330px, 0.58fr);
  gap: 14px;
}

.inventory-list {
  display: grid;
  gap: 8px;
}

.inventory-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 76px;
  padding: 8px;
  box-shadow: none;
}

.mini-art {
  width: 58px;
  height: 46px;
  border: 1px solid rgba(238, 242, 246, 0.08);
  border-radius: 6px;
  background: linear-gradient(135deg, var(--art-a), var(--art-b) 50%, var(--art-c));
}

.mini-art.has-image {
  background-color: #171c26;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.panel-note {
  margin: 0 0 12px;
  padding: 10px;
  border: 1px solid rgba(208, 112, 112, 0.42);
  border-radius: var(--radius);
  color: #e5bdc0;
  background: rgba(208, 112, 112, 0.08);
  font-size: 13px;
  line-height: 1.45;
}

.inventory-row h3 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-row p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.basket-total {
  margin: 12px 0;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.basket-total span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.basket-total strong {
  font-size: 20px;
}

.steps {
  display: grid;
  gap: 10px;
}

.step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171c26;
}

.step-index {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--border-soft);
  border-radius: 50%;
  color: #d9dfe6;
  font-size: 12px;
  font-weight: 800;
}

.step h3 {
  margin: 0 0 4px;
  font-size: 14px;
}

.step p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.42;
}

.mechanics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.mechanic-block ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 18px;
  color: #bec6cf;
  font-size: 13px;
  line-height: 1.45;
}

.portfolio-top {
  align-items: stretch;
  margin-bottom: 14px;
}

.balance-card {
  flex: 1;
  min-height: 112px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171c26;
}

.balance-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.balance-card strong {
  display: block;
  margin-top: 10px;
  font-size: 28px;
}

.sell-head {
  margin-bottom: 12px;
}

.inline-actions {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}

.inventory-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
}

.inventory-card-grid > .empty-state {
  grid-column: 1 / -1;
}

.inventory-card-grid.compact {
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
}

.inventory-card {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #1b202b;
  box-shadow: none;
  cursor: pointer;
}

.inventory-card:hover,
.inventory-card.is-selected {
  border-color: var(--blue);
  background: #202735;
}

.inventory-art-wrap {
  position: relative;
  min-height: 154px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(238, 242, 246, 0.03), transparent);
}

.inventory-art,
.inventory-preview-art,
.preview-3d-art {
  width: 100%;
  height: 154px;
  border: 0;
  border-radius: 0;
}

.inventory-actions {
  position: absolute;
  right: 8px;
  bottom: 8px;
  display: grid;
  gap: 6px;
}

.icon-chip {
  display: grid;
  min-width: 34px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(151, 161, 173, 0.34);
  border-radius: 7px;
  color: #cbd3dc;
  background: rgba(13, 18, 24, 0.82);
  font-size: 11px;
  font-weight: 850;
  cursor: pointer;
}

.inventory-card-body {
  display: grid;
  gap: 9px;
  padding: 11px;
}

.inventory-card h3 {
  margin: 0;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: normal;
}

.inventory-card p {
  margin: 4px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wear-line,
.inventory-price-row,
.inventory-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.wear-line {
  color: #cbd3dc;
  font-size: 12px;
  font-weight: 720;
}

.wear-dot {
  width: 7px;
  height: 15px;
  border-radius: 99px;
  background: var(--positive);
  box-shadow: 0 0 0 3px rgba(127, 182, 133, 0.12);
}

.wear-line strong {
  margin-left: auto;
  color: #cfd6de;
}

.inventory-price-row {
  padding-top: 9px;
  border-top: 1px solid rgba(37, 45, 55, 0.72);
}

.inventory-price-row span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 780;
}

.inventory-price-row strong {
  display: block;
  margin-top: 3px;
  font-size: 18px;
}

.inventory-price-row small {
  color: var(--muted-2);
  font-size: 12px;
  font-weight: 760;
}

.modal.modal-wide {
  width: min(1500px, 100%);
}

.inventory-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
}

.inventory-main,
.inventory-inspector,
.preview-side {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #171c26;
}

.inventory-main {
  padding: 12px;
}

.inventory-toolbar {
  min-height: 44px;
  margin-bottom: 12px;
}

.inventory-toolbar strong {
  font-size: 22px;
}

.inventory-toolbar span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.inventory-inspector {
  position: sticky;
  top: 0;
  align-self: start;
  padding: 12px;
}

.inventory-inspector.compact {
  display: grid;
  gap: 12px;
}

.inventory-preview-art {
  height: 220px;
  margin-bottom: 12px;
  border: 1px solid rgba(238, 242, 246, 0.08);
  border-radius: var(--radius);
}

.fine-print {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.preview-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.preview-stage {
  min-height: 520px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 50% 28%, rgba(238, 242, 246, 0.08), transparent 34%),
    linear-gradient(145deg, #151b24, #0d1117 46%, #1f2128);
  perspective: 1000px;
}

.preview-3d-art {
  width: min(760px, 92%);
  height: 420px;
  border: 0;
  transform: rotateX(12deg) rotateY(-18deg);
  animation: preview-drift 5.6s ease-in-out infinite alternate;
}

.preview-side {
  padding: 14px;
}

@keyframes preview-drift {
  from { transform: rotateX(12deg) rotateY(-18deg) translateY(0); }
  to { transform: rotateX(8deg) rotateY(16deg) translateY(-6px); }
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(10px);
}

.modal-backdrop[hidden],
.drawer[hidden] {
  display: none;
}

.modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 36px);
  overflow: auto;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  background: #171c26;
  box-shadow: var(--shadow);
}

.modal-head,
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h2,
.drawer-head h2 {
  margin: 4px 0 0;
  font-size: 22px;
}

.icon-btn {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  color: var(--muted-2);
  font-weight: 800;
}

.modal-body {
  padding: 16px;
}

.modal-row {
  min-height: 48px;
  border-bottom: 1px solid var(--border);
  color: #dbe1e7;
}

.modal-row:last-child {
  border-bottom: 0;
}

.modal-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 740;
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.secondary-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 13px;
  color: #d8e0eb;
  background: #1b202b;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.secondary-link:hover {
  border-color: var(--border-soft);
  background: #222938;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 60;
  width: min(440px, 100vw);
  height: 100vh;
  border-left: 1px solid var(--border-soft);
  background: #171c26;
  box-shadow: var(--shadow);
}

.drawer-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.drawer-body p {
  margin: 0;
  color: #c3cbd4;
  line-height: 1.55;
}

@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 248px minmax(0, 1fr);
  }

  .details-panel {
    position: static;
    grid-column: 1 / -1;
    height: auto;
  }
}

@media (max-width: 980px) {
  .topbar {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px;
  }

  .workspace,
  .two-column,
  .exchange-layout,
  .mechanics-grid,
  .inventory-workspace,
  .preview-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

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

@media (max-width: 640px) {
  .top-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    padding: 10px;
  }

  .stats-grid,
  .market-grid,
  .detail-grid,
  .portfolio-top {
    grid-template-columns: 1fr;
  }

  .item-card {
    min-height: 260px;
  }

  .table-head,
  .table-row {
    grid-template-columns: 1.2fr 0.6fr 0.6fr;
  }

  .table-head span:nth-child(4),
  .table-row span:nth-child(4) {
    display: none;
  }
}
