/* ============================================================
   BLENDER 5.x REFERENCE GUIDE — PROFESSIONAL REDESIGN
   ============================================================ */

:root {
  /* Backgrounds */
  --bg-0:  #07070A;
  --bg-1:  #0E0E12;
  --bg-2:  #141418;
  --bg-3:  #1A1A1F;
  --bg-4:  #202026;
  --bg-code: #111116;

  /* Borders */
  --bd-0: #1C1C22;
  --bd-1: #252530;
  --bd-2: #30303C;

  /* Accent */
  --accent:      #E87D0D;
  --accent-s:    rgba(232,125,13,.12);
  --accent-text: #F59340;

  /* Semantic colors */
  --blue:   #3B82F6; --blue-s:   rgba(59,130,246,.12);
  --green:  #22C55E; --green-s:  rgba(34,197,94,.12);
  --purple: #A855F7; --purple-s: rgba(168,85,247,.12);
  --red:    #EF4444; --red-s:    rgba(239,68,68,.12);
  --yellow: #F59E0B; --yellow-s: rgba(245,158,11,.12);
  --cyan:   #06B6D4; --cyan-s:   rgba(6,182,212,.12);

  /* Text */
  --t-0: #F0F0F5;
  --t-1: #A0A0B0;
  --t-2: #5A5A6E;
  --t-3: #38383A;

  /* Layout */
  --sidebar-w:  256px;
  --topbar-h:   52px;
  --r:          6px;
  --r-lg:       10px;

  /* Fonts */
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Transitions */
  --tx: 150ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg-0);
  color: var(--t-0);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); text-decoration: none; }
a:hover { text-decoration: underline; }

::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--bd-2); border-radius: 4px; }

/* ─────────────────────────────────────────
   TOPBAR
───────────────────────────────────────── */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--topbar-h);
  background: rgba(7,7,10,.88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--bd-0);
  display: flex; align-items: center; gap: 12px;
  padding: 0 20px;
}

.topbar-logo {
  display: flex; align-items: center; gap: 9px;
  font-size: 14px; font-weight: 700; color: var(--t-0);
  white-space: nowrap; flex-shrink: 0;
  letter-spacing: -.01em;
}
.logo-mark {
  width: 28px; height: 28px; border-radius: 7px;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}

.topbar-search {
  flex: 1; max-width: 440px; position: relative;
}
.topbar-search input {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--bd-1);
  border-radius: var(--r);
  padding: 7px 52px 7px 32px;
  color: var(--t-0);
  font-size: 13px; font-family: var(--font);
  outline: none;
  transition: border-color var(--tx), box-shadow var(--tx);
  cursor: pointer;
}
.topbar-search input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-s);
}
.topbar-search input::placeholder { color: var(--t-2); }
.ts-icon { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--t-2); pointer-events: none; font-size: 13px; }
.ts-kbd { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); }

.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.version-tag {
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  color: var(--accent); background: var(--accent-s);
  border: 1px solid rgba(232,125,13,.3);
  border-radius: 4px; padding: 3px 8px;
  letter-spacing: .03em;
}

#menu-toggle {
  display: none;
  background: var(--bg-3); border: 1px solid var(--bd-1);
  border-radius: var(--r); color: var(--t-1);
  padding: 6px 10px; cursor: pointer; font-size: 15px;
}

/* ─────────────────────────────────────────
   LAYOUT
───────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--topbar-h);
  min-height: calc(100vh - var(--topbar-h));
}

/* ─────────────────────────────────────────
   SIDEBAR
───────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--topbar-h); left: 0;
  width: var(--sidebar-w);
  height: calc(100vh - var(--topbar-h));
  background: var(--bg-1);
  border-right: 1px solid var(--bd-0);
  overflow-y: auto; overflow-x: hidden;
  padding: 20px 0 40px;
  z-index: 90;
  transition: transform var(--tx);
}
.sidebar::-webkit-scrollbar { width: 0; }

.sb-group { margin-bottom: 6px; }
.sb-group-label {
  padding: 10px 16px 4px;
  font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--t-2);
}
.sb-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 16px;
  font-size: 13px; color: var(--t-1);
  cursor: pointer;
  border-left: 2px solid transparent;
  transition: color var(--tx), background var(--tx), border-color var(--tx);
  user-select: none;
}
.sb-item:hover { color: var(--t-0); background: var(--bg-3); }
.sb-item.active {
  color: var(--accent-text);
  background: var(--accent-s);
  border-left-color: var(--accent);
  font-weight: 600;
}
.sb-icon {
  width: 16px; text-align: center; flex-shrink: 0;
  font-size: 13px; opacity: .7;
}
.sb-item.active .sb-icon { opacity: 1; }

/* ─────────────────────────────────────────
   MAIN
───────────────────────────────────────── */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  padding: 44px 52px 80px;
  max-width: calc(100vw - var(--sidebar-w));
  min-width: 0;
}

