/* =========================================================================
   POPBRICK v2 — EDITORIAL PAPER + CYBER CORE DESIGN SYSTEM (100% Pure CSS)
   ========================================================================= */
:root {
  /* Powierzchnie */
  --bg-canvas: #F2EDE2;
  --bg-surface: #FAF8F4;
  --bg-paper: #EAE3D5;
  --bg-dark: #141517;
  --bg-dark-elevated: #1F2124;
  --bg-stage-dark: #0D0E10;

  /* Tekst */
  --text-primary: #18181A;
  --text-secondary: #63615C;
  --text-inverse: #F5F3EE;
  --text-inverse-muted: #9A9B9F;

  /* Akcent główny */
  --accent-pop: #FF4D00;
  --accent-pop-hover: #E04300;
  --accent-pop-soft: rgba(255, 77, 0, 0.12);

  /* Mikro-stany semantyczne */
  --status-ok: #15803D;
  --status-ok-soft: rgba(21, 128, 61, 0.12);
  --status-warn: #B45309;
  --status-warn-soft: rgba(180, 83, 9, 0.14);
  --status-err: #DC2626;
  --status-err-soft: rgba(220, 38, 38, 0.12);

  /* Linie i obrysy */
  --border-light: #DCD6CA;
  --border-strong: #18181A;
  --border-dark: #2D3035;
  --hud-crosshair: rgba(255, 255, 255, 0.28);

  /* Typografia */
  --font-display: 'Archivo', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Geometria & Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-pill: 9999px;
  --container-max: 1320px;
  --topbar-h: 64px;
  --mnav-h: 64px;

  /* Cienie (wyłącznie elementy pływające) */
  --shadow-float: 0 12px 32px rgba(20, 21, 23, 0.16);
  --shadow-mnav: 0 -4px 20px rgba(20, 21, 23, 0.08);
}

