:root {
  --primary: #0d1117;
  --accent: #39ff14;
  --label: #e0ffe0;
  --sublabel: #80c080;
  --radius: 8px;
  --display: "Space Grotesk", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;

  --btn-blur: 16px;
  --btn-fill: rgba(57, 255, 20, 0.08);
  --btn-border: rgba(57, 255, 20, 0.40);

  --panel: rgba(255, 255, 255, 0.03);
  --panel-border: rgba(224, 255, 224, 0.08);

  --status-in: #39ff14;
  --status-low: #ffb648;
  --status-out: #ff5470;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--primary);
  color: var(--label);
  font-family: var(--body);
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
}

body {
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(57,255,20,0.06), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(57,255,20,0.05), transparent 60%),
    var(--primary);
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.topbar, .wrap, .foot { position: relative; z-index: 1; }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 28px clamp(20px, 4vw, 56px) 16px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--btn-fill);
  border: 1px solid var(--btn-border);
  box-shadow: 0 0 24px rgba(57,255,20,0.25), inset 0 0 12px rgba(57,255,20,0.15);
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 8px;
  border-radius: 3px;
  background: var(--accent);
  box-shadow: 0 0 14px var(--accent);
}

.brand h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--label);
}
.sub { margin: 2px 0 0; color: var(--sublabel); font-size: 13px; }

.brand-eu {
  color: var(--accent);
  text-shadow: 0 0 14px rgba(57,255,20,0.4);
  letter-spacing: 0.02em;
}

.tg-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: 600 12.5px var(--display);
  letter-spacing: 0.03em;
  color: var(--label);
  text-decoration: none;
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--btn-fill);
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(var(--btn-blur));
  -webkit-backdrop-filter: blur(var(--btn-blur));
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.tg-btn svg { width: 14px; height: 14px; fill: currentColor; }
.tg-btn:hover {
  transform: translateY(-1px);
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(57,255,20,0.25), 0 0 22px rgba(57,255,20,0.18);
}
.tg-btn--solid {
  color: var(--primary);
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 22px rgba(57,255,20,0.35);
}
.tg-btn--solid:hover {
  color: var(--primary);
  filter: brightness(1.08);
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius);
  background: var(--btn-fill);
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(var(--btn-blur));
  -webkit-backdrop-filter: blur(var(--btn-blur));
  min-width: 240px;
}
.search svg { width: 16px; height: 16px; fill: var(--sublabel); }
.search input {
  background: transparent;
  border: 0;
  outline: none;
  color: var(--label);
  font: 500 14px var(--body);
  width: 100%;
}
.search input::placeholder { color: var(--sublabel); }

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

.chip {
  font: 600 12.5px var(--display);
  letter-spacing: 0.02em;
  color: var(--label);
  padding: 9px 14px;
  border-radius: var(--radius);
  background: var(--btn-fill);
  border: 1px solid var(--btn-border);
  backdrop-filter: blur(var(--btn-blur));
  -webkit-backdrop-filter: blur(var(--btn-blur));
  cursor: pointer;
  transition: transform .15s ease, background .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover { transform: translateY(-1px); }
.chip.is-active {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(57,255,20,0.3), 0 0 20px rgba(57,255,20,0.15);
}

.wrap {
  padding: 8px clamp(20px, 4vw, 56px) 80px;
  max-width: 1400px;
  margin: 0 auto;
}

.meta {
  color: var(--sublabel);
  font-size: 13px;
  padding: 8px 4px 18px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

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

.card {
  position: relative;
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.015));
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(var(--btn-blur));
  -webkit-backdrop-filter: blur(var(--btn-blur));
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.card::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 2px;
  background: var(--accent);
  opacity: .0;
  transition: opacity .2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: rgba(57,255,20,0.35);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4), 0 0 28px rgba(57,255,20,0.07);
}
.card:hover::before { opacity: 1; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }

.card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 16px;
  margin: 0;
  color: var(--label);
  line-height: 1.25;
}

.conc {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--sublabel);
  letter-spacing: 0.02em;
}

