* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

.offer-card > * {
  min-width: 0;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

:root {
  --bg: #070b12;
  --panel: #101722;
  --panel-soft: #141d2b;
  --panel-strong: #182235;
  --border: #243044;
  --border-soft: rgba(148, 163, 184, 0.16);
  --text: #e5edf8;
  --muted: #8fa1b8;
  --muted-2: #64748b;
  --blue: #3b82f6;
  --blue-soft: rgba(59, 130, 246, 0.14);
  --green: #86efac;
  --red: #fca5a5;
  --yellow: #fcd34d;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
}

body {
  font-family: Arial, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(59, 130, 246, 0.14), transparent 32rem),
    radial-gradient(circle at top right, rgba(34, 197, 94, 0.08), transparent 28rem),
    var(--bg);
  color: var(--text);
  margin: 0;
}

.hero {
  padding: 34px 20px 26px;
  background: rgba(10, 15, 24, 0.78);
  border-bottom: 1px solid var(--border-soft);
  backdrop-filter: blur(12px);
}

.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 56px);
  letter-spacing: -2px;
  line-height: 1;
}

.hero p {
  max-width: 620px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 16px;
}

main {
  max-width: 1750px;
  margin: 24px auto 48px;
  padding: 0 24px;
}

.site-footer {
  max-width: 980px;
  margin: 22px auto 0;
  padding: 16px 18px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(16, 23, 34, 0.72);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  line-height: 1.5;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 6px;
}

.site-footer a {
  color: #93c5fd;
  font-weight: 900;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

@media (max-width: 760px) {
  .site-footer {
    margin-bottom: 86px;
  }
}

.controls,
.build-card,
.table-card {
  box-shadow: var(--shadow);
}

.controls {
  background: linear-gradient(180deg, rgba(17, 24, 35, 0.94), rgba(13, 19, 30, 0.94));
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
}

.home-tabs-card {
  display: none;
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
  margin-bottom: 16px;
}

.home-tabs-card h2 {
  margin: 0 0 14px;
  font-size: 20px;
}

.home-tabs {
  margin-bottom: 0;
  justify-content: center;
}

@media (min-width: 761px) {
  body.home-mode .home-tabs {
    gap: 14px;
  }

  body.home-mode .home-tabs .tab {
    padding: 14px 22px;
    font-size: 16px;
    min-width: 130px;
  }

  body.home-mode .home-tabs-card {
    padding: 24px;
  }

  body.home-mode .home-tabs-card h2 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 18px;
  }

  body.home-mode .start-building-btn {
    min-width: 230px;
    padding: 14px 24px;
    font-size: 16px;
    margin-top: 20px;
  }
}

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

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 16px;
}

.tab {
  padding: 10px 15px;
  border: 1px solid var(--border);
  background: rgba(21, 30, 43, 0.84);
  color: #cbd5e1;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  transition: 0.15s ease;
}

.tab:hover {
  border-color: #3b82f6;
  background: rgba(37, 99, 235, 0.16);
  color: white;
}

.tab.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: #60a5fa;
  color: white;
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.26);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1.4fr) 170px 190px;
  gap: 10px;
  align-items: center;
}

.filters .secondary-btn {
  padding: 12px;
  white-space: nowrap;
}

body.product-detail-mode .controls {
  padding: 14px 18px;
}

body.product-detail-mode .tabs {
  margin-bottom: 0;
  align-items: center;
}

body.product-detail-mode .filters,
body.product-detail-mode .hint {
  display: none;
}

body.product-detail-mode .tabs {
  margin-bottom: 0;
}

.dynamic-filters {
  display: contents;
}

.dynamic-filter {
  padding: 12px;
  font-size: 14px;
  background: #0b111b;
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
}

input,
select {
  width: 100%;
  padding: 12px;
  font-size: 14px;
  background: #0b111b;
  color: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
}

input:focus,
select:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.12);
}

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

.stat-card {
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  padding: 16px;
}

.stat-card span {
  display: block;
  font-size: 22px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.build-card {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 36px);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(16, 23, 34, 0.96), rgba(12, 18, 29, 0.96));
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 18px;
  margin-bottom: 16px;
}

.build-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.build-header h2 {
  margin: 0;
  font-size: 22px;
}

.build-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.secondary-btn,
.add-build-btn {
  border: 1px solid var(--border);
  background: #151e2b;
  color: var(--text);
  border-radius: 12px;
  padding: 9px 12px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
  transition: 0.15s ease;
}