/* Niezależny tryb ciemny WYŁĄCZNIE dla ekranu roboczego Builder 2D */
[data-theme="builder-dark"] {
  --bg-canvas: #111214;
  --bg-surface: #1A1C1F;
  --bg-paper: #1D1F23;
  --text-primary: #F5F3EE;
  --text-secondary: #9A9B9F;
  --border-light: #2A2D32;
  --border-strong: #F5F3EE;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--bg-canvas);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}
body.in-builder { overflow: hidden; height: 100dvh; }
button, input, select { font-family: inherit; color: inherit; }
button { cursor: pointer; }
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(24, 24, 26, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.display { font-family: var(--font-display); text-transform: uppercase; letter-spacing: -0.03em; }
.muted { color: var(--text-secondary); }
.small { font-size: 12.5px; }

/* =========================================================================
   SHARED VISUAL PRIMITIVES (3 Card Variants, HUD Crosshairs, Stamp, Badges)
   ========================================================================= */
.card-base {
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}
.card-paper {
  position: relative;
  background: var(--bg-paper);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.card-paper::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.045;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.card-cyber {
  position: relative;
  background: var(--bg-dark);
  color: var(--text-inverse);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.card-cyber .muted { color: var(--text-inverse-muted); }
.card-interactive { cursor: pointer; }
.card-base.card-interactive:hover,
.card-paper.card-interactive:hover { border-color: var(--border-strong); }
.card-cyber.card-interactive:hover { border-color: var(--accent-pop); }
.card-selected { outline: 2px solid var(--accent-pop); outline-offset: -1px; }

/* HUD Crosshairs (+) */
.hud-cross {
  position: absolute;
  width: 11px;
  height: 11px;
  pointer-events: none;
  z-index: 2;
}
.hud-cross::before, .hud-cross::after {
  content: "";
  position: absolute;
  background: var(--hud-crosshair);
}
.hud-cross::before { top: 5px; left: 0; right: 0; height: 1px; }
.hud-cross::after { left: 5px; top: 0; bottom: 0; width: 1px; }
.hud-tl { top: 10px; left: 10px; }
.hud-tr { top: 10px; right: 10px; }
.hud-bl { bottom: 10px; left: 10px; }
.hud-br { bottom: 10px; right: 10px; }

/* Collector Stamp */
.stamp {
  width: 54px;
  height: 54px;
  border: 1.5px solid currentColor;
  border-radius: 9999px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  opacity: 0.65;
  transform: rotate(-10deg);
  flex-shrink: 0;
  user-select: none;
  line-height: 1.05;
}
.stamp-sm { width: 44px; height: 44px; }
.stamp-top { font-family: var(--font-mono); font-size: 6px; font-weight: 700; letter-spacing: 0.06em; }
.stamp-mid { font-family: var(--font-display); font-size: 10px; font-weight: 900; }
.stamp-bot { font-family: var(--font-mono); font-size: 5.5px; font-weight: 700; letter-spacing: 0.05em; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge-pop { background: var(--accent-pop); color: #FFFFFF; }
.badge-ink { background: var(--text-primary); color: var(--bg-surface); }
.badge-outline {
  background: transparent;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.card-cyber .badge-outline { border-color: var(--border-dark); color: var(--text-inverse-muted); }
.badge-ok { background: var(--status-ok-soft); color: var(--status-ok); }
.badge-warn { background: var(--status-warn-soft); color: var(--status-warn); border: 1px solid rgba(180, 83, 9, 0.35); }
.badge-err { background: var(--status-err-soft); color: var(--status-err); }

@keyframes popPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.35; transform: scale(0.78); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  border-top-color: var(--accent-pop);
  animation: spin 0.7s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 9999px;
  background: #FFFFFF;
  animation: popPulse 1.5s infinite ease-in-out;
}
.dot { width: 7px; height: 7px; border-radius: 9999px; display: inline-block; flex-shrink: 0; }
.dot-pop { background: var(--accent-pop); }
.dot-ok { background: var(--status-ok); }
.dot-muted { background: var(--border-light); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 40px;
  padding: 0 18px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.08s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.98); }
.btn-pop, .btn.primary { background: var(--accent-pop); color: #FFFFFF; border-color: var(--accent-pop); }
.btn-pop:hover, .btn.primary:hover { background: var(--accent-pop-hover); border-color: var(--accent-pop-hover); }
.btn-ink, .btn.tonal { background: var(--text-primary); color: var(--bg-surface); border-color: var(--text-primary); }
.btn-ink:hover, .btn.tonal:hover { opacity: 0.88; }
.btn-outline, .btn.outline { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-light); }
.btn-outline:hover, .btn.outline:hover { border-color: var(--border-strong); }
.btn-ok, .btn.success { background: var(--status-ok); color: #FFFFFF; border-color: var(--status-ok); }
.btn-danger, .btn.danger { background: var(--status-err); color: #FFFFFF; border-color: var(--status-err); }
.btn-ghost-dark {
  background: transparent;
  color: var(--text-inverse);
  border-color: rgba(255, 255, 255, 0.25);
}
.btn-ghost-dark:hover { background: var(--accent-pop); border-color: var(--accent-pop); color: #FFFFFF; }
.btn-sm { height: 34px; padding: 0 13px; font-size: 11px; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: var(--radius-sm); }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.42; cursor: not-allowed; }

/* Shelf 3-State Pills */
.shelf-strip { display: inline-flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.shelf-pill {
  height: 26px;
  padding: 0 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.card-cyber .shelf-pill { border-color: #353940; color: #A8ABB2; }
.shelf-pill:hover { border-color: var(--accent-pop); color: var(--accent-pop); }
.shelf-pill.active {
  background: var(--accent-pop);
  border-color: var(--accent-pop);
  color: #FFFFFF !important;
}

/* =========================================================================
   TOP HEADER & MOBILE BOTTOM NAV
   ========================================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  height: var(--topbar-h);
  padding-top: env(safe-area-inset-top);
  background: rgba(242, 237, 226, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-light);
}
.header-inner {
  max-width: var(--container-max);
  height: 100%;
  margin: 0 auto;
  padding: 0 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: none;
  border: none;
  padding: 0;
}
.brand-logo { width: 34px; height: 34px; flex-shrink: 0; transition: transform 0.15s ease; }
.brand-btn:hover .brand-logo { transform: scale(1.05); }
.brand-name {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.desktop-nav { display: flex; align-items: center; gap: 26px; }
.nav-link {
  position: relative;
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-secondary);
  transition: color 0.15s ease;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--text-primary); }
.nav-link.active::before {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -11px;
  width: 5px;
  height: 5px;
  border-radius: 9999px;
  background: var(--accent-pop);
}
.nav-link.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -19px;
  height: 2.5px;
  background: var(--accent-pop);
}

.header-controls { display: flex; align-items: center; gap: 8px; }
.search-box { position: relative; width: 210px; }
.search-box svg {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--text-secondary);
  pointer-events: none;
}
.input-field, .select-field, .text-input {
  height: 36px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}
.text-input { width: 100%; }
.search-box .input-field { width: 100%; padding-left: 34px; }
.input-field:focus, .select-field:focus, .text-input:focus { border-color: var(--border-strong); }

.lang-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.lang-pill:hover { border-color: var(--border-strong); }
.lang-active { color: var(--text-primary); }
.lang-dim { color: var(--text-secondary); font-weight: 500; }

.shelf-counter-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 36px;
  padding: 0 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.shelf-counter-pill:hover { border-color: var(--border-strong); }
.mobile-only { display: none; }

/* Mobile Bottom Navigation */
.mobile-nav {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  background: rgba(250, 248, 244, 0.96);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--border-light);
  box-shadow: var(--shadow-mnav);
  padding-bottom: env(safe-area-inset-bottom);
}
.mobile-nav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: 60px;
}
.mnav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
}
.mnav-btn svg { width: 20px; height: 20px; }
.mnav-btn.active { color: var(--accent-pop); }

/* =========================================================================
   LAYOUT, BANNERS & VIEWS
   ========================================================================= */
.page-main {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 32px 32px 64px;
}
.view-section { display: none; }
.view-section.active { display: block; }

.status-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-size: 12px;
  color: var(--text-secondary);
}
.demo-card {
  padding: 18px 20px;
  margin-bottom: 22px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.empty-box {
  padding: 40px 24px;
  text-align: center;
  border-style: dashed;
}

/* --- VIEW 1: START (HOME) --- */
.hero-grid {
  display: grid;
  grid-template-columns: 7fr 5fr;
  gap: 32px;
  align-items: end;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--border-light);
}
.hero-h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 5.6vw, 4.75rem);
  font-weight: 900;
  line-height: 0.94;
  letter-spacing: -0.035em;
  text-transform: uppercase;
}
.hero-index { border-top: 1px solid var(--border-light); border-bottom: 1px solid var(--border-light); }
.hero-index-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 14px 0;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  transition: color 0.15s ease;
}
.hero-index-row:last-child { border-bottom: none; }
.hero-index-row:hover { color: var(--accent-pop); }
.hero-index-row:hover .row-arrow { transform: translateX(4px); }
.hero-index-left { display: flex; align-items: center; gap: 16px; }
.hero-index-num { font-family: var(--font-mono); font-size: 12px; font-weight: 700; color: var(--text-secondary); }
.hero-index-row:hover .hero-index-num { color: var(--accent-pop); }
.hero-index-title { font-family: var(--font-display); font-size: 14px; font-weight: 800; letter-spacing: 0.02em; text-transform: uppercase; }
.row-arrow { font-family: var(--font-mono); transition: transform 0.15s ease; }

.explore-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 0;
}
.kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.brand-chips { display: flex; gap: 8px; flex-wrap: wrap; }
.brand-chip {
  height: 30px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  transition: all 0.15s ease;
}
.brand-chip:hover { background: var(--text-primary); border-color: var(--text-primary); color: var(--bg-surface); }

.pillars-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}
.pillar-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 332px;
}
.pillar-top {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.pillar-label {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -0.02em;
}
.pillar-stage {
  position: relative;
  z-index: 2;
  margin: 16px 0;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: rgba(242, 237, 226, 0.55);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 156px;
}
.card-cyber .pillar-stage {
  background: var(--bg-stage-dark);
  border-color: var(--border-dark);
  justify-content: center;
}
.card-paper .pillar-stage {
  background: transparent;
  border: none;
  padding: 6px 0;
  justify-content: center;
}
.pillar-cover {
  width: 122px;
  height: 122px;
  object-fit: contain;
  border-radius: 6px;
  flex-shrink: 0;
}
.pillar-cover-lg {
  width: 100%;
  max-width: 220px;
  height: 136px;
  object-fit: contain;
  border-radius: 6px;
}
.pillar-bottom { position: relative; z-index: 2; }
.pillar-stat {
  margin: 0;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pillar-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.summary-strip {
  margin-top: 22px;
  padding: 16px 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.summary-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* --- VIEW 2: CATALOG + STICKY PRICE SIDEBAR --- */
.view-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.view-h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 3.8vw, 3.1rem);
  font-weight: 900;
  line-height: 0.98;
  letter-spacing: -0.03em;
  text-transform: uppercase;
}
.view-sub { margin: 8px 0 0; color: var(--text-secondary); font-size: 14px; }

.filter-strip {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 12px;
  scrollbar-width: none;
}
.filter-strip::-webkit-scrollbar { display: none; }
.filter-sep { width: 1px; height: 22px; background: var(--border-light); flex-shrink: 0; margin: 0 2px; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.filter-chip:hover { border-color: var(--border-strong); }
.filter-chip.active {
  background: var(--text-primary);
  border-color: var(--text-primary);
  color: var(--bg-surface);
}

.catalog-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}
.catalog-search-input { min-width: 210px; flex: 1; max-width: 320px; }

.catalog-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(300px, 4fr);
  gap: 20px;
  align-items: start;
}
.sets-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.set-card {
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
}
.set-card-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.set-series {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.card-cyber .set-series { color: var(--text-inverse-muted); }
.set-title {
  margin: 4px 0 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.set-meta {
  margin: 5px 0 0;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-secondary);
}
.card-cyber .set-meta { color: var(--text-inverse-muted); }

.set-card-mid {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.price-now {
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.02em;
}
.price-old {
  font-family: var(--font-mono);
  font-size: 11.5px;
  text-decoration: line-through;
  color: var(--text-secondary);
}
.card-cyber .price-old { color: #73767D; }
.price-subline {
  margin-top: 4px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
}
.set-thumb {
  width: 104px;
  height: 104px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  padding: 5px;
  background: rgba(242, 237, 226, 0.55);
  border: 1px solid rgba(220, 214, 202, 0.75);
  overflow: hidden;
}
.card-cyber .set-thumb {
  background: var(--bg-stage-dark);
  border-color: var(--border-dark);
}
.set-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: 4px;
}

.card-prog-wrap {
  position: relative;
  z-index: 2;
}
.card-prog-head {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 4px;
}

.set-card-foot {
  position: relative;
  z-index: 2;
  padding-top: 11px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.card-cyber .set-card-foot { border-top-color: var(--border-dark); }
.open-link {
  background: none;
  border: none;
  padding: 4px 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: inherit;
  white-space: nowrap;
}
.open-link:hover { color: var(--accent-pop); }

/* Price Sidebar */
.price-sidebar {
  position: sticky;
  top: calc(var(--topbar-h) + 20px);
  padding: 20px;
}
.sidebar-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.sidebar-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  text-transform: uppercase;
}
.side-set-subtitle {
  margin: 4px 0 0;
  font-size: 11.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 240px;
}
.chart-box { margin: 14px 0; }
.chart-single-point {
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-sm);
  padding: 16px 14px;
  text-align: center;
  background: rgba(242, 237, 226, 0.45);
}
.offers-list {
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
  margin: 14px 0 16px;
}
.offer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 12px;
  text-decoration: none;
  color: inherit;
}
.offer-row:last-child { border-bottom: none; }
a.offer-row:hover { color: var(--accent-pop); }
.wh-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.wh-tag {
  padding: 2px 7px;
  border-radius: 5px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border: 1px solid var(--border-light);
  color: var(--text-secondary);
}
.wh-tag.ok { border-color: var(--status-ok); color: var(--status-ok); background: var(--status-ok-soft); }
.two-col-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.coupon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  margin-top: 10px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--accent-pop);
  background: var(--accent-pop-soft);
  font-family: var(--font-mono);
  font-size: 11px;
}

/* --- VIEW 3: FULL SET DETAIL --- */
.detail-topbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 7.5fr) minmax(300px, 4.5fr);
  gap: 22px;
  align-items: start;
}
.detail-stack { display: flex; flex-direction: column; gap: 18px; }
.detail-hero-stage {
  position: relative;
  min-height: 290px;
  max-height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px 52px;
  background: rgba(242, 237, 226, 0.55);
}
.card-cyber .detail-hero-stage { background: var(--bg-stage-dark); }
.detail-hero-img {
  max-width: 100%;
  max-height: 310px;
  object-fit: contain;
  border-radius: var(--radius-sm);
}
.detail-specs-pills {
  position: absolute;
  left: 16px;
  bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  z-index: 2;
}
.detail-hero-body { padding: 22px; position: relative; z-index: 2; }
.detail-h1 {
  margin: 8px 0 0;
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.35rem);
  font-weight: 900;
  line-height: 1.02;
  text-transform: uppercase;
}
.detail-price-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.card-cyber .detail-price-bar { border-top-color: var(--border-dark); }

.progress-bar-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--border-light);
  overflow: hidden;
}
.card-cyber .progress-bar-track { background: var(--border-dark); }
.progress-bar-fill {
  height: 100%;
  border-radius: var(--radius-pill);
  background: var(--accent-pop);
  transition: width 0.25s ease;
}
.progress-bar-fill.ok { background: var(--status-ok); }

.bags-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.bag-tile {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-canvas);
  text-align: left;
  transition: border-color 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.bag-tile:hover { border-color: var(--accent-pop); }
.bag-tile.done { border-color: var(--status-ok); }
.bag-tile-top {
  display: flex;
  align-items: center;
  gap: 10px;
}
.bag-thumb {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 5px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}

.spec-dl { margin: 12px 0 0; }
.spec-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  border-bottom: 1px solid var(--border-light);
  font-family: var(--font-mono);
  font-size: 11.5px;
}
.spec-row:last-child { border-bottom: none; }
.spec-row strong { text-align: right; }

.video-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.video-card {
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-canvas);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.video-card-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.video-play {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--bg-dark);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 13px;
}
.video-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
}
.video-link:hover { color: var(--accent-pop); }
.video-embed-frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
  border-radius: var(--radius-sm);
  background: #000;
}

.detail-mobile-bar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(60px + env(safe-area-inset-bottom));
  z-index: 45;
  padding: 10px 16px;
  background: rgba(250, 248, 244, 0.96);
  backdrop-filter: blur(8px);
  border-top: 1px solid var(--border-light);
  gap: 10px;
  grid-template-columns: 1fr 1fr;
}

/* --- VIEW 4B: FULLSCREEN BUILDER 2D --- */
.builder-workspace {
  display: none;
  flex-direction: column;
  height: 100dvh;
  background: var(--bg-canvas);
  color: var(--text-primary);
}
.builder-workspace.active { display: flex; }
.builder-topbar {
  height: 56px;
  padding: 0 16px;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-shrink: 0;
}
.builder-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  min-width: 0;
}
.builder-step-text {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.builder-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.builder-thin-progress { height: 3px; background: var(--border-light); flex-shrink: 0; }
.builder-thin-fill { height: 100%; background: var(--accent-pop); transition: width 0.2s ease; }

.builder-stage {
  position: relative;
  flex: 1;
  overflow: hidden;
  background: var(--bg-paper);
  touch-action: none;
  user-select: none;
}
[data-theme="builder-dark"] .builder-stage { background: var(--bg-stage-dark); }

.canvas-tilt-wrap {
  width: 100%;
  height: 100%;
  transition: transform 0.12s ease-out;
  transform-style: preserve-3d;
}
#builderCanvas {
  width: 100%;
  height: 100%;
  display: block;
}
.loupe-canvas {
  position: absolute;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  border: 2.5px solid var(--accent-pop);
  box-shadow: var(--shadow-float);
  pointer-events: none;
  z-index: 15;
}
.confetti-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 18;
}

