/* ============================================================================
   LEGOBUL.COM / EMARE BRICKLAB — GOOGLE & VEEGRID TARZI ULTRA SADE ÖN YÜZ
   2-Ton Monokrom Renk Paleti (--paper / --ink / --muted / --line) + Gece Modu
   ============================================================================ */

:root {
  --paper: #f6f6f3;
  --ink: #1b1d1a;
  --muted: #686c65;
  --line: #dedfd8;
  --surface: #ffffff;
  --surface-alt: #efefea;
  --font-sans: "Inter", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", monospace;
  /* Legacy compatibility aliases used by inline JS badges */
  --lego-yellow: #1b1d1a;
  --lego-red: #1b1d1a;
  --lego-green: #15803d;
  --fb-red: #1b1d1a;
  --fb-text: #1b1d1a;
  --fb-muted: #686c65;
  --fb-border: #dedfd8;
  --fb-border-soft: #e8e9e2;
}

html[data-theme="dark"] {
  --paper: #141614;
  --ink: #eceee8;
  --muted: #989d92;
  --line: #2b2f2a;
  --surface: #1c1f1c;
  --surface-alt: #232723;
  --lego-yellow: #eceee8;
  --lego-red: #eceee8;
  --fb-red: #eceee8;
  --fb-text: #eceee8;
  --fb-muted: #989d92;
  --fb-border: #2b2f2a;
  --fb-border-soft: #252925;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  background: var(--paper);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font-family: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.container {
  max-width: 1400px;
  width: 100%;
  margin: 0 auto;
  padding: 0 28px;
}

/* 1. TEK SATIR MİNİMALİST HEADER */
.site-header {
  background: rgba(246, 246, 243, 0.94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 90;
}

html[data-theme="dark"] .site-header {
  background: rgba(20, 22, 20, 0.94);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
  gap: 16px;
}

.brand-logo-link {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.brand-title {
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--ink);
}

.brand-dot {
  color: var(--muted);
  font-weight: 500;
}

.brand-sub-tag {
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 500;
  padding-left: 10px;
  border-left: 1px solid var(--line);
  white-space: nowrap;
}

@media (max-width: 1260px) {
  .brand-sub-tag {
    display: none;
  }
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.header-pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 500;
  min-height: 32px;
  white-space: nowrap;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

#headerSetPill {
  max-width: 280px;
}

#headerSetTitle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#headerSetStats {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 110px;
}

.header-pill-btn:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.header-pill-btn img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  border-radius: 4px;
}

.muted-inline {
  color: var(--muted);
  font-size: 11px;
}

.cart-count-badge {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 600;
}

/* 2. GOOGLE-TARZI ORTALANMIŞ ULTRA SADE KARŞILAMA EKRANI */
body:not(.workspace-active) #workspaceCatalogMain {
  display: none !important;
}

body:not(.workspace-active) .hero-section {
  min-height: calc(100vh - 56px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 0 36px;
}

body.workspace-active .hero-section {
  padding: 16px 0 8px;
}

body.workspace-active .hero-headline,
body.workspace-active #welcomeModulePicker,
body.workspace-active #welcomeOfficialLegalBar {
  display: none !important;
}

.hero-main {
  display: block;
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  text-align: center;
}

.hero-left-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  width: 100%;
}

.hero-headline {
  font-size: clamp(30px, 3.8vw, 46px);
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1.14;
  color: var(--ink);
  margin: 0 0 24px;
}

.text-highlight {
  color: var(--muted);
  font-weight: 400;
}

/* Google Yuvarlak Arama Çubuğu */
.search-bar-form {
  width: 100%;
  max-width: 660px;
  margin: 0 auto 20px;
  position: relative;
}

.search-input-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 8px 6px 18px;
  min-height: 56px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  gap: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-input-group:focus-within {
  border-color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.06);
}

.search-icon {
  color: var(--muted);
  flex-shrink: 0;
}

.search-input {
  flex: 1 1 auto;
  min-width: 140px;
  font-size: 14.5px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: none;
}

.search-input::placeholder {
  color: var(--muted);
}

.ocr-pill-btn {
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  flex-shrink: 0;
  transition: background-color 0.15s ease;
}

.ocr-pill-btn:hover {
  border-color: var(--ink);
}

.search-submit-btn {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  border-radius: 999px;
  height: 42px;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-submit-btn:hover {
  opacity: 0.88;
}

/* Canlı Arama Önizleme Açılır Kutusu */
.search-instant-dropdown {
  position: absolute;
  top: 62px;
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.1);
  padding: 8px;
  z-index: 120;
  text-align: left;
  max-height: 360px;
  overflow-y: auto;
}