.secondary-btn:hover,
.add-build-btn:hover {
  background: #1d2a44;
  border-color: #3b82f6;
}

.add-build-btn {
  background: var(--blue-soft);
  border-color: rgba(96, 165, 250, 0.45);
  color: #bfdbfe;
}

.add-build-btn.selected {
  background: rgba(34, 197, 94, 0.14);
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.add-build-btn.selected:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.65);
}

.product-card:has(.add-build-btn.selected) {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(34, 197, 94, 0.055);
}

.compatibility {
  border-radius: 16px;
  padding: 14px;
  font-weight: 800;
  line-height: 1.55;
}

.compatibility.neutral {
  background: #172033;
  color: #cbd5e1;
}

.compatibility.good {
  background: rgba(34, 197, 94, 0.14);
  color: var(--green);
  border: 1px solid rgba(34, 197, 94, 0.35);
}

.compatibility.bad {
  background: rgba(239, 68, 68, 0.14);
  color: var(--red);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

.compatibility.warn {
  background: rgba(245, 158, 11, 0.14);
  color: var(--yellow);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.cpu-graphics-warning {
  margin-top: 10px;
}

.table-card {
  overflow-x: auto;
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 450px;
  gap: 24px;
  align-items: start;
}

.catalog-column {
  min-width: 0;
}

.build-sidebar {
  position: sticky;
  top: 18px;
  align-self: start;
  max-height: calc(100vh - 36px);
}

body.home-mode .page-layout {
  grid-template-columns: minmax(0, 980px);
  justify-content: center;
}

body.home-mode .catalog-column {
  display: none;
}

body.home-mode .build-sidebar {
  position: static;
  max-height: none;
}

body.home-mode .build-header-actions {
  justify-content: center;
}

body.home-mode #toggleBuildBtn {
  min-width: 180px;
  padding: 12px 18px;
  font-size: 15px;
}

@media (max-width: 760px) {
  .mobile-build-btn {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 60;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 50px;
    padding: 10px 14px;

    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 16px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;

    font-weight: 900;
    cursor: pointer;

    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  }

  .mobile-build-btn span {
    font-size: 15px;
  }

  .mobile-build-btn strong {
    font-size: 13px;
    font-weight: 900;
    opacity: 0.92;
    white-space: nowrap;
  }

  .mobile-build-btn.has-parts {
    border-color: rgba(134, 239, 172, 0.65);
    background: linear-gradient(135deg, #15803d, #166534);
  }

  body {
    padding-bottom: 78px;
  }
}

body.home-mode .build-header {
  align-items: stretch;
  flex-direction: column;
}

body.home-mode .build-header-actions {
  justify-content: flex-start;
}

body.home-mode .home-tabs-card {
  display: block;
}

body:not(.home-mode) .home-tabs-card {
  display: none;
}

body.home-mode .build-card {
  max-height: none;
  overflow: visible;
}

body.home-mode .build-body {
  overflow: visible;
  padding-right: 0;
}

body.home-mode .build-card {
  margin-bottom: 0;
}

body.home-mode .stats,
body.home-mode .controls,
body.home-mode .product-grid-card,
body.home-mode .product-detail {
  display: none;
}

.product-grid-card,
.product-detail,
.stats {
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  box-shadow: var(--shadow);
  padding: 18px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
}

.section-header h2 {
  margin: 0;
  font-size: 22px;
}

.section-header p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.sort-control {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.sort-control select {
  min-width: 190px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 14px;
}

.product-title {
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.25;
}

.product-card .product-title {
  display: -webkit-box;
  line-clamp: 4;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 190px;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 18px;
  background: rgba(11, 17, 27, 0.82);
  cursor: pointer;
  transition: 0.15s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(15, 23, 42, 0.96);
}

.product-card-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  display: inline-flex;
  width: fit-content;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.12);
  color: var(--green);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.favorite-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.favorite-btn:hover {
  color: var(--text);
}

.product-card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.3;
}

.product-card-meta {
  display: grid;
  grid-template-columns: 1fr 80px;
  gap: 12px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

.meta-label {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 11px;
}

.product-card-actions {
  display: grid;
  grid-template-columns: minmax(74px, 0.9fr) minmax(105px, 1.1fr);
  gap: 8px;
}

.product-card-actions .secondary-btn,
.product-card-actions .add-build-btn {
  padding: 9px 8px;
  font-size: 13px;
  min-width: 0;
}

.product-card-actions button {
  width: 100%;
}

.toast-container {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: grid;
  gap: 6px;
  pointer-events: none;
  justify-items: center;
}

.toast {
  width: fit-content;
  max-width: min(360px, calc(100vw - 24px));
  padding: 10px 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(16, 23, 34, 0.96);
  color: var(--text);
  box-shadow: var(--shadow);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-success {
  border-color: rgba(34, 197, 94, 0.45);
  background: rgba(22, 101, 52, 0.92);
  color: #dcfce7;
}

.toast-error {
  border-color: rgba(239, 68, 68, 0.45);
  background: rgba(127, 29, 29, 0.92);
  color: #fee2e2;
}

.toast-info {
  border-color: rgba(96, 165, 250, 0.45);
  background: rgba(30, 64, 175, 0.92);
  color: #dbeafe;
}

@media (max-width: 600px) {
  .toast-container {
    top: 8px;
    left: 10px;
    right: 10px;
    transform: none;
    gap: 6px;
  }

  .toast {
    width: 100%;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: none;
    transform: none;
  }
}

.empty-card {
  grid-column: 1 / -1;
  padding: 30px;
  text-align: center;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: 16px;
}

.loading-card {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.loading-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(148, 163, 184, 0.3);
  border-top-color: #93c5fd;
  border-radius: 999px;
  animation: spin 0.75s linear infinite;
}

.error-card {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.08);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1050px) {
  .page-layout {
    grid-template-columns: 1fr;
  }

  .build-sidebar {
    position: static;
    max-height: none;
  }

  .build-card {
    max-height: none;
    overflow: visible;
  }

  .build-body {
    overflow: visible;
    padding-right: 0;
  }

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

@media (max-width: 760px) {
  .section-header {
    align-items: stretch;
    flex-direction: column;
  }

  .sort-control {
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
  }

  .sort-control select {
    width: 100%;
    min-width: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .loading-spinner {
    animation: none;
  }
}

@media (max-width: 820px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

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

  .product-card-actions {
    grid-template-columns: 1fr;
  }
}

.product-detail-card {
  background: rgba(16, 23, 34, 0.94);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.product-detail-header {
  margin-top: 16px;
  margin-bottom: 18px;
}

.product-detail-header h2 {
  margin: 0;
  font-size: 26px;
}

.product-detail-header p {
  margin: 8px 0 0;
  color: var(--muted);
}

.product-detail-grid {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.specs-panel {
  position: sticky;
  top: 18px;
}

.offers-panel {
  min-width: 0;
}

.product-detail-panel {
  background: rgba(11, 17, 27, 0.78);
  border: 1px solid var(--border-soft);
  border-radius: 16px;
  padding: 14px;
}

.product-detail-panel h3 {
  margin: 0 0 12px;
}

.offer-list {
  display: grid;
  gap: 10px;
}

.offer-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  grid-template-areas:
    "store name price"
    "store actions actions";
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(16, 23, 34, 0.75);
}

.offer-card .store-badge {
  grid-area: store;
  align-self: start;
  width: fit-content;
}

.offer-card > div:not(.price) {
  grid-area: name;
  min-width: 0;
}

.offer-card .price {
  grid-area: price;
  text-align: right;
  white-space: nowrap;
  align-self: start;
}

.offer-card .open-link {
  grid-area: actions;
  justify-self: start;
}

.offer-card .add-build-btn {
  grid-area: actions;
  justify-self: end;
  min-width: 115px;
}

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

.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  padding-bottom: 8px;
}

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

.spec-label {
  color: var(--muted);
}

.spec-value {
  font-weight: 900;
  text-align: right;
}

@media (max-width: 1100px) {
  .product-detail-grid {
    grid-template-columns: 1fr;
  }

  .specs-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .offer-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .offer-card > * {
    width: 100%;
    min-width: 0;
  }

  .offer-card .store-badge {
    width: fit-content;
  }

  .offer-card > div:not(.price) {
    width: 100%;
  }

  .offer-card strong {
    display: block;
    overflow-wrap: anywhere;
    line-height: 1.25;
  }

  .offer-card .details {
    margin-top: 6px;
  }

  .offer-card .price {
    width: 100%;
    text-align: left;
    font-size: 18px;
    white-space: normal;
  }

  .offer-card .open-link,
  .offer-card .add-build-btn {
    width: 100%;
    justify-content: center;
    justify-self: stretch;
  }
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 900px;
}

th,
td {
  padding: 15px 14px;
  border-bottom: 1px solid rgba(36, 48, 68, 0.72);
  text-align: left;
  vertical-align: middle;
}

th {
  background: rgba(21, 30, 43, 0.96);
  color: #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 1;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.055em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tr {
  transition: 0.12s ease;
}

tr:hover {
  background: rgba(29, 42, 68, 0.72);
}

.main-row {
  cursor: pointer;
}

.main-row:hover {
  background: rgba(37, 99, 235, 0.12);
}

.main-row .price {
  color: var(--green);
}

.offer-row:first-of-type .price {
  color: var(--green);
}

.offer-row {
  background: rgba(13, 20, 32, 0.9);
}

.offer-row td {
  color: #cbd5e1;
  font-size: 14px;
}

.offer-name {
  padding-left: 28px;
}

.store-badge {
  display: inline-block;
  padding: 6px 11px;
  border-radius: 999px;
  background: #1e293b;
  border: 1px solid rgba(148, 163, 184, 0.14);
  font-size: 12px;
  font-weight: 900;
}

.price {
  font-weight: 900;
  white-space: nowrap;
  color: var(--green);
}

.empty {
  text-align: center;
  padding: 30px;
  color: var(--muted);
}

.subtext {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.open-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(96, 165, 250, 0.45);
  border-radius: 12px;
  background: rgba(59, 130, 246, 0.14);
  color: #bfdbfe;
  text-decoration: none;
  font-weight: 900;
  white-space: nowrap;
  cursor: pointer;
  transition: 0.15s ease;
}

.open-link:hover {
  background: #1d2a44;
  border-color: #3b82f6;
  color: white;
  text-decoration: none;
}

.no-link {
  color: var(--muted-2);
  font-size: 13px;
  white-space: nowrap;
}

.details {
  margin-top: 6px;
  color: #60a5fa;
  font-size: 12px;
}

@media (max-width: 900px) {
  main {
    margin-top: 16px;
  }

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

  .filters input {
    grid-column: 1 / -1;
  }

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

  .build-header {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 760px) {
  .build-card:has(.build-body[hidden]) .build-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .build-card:has(.build-body[hidden]) .build-header h2 {
    font-size: 20px;
    white-space: nowrap;
  }

  .build-card:has(.build-body[hidden]) .build-header-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: stretch;
    width: 100%;
    min-width: 0;
  }

  .build-card:has(.build-body[hidden]) .secondary-btn,
  .build-card:has(.build-body[hidden]) .compat-filter-toggle {
    width: 100%;
    max-width: 100%;
    min-width: 0;
  }

  .build-card:has(.build-body[hidden]) .secondary-btn {
    padding: 8px 10px;
    font-size: 13px;
  }

  .build-card:has(.build-body[hidden]) .compat-filter-toggle {
    white-space: normal;
    text-align: center;
  }
}

@media (max-width: 600px) {
  .hero {
    padding: 28px 16px 22px;
  }

  main {
    padding: 0 12px;
  }

  .controls,
  .build-card,
  .table-card,
  .stat-card {
    border-radius: 16px;
  }

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

  .stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .stat-card {
    padding: 12px;
  }

  .stat-card span {
    font-size: 18px;
  }

  .stat-card p {
    font-size: 11px;
  }

  .stat-card:last-child {
    grid-column: 1 / -1;
  }

  .stat-card:last-child span {
    font-size: 20px;
  }

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

  th,
  td {
    padding: 12px;
  }
}

#lastUpdated {
  white-space: normal;
  line-height: 1.2;
}

.build-table {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.build-row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) 130px 180px;
  gap: 12px;
  align-items: center;
  padding: 12px;
  background: rgba(11, 17, 27, 0.78);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
}

.build-row.selected {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.055);
}

.build-row.active-choice {
  border-color: rgba(96, 165, 250, 0.7);
  background: rgba(59, 130, 246, 0.1);
  box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.18);
}