.builder-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
  max-width: calc(100% - 140px);
}
.ctx-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #FFFFFF;
  background: #18181A;
  border: 1px solid rgba(255, 255, 255, 0.14);
}
.ctx-badge.pop { background: var(--accent-pop); border-color: var(--accent-pop); }
.ctx-badge.ok { background: var(--bg-surface); color: var(--text-primary); border-color: var(--border-light); }
.ctx-badge.warn { background: var(--status-warn-soft); color: var(--status-warn); border-color: rgba(180, 83, 9, 0.55); backdrop-filter: blur(4px); }
[data-theme="builder-dark"] .ctx-badge.warn { background: rgba(180, 83, 9, 0.88); color: #FFFBEB; }

.builder-side-tools {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.zoom-group {
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  overflow: hidden;
}
.zoom-group button {
  height: 32px;
  min-width: 32px;
  padding: 0 8px;
  background: none;
  border: none;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.zoom-group button:hover { background: var(--bg-paper); }
.tool-pill {
  height: 32px;
  padding: 0 11px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  transition: all 0.15s ease;
}
.tool-pill:hover { border-color: var(--border-strong); }
.tool-pill.active {
  border-color: var(--accent-pop);
  background: var(--accent-pop-soft);
  color: var(--accent-pop);
}

.led-popover {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 14;
  width: min(300px, calc(100% - 28px));
  max-height: 60%;
  overflow-y: auto;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-surface);
  box-shadow: var(--shadow-float);
}
.led-check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 6px 0;
  font-size: 12.5px;
  cursor: pointer;
}
.led-check-row input { accent-color: var(--accent-pop); width: 15px; height: 15px; margin-top: 2px; flex-shrink: 0; }

.builder-footer {
  height: calc(68px + env(safe-area-inset-bottom));
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bg-surface);
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}
.scrubber-wrap { flex: 1; min-width: 0; }
.scrubber-labels {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 6px;
}
.scrubber-title {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-slider { width: 100%; accent-color: var(--accent-pop); cursor: pointer; }
.nav-next { min-width: 112px; }

/* --- VIEW 5: ON THE RADAR --- */
.radar-layout {
  display: grid;
  grid-template-columns: minmax(0, 8fr) minmax(290px, 4fr);
  gap: 20px;
  align-items: start;
}
.radar-feed {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.radar-featured {
  grid-row: span 2;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.radar-small {
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 205px;
}
.radar-thumb-sm {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border-radius: 6px;
  background: rgba(242, 237, 226, 0.55);
  border: 1px solid var(--border-light);
  padding: 3px;
  flex-shrink: 0;
}

.social-card-preview {
  border-radius: var(--radius-md);
  border: 1px solid var(--border-dark);
  background: var(--bg-dark);
  color: var(--text-inverse);
  overflow: hidden;
}
.social-top-strip {
  background: #F2EDE2;
  color: #18181A;
  padding: 11px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.social-stage {
  position: relative;
  background: #0D0E10;
  padding: 26px 18px;
  min-height: 210px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 3px solid var(--accent-pop);
}
.social-stage img {
  max-width: 210px;
  max-height: 175px;
  object-fit: contain;
}
.social-caption { padding: 16px; }

/* --- VIEW 6: MY SHELF --- */
.shelf-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.kpi-tile {
  padding: 14px 16px;
  text-align: left;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  transition: border-color 0.15s ease;
}
.kpi-tile:hover { border-color: var(--border-strong); }
.kpi-tile.active { border-color: var(--accent-pop); outline: 1px solid var(--accent-pop); }
.kpi-num { font-family: var(--font-display); font-size: 28px; font-weight: 900; line-height: 1; margin-top: 6px; }

/* --- MODALS, DRAWER, DROP OVERLAY & TOAST --- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(20, 21, 23, 0.58);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.overlay.drawer-align { justify-content: flex-end; padding: 0; }
.modal-box {
  width: min(540px, 100%);
  max-height: 88dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}
.drawer-box {
  width: min(380px, 92vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-light);
  box-shadow: var(--shadow-float);
}
.modal-head {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-light);
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
}
.modal-footer:empty { display: none; }
.modal-section {
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-canvas);
  margin-bottom: 12px;
}
.modal-section:last-child { margin-bottom: 0; }

.drawer-list { flex: 1; overflow-y: auto; padding: 10px 14px; }
.step-row {
  width: 100%;
  padding: 8px 10px;
  margin-bottom: 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-canvas);
  display: flex;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}
.step-row:hover { border-color: var(--border-strong); }
.step-row.current { border-left: 3px solid var(--accent-pop); border-color: var(--accent-pop); }
.step-row-thumb {
  width: 44px;
  height: 34px;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
  flex-shrink: 0;
}
.step-row-info { flex: 1; min-width: 0; }
.step-row-title { font-family: var(--font-mono); font-size: 11.5px; font-weight: 700; }
.step-row.current .step-row-title { color: var(--accent-pop); }
.step-row-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.step-row-done {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  flex-shrink: 0;
}
.step-row-done.done { color: var(--status-ok); }

.drop-overlay {
  position: fixed;
  inset: 0;
  z-index: 95;
  background: rgba(20, 21, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.drop-box {
  width: min(460px, 100%);
  padding: 36px 28px;
  text-align: center;
  border: 2px dashed var(--accent-pop);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  z-index: 100;
  padding: 10px 18px;
  border-radius: var(--radius-pill);
  background: #18181A;
  color: #F5F3EE;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-float);
  max-width: calc(100vw - 32px);
}

/* =========================================================================
   RESPONSIVE BREAKPOINTS
   ========================================================================= */
@media (max-width: 1199px) {
  .header-inner { padding: 0 24px; }
  .page-main { padding: 28px 24px 64px; }
}
@media (max-width: 1079px) {
  .catalog-layout { grid-template-columns: 1fr; }
  .price-sidebar { display: none; }
  .radar-layout { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
}
@media (max-width: 959px) {
  .header-inner { padding: 0 20px; }
  .page-main { padding: 24px 20px 88px; }
  .search-box { display: none; }
  .pillars-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 20px; }
}
@media (max-width: 767px) {
  .site-header { height: calc(56px + env(safe-area-inset-top)); }
  .header-inner { padding: 0 16px; }
  .desktop-nav, .shelf-counter-pill { display: none; }
  .mobile-only { display: inline-flex; }
  .mobile-nav { display: block; }
  .page-main { padding: 20px 16px 104px; }
  .sets-grid { grid-template-columns: 1fr; }
  .radar-feed { grid-template-columns: 1fr; }
  .radar-featured { grid-row: span 1; }
  .shelf-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .video-grid { grid-template-columns: 1fr; }
  .summary-strip .btn { width: 100%; }
  .toast { bottom: 80px; }
  .builder-timer-btn { display: none; }
  .detail-mobile-bar:not(.hidden) { display: grid; }
  #viewDetail { padding-bottom: 68px; }
}