.instant-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.12s ease;
}

.instant-item:hover {
  background: var(--surface-alt);
}

.instant-item-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.instant-item-left img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.instant-item-left strong {
  font-size: 13px;
  color: var(--ink);
  display: block;
}

.instant-item-left small {
  font-size: 11.5px;
  color: var(--muted);
}

.instant-add-btn {
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 500;
  border: 0;
}

/* Arama Altı Hızlı Aksiyon Hapları */
.search-sub-actions-row {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.search-sub-pill {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.search-sub-pill:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

/* Hoşgeldin Ekranı: 2x3 Minimalist Modül Seçim Kartları */
.welcome-vehicle-picker {
  width: 100%;
  max-width: 660px;
  margin: 4px auto 26px;
}

.welcome-picker-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin-bottom: 12px;
}

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

.welcome-vtype-btn {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 15px 36px 15px 18px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.14s ease;
}

.welcome-vtype-btn::after {
  content: "→";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: var(--muted);
  transition: transform 0.16s ease, color 0.16s ease;
}

.welcome-vtype-btn:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.welcome-vtype-btn:hover::after {
  transform: translate(3px, -50%);
  color: var(--ink);
}

.welcome-vtype-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
}

.welcome-vtype-btn small {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.35;
}

/* Hoşgeldin Ekranı: Alt Bilgi Satırı */
.welcome-official-legal {
  width: 100%;
  max-width: 660px;
  margin: 12px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  text-align: center;
}

.welcome-legal-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 10px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 11.5px;
}

.welcome-legal-links strong {
  color: var(--ink);
  font-weight: 600;
}

.welcome-legal-notice {
  margin: 0 auto;
  max-width: 580px;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

/* 3. ÇALIŞMA ALANI (WORKSPACE) ÜST ÇUBUĞU & GOOGLE SEKME BARI */
.catalog-main {
  padding-bottom: 48px;
}

.workspace-vtype-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  margin: 0 auto 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.workspace-bar-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.workspace-back-btn {
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.workspace-back-btn:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.workspace-active-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
}

.inline-set-search {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.inline-set-search input {
  height: 32px;
  width: 150px;
  padding: 0 11px;
  font-size: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.quick-sets {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}

.set-chip,
.set-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 11.5px;
  max-width: 240px;
  transition: all 0.14s ease;
}

.set-chip img,
.set-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  border-radius: 3px;
  flex-shrink: 0;
  background: #ffffff;
}

.set-chip-info,
.set-item-info {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.set-chip-info strong,
.set-item-info strong {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.set-chip-info small,
.set-item-info span {
  display: none;
}

.set-chip:hover,
.set-chip.active,
.set-item:hover,
.set-item.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.set-chip:hover .set-chip-info strong,
.set-chip.active .set-chip-info strong,
.set-item:hover .set-item-info strong,
.set-item.active .set-item-info strong {
  color: var(--paper);
}

.toggle-row-compact {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}

.toggle-row-compact input {
  accent-color: var(--ink);
}

/* Google Arama Altı İnce Sekme Çubuğu */
.detail-explorer-hub {
  border-bottom: 1px solid var(--line);
  margin: 0 auto 20px;
}

.hub-buttons-scroll {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 22px;
}

.hub-pill-btn {
  background: transparent;
  border: 0;
  border-bottom: 2px solid transparent;
  padding: 10px 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.15s ease, border-color 0.15s ease;
}

.hub-pill-btn:hover {
  color: var(--ink);
  border-bottom-color: var(--line);
}

.hub-pill-btn.active {
  color: var(--ink);
  font-weight: 600;
  border-bottom: 2px solid var(--ink);
}

/* 4. SEKME GÖRÜNÜMLERİ VE GENEL KART DÜZENİ */
.tab-view {
  display: none;
}

.tab-view.active {
  display: block;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px 18px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.panel-header h2,
.panel-header h3 {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.sub-hint,
.small-note {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

.badge-mono,
.badge-green {
  background: var(--surface-alt);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

/* Ortak Form Elemanları & Butonlar */
input[type="text"],
input[type="number"],
select,
textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--ink);
}

.btn-primary,
.btn-accent,
.workspace-quick-pill.active-pill {
  background: var(--ink);
  color: var(--paper);
  border: 1px solid var(--ink);
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  transition: opacity 0.15s ease;
}

.btn-primary:hover,
.btn-accent:hover {
  opacity: 0.86;
}

.btn-hud {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.btn-hud:hover,
.btn-hud.active-elec {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.full-width {
  width: 100%;
  margin-top: 8px;
}

/* 5. TAB 1: 3D STUDIO */
.studio-top-templates-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 14px;
}

.template-grid {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  flex: 1;
}

.tpl-card {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: all 0.14s ease;
}

.tpl-card .tpl-icon {
  font-size: 14px;
}

.tpl-card strong {
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
}

.tpl-card span:not(.tpl-icon) {
  display: none;
}

.tpl-card:hover,
.tpl-card.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.tpl-card:hover strong,
.tpl-card.active strong {
  color: var(--paper);
}

.prompt-box-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 300px;
}

.studio-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 14px;
  min-height: 600px;
}

.canvas-wrapper {
  position: relative;
  background: radial-gradient(circle at 50% 35%, #232723 0%, #141614 100%);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 580px;
}

.three-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.canvas-hud-top {
  position: relative;
  z-index: 5;
  display: flex;
  gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
  pointer-events: none;
}

.hud-kpi {
  background: rgba(20, 22, 20, 0.78);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  padding: 7px 12px;
  border-radius: 8px;
  display: flex;
  flex-direction: column;
}

.kpi-label {
  font-size: 9.5px;
  letter-spacing: 0.06em;
  color: #989d92;
  font-weight: 600;
}

.hud-kpi strong {
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  margin-top: 2px;
}

.canvas-hud-bottom {
  position: relative;
  z-index: 5;
  background: rgba(20, 22, 20, 0.86);
  backdrop-filter: blur(8px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.hud-control-group {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11.5px;
  color: #eceee8;
}

.hud-control-group input[type="range"] {
  width: 100px;
  accent-color: #ffffff;
}

.hud-buttons {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.studio-inspector {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.param-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

.param-group label {
  font-size: 12px;
  color: var(--muted);
}

.param-group input[type="range"] {
  width: 100%;
  accent-color: var(--ink);
}

.freebuild-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.freebuild-row input[type="color"] {
  width: 42px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 2px;
}

.mini-bom-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 220px;
  overflow-y: auto;
}

.mini-bom-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 11.5px;
}

.mini-bom-item img {
  width: 26px;
  height: 26px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

.color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1px solid rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
}

/* 6. TAB 2: DÜNYA LEGO KÜTÜPHANESİ (1949-2027) */
.booklets-layout,
.arduino-studio-layout,
.instructions-container,
.swap-exchange-layout {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.world-lib-stats-strip {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.wlib-stat {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 9px 6px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.wlib-stat strong {
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--ink);
}

.wlib-stat span {
  font-size: 10.5px;
  color: var(--muted);
}

.world-lib-subtabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.wlib-subtab {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: 999px;
}

.wlib-subtab:hover {
  color: var(--ink);
  border-color: var(--ink);
}

.wlib-subtab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.world-lib-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.world-lib-filters input {
  flex: 2;
  min-width: 220px;
}

.world-lib-filters select {
  flex: 1;
  min-width: 150px;
}

.world-lib-pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

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

.wlib-page-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.world-library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  max-height: 700px;
  overflow-y: auto;
}

.wlib-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
  transition: border-color 0.15s ease;
}

.wlib-card:hover {
  border-color: var(--ink);
}

.wlib-card-img-wrap {
  height: 115px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  position: relative;
}

.wlib-card-img-wrap img {
  max-height: 100px;
  max-width: 100%;
  object-fit: contain;
}

.wlib-badge-top,
.wlib-badge-year {
  position: absolute;
  top: 6px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 999px;
}

.wlib-badge-top {
  left: 6px;
}

.wlib-badge-year {
  right: 6px;
}

.wlib-card-title {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.35;
}

.wlib-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  color: var(--muted);
}

.wlib-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.wlib-btn {
  font-size: 11px;
  font-weight: 500;
  padding: 6px 8px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
}

.wlib-btn:hover {
  background: var(--surface-alt);
  border-color: var(--ink);
}

.wlib-btn.primary {
  grid-column: span 2;
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.wlib-color-swatch-box {
  height: 60px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wlib-color-stud {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: inherit;
  border: 2px solid rgba(255, 255, 255, 0.45);
}

.official-booklets-grid,
.compatibility-grid,
.booklet-parts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 10px;
}

.booklets-middle-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 14px;
}

.pdf-booklet-card,
.compat-card,
.inv-part-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.pdf-booklet-card img,
.inv-part-card img {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

/* 7. TAB 3: ARDUINO & MEKATRONİK */
.arduino-projects-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.ard-proj-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ard-proj-card:hover,
.ard-proj-card.active {
  border-color: var(--ink);
  background: var(--surface-alt);
}

.arduino-main-split {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 14px;
}

.arduino-left-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.ard-components-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.ard-comp-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.housing-notes-list {
  padding-left: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 12.5px;
  color: var(--ink);
}

.ino-code-pre {
  background: #141614;
  color: #e2e8f0;
  border-radius: 8px;
  padding: 14px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.5;
  overflow: auto;
  max-height: 540px;
}

/* 8. TAB 4: ADIM ADIM YAPIM KILAVUZU */
.instructions-header {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.booklet-tag {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.instructions-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.step-indicator {
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.instructions-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 14px;
}

.step-callout-card,
.step-blueprint-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
}

.step-parts-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
}

.callout-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.callout-item img {
  width: 34px;
  height: 34px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
}

.callout-qty {
  font-size: 12px;
  font-weight: 700;
}

.step-tip-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 12px;
  color: var(--muted);
}

.blueprint-canvas-wrap {
  background: #141614;
  border-radius: 10px;
  padding: 12px;
  display: flex;
  justify-content: center;
}

.step-pills-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.step-pill {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--paper);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
}

.step-pill.active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

/* 9. TAB 5: TAKAS & 2. EL BORSASI */
.swap-calculator-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--paper);
  border: 1px solid var(--line);
  padding: 12px;
  border-radius: 10px;
  margin-bottom: 12px;
}

.swap-side-box {
  flex: 1;
  min-width: 240px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.swap-side-box label {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
}

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

.swap-vs-badge {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.swap-compare-cards {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1fr;
  gap: 10px;
}

.swap-set-card,
.swap-verdict-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  gap: 10px;
  align-items: center;
}

.swap-verdict-card {
  flex-direction: column;
  align-items: flex-start;
}

.swap-set-card img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  background: #fff;
  border-radius: 6px;
  border: 1px solid var(--line);
}

.swap-bottom-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 14px;
}

.market-listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
}

.market-listing-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 8px;
}

.listing-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.listing-form label {
  font-size: 11.5px;
  color: var(--muted);
}

.form-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auto-valuation-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  font-size: 11.5px;
}

/* 10. TAB 6: BOM, MALİYET & ÖZEL KİTLER */
.marketplace-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 14px;
}

.bom-export-col {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.econ-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 12px;
}

.econ-box {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.econ-box span {
  font-size: 11px;
  color: var(--muted);
}

.econ-box strong {
  font-size: 18px;
  font-weight: 600;
}

.price-input-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}

.export-bar,
.publish-kit-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.publish-kit-bar input {
  flex: 1;
}

.bom-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.bom-table th {
  text-align: left;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.bom-table td {
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.bom-table img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  background: #fff;
  border-radius: 4px;
  border: 1px solid var(--line);
}

.marketplace-kits-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.kit-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.kit-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.kit-price {
  font-size: 16px;
  font-weight: 600;
}

.kit-meta-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11.5px;
  color: var(--muted);
}

@media (max-width: 1024px) {
  .studio-layout,
  .arduino-main-split,
  .swap-bottom-grid,
  .marketplace-layout,
  .instructions-body,
  .booklets-middle-grid,
  .swap-compare-cards {
    grid-template-columns: 1fr;
  }
  .world-lib-stats-strip {
    grid-template-columns: repeat(4, 1fr);
  }
  .arduino-projects-bar {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .welcome-picker-grid {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------------ Hesap penceresi */
.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 10050; /* hediye penceresinin (9999) üstünde: girişsiz hediye denemesi burayı açar */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  box-sizing: border-box;
  background: rgba(20, 22, 20, 0.55);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 380px;
  max-height: 100%;
  box-sizing: border-box;
  overflow-y: auto;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px 22px 20px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.auth-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  border-radius: 8px;
}

.auth-close:hover {
  background: var(--surface-alt);
  color: var(--ink);
}

.auth-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 600;
}

.auth-lead {
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.auth-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
}

.auth-field input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
}

.auth-error {
  font-size: 13px;
  line-height: 1.4;
  color: #b42318;
  background: rgba(180, 35, 24, 0.08);
  border: 1px solid rgba(180, 35, 24, 0.25);
  border-radius: 9px;
  padding: 8px 10px;
}

html[data-theme="dark"] .auth-error {
  color: #ffb4a8;
}

.auth-submit {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: 0.6;
  cursor: default;
}

.auth-switch {
  display: block;
  width: 100%;
  margin-top: 12px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.auth-switch:hover {
  color: var(--ink);
}
