:root {
  --bg-page: #eef2f6;
  --bg-panel: #ffffff;
  --bg-panel-alt: #f8fafc;
  --bg-header: #131822;
  --bg-header-sub: #1c2433;
  --border-light: #dce3ec;
  --border-med: #b8c4d4;
  --text-main: #151b26;
  --text-muted: #526071;
  --text-light: #7c8b9e;

  /* Category Accents (Tasteful, Lively Engineering Palette) */
  --cat-part: #0d9488;
  --cat-part-soft: #e6f7f5;
  --cat-asm: #d97706;
  --cat-asm-soft: #fef3c7;
  --cat-drw: #4f46e5;
  --cat-drw-soft: #eef2ff;
  --cat-ui: #9333ea;

  --state-active: #16a34a;
  --state-active-bg: #dcfce7;
  --state-passive: #788292;
  --state-locked: #b45309;
  --state-locked-bg: #fef3c7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --shadow-sm: 0 2px 6px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 10px 24px rgba(15, 23, 42, 0.11);
}

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

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
  background-color: var(--bg-page);
  background-image: radial-gradient(#cbd5e1 0.75px, transparent 0.75px);
  background-size: 20px 20px;
  color: var(--text-main);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

/* Header & Navigation */
.main-header {
  background: linear-gradient(90deg, #111722 0%, #1c2536 100%);
  color: #f0f4f8;
  border-bottom: 1px solid #2d384d;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.2);
}

.header-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
}

.brand-cube {
  width: 38px;
  height: 38px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid #38bdf8;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(56, 189, 248, 0.22);
}

.brand-title {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-title span {
  font-weight: 600;
  color: #38bdf8;
  font-size: 12.5px;
  border-left: 1px solid #334155;
  padding-left: 10px;
  letter-spacing: 0.6px;
}

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

.lang-switcher,
.mode-switcher {
  background: #1e293b;
  color: #f1f5f9;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 7px 11px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.coming-soon-pill {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 7px 14px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 7px;
  box-shadow: 0 2px 8px rgba(217, 119, 6, 0.35);
}

/* Sub Navigation */
.sub-nav {
  background: var(--bg-header-sub);
  border-bottom: 1px solid #2e3b52;
}

.sub-nav-inner {
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

.nav-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}

.nav-tab {
  background: transparent;
  color: #94a3b8;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 12px 18px;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}

.nav-tab:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.04);
}

.nav-tab.active {
  color: #38bdf8;
  border-bottom-color: #38bdf8;
  background: rgba(56, 189, 248, 0.08);
}

/* Container */
.container {
  max-width: 1360px;
  margin: 22px auto 60px;
  padding: 0 20px;
}

/* Pre-Launch Coming Soon Ribbon */
.prelaunch-ribbon {
  background: linear-gradient(90deg, #0f766e 0%, #1e3a8a 50%, #6d28d9 100%);
  color: #ffffff;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.2);
}

.prelaunch-ribbon-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pulse-dot {
  width: 11px;
  height: 11px;
  background: #4ade80;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.3);
  flex-shrink: 0;
}

/* Hero Banner */
.hero-banner {
  background: linear-gradient(135deg, #131c2e 0%, #1e293b 55%, #172a3a 100%);
  color: #f8fafc;
  border: 1px solid #334155;
  border-radius: var(--radius-md);
  padding: 28px 30px;
  margin-bottom: 22px;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 24px;
  align-items: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

.hero-title {
  font-size: 25px;
  font-weight: 800;
  margin-bottom: 10px;
  color: #ffffff;
  line-height: 1.25;
}

.hero-sub {
  color: #cbd5e1;
  font-size: 14.5px;
  margin-bottom: 18px;
  max-width: 700px;
}

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

.cad-badge {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.32);
  color: #e0f2fe;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}

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

.stat-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-left: 3px solid #38bdf8;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
}

.stat-card:nth-child(2) { border-left-color: #14b8a6; }
.stat-card:nth-child(3) { border-left-color: #f59e0b; }
.stat-card:nth-child(4) { border-left-color: #818cf8; }

.stat-card small {
  display: block;
  color: #94a3b8;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 2px;
}

.stat-card strong {
  font-size: 19px;
  color: #ffffff;
  font-weight: 800;
}

/* Filter Toolbar */
.toolbar-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-sm);
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  background: var(--bg-panel-alt);
  color: var(--text-main);
  border: 1px solid var(--border-light);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.15s;
}

.filter-btn:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
}

.filter-btn.active[data-cat="all"] {
  background: #1e293b;
  color: #ffffff;
  border-color: #0f172a;
}

.filter-btn.active[data-cat="part"] {
  background: var(--cat-part);
  color: #ffffff;
  border-color: #0f766e;
}

.filter-btn.active[data-cat="assembly"] {
  background: var(--cat-asm);
  color: #ffffff;
  border-color: #b45309;
}

.filter-btn.active[data-cat="drawing"] {
  background: var(--cat-drw);
  color: #ffffff;
  border-color: #3730a3;
}

.filter-btn.active[data-cat="userform"] {
  background: var(--cat-ui);
  color: #ffffff;
  border-color: #7e22ce;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 240px;
  justify-content: flex-end;
}

.search-input {
  width: 100%;
  max-width: 320px;
  padding: 8px 13px;
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #ffffff;
}

/* Task Pane Simulator Bar */
.sim-bar {
  background: linear-gradient(90deg, #ffffff 0%, #f1f5f9 100%);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  padding: 11px 18px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  box-shadow: var(--shadow-sm);
}

.sim-bar .filter-btn.active {
  background: #0284c7;
  color: #ffffff;
  border-color: #0369a1;
}

.sim-legend {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: #334155;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
}

/* Exact 8x8 Vector Indicators */
.ind-dot-active {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #16a34a;
  border: 1px solid #15803d;
  box-shadow: 0 0 6px rgba(22, 163, 74, 0.45);
  display: inline-block;
  flex-shrink: 0;
}

.ind-dot-passive {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid #94a3b8;
  display: inline-block;
  flex-shrink: 0;
}

.ind-lock {
  width: 9px;
  height: 9px;
  background: #d97706;
  border-radius: 1.5px;
  position: relative;
  display: inline-block;
  flex-shrink: 0;
  margin-top: 2px;
}

.ind-lock::before {
  content: '';
  position: absolute;
  width: 5px;
  height: 4px;
  border: 1.5px solid #d97706;
  border-bottom: none;
  border-radius: 4px 4px 0 0;
  top: -4px;
  left: 0.5px;
}

/* Macro Grid & Lively Cards with Visual Preview Viewport */
.macro-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.macro-card {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-top: 4px solid var(--cat-part);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
  box-shadow: var(--shadow-sm);
}

.macro-card.cat-part { border-top-color: var(--cat-part); }
.macro-card.cat-assembly { border-top-color: var(--cat-asm); }
.macro-card.cat-drawing { border-top-color: var(--cat-drw); }

.macro-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.macro-card.passive-sim {
  opacity: 0.62;
  filter: grayscale(0.45);
}

/* Visual Schematic / Video Preview Viewport inside every card */
.card-visual {
  height: 132px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid #cbd5e1;
  cursor: pointer;
  overflow: hidden;
}

.macro-card.cat-part .card-visual {
  background: linear-gradient(135deg, #0d252c 0%, #134e4a 100%);
}

.macro-card.cat-assembly .card-visual {
  background: linear-gradient(135deg, #271c12 0%, #5c3409 100%);
}

.macro-card.cat-drawing .card-visual {
  background: linear-gradient(135deg, #151936 0%, #2e2968 100%);
}

.card-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 16px 16px;
  pointer-events: none;
}

.visual-svg-wrap {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 14px;
  transition: transform 0.22s ease;
}

.card-visual:hover .visual-svg-wrap {
  transform: scale(1.05);
}

.play-pill {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(15, 23, 42, 0.82);
  color: #f8fafc;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  padding: 3px 9px;
  font-size: 11px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(4px);
}

.card-visual:hover .play-pill {
  background: #0284c7;
  border-color: #7dd3fc;
}

.card-body {
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

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

.card-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.tag-badge {
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 7px;
  border-radius: 4px;
  background: #e2e8f0;
  color: #1e293b;
}

.tag-badge.part { background: var(--cat-part-soft); color: #0f766e; border: 1px solid #99f6e4; }
.tag-badge.assembly { background: var(--cat-asm-soft); color: #b45309; border: 1px solid #fde68a; }
.tag-badge.drawing { background: var(--cat-drw-soft); color: #4338ca; border: 1px solid #c7d2fe; }
.tag-badge.userform { background: #f3e8ff; color: #7e22ce; border: 1px solid #d8b4fe; }

.card-code {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: var(--text-light);
  margin-bottom: 7px;
}

.card-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 14px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--bg-panel-alt);
  border-top: 1px solid var(--border-light);
  gap: 8px;
}

.coming-soon-badge {
  font-size: 12px;
  font-weight: 700;
  color: #b45309;
  background: #fef3c7;
  border: 1px solid #fde68a;
  padding: 3px 9px;
  border-radius: 12px;
}

.price-tag {
  font-size: 15.5px;
  font-weight: 800;
  color: #0f172a;
}

.btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 700;
  border: 1px solid var(--border-med);
  background: #ffffff;
  color: var(--text-main);
  cursor: pointer;
  transition: all 0.14s;
}

.btn:hover {
  background: #f1f5f9;
}

.btn-primary {
  background: #1e293b;
  color: #ffffff;
  border-color: #0f172a;
}

.btn-primary:hover {
  background: #334155;
}

.btn-teal {
  background: #0d9488;
  color: #ffffff;
  border-color: #0f766e;
}

.btn-teal:hover {
  background: #0f766e;
}

/* Panels & Modals */
.panel-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-md);
  padding: 22px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-sm);
}

.panel-box h3 {
  font-size: 16.5px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border-med);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
}

.notice-box {
  background: #fef3c7;
  border-left: 4px solid #d97706;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: #78350f;
  margin: 12px 0;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 20px;
}

.modal-box {
  background: var(--bg-panel);
  border: 1px solid var(--border-med);
  border-radius: var(--radius-md);
  max-width: 740px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.workflow-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 14px 0;
}

.wf-step {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
}

.wf-step strong {
  display: block;
  font-size: 12px;
  color: #0f766e;
  margin-bottom: 4px;
}

@media (max-width: 820px) {
  .hero-banner { grid-template-columns: 1fr; }
  .workflow-steps { grid-template-columns: 1fr; }
}

/* FULL-SCREEN COMING SOON PUBLIC COVER (DEFAULT PUBLIC VIEW) */
.coming-soon-cover {
  min-height: 100vh;
  background: radial-gradient(circle at 50% 25%, #1e293b 0%, #0f172a 65%, #090d16 100%);
  color: #f8fafc;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 24px;
  position: relative;
  overflow: hidden;
}

.coming-soon-cover::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(56, 189, 248, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(56, 189, 248, 0.05) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

.cs-top-bar {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 2;
}

.cs-center-box {
  max-width: 680px;
  margin: auto;
  text-align: center;
  position: relative;
  z-index: 2;
  padding: 36px 24px;
}

.cs-cube-large {
  width: 78px;
  height: 78px;
  margin: 0 auto 22px;
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1.5px solid #38bdf8;
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 32px rgba(56, 189, 248, 0.28);
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(20, 184, 166, 0.15);
  border: 1px solid rgba(45, 212, 191, 0.4);
  color: #5eead4;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.cs-title {
  font-size: 38px;
  font-weight: 800;
  color: #ffffff;
  margin-bottom: 14px;
  letter-spacing: -0.5px;
  line-height: 1.2;
}

.cs-subtitle {
  font-size: 16px;
  color: #94a3b8;
  margin-bottom: 28px;
  line-height: 1.6;
}

.cs-footer-bar {
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
  padding-top: 18px;
  font-size: 12.5px;
  color: #64748b;
  position: relative;
  z-index: 2;
}

.cs-admin-login-pop {
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 18px;
  max-width: 380px;
  margin: 18px auto 0;
  text-align: left;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.45);
}