.build-row.active-choice .build-component {
  color: #93c5fd;
}

.build-row.active-choice .choose-part-btn {
  border-color: rgba(96, 165, 250, 0.65);
  background: rgba(59, 130, 246, 0.16);
  color: #bfdbfe;
}

.build-sidebar .build-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 12px;
  padding: 12px;
}

.build-sidebar .build-component {
  grid-column: 1 / -1;
  font-size: 11px;
}

.build-sidebar .build-selection {
  grid-column: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.build-sidebar .build-price {
  grid-column: 2;
  text-align: right;
  white-space: nowrap;
}

.build-sidebar .build-action {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.build-sidebar .build-row.empty-build-row {
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 6px 12px;
  padding: 12px 14px;
}

.build-sidebar .build-row.empty-build-row .build-component {
  grid-column: 1;
}

.build-sidebar .build-row.empty-build-row .build-selection {
  grid-column: 1;
  font-size: 13px;
}

.build-sidebar .build-row.empty-build-row .build-price {
  display: none;
}

.build-sidebar .build-row.empty-build-row .build-action {
  grid-column: 2;
  grid-row: 1 / span 2;
  display: flex;
  align-items: center;
}

.build-sidebar .build-row.empty-build-row .choose-part-btn {
  width: 100%;
  min-height: 38px;
  padding: 9px 12px;
}

.build-sidebar .choose-part-btn,
.build-sidebar .remove-part-btn {
  width: 100%;
}

.build-sidebar .build-header {
  align-items: stretch;
  flex-direction: column;
}

.build-sidebar .build-header-actions {
  justify-content: flex-start;
}

.build-sidebar .choose-part-btn,
.build-sidebar .remove-part-btn {
  flex: 1;
}

.build-component {
  color: var(--muted);
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 12px;
}

.build-selection {
  min-width: 0;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.build-price {
  font-weight: 900;
  color: var(--green);
  white-space: nowrap;
  text-align: right;
}

.build-action {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.choose-part-btn,
.remove-part-btn {
  border: 1px solid var(--border);
  background: #151e2b;
  color: var(--text);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
  font-weight: 800;
  white-space: nowrap;
}

.choose-part-btn:hover,
.remove-part-btn:hover {
  background: #1d2a44;
  border-color: #3b82f6;
}

.remove-part-btn {
  color: #fca5a5;
  border-color: rgba(239, 68, 68, 0.35);
}

.total-row {
  background: rgba(59, 130, 246, 0.09);
  border-color: rgba(96, 165, 250, 0.26);
}

.total-row .build-selection {
  color: var(--muted);
}

.total-row .build-price {
  font-size: 18px;
}

@media (max-width: 760px) {
  .build-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .build-price {
    text-align: left;
  }

  .build-action {
    justify-content: flex-start;
  }
}

.build-header-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.build-body {
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
}

.build-body::-webkit-scrollbar {
  width: 8px;
}

.build-body::-webkit-scrollbar-track {
  background: transparent;
}

.build-body::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
  border-radius: 999px;
}

.build-body::-webkit-scrollbar-thumb:hover {
  background: rgba(148, 163, 184, 0.45);
}

.build-body[hidden] {
  display: none;
}
.build-card:has(.build-body[hidden]) {
  padding-bottom: 18px;
}

.build-card:has(.build-body[hidden]) .beta-note {
  display: none;
}

.compat-filter-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  justify-self: start;
  gap: 8px;
  width: fit-content;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid #456897;
  border-radius: 12px;
  background: #111820;
  color: #eaf2ff;
  font-size: 14px;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.build-compat-filter {
  width: auto;
  min-height: 36px;
  justify-content: center;
  margin-bottom: 0;
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(96, 165, 250, 0.35);
}

.compat-filter-toggle input {
  width: auto;
  padding: 0;
  margin: 0;
  cursor: pointer;
  accent-color: var(--blue);
}

.currency-toggle {
  display: inline-flex;
  padding: 4px;
  background: rgba(11, 17, 27, 0.9);
  border: 1px solid var(--border);
  border-radius: 999px;
  flex-shrink: 0;
}

.currency-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 900;
  cursor: pointer;
}

.currency-btn:hover {
  color: var(--text);
}

.currency-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
}

@media (max-width: 600px) {
  .hero-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

.home-title {
  all: unset;
  cursor: pointer;
}

.home-title:hover {
  color: #93c5fd;
}

@media (max-width: 760px) {
  .table-card {
    overflow-x: visible;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  table {
    min-width: 0;
    border-spacing: 0 10px;
  }

  thead {
    display: none;
  }

  tbody {
    display: grid;
    gap: 10px;
  }

  tr.main-row,
  tr.offer-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 14px;
    background: rgba(16, 23, 34, 0.94);
    border: 1px solid var(--border-soft);
    border-radius: 16px;
  }

  tr.offer-row {
    margin-left: 12px;
    background: rgba(13, 20, 32, 0.94);
    border-color: rgba(96, 165, 250, 0.18);
  }

  tr.hidden {
    display: none;
  }

  th,
  td {
    display: block;
    padding: 0;
    border-bottom: 0;
  }

  td:first-child {
    order: 1;
  }

  td:nth-child(2) {
    order: 2;
  }

  td:nth-child(3) {
    order: 3;
    font-size: 18px;
  }

  td:nth-child(4) {
    order: 4;
    color: var(--muted);
    font-size: 13px;
  }

  td:nth-child(5) {
    order: 5;
    display: inline-flex;
    width: auto;
  }

  td:nth-child(5) {
    margin-right: 8px;
  }

  td:nth-child(5) .open-link,
  td:nth-child(5) .add-build-btn {
    display: inline-flex;
    justify-content: center;
    width: auto;
    min-width: 105px;
    min-height: 36px;
    padding: 8px 12px;
  }

  tr.offer-row {
    padding: 11px;
    gap: 6px;
  }

  tr.offer-row .store-badge {
    font-size: 11px;
    padding: 5px 9px;
  }

  tr.offer-row .price {
    font-size: 15px;
  }

  .open-link,
  .add-build-btn {
    min-height: 36px;
    align-items: center;
  }

  .offer-name {
    padding-left: 0;
  }

  .subtext {
    font-size: 12px;
    line-height: 1.35;
  }

  .details {
    font-size: 12px;
    line-height: 1.4;
  }

  .store-badge {
    width: fit-content;
  }

  .offers-cell {
    padding-top: 2px;
  }

  tr.main-row,
  tr.offer-row {
    grid-template-columns: 1fr auto auto;
  }

  td:first-child,
  td:nth-child(2),
  td:nth-child(3),
  td:nth-child(4) {
    grid-column: 1 / -1;
  }

  td:nth-child(5) {
    grid-column: auto;
  }
}

.build-card:has(.build-body[hidden]) .build-header {
  margin-bottom: 0;
}

.build-card:has(.build-body[hidden]) {
  padding: 14px;
}

.build-card:has(.build-body[hidden]) .build-header p {
  display: none;
}

.product-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.product-actions .secondary-btn,
.product-actions .add-build-btn {
  min-height: 36px;
}

@media (max-width: 760px) {
  .product-actions {
    width: 100%;
  }

  .product-actions .secondary-btn,
  .product-actions .add-build-btn {
    flex: 1;
    justify-content: center;
  }
}

.back-to-top-btn {
  display: none;
}

@media (max-width: 760px) {
  .back-to-top-btn {
    position: fixed;
    right: 16px;
    bottom: 82px;
    z-index: 50;

    display: grid;
    place-items: center;

    width: 46px;
    height: 46px;
    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 999px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;

    font-size: 22px;
    font-weight: 900;
    cursor: pointer;

    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);

    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.18s ease;
  }

  .back-to-top-btn.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .back-to-top-btn:active {
    transform: translateY(1px) scale(0.96);
  }
}

.mobile-build-btn {
  display: none;
}

@media (max-width: 760px) {
  .mobile-build-btn {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 14px;
    z-index: 60;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;

    min-height: 50px;
    padding: 10px 14px;

    border: 1px solid rgba(96, 165, 250, 0.55);
    border-radius: 16px;

    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: white;

    font-weight: 900;
    cursor: pointer;

    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  }

  .mobile-build-btn span {
    font-size: 15px;
  }

  .mobile-build-btn strong {
    font-size: 13px;
    font-weight: 900;
    opacity: 0.92;
    white-space: nowrap;
  }

  .mobile-build-btn.has-parts {
    border-color: rgba(134, 239, 172, 0.65);
    background: linear-gradient(135deg, #15803d, #166534);
  }

  body {
    padding-bottom: 78px;
  }
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.language-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
}

.language-btn {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
  cursor: pointer;
}

.language-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
}

.beta-note {
  margin: -4px 0 14px;
  padding: 10px 12px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.08);
  color: var(--yellow);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.site-logo {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.home-title {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.start-building-btn {
  display: block;
  margin: 16px auto 0;
  min-width: 190px;
  padding: 12px 18px;
  border: 1px solid rgba(96, 165, 250, 0.55);
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: white;
  font-weight: 900;
  cursor: pointer;
}

.start-building-btn:hover {
  border-color: #93c5fd;
  filter: brightness(1.08);
}

.beta-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.14);
  color: #facc15;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}