:root {
  color-scheme: dark;
  --bg: #06090e;
  --panel: #0d141d;
  --panel-2: #121c28;
  --grid: #1a2430;
  --line: #263646;
  --text: #f4f7fa;
  --muted: #a8b4c2;
  --dim: #66798b;
  --green: #00d084;
  --blue: #4ca6ff;
  --amber: #ffc13b;
  --red: #ff4d6d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Aptos, Inter, Segoe UI, Arial, sans-serif;
  color: var(--text);
  background:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px),
    var(--bg);
  background-size: 54px 54px;
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 42px 0 56px;
}

body.is-embed .shell {
  width: min(1180px, 100%);
  padding: 0;
}

body.is-embed .hero {
  display: none;
}

body.is-embed .detail,
body.is-embed .sidebar {
  border-radius: 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 42px;
  align-items: center;
  min-height: 260px;
  border-top: 6px solid var(--green);
}

.eyebrow {
  margin: 28px 0 14px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 780px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.98;
  letter-spacing: 0;
}

.lead {
  max-width: 680px;
  margin-top: 24px;
  color: var(--muted);
  font-size: 20px;
  line-height: 1.45;
}

.radar {
  position: relative;
  width: 240px;
  aspect-ratio: 1;
  border: 2px solid var(--green);
  border-radius: 50%;
  background: rgba(0, 208, 132, 0.06);
}

.radar::before,
.radar::after,
.radar span {
  content: "";
  position: absolute;
  border-radius: 50%;
}

.radar::before {
  inset: 28%;
  border: 1px solid rgba(0, 208, 132, 0.35);
}

.radar::after {
  left: 50%;
  top: 50%;
  width: 45%;
  height: 2px;
  transform-origin: left center;
  background: var(--green);
}

.radar span:nth-child(1) {
  left: 30%;
  top: 34%;
  width: 12px;
  height: 12px;
  background: var(--green);
}

.radar span:nth-child(2) {
  right: 32%;
  top: 42%;
  width: 10px;
  height: 10px;
  background: var(--blue);
}

.radar span:nth-child(3) {
  right: 28%;
  bottom: 31%;
  width: 11px;
  height: 11px;
  background: var(--red);
}

.radar b {
  position: absolute;
  left: 50%;
  top: 50%;
  translate: -50% -50%;
  color: var(--green);
  font-size: 32px;
}

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

.sidebar,
.detail,
.offers-panel,
.chart-panel,
.sources-panel,
.admin-panel {
  border: 1px solid var(--line);
  background: rgba(13, 20, 29, 0.92);
}

.sidebar {
  position: sticky;
  top: 20px;
  padding: 20px;
  border-radius: 10px;
}

.search-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

#search {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #090e15;
  outline: none;
}

#search:focus {
  border-color: var(--green);
}

.filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}

.filters label {
  min-width: 0;
}

.filters span {
  display: block;
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 11px;
  font-weight: 800;
}

.filters select,
.filters input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #090e15;
  outline: none;
}

.filters select:focus,
.filters input:focus {
  border-color: var(--green);
}

.result-count {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.product-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.product-card {
  --store-accent: var(--green);
  --store-bg: #101923;
  --thumb-height: clamp(150px, 14vw, 190px);
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--store-accent) 22%, transparent), transparent 44%),
    var(--store-bg);
  cursor: pointer;
  box-shadow: inset 4px 0 0 var(--store-accent);
}

.product-card .thumb,
.offer-thumb {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--store-accent) 42%, #d9e3ec);
  border-radius: 7px;
  background: #ffffff;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.88),
    0 10px 24px rgba(0, 0, 0, 0.18);
}

.product-card .thumb {
  width: 100%;
  height: var(--thumb-height);
  aspect-ratio: auto;
  align-self: start;
}

.product-card .thumb img,
.offer-thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 10px;
}

.product-card .thumb b,
.offer-thumb b {
  display: block;
  visibility: hidden;
  color: var(--store-accent);
  font-size: 12px;
}

.product-card .thumb:not(:has(img)) b,
.offer-thumb:not(:has(img)) b,
.product-card .thumb.image-missing b,
.offer-thumb.image-missing b {
  visibility: visible;
}

.product-card .thumb.image-missing img,
.offer-thumb.image-missing img {
  display: none;
}

.product-card.is-active {
  border-color: var(--store-accent);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--store-accent) 30%, transparent), transparent 50%),
    #10201c;
}

.product-card strong,
.product-card small,
.product-card i,
.product-card em {
  display: block;
}

.product-card strong {
  font-size: 15px;
  line-height: 1.25;
}

.product-card i {
  width: fit-content;
  margin-bottom: 8px;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--store-accent) 65%, transparent);
  border-radius: 4px;
  color: var(--store-accent);
  background: color-mix(in srgb, var(--store-accent) 12%, transparent);
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.product-card small {
  margin-top: 5px;
  color: var(--muted);
}

.product-card .price {
  grid-column: 1;
  color: var(--store-accent);
  font-size: 22px;
  font-weight: 800;
}

.product-card em {
  grid-column: 1;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.product-card em.good {
  color: var(--green);
}

.product-card em.warn {
  color: var(--red);
}

.detail {
  min-width: 0;
  padding: 28px;
  border-radius: 14px;
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 28px;
  align-items: start;
}

h2 {
  font-size: clamp(28px, 3.4vw, 42px);
  line-height: 1.28;
  overflow-wrap: anywhere;
}

#productSummary {
  margin-top: 14px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.45;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.chips span {
  padding: 7px 11px;
  border-radius: 6px;
  color: #061014;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
}

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

.stats article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-2);
}

.stats span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.stats strong {
  display: block;
  margin-top: 6px;
  color: var(--green);
  font-size: 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-top: 28px;
}

.offers-panel,
.chart-panel,
.sources-panel,
.admin-panel {
  min-width: 0;
  padding: 20px;
  border-radius: 10px;
}

.panel-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 16px;
}

.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

h3 {
  font-size: 20px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

.panel-title select {
  min-width: 112px;
  height: 34px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  background: #090e15;
}

#refreshAll,
#refreshModel,
#copyLink,
#exportCsv,
.show-more,
.offer button,
.open-offer {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 0;
  border-radius: 6px;
  color: #061014;
  background: var(--green);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

#refreshAll {
  padding: 0 12px;
}

#refreshModel {
  padding: 0 12px;
  color: var(--text);
  background: #263646;
}

#copyLink {
  padding: 0 12px;
  color: var(--text);
  background: #1d2b3a;
}

#exportCsv {
  padding: 0 12px;
  color: var(--text);
  background: #143326;
}

#refreshAll:disabled,
#refreshModel:disabled,
#copyLink:disabled,
.offer button:disabled {
  opacity: 0.58;
  cursor: wait;
}

.show-more {
  width: 100%;
  margin-top: 14px;
  border: 1px solid var(--line);
  color: var(--text);
  background: #101923;
}

.show-more:hover {
  border-color: var(--green);
}

body.is-static-mode .radar b {
  color: var(--yellow);
  border-color: rgba(255, 209, 49, 0.75);
  background: rgba(255, 209, 49, 0.12);
}

body.is-static-mode .source-status {
  border-color: rgba(255, 209, 49, 0.35);
  color: #f7d872;
}

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

.offer {
  --store-accent: var(--green);
  --store-bg: #101923;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 150px;
  gap: 10px 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--store-accent) 18%, transparent), transparent 46%),
    var(--store-bg);
  box-shadow: inset 4px 0 0 var(--store-accent);
}

.offer-thumb {
  width: 84px;
  aspect-ratio: 4 / 3;
  grid-row: 1 / span 2;
}

.offer.best {
  border-color: var(--store-accent);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--store-accent) 26%, transparent), transparent 52%),
    #10201c;
}

.offer.freshness-fresh small::after,
.offer.freshness-recent small::after,
.offer.freshness-stale small::after,
.offer.freshness-unknown small::after {
  display: inline-flex;
  margin-left: 8px;
  padding: 2px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.offer.freshness-fresh small::after {
  content: "friss";
  color: #061014;
  background: var(--green);
}

.offer.freshness-recent small::after {
  content: "pár napos";
  color: #061014;
  background: var(--amber);
}

.offer.freshness-stale small::after {
  content: "régi";
  color: var(--text);
  background: var(--red);
}

.offer.freshness-unknown small::after {
  content: "ismeretlen";
  color: var(--text);
  background: #263646;
}

.offer strong,
.offer span,
.offer b,
.offer small {
  display: block;
}

.offer strong {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  min-width: 0;
  overflow-wrap: anywhere;
}

.best-badge {
  padding: 3px 6px;
  border-radius: 4px;
  color: #061014;
  background: var(--store-accent);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.offer span,
.offer small,
.offer-source {
  color: var(--muted);
  font-size: 13px;
}

.offer > div {
  min-width: 0;
}

.offer > div span {
  overflow-wrap: anywhere;
  white-space: normal;
  line-height: 1.35;
}

.offer-source {
  display: inline-flex;
  width: fit-content;
  max-width: 100%;
  margin-top: 7px;
  padding: 3px 6px;
  border: 1px solid color-mix(in srgb, var(--store-accent) 35%, transparent);
  border-radius: 4px;
  color: color-mix(in srgb, var(--store-accent) 75%, var(--muted));
  background: rgba(0, 0, 0, 0.18);
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.offer b {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  color: var(--store-accent);
  font-size: 22px;
  white-space: nowrap;
}

.offer button {
  grid-column: 3;
  grid-row: 2;
  justify-self: end;
  min-width: 76px;
}

.open-offer {
  grid-column: 2;
  grid-row: 2;
  width: 104px;
  color: var(--text);
  background: #263646;
}

.store-aqua {
  --store-accent: #00a6e8;
  --store-bg: #0b1724;
}

.store-ipon {
  --store-accent: #98d934;
  --store-bg: #101a13;
}

.store-pcx {
  --store-accent: #ff4558;
  --store-bg: #1b1116;
}

.store-pepita {
  --store-accent: #ff8a22;
  --store-bg: #1a140e;
}

.store-oazis {
  --store-accent: #27c8a7;
  --store-bg: #0d1b1a;
}

.store-mysoft {
  --store-accent: #4f8cff;
  --store-bg: #0d1421;
}

.store-bluechip {
  --store-accent: #60ce20;
  --store-bg: #101a0d;
}

.store-emag {
  --store-accent: #1f7bff;
  --store-bg: #0d1424;
}

.store-firstshop {
  --store-accent: #ffd13d;
  --store-bg: #1a170d;
}

.store-foramax {
  --store-accent: #00c0ff;
  --store-bg: #081925;
}

.store-pcland {
  --store-accent: #f47920;
  --store-bg: #1a120c;
}

.store-konzolvilag {
  --store-accent: #e3262f;
  --store-bg: #1c0d10;
}

.store-notebook {
  --store-accent: #00aeef;
  --store-bg: #081722;
}

.store-alza {
  --store-accent: #9adf35;
  --store-bg: #101b0f;
}

.store-generic {
  --store-accent: var(--green);
  --store-bg: #101923;
}

.source-status {
  margin-top: 14px;
  color: var(--dim);
  font-size: 13px;
}

.source-health {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.source-summary {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b121b;
}

.source-summary span,
.source-summary strong,
.source-summary small {
  min-width: 0;
}

.source-summary span {
  color: var(--text);
  font-weight: 900;
}

.source-summary strong {
  color: var(--green);
  font-size: 13px;
}

.source-summary.has-errors strong {
  color: var(--red);
}

.source-summary small {
  color: var(--muted);
  font-size: 12px;
}

.source-row {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101923;
}

.source-row span,
.source-row strong,
.source-row small {
  display: block;
}

.source-row span {
  color: var(--text);
  font-weight: 800;
}

.source-row strong {
  margin-top: 7px;
  color: var(--green);
  font-size: 13px;
}

.source-row.bad strong {
  color: var(--red);
}

.source-row small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.admin-health {
  display: grid;
  gap: 14px;
}

.admin-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
}

.admin-metric,
.admin-summary,
.admin-columns > article {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101923;
}

.admin-metric,
.admin-summary {
  padding: 12px;
}

.admin-metric span,
.admin-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.admin-metric strong,
.admin-summary strong {
  display: block;
  margin-top: 5px;
  color: var(--green);
  font-size: 20px;
}

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

.admin-columns > article {
  padding: 12px;
}

.admin-columns h4 {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 14px;
}

.admin-row {
  display: block;
  width: 100%;
  min-width: 0;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  text-align: left;
  background: #0b121b;
  cursor: pointer;
}

.admin-row.is-static {
  cursor: default;
}

.admin-row:hover:not(.is-static) {
  border-color: var(--green);
}

.admin-row strong,
.admin-row span {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.admin-row strong {
  font-size: 13px;
}

.admin-row span,
.admin-empty {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.chart {
  min-height: 250px;
}

.chart svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.chart .grid line {
  stroke: #293747;
}

.chart .line {
  fill: none;
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart .line.min {
  stroke: var(--green);
}

.chart .line.max {
  stroke: var(--red);
}

.chart text {
  fill: var(--dim);
  font-size: 12px;
}

.chart .axis {
  fill: var(--muted);
}

.legend {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 13px;
}

.legend span::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 3px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--green);
}

.legend .max::before {
  background: var(--red);
}

@media (max-width: 920px) {
  .hero,
  .workspace,
  .detail-head,
  .content-grid {
    grid-template-columns: 1fr;
  }

  .radar {
    display: none;
  }

  .sidebar {
    position: static;
  }

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

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

  .product-card {
    --thumb-height: clamp(150px, 36vw, 190px);
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-card .thumb {
    width: 100%;
  }

  .product-card .thumb img {
    padding: 10px;
  }

  .product-card .price,
  .product-card em {
    grid-column: 1;
  }

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

  .offer-thumb {
    width: 84px;
  }

  .offer b {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }

  .open-offer,
  .offer button {
    grid-column: 2;
    grid-row: auto;
    justify-self: start;
  }
}