.badge {
  flex-shrink: 0;
  font: 600 10.5px var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 9px;
  border-radius: 999px;
  border: 1px solid currentColor;
  background: rgba(255,255,255,0.02);
}
.badge.in { color: var(--status-in); }
.badge.low { color: var(--status-low); }
.badge.out { color: var(--status-out); }

.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; box-shadow: 0 0 8px currentColor; }

.prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 2px;
}
.price-tile {
  border-radius: 6px;
  padding: 10px 12px;
  border: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.015);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.price-tile .lbl {
  font: 600 10.5px var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sublabel);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.price-tile .val {
  font: 600 18px var(--display);
  color: var(--label);
  letter-spacing: -0.01em;
}
.price-tile.kit .val { color: var(--accent); text-shadow: 0 0 14px rgba(57,255,20,0.25); }
.price-tile .mini {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: currentColor;
}
.price-tile.is-out .val { color: var(--status-out); text-shadow: none; }
.price-tile.is-out { border-color: rgba(255,84,112,0.25); }

.view-toggle { display: inline-flex; gap: 4px; padding: 3px; border-radius: var(--radius); background: var(--btn-fill); border: 1px solid var(--btn-border); backdrop-filter: blur(var(--btn-blur)); -webkit-backdrop-filter: blur(var(--btn-blur)); }
.view-toggle .chip { padding: 6px 10px; border: 1px solid transparent; background: transparent; backdrop-filter: none; }
.view-toggle .chip svg { width: 14px; height: 14px; fill: currentColor; display: block; }
.view-toggle .chip.is-active { color: var(--accent); border-color: var(--btn-border); background: rgba(57,255,20,0.06); box-shadow: none; }

.table-wrap {
  border-radius: var(--radius);
  border: 1px solid var(--panel-border);
  background: linear-gradient(180deg, rgba(255,255,255,0.025), rgba(255,255,255,0.012));
  backdrop-filter: blur(var(--btn-blur));
  -webkit-backdrop-filter: blur(var(--btn-blur));
  overflow: hidden;
}
.ptable { width: 100%; border-collapse: collapse; font-size: 14px; }
.ptable thead th {
  text-align: left;
  font: 600 11px var(--display);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sublabel);
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  background: rgba(255,255,255,0.02);
}
.ptable thead th.num { text-align: right; }
.ptable tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--panel-border);
  color: var(--label);
  vertical-align: middle;
}
.ptable tbody tr:last-child td { border-bottom: 0; }
.ptable tbody tr { transition: background .12s ease; }
.ptable tbody tr:hover { background: rgba(57,255,20,0.04); }
.t-name-main { font-family: var(--display); font-weight: 600; font-size: 14.5px; }
.t-name-sub { font-size: 12px; color: var(--sublabel); margin-top: 2px; }
.t-price { text-align: right; font-family: var(--display); font-weight: 600; font-variant-numeric: tabular-nums; }
.t-price.kit { color: var(--accent); text-shadow: 0 0 12px rgba(57,255,20,0.2); }
.t-status { width: 1%; white-space: nowrap; text-align: right; }

.empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--sublabel);
  font-size: 14px;
}

.skeleton {
  height: 152px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(255,255,255,0.03), rgba(255,255,255,0.06), rgba(255,255,255,0.03));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border: 1px solid var(--panel-border);
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

.foot {
  position: fixed;
  bottom: 12px;
  right: 16px;
  font-size: 11px;
  color: var(--sublabel);
  opacity: 0.7;
  z-index: 1;
  font-family: var(--display);
  letter-spacing: 0.04em;
}

.error {
  border: 1px solid rgba(255,84,112,0.4);
  color: #ffb3c1;
  background: rgba(255,84,112,0.08);
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 13.5px;
}

@media (max-width: 540px) {
  .search { min-width: 0; flex: 1 1 100%; }
  .controls { width: 100%; }
  .topbar { padding-top: 20px; }
  .prices { grid-template-columns: 1fr; }
  .ptable thead { display: none; }
  .ptable tbody td { display: block; padding: 6px 14px; border: 0; }
  .ptable tbody tr { display: block; padding: 12px 0; border-bottom: 1px solid var(--panel-border); }
  .t-price, .t-status { text-align: left; }
  .t-price::before { content: attr(data-lbl); }
}