.section { display: none; animation: fadeUp .2s ease; }
.section.active { display: block; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─────────────────────────────────────────
   PAGE HEADER
───────────────────────────────────────── */
.ph {
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--bd-0);
}
.ph h1 {
  font-size: 28px; font-weight: 800;
  color: var(--t-0); letter-spacing: -.02em;
  line-height: 1.2; margin-bottom: 8px;
}
.ph p {
  font-size: 15px; color: var(--t-1);
  max-width: 600px; line-height: 1.6;
}
.ph-meta {
  display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap;
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────── */
h2 {
  font-size: 19px; font-weight: 700;
  color: var(--t-0); letter-spacing: -.01em;
  margin: 40px 0 14px;
  display: flex; align-items: center; gap: 8px;
}
h2::before {
  content: '';
  display: block; width: 3px; height: 18px;
  background: var(--accent); border-radius: 2px;
  flex-shrink: 0;
}
h2:first-child { margin-top: 0; }

h3 {
  font-size: 15px; font-weight: 700;
  color: var(--t-0); margin: 24px 0 10px;
  letter-spacing: -.01em;
}
h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em;
  color: var(--t-2); margin: 18px 0 8px;
}
p { color: var(--t-1); line-height: 1.7; margin-bottom: 12px; }
p:last-child { margin-bottom: 0; }

strong { color: var(--t-0); font-weight: 600; }

/* ─────────────────────────────────────────
   KBD
───────────────────────────────────────── */
kbd {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-3);
  border: 1px solid var(--bd-2);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 2px 7px;
  font-family: var(--mono); font-size: 11.5px; font-weight: 600;
  color: var(--t-0);
  white-space: nowrap; line-height: 1.4;
}

/* ─────────────────────────────────────────
   BADGES
───────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center;
  padding: 2px 7px; border-radius: 4px;
  font-size: 11px; font-weight: 700; white-space: nowrap;
  font-family: var(--mono);
}
.b-o { background: var(--accent-s);  color: var(--accent-text); border: 1px solid rgba(232,125,13,.25); }
.b-b { background: var(--blue-s);    color: var(--blue);   border: 1px solid rgba(59,130,246,.25); }
.b-g { background: var(--green-s);   color: var(--green);  border: 1px solid rgba(34,197,94,.25); }
.b-p { background: var(--purple-s);  color: var(--purple); border: 1px solid rgba(168,85,247,.25); }
.b-r { background: var(--red-s);     color: var(--red);    border: 1px solid rgba(239,68,68,.25); }
.b-y { background: var(--yellow-s);  color: var(--yellow); border: 1px solid rgba(245,158,11,.25); }
.b-c { background: var(--cyan-s);    color: var(--cyan);   border: 1px solid rgba(6,182,212,.25); }

/* ─────────────────────────────────────────
   CALLOUTS
───────────────────────────────────────── */
.callout {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-radius: var(--r);
  border-left: 3px solid;
  margin: 14px 0;
  font-size: 13.5px; line-height: 1.6;
}
.callout-icon { font-size: 15px; flex-shrink: 0; margin-top: 1px; }
.callout-body { flex: 1; }
.callout-body strong { display: block; margin-bottom: 2px; font-size: 13px; }

.c-tip    { background: var(--green-s);  border-color: var(--green);  }
.c-tip    .callout-icon, .c-tip  strong { color: var(--green); }
.c-warn   { background: var(--yellow-s); border-color: var(--yellow); }
.c-warn   .callout-icon, .c-warn strong { color: var(--yellow); }
.c-info   { background: var(--blue-s);   border-color: var(--blue);   }
.c-info   .callout-icon, .c-info strong { color: var(--blue); }
.c-error  { background: var(--red-s);    border-color: var(--red);    }
.c-error  .callout-icon, .c-error strong { color: var(--red); }
.c-accent { background: var(--accent-s); border-color: var(--accent); }
.c-accent .callout-icon, .c-accent strong { color: var(--accent-text); }

/* ─────────────────────────────────────────
   TABLES
───────────────────────────────────────── */
.tbl { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--bd-1); margin: 16px 0; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
thead { background: var(--bg-3); }
thead th {
  padding: 10px 14px;
  text-align: left; font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--t-2); white-space: nowrap;
}
tbody tr { border-top: 1px solid var(--bd-0); }
tbody tr:hover { background: var(--bg-2); }
td { padding: 10px 14px; color: var(--t-1); vertical-align: top; }
td:first-child { color: var(--t-0); }
td code, th code { font-family: var(--mono); font-size: 12px; }

/* ─────────────────────────────────────────
   TABS
───────────────────────────────────────── */
.tab-bar {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--bd-1);
  margin-bottom: 24px;
  overflow-x: auto; scrollbar-width: none;
}
.tab-bar::-webkit-scrollbar { display: none; }
.tab-btn {
  padding: 8px 16px;
  font-size: 13px; font-weight: 500; font-family: var(--font);
  color: var(--t-2); background: none; border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer; white-space: nowrap;
  transition: color var(--tx), border-color var(--tx);
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--t-0); }
.tab-btn.active { color: var(--accent-text); border-bottom-color: var(--accent); font-weight: 700; }
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─────────────────────────────────────────
   CODE BLOCKS
───────────────────────────────────────── */
.code {
  background: var(--bg-code);
  border: 1px solid var(--bd-1);
  border-radius: var(--r);
  padding: 16px 18px;
  font-family: var(--mono); font-size: 12.5px;
  color: var(--t-1); overflow-x: auto;
  margin: 12px 0; line-height: 1.7;
}
.code .c  { color: var(--t-2); }      /* comment */
.code .kw { color: var(--accent-text); font-weight: 600; } /* keyword */
.code .st { color: var(--green); }    /* string */
.code .nm { color: var(--blue); }     /* number */
.code .fn { color: var(--cyan); }     /* function */

code {
  font-family: var(--mono); font-size: 12.5px;
  background: var(--bg-3); border: 1px solid var(--bd-1);
  border-radius: 3px; padding: 1px 6px; color: var(--t-0);
}

/* ─────────────────────────────────────────
   CARDS GRID
───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px,1fr)); gap: 14px; margin: 16px 0; }
.grid-3 { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px,1fr)); gap: 14px; margin: 16px 0; }
.grid-4 { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px,1fr)); gap: 12px; margin: 16px 0; }

.card {
  background: var(--bg-2);
  border: 1px solid var(--bd-1);
  border-radius: var(--r-lg);
  padding: 18px;
  transition: border-color var(--tx), background var(--tx);
}
.card:hover { border-color: var(--bd-2); background: var(--bg-3); }
.card-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; color: var(--t-2); margin-bottom: 6px;
}
.card h3 { font-size: 14px; margin: 0 0 6px; }
.card p { font-size: 12.5px; color: var(--t-1); line-height: 1.55; margin: 0; }

/* ─────────────────────────────────────────
   TOOL CARD (modelado, modificadores)
───────────────────────────────────────── */
.tool-card {
  background: var(--bg-2);
  border: 1px solid var(--bd-1);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 20px;
  transition: border-color var(--tx);
}
.tool-card:hover { border-color: var(--bd-2); }

.tc-header {
  display: flex; align-items: flex-start; gap: 14px;
  padding: 20px 22px;
  border-bottom: 1px solid var(--bd-0);
  background: var(--bg-3);
}
.tc-shortcut {
  background: var(--accent-s); border: 1px solid rgba(232,125,13,.3);
  border-radius: var(--r); padding: 6px 12px;
  font-family: var(--mono); font-size: 15px; font-weight: 800;
  color: var(--accent-text); flex-shrink: 0;
  white-space: nowrap;
}
.tc-info { flex: 1; }
.tc-info h3 { font-size: 16px; margin: 0 0 4px; }
.tc-info .tc-sub { font-size: 12.5px; color: var(--t-1); line-height: 1.5; }
.tc-meta { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }

.tc-body { padding: 20px 22px; }
.tc-body > p { margin-bottom: 14px; }

/* ─────────────────────────────────────────
   PARAMETER PANEL (Blender UI simulation)
───────────────────────────────────────── */
.param-panel {
  background: #111116;
  border: 1px solid #252530;
  border-radius: var(--r);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 12px;
  margin: 14px 0;
}
.param-panel-header {
  background: #1A1A20;
  padding: 7px 12px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--t-2);
  border-bottom: 1px solid var(--bd-0);
  display: flex; align-items: center; gap: 6px;
}
.param-row {
  display: flex; align-items: center;
  padding: 6px 12px;
  border-bottom: 1px solid var(--bd-0);
  gap: 8px;
}
.param-row:last-child { border-bottom: none; }
.param-row:hover { background: var(--bg-3); }
.param-name { color: var(--t-2); flex: 1; font-size: 12px; }
.param-val  {
  color: var(--t-0); font-weight: 600;
  background: var(--bg-4); border: 1px solid var(--bd-1);
  border-radius: 3px; padding: 2px 8px;
  font-size: 12px; min-width: 60px; text-align: center;
}
.param-val.range-fill {
  position: relative; overflow: hidden;
  border: 1px solid var(--bd-2);
}
.param-val.range-fill::before {
  content: '';
  position: absolute; left: 0; top: 0; bottom: 0;
  background: rgba(59,130,246,.25);
  border-radius: 2px 0 0 2px;
}
.param-val.v-0 { --w: 0%; } .param-val.v-0::before { width: var(--w,0); }
.param-val.v-10::before { width: 10%; }
.param-val.v-20::before { width: 20%; }
.param-val.v-25::before { width: 25%; }
.param-val.v-30::before { width: 30%; }
.param-val.v-50::before { width: 50%; }
.param-val.v-70::before { width: 70%; }
.param-val.v-100::before { width: 100%; }
.param-desc { font-size: 11px; color: var(--t-2); font-family: var(--font); }
.param-check { width: 14px; height: 14px; background: var(--blue); border-radius: 2px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.param-check.off { background: var(--bg-4); border: 1px solid var(--bd-2); }
.param-check::after { content: '✓'; color: #fff; font-size: 10px; font-family: var(--font); }
.param-check.off::after { content: ''; }
.param-enum {
  background: var(--bg-4); border: 1px solid var(--bd-2);
  border-radius: 3px; padding: 2px 8px;
  color: var(--t-0); font-size: 12px;
}

/* ─────────────────────────────────────────
   VISUAL DEMOS (CSS art)
───────────────────────────────────────── */
.demo-box {
  background: var(--bg-code);
  border: 1px solid var(--bd-1);
  border-radius: var(--r);
  padding: 20px;
  display: flex; align-items: center; justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin: 14px 0;
  min-height: 100px;
}
.demo-label {
  font-size: 11px; color: var(--t-2);
  text-align: center; margin-top: 6px;
  font-family: var(--mono);
}
.demo-item { text-align: center; }

/* Cube wireframes */
.cube-base {
  width: 60px; height: 60px;
  border: 2px solid var(--t-2);
  position: relative;
  transform: perspective(200px) rotateX(20deg) rotateY(-25deg);
}
.cube-base::before {
  content: ''; position: absolute;
  top: -12px; left: 12px;
  width: 60px; height: 60px;
  border: 2px solid var(--t-2);
  border-bottom: none; border-right: none;
  transform: none;
}

/* Arrows */
.arrow-right {
  width: 0; height: 0;
  border-top: 6px solid transparent;
  border-bottom: 6px solid transparent;
  border-left: 10px solid var(--t-2);
}
.arrow-up {
  width: 0; height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-bottom: 10px solid var(--accent);
}

/* Bevel visual */
.bevel-demo {
  display: inline-flex; flex-direction: column; align-items: center; gap: 16px;
}
.bevel-sharp { width: 60px; height: 60px; background: transparent; border: 2px solid var(--t-2); }
.bevel-soft {
  width: 60px; height: 60px;
  background: transparent;
  border: 2px solid var(--blue);
  border-radius: 6px;
}

/* Loop cut visual */
.loop-demo {
  width: 90px; height: 70px;
  border: 2px solid var(--t-2);
  position: relative;
}
.loop-cut-line {
  position: absolute;
  top: 0; bottom: 0;
  left: 50%; width: 2px;
  background: var(--yellow);
  transform: translateX(-50%);
}

/* ─────────────────────────────────────────
   NODE DIAGRAM
───────────────────────────────────────── */
.node-flow {
  display: flex; align-items: center; gap: 0;
  overflow-x: auto; padding: 20px 0;
  margin: 14px 0;
}
.node-flow::-webkit-scrollbar { height: 4px; }

.nd-node {
  background: var(--bg-3);
  border: 1px solid var(--bd-2);
  border-radius: var(--r);
  min-width: 160px;
  flex-shrink: 0;
  overflow: hidden;
  font-family: var(--mono);
}
.nd-header {
  padding: 7px 12px;
  font-size: 11.5px; font-weight: 700;
  border-bottom: 1px solid var(--bd-1);
  display: flex; align-items: center; gap: 6px;
}
.nd-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.nd-socket-row {
  display: flex; align-items: center;
  padding: 4px 10px; gap: 6px; font-size: 11px;
}
.nd-socket-row.out { justify-content: flex-end; }
.nd-socket {
  width: 8px; height: 8px; border-radius: 50%;
  flex-shrink: 0; border: 1px solid rgba(255,255,255,.2);
}
.nd-socket-name { color: var(--t-1); }

.nd-connector {
  display: flex; align-items: center;
  padding: 0 4px; flex-shrink: 0;
}
.nd-wire {
  width: 40px; height: 2px;
  background: linear-gradient(90deg, var(--bd-2), var(--accent), var(--bd-2));
  position: relative;
}

/* colors for socket types */
.s-gray   { background: #8B8B9A; }
.s-yellow { background: var(--yellow); }
.s-green  { background: var(--green); }
.s-blue   { background: var(--blue); }
.s-purple { background: var(--purple); }
.s-orange { background: var(--accent); }
.s-cyan   { background: var(--cyan); }
.s-red    { background: var(--red); }

/* ─────────────────────────────────────────
   ACCORDION (problems)
───────────────────────────────────────── */
.acc-item {
  border: 1px solid var(--bd-1);
  border-radius: var(--r-lg);
  margin-bottom: 10px;
  overflow: hidden;
}
.acc-head {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 18px;
  cursor: pointer;
  transition: background var(--tx);
  background: var(--bg-2);
}
.acc-head:hover { background: var(--bg-3); }
.acc-head.open { border-bottom: 1px solid var(--bd-1); }
.acc-sym {
  width: 32px; height: 32px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; flex-shrink: 0;
}
.acc-titles { flex: 1; }
.acc-titles strong { display: block; font-size: 14px; color: var(--t-0); }
.acc-titles span { font-size: 12px; color: var(--t-2); }
.acc-arrow { color: var(--t-2); font-size: 12px; transition: transform var(--tx); }
.acc-head.open .acc-arrow { transform: rotate(90deg); }
.acc-body { display: none; padding: 20px 18px; background: var(--bg-1); }
.acc-body.open { display: block; }

.step-row {
  display: flex; gap: 14px; margin-bottom: 14px; align-items: flex-start;
}
.step-n {
  width: 26px; height: 26px;
  background: var(--accent); border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; color: #fff;
  flex-shrink: 0; margin-top: 1px;
}
.step-c { flex: 1; font-size: 13.5px; color: var(--t-1); line-height: 1.6; }
.step-c strong { color: var(--t-0); }

/* ─────────────────────────────────────────
   MATERIAL CARDS
───────────────────────────────────────── */
.mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px,1fr)); gap: 10px; margin: 14px 0; }
.mat-card {
  background: var(--bg-2);
  border: 1px solid var(--bd-1);
  border-radius: var(--r-lg);
  overflow: hidden; cursor: pointer;
  transition: border-color var(--tx), transform var(--tx);
}
.mat-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.mat-preview {
  height: 72px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; font-family: var(--mono);
  color: rgba(255,255,255,.6);
  letter-spacing: .05em;
}
.mat-info { padding: 10px 12px; border-top: 1px solid var(--bd-0); }
.mat-info h4 { font-size: 12.5px; font-weight: 700; color: var(--t-0); text-transform: none; letter-spacing: 0; margin: 0 0 2px; }
.mat-info p  { font-size: 11px; color: var(--t-2); margin: 0; }

/* Material preview gradients */
.mp-metal   { background: linear-gradient(135deg,#555 0%,#aaa 45%,#666 100%); }
.mp-gold    { background: linear-gradient(135deg,#7A5300 0%,#FFD700 40%,#8B6914 100%); }
.mp-silver  { background: linear-gradient(135deg,#7a7a7a 0%,#d8d8d8 45%,#999 100%); }
.mp-glass   { background: linear-gradient(135deg,rgba(180,210,255,.1),rgba(255,255,255,.3),rgba(180,210,255,.1)); border-bottom:1px solid rgba(200,225,255,.2); }
.mp-water   { background: linear-gradient(160deg,#003D5C 0%,#0077A8 50%,#005070 100%); }
.mp-lava    { background: radial-gradient(circle at 40% 60%,#FF8C00 0%,#C03000 40%,#4A0000 100%); }
.mp-ice     { background: linear-gradient(135deg,#8FC8DC,#D4EEF8,#A4CFDF); }
.mp-wood    { background: repeating-linear-gradient(95deg,#3D2010 0%,#5C3520 10%,#3D2010 20%); }
.mp-stone   { background: linear-gradient(135deg,#3a3a3a,#666,#3a3a3a); }
.mp-plastic { background: linear-gradient(135deg,#8B0000,#FF3333,#AA0000); }
.mp-cloth   { background: repeating-linear-gradient(45deg,#3D1D60 0px,#3D1D60 4px,#5A3080 4px,#5A3080 8px); }
.mp-skin    { background: linear-gradient(135deg,#A0621A,#D8924A,#B06A22); }
.mp-emit    { background: radial-gradient(circle,#BBFF66 0%,#446600 60%,#223300 100%); }
.mp-ghost   { background: linear-gradient(135deg,rgba(100,100,200,.06),rgba(150,150,255,.18),rgba(100,100,200,.06)); }
.mp-holo    { background: linear-gradient(135deg,#00FFFF 0%,#0080FF 33%,#FF00FF 66%,#00FFFF 100%); opacity:.75; }

/* ─────────────────────────────────────────
   MODAL (material details)
───────────────────────────────────────── */
.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.75); backdrop-filter: blur(8px);
  z-index: 200; align-items: flex-start; justify-content: center;
  padding: 8vh 20px;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--bg-2);
  border: 1px solid var(--bd-2);
  border-radius: var(--r-lg);
  width: 100%; max-width: 600px;
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
  overflow: hidden;
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--bd-1);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: var(--bg-3); border: 1px solid var(--bd-1);
  border-radius: var(--r); color: var(--t-1);
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px;
}
.modal-close:hover { color: var(--t-0); }
.modal-content { padding: 22px; max-height: 72vh; overflow-y: auto; }

/* ─────────────────────────────────────────
   SEARCH OVERLAY
───────────────────────────────────────── */
.search-ov {
  display: none; position: fixed; inset: 0;
  background: rgba(0,0,0,.8); backdrop-filter: blur(10px);
  z-index: 300;
  align-items: flex-start; justify-content: center;
  padding: 8vh 20px;
}
.search-ov.open { display: flex; }
.search-box {
  background: var(--bg-2);
  border: 1px solid var(--bd-2);
  border-radius: var(--r-lg);
  width: 100%; max-width: 600px;
  overflow: hidden;
  box-shadow: 0 24px 80px rgba(0,0,0,.7);
}
.search-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px; border-bottom: 1px solid var(--bd-1);
}
.search-input-row svg { color: var(--t-2); flex-shrink: 0; }
.search-input {
  flex: 1; background: none; border: none;
  font-size: 15px; color: var(--t-0); outline: none;
  font-family: var(--font);
}
.search-input::placeholder { color: var(--t-2); }
.search-results { max-height: 380px; overflow-y: auto; padding: 6px; }
.sr-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 12px; border-radius: var(--r);
  cursor: pointer; transition: background var(--tx);
}
.sr-item:hover, .sr-item.sel { background: var(--bg-3); }
.sr-icon { width: 32px; height: 32px; border-radius: var(--r); display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; background: var(--bg-4); }
.sr-content { flex: 1; }
.sr-title { font-size: 13.5px; color: var(--t-0); font-weight: 500; }
.sr-sub { font-size: 11.5px; color: var(--t-2); }
.sr-cat { font-size: 10.5px; font-weight: 700; font-family: var(--mono); }
.search-empty { padding: 40px; text-align: center; color: var(--t-2); font-size: 13.5px; }
.search-footer {
  padding: 10px 18px; border-top: 1px solid var(--bd-0);
  display: flex; gap: 16px; font-size: 11px; color: var(--t-2);
}
mark { background: var(--accent-s); color: var(--accent-text); border-radius: 2px; padding: 0 2px; }

/* ─────────────────────────────────────────
   WORKFLOW STEPS
───────────────────────────────────────── */
.workflow { position: relative; margin: 20px 0; }
.workflow::before {
  content: '';
  position: absolute; left: 19px; top: 0; bottom: 0;
  width: 1px; background: var(--bd-2);
}
.wf-step {
  display: flex; gap: 18px; padding: 12px 0;
  align-items: flex-start; position: relative;
}
.wf-n {
  width: 38px; height: 38px;
  background: var(--bg-3); border: 1px solid var(--bd-2);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: var(--accent-text);
  flex-shrink: 0; position: relative; z-index: 1;
  font-family: var(--mono);
}
.wf-c { flex: 1; padding-top: 8px; }
.wf-c h4 { font-size: 14px; font-weight: 700; color: var(--t-0); margin-bottom: 4px; text-transform: none; letter-spacing: 0; }
.wf-c p  { font-size: 13px; color: var(--t-1); margin: 0; line-height: 1.6; }

/* ─────────────────────────────────────────
   COMPARISON
───────────────────────────────────────── */
.comp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 16px 0; }
.comp-card { background: var(--bg-2); border: 1px solid var(--bd-1); border-radius: var(--r-lg); overflow: hidden; }
.comp-head {
  padding: 12px 16px; border-bottom: 1px solid var(--bd-1);
  font-size: 13px; font-weight: 700;
  display: flex; align-items: center; gap: 8px;
}
.comp-body { padding: 12px 16px; }
.comp-row {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 5px 0; font-size: 13px; color: var(--t-1);
  border-bottom: 1px solid var(--bd-0);
}
.comp-row:last-child { border-bottom: none; }
.ci { flex-shrink: 0; font-size: 12px; margin-top: 2px; }
.ci.g { color: var(--green); }
.ci.r { color: var(--red); }
.ci.y { color: var(--yellow); }

/* ─────────────────────────────────────────
   CHECKLIST
───────────────────────────────────────── */
.checklist { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 14px 0; }
.checklist li {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 14px;
  background: var(--bg-2); border: 1px solid var(--bd-0);
  border-radius: var(--r); font-size: 13.5px; color: var(--t-1);
}
.cl-icon { color: var(--green); flex-shrink: 0; font-size: 13px; margin-top: 2px; }

/* ─────────────────────────────────────────
   DIVIDER
───────────────────────────────────────── */
.divider { height: 1px; background: var(--bd-0); margin: 32px 0; }

/* ─────────────────────────────────────────
   STAT ROW
───────────────────────────────────────── */
.stat-row { display: flex; gap: 12px; margin: 24px 0; flex-wrap: wrap; }
.stat {
  flex: 1; min-width: 110px;
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); padding: 16px 20px; text-align: center;
}
.stat-n { font-size: 26px; font-weight: 800; color: var(--accent-text); font-family: var(--mono); line-height: 1; }
.stat-l { font-size: 11px; color: var(--t-2); margin-top: 4px; text-transform: uppercase; letter-spacing: .07em; }

/* ─────────────────────────────────────────
   INTERFACE DIAGRAM
───────────────────────────────────────── */
.ui-diagram {
  border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); overflow: hidden; margin: 16px 0;
}
.ui-diagram-mobile { display: none; }
.ui-img-map { position: relative; line-height: 0; display: block; }
.ui-blender-img { width: 100%; height: auto; display: block; }
.ui-area { cursor: help; }
.ui-overlay {
  position: absolute; box-sizing: border-box;
  border: 2px solid transparent; border-radius: 2px;
  transition: background .15s, border-color .15s;
}
.ui-overlay:hover {
  background: rgba(232,125,13,.13);
  border-color: rgba(232,125,13,.55);
}

/* ─────────────────────────────────────────
   ADDON CARD
───────────────────────────────────────── */
.addon-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 16px 18px;
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); margin-bottom: 10px;
  transition: border-color var(--tx);
}
.addon-card:hover { border-color: var(--bd-2); }
.addon-icon {
  width: 40px; height: 40px; border-radius: var(--r);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; flex-shrink: 0;
  background: var(--bg-4); border: 1px solid var(--bd-1);
}
.addon-c { flex: 1; }
.addon-c h4 { font-size: 14px; font-weight: 700; color: var(--t-0); margin-bottom: 3px; text-transform: none; letter-spacing: 0; }
.addon-c p { font-size: 13px; color: var(--t-1); margin-bottom: 8px; }
.addon-meta { display: flex; gap: 6px; flex-wrap: wrap; }

/* ─────────────────────────────────────────
   RESPONSIVE
───────────────────────────────────────── */
@media (max-width: 1024px) {
  .main { padding: 32px 32px 60px; }
  .comp-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  #menu-toggle { display: block; }
  .sidebar { transform: translateX(-256px); width: 256px; z-index: 110; }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; max-width: 100vw; padding: 20px 16px 60px; }
  .topbar-search { display: none; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .mat-grid { grid-template-columns: repeat(2, 1fr); }
  .ui-diagram { display: none; }
  .ui-diagram-mobile { display: block; }
  .tb-name { display: none; }
  .tb-login-text { display: none; }
  .tb-login-btn { padding: 5px 7px !important; }
}
@media (max-width: 480px) {
  .ph h1 { font-size: 22px; }
  .mat-grid { grid-template-columns: 1fr; }
  .comp-grid { grid-template-columns: 1fr; }
}

/* ─────────────────────────────────────────
   COMMENTS SYSTEM (Firebase)
───────────────────────────────────────── */
.comments-section {
  margin-top: 48px;
  border-top: 1px solid var(--bd-1);
  padding-top: 32px;
}
.comments-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.comments-header h3 {
  font-size: 15px; font-weight: 700; color: var(--t-0);
  text-transform: uppercase; letter-spacing: .06em; margin: 0;
}
.auth-bar {
  display: flex; align-items: center; gap: 10px;
}
.auth-btn {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg-3); border: 1px solid var(--bd-2);
  border-radius: var(--r); padding: 7px 14px;
  color: var(--t-0); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: border-color var(--tx), background var(--tx);
  font-family: var(--font);
}
.auth-btn:hover { border-color: var(--accent); background: var(--accent-s); }
.auth-btn.google { gap: 8px; }
.auth-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--bd-2); object-fit: cover;
}
.auth-name { font-size: 12px; color: var(--t-1); }
.auth-user-info { display: flex; align-items: center; gap: 8px; }
.sign-out-btn {
  background: none; border: 1px solid var(--bd-1);
  border-radius: var(--r); padding: 4px 10px;
  color: var(--t-2); font-size: 11px; cursor: pointer;
  font-family: var(--font); transition: color var(--tx), border-color var(--tx);
}
.sign-out-btn:hover { color: var(--red); border-color: var(--red); }

/* ── TOPBAR AUTH ────────────────────────────── */
.tb-login-btn { padding: 5px 11px !important; font-size: 12px !important; }
#topbar-auth { position: relative; }
.tb-user {
  display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 4px 8px; position: relative;
  border-radius: var(--r); border: 1px solid transparent;
  color: var(--t-1);
  transition: border-color var(--tx), background var(--tx), color var(--tx);
}
.tb-user:hover { border-color: var(--bd-1); background: var(--bg-2); color: var(--t-0); }
.tb-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  object-fit: cover; flex-shrink: 0;
}
.tb-avatar-init {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent); color: #fff; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700;
}
.tb-name {
  font-size: 13px; font-weight: 500;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tb-menu {
  display: none; position: absolute; top: calc(100% + 6px); right: 0;
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r); min-width: 148px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); z-index: 200;
}
.tb-menu.open { display: block; }
.tb-menu button {
  width: 100%; padding: 9px 14px; font-size: 13px;
  color: var(--t-1); background: none; border: none;
  text-align: left; cursor: pointer;
  font-family: var(--font);
  transition: background var(--tx), color var(--tx);
}
.tb-menu button:hover { background: var(--bg-3); color: #e55; }

.comment-form {
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); padding: 16px;
  margin-bottom: 20px;
}
.comment-form textarea {
  width: 100%; min-height: 72px;
  background: var(--bg-3); border: 1px solid var(--bd-1);
  border-radius: var(--r); padding: 10px 12px;
  color: var(--t-0); font-size: 13px; line-height: 1.6;
  font-family: var(--font); resize: vertical;
  outline: none; transition: border-color var(--tx);
  box-sizing: border-box;
}
.comment-form textarea:focus { border-color: var(--accent); }
.comment-form-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: 10px; flex-wrap: wrap; gap: 8px;
}
.comment-hint { font-size: 11px; color: var(--t-2); }
.comment-submit {
  background: var(--accent); border: none;
  border-radius: var(--r); padding: 7px 18px;
  color: #fff; font-size: 13px; font-weight: 700;
  cursor: pointer; font-family: var(--font);
  transition: opacity var(--tx);
}
.comment-submit:hover { opacity: .85; }
.comment-submit:disabled { opacity: .4; cursor: not-allowed; }

.comment-login-prompt {
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); padding: 16px 20px;
  margin-bottom: 20px; font-size: 13px; color: var(--t-2);
  display: flex; align-items: center; gap: 12px;
}
.comment-login-prompt strong { color: var(--t-1); }

.comments-list { display: flex; flex-direction: column; gap: 12px; }
.comment-item {
  background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: var(--r-lg); padding: 14px 16px;
  transition: border-color var(--tx);
}
.comment-item:hover { border-color: var(--bd-2); }
.comment-meta {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 8px;
}
.comment-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--bd-2); object-fit: cover; flex-shrink: 0;
}
.comment-avatar-placeholder {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent-s); border: 1px solid rgba(232,125,13,.3);
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--accent-text); flex-shrink: 0;
}
.comment-author { font-size: 13px; font-weight: 600; color: var(--t-0); }
.comment-date { font-size: 11px; color: var(--t-2); margin-left: auto; }
.comment-delete {
  background: none; border: none; color: var(--t-3);
  cursor: pointer; font-size: 11px; padding: 2px 6px;
  border-radius: 4px; transition: color var(--tx), background var(--tx);
  font-family: var(--font);
}
.comment-delete:hover { color: var(--red); background: var(--red-s); }
.comment-text {
  font-size: 13px; color: var(--t-1); line-height: 1.65;
  white-space: pre-wrap; word-break: break-word;
}
.comments-empty {
  text-align: center; padding: 32px; color: var(--t-2); font-size: 13px;
}
.comments-loading {
  text-align: center; padding: 20px; color: var(--t-2); font-size: 12px;
}
.rate-limit-msg {
  background: var(--yellow-s); border: 1px solid rgba(245,158,11,.3);
  border-radius: var(--r); padding: 8px 14px;
  font-size: 12px; color: var(--yellow); margin-top: 8px;
}

/* AI ASSISTANT */
.ai-fab {
  position: fixed; bottom: 28px; right: 28px;
  width: 52px; height: 52px;
  background: var(--accent); border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 20px rgba(232,125,13,.4);
  font-size: 22px; color: #fff; z-index: 150;
  transition: transform var(--tx), box-shadow var(--tx);
}
.ai-fab:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(232,125,13,.55); }
.ai-panel {
  position: fixed; bottom: 92px; right: 28px;
  width: 360px; max-height: 520px;
  background: var(--bg-2); border: 1px solid var(--bd-2);
  border-radius: var(--r-lg); box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: none; flex-direction: column; overflow: hidden;
  z-index: 150;
}
.ai-panel.open { display: flex; }
.ai-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--bd-1);
  background: var(--bg-3);
}
.ai-panel-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--t-0); }
.ai-panel-head span { font-size: 11px; color: var(--t-2); }
.ai-close {
  background: none; border: none; color: var(--t-2);
  cursor: pointer; font-size: 16px; line-height: 1; padding: 2px;
}
.ai-messages {
  flex: 1; overflow-y: auto; padding: 14px;
  display: flex; flex-direction: column; gap: 10px;
}
.ai-msg {
  max-width: 90%; font-size: 13px; line-height: 1.55;
  padding: 9px 12px; border-radius: 12px;
}
.ai-msg.user {
  background: var(--accent-s); border: 1px solid rgba(232,125,13,.25);
  color: var(--t-0); align-self: flex-end; border-radius: 12px 12px 4px 12px;
}
.ai-msg.bot {
  background: var(--bg-3); border: 1px solid var(--bd-1);
  color: var(--t-1); align-self: flex-start; border-radius: 12px 12px 12px 4px;
}
.ai-msg.error { border-color: rgba(239,68,68,.3); background: var(--red-s); color: var(--red); }
.ai-suggestions {
  padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px;
}
.ai-sug-btn {
  background: var(--bg-3); border: 1px solid var(--bd-1);
  border-radius: 20px; padding: 5px 12px;
  font-size: 11px; color: var(--t-1); cursor: pointer;
  font-family: var(--font); transition: border-color var(--tx), color var(--tx);
}
.ai-sug-btn:hover { border-color: var(--accent); color: var(--accent-text); }
.ai-input-row {
  display: flex; gap: 8px; padding: 12px 14px;
  border-top: 1px solid var(--bd-1); background: var(--bg-3);
}
.ai-input {
  flex: 1; background: var(--bg-2); border: 1px solid var(--bd-1);
  border-radius: 20px; padding: 8px 14px;
  color: var(--t-0); font-size: 13px; font-family: var(--font);
  outline: none; transition: border-color var(--tx);
}
.ai-input:focus { border-color: var(--accent); }
.ai-send {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--accent); border: none;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 14px; color: #fff;
  transition: opacity var(--tx); flex-shrink: 0;
}
.ai-send:hover { opacity: .85; }
.ai-send:disabled { opacity: .4; cursor: not-allowed; }
.ai-usage { font-size: 10px; color: var(--t-2); text-align: center; padding: 4px; }
@media (max-width: 480px) {
  .ai-panel { width: calc(100vw - 32px); right: 16px; bottom: 80px; }
  .ai-fab { bottom: 20px; right: 16px; }
}
