/* Arduino Ustaxona — umumiy uslublar */

:root {
  --bg: #0b0f17;
  --bg-2: #0f1520;
  --panel: #131a26;
  --panel-2: #192233;
  --panel-3: #202b3f;
  --line: #243049;
  --line-2: #33415e;
  --text: #e7edf6;
  --text-2: #b9c4d6;
  --muted: #8592a8;
  --accent: #c6f432;
  --accent-2: #a6d81a;
  --accent-text: #c6f432;
  --accent-ink: #11160a;
  --amber: #ffb020;
  --cyan: #3fd6e8;
  --pink: #ff6b9a;
  --ok: #34d399;
  --bad: #ff6b6b;
  --scene: #0d131d;
  --scene-dot: #1d2738;
  --code-bg: #0a0e15;
  --term: #070a0f;
  --term-text: #9ef01a;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 18px;
  --radius-sm: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --display: "Space Grotesk", "Inter", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  --kw: #c792ea;
  --fn: #82aaff;
  --num: #f78c6c;
  --str: #c3e88d;
  --com: #637089;
  --const: #ffcb6b;
  --pre: #89ddff;
  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f3f5f9;
  --bg-2: #e9edf4;
  --panel: #ffffff;
  --panel-2: #f4f6fa;
  --panel-3: #e9eef6;
  --line: #dfe5ee;
  --line-2: #cbd4e1;
  --text: #121826;
  --text-2: #364156;
  --muted: #627089;
  --accent: #c6f432;
  --accent-2: #b2e01e;
  --accent-text: #4c7a00;
  --accent-ink: #11160a;
  --scene: #eef2f7;
  --scene-dot: #d5dce8;
  --code-bg: #f7f9fc;
  --term: #0d1117;
  --shadow: 0 10px 30px rgba(20, 30, 50, .08);
  --kw: #8e3bd1;
  --fn: #2563eb;
  --num: #c2410c;
  --str: #2f7d32;
  --com: #8090a6;
  --const: #a16207;
  --pre: #0e7490;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.6 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(198, 244, 50, .07), transparent 60%),
    radial-gradient(700px 500px at -10% 30%, rgba(63, 214, 232, .06), transparent 60%);
  z-index: -1;
}
a { color: inherit; }
button { font: inherit; color: inherit; }
code { font-family: var(--mono); font-size: .9em; background: var(--panel-3); padding: .08em .38em; border-radius: 6px; color: var(--text); }
h1, h2, h3 { font-family: var(--display); letter-spacing: -.01em; line-height: 1.15; margin: 0; }
svg { display: block; }
.i { width: 1.1em; height: 1.1em; display: inline-block; vertical-align: -.18em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.tab-note .i { color: var(--accent-text); }
.set-row > .i { width: 22px; height: 22px; color: var(--muted); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--accent); color: var(--accent-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.noscript { padding: 24px; text-align: center; }

/* ---------- Yuqori panel ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 40px; height: 40px; }
.bm-bg { fill: var(--accent); }
.bm-loop { fill: none; stroke: var(--accent-ink); stroke-width: 3; }
.bm-sign { stroke: var(--accent-ink); stroke-width: 2.6; stroke-linecap: round; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text b { font-family: var(--display); font-size: 18px; }
.brand-text small { color: var(--muted); font-size: 11.5px; letter-spacing: .04em; }
.mainnav { display: flex; gap: 4px; margin-left: auto; background: var(--panel); border: 1px solid var(--line); padding: 4px; border-radius: 999px; }
.mainnav a {
  text-decoration: none;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--text-2);
  font-weight: 500;
  font-size: 14px;
  white-space: nowrap;
  transition: background .2s, color .2s;
}
.mainnav a:hover { color: var(--text); background: var(--panel-3); }
.mainnav a.is-active { background: var(--accent); color: var(--accent-ink); font-weight: 600; }
.progress-chip { display: flex; align-items: center; gap: 8px; text-decoration: none; padding: 4px 12px 4px 4px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); }
.progress-chip svg { width: 36px; height: 36px; transform: rotate(-90deg); }
.pc-track { fill: none; stroke: var(--line-2); stroke-width: 4; }
.pc-fill { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 88; stroke-dashoffset: 88; transition: stroke-dashoffset .6s; }
.progress-chip span { display: flex; flex-direction: column; line-height: 1.1; }
.progress-chip b { font-family: var(--display); font-size: 15px; }
.progress-chip small { color: var(--muted); font-size: 11px; }
.menu-btn { display: none; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; width: 42px; height: 42px; padding: 9px; cursor: pointer; }
.menu-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* oʻrta kenglik (noutbuklar): menyu ixchamroq — sarlavha bir qatorga sigʻsin */
@media (max-width: 1400px) {
  .topbar { gap: 12px; }
  .mainnav a { padding: 7px 10px; font-size: 13.5px; }
  .brand-text small { display: none; }
}
@media (max-width: 1260px) {
  .mainnav a { padding: 7px 8px; font-size: 13px; }
  .progress-chip { padding: 3px; }
  .progress-chip span { display: none; }
  .acct-btn span { display: none; }
}
@media (max-width: 1100px) {
  .menu-btn { display: block; }
  .mainnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 12px;
    right: 12px;
    flex-direction: column;
    border-radius: 18px;
    padding: 8px;
    box-shadow: var(--shadow);
    margin: 0;
  }
  .mainnav.open { display: flex; }
  .mainnav a { padding: 12px 16px; border-radius: 12px; }
  .progress-chip { margin-left: auto; }
}
@media (max-width: 520px) {
  .brand-text small { display: none; }
  .brand-text b { font-size: 16px; }
  .progress-chip small { display: none; }
  /* telefon: sarlavha bir qatorga sigʻsin */
  .topbar { gap: 8px; padding: 10px 12px; }
  .brand { gap: 8px; flex-shrink: 1; min-width: 0; }
  .brand-mark { width: 34px; height: 34px; flex: none; }
  .brand-text { min-width: 0; }
  .brand-text b { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .acct { margin-left: auto; }
  .progress-chip { margin-left: 0; padding: 3px; }
  .progress-chip span { display: none; }
  .progress-chip svg { width: 30px; height: 30px; }
  .menu-btn { width: 38px; height: 38px; padding: 7px; flex: none; }
  .acct-btn { padding: 6px 8px; }
}
@media (max-width: 360px) { .brand-text { display: none; } }

main { flex: 1; outline: none; }
.page { width: min(1440px, 100%); margin: 0 auto; padding: 28px clamp(16px, 3vw, 32px) 48px; animation: page-in .35s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }
.foot { border-top: 1px solid var(--line); padding: 22px clamp(16px, 3vw, 32px); color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot p { margin: 0; }
.foot a { color: var(--text-2); }

/* ---------- Umumiy elementlar ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-2);
  background: var(--panel-2);
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .15s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:hover { border-color: var(--muted); }
.btn:active { transform: scale(.97); }
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }
.btn-danger { color: var(--bad); }
.icon-btn {
  width: 36px; height: 36px;
  display: inline-grid; place-items: center;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
  color: var(--text-2);
}
.icon-btn:hover { color: var(--text); border-color: var(--line-2); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); border-color: color-mix(in srgb, var(--accent) 60%, transparent); color: var(--accent-text); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: 11.5px; font-weight: 600; color: var(--accent-text); }
.muted { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; background: var(--panel-3); font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); }
.chip.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px);
  background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 999px; font-weight: 600; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 90;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(24px, 4vw, 56px); align-items: center; padding: 12px 0 36px; }
.hero h1 { font-size: clamp(36px, 5.2vw, 64px); margin: 14px 0 18px; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero p.lead { font-size: 17.5px; color: var(--text-2); max-width: 560px; margin: 0 0 26px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats b { font-family: var(--display); font-size: 28px; }
.hero-stats span { color: var(--muted); font-size: 13px; }
.hero-art { position: relative; padding: 28px 18px 78px; border-radius: 28px; background: var(--scene); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.hero-art svg { width: 100%; height: auto; }
.hero-art .badge { position: absolute; left: 18px; bottom: 18px; background: color-mix(in srgb, var(--panel) 85%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; font-family: var(--mono); font-size: 12.5px; }
.hero-art .badge b { color: var(--term-text); }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.hero-blink .led .led-glow, .hero-blink .led .led-hot { animation: hero-blink 2s steps(1) infinite; }
.hero-blink [data-k="board-L"] .sled-glow { opacity: 1; animation: hero-blink 2s steps(1) infinite; }
.hero-blink [data-k="board-L"] rect { animation: hero-l 2s steps(1) infinite; }
.hero-blink .wire[data-wire="a"] .w-flow { opacity: .95; animation: flow .55s linear infinite; }
@keyframes hero-blink { 50% { opacity: 0; } }
@keyframes hero-l { 0% { fill: #ffb020; } 50% { fill: #e9e2cf; } }

.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 40px 0 18px; flex-wrap: wrap; }
.section-head h2 { font-size: clamp(24px, 3vw, 32px); margin-top: 6px; }
.section-head p { margin: 6px 0 0; color: var(--muted); max-width: 560px; }

.path-card { padding: clamp(14px, 2vw, 26px); }
.path-svg { width: 100%; height: auto; }
.path-svg.mobile { display: none; }
@media (max-width: 720px) { .path-svg.desktop { display: none; } .path-svg.mobile { display: block; } }
.path-line { fill: none; stroke: var(--line-2); stroke-width: 4; stroke-dasharray: 2 10; stroke-linecap: round; }
.path-line-done { fill: none; stroke: var(--accent); stroke-width: 4; stroke-linecap: round; }
.pnode { cursor: pointer; }
.pnode .pn-ring { fill: var(--panel-2); stroke: var(--line-2); stroke-width: 2; transition: stroke .2s, fill .2s; }
.pnode .pn-icon { fill: none; stroke: var(--text-2); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.pnode .pn-num { font: 700 12px var(--display); fill: var(--muted); }
.pnode .pn-title { font: 600 13px var(--font); fill: var(--text); }
.pnode:hover .pn-ring, .pnode:focus-visible .pn-ring { stroke: var(--accent); }
.pnode.done .pn-ring { fill: var(--accent); stroke: var(--accent); }
.pnode.done .pn-icon { stroke: var(--accent-ink); }
.pnode.next .pn-ring { stroke: var(--accent); stroke-width: 3; }
.pnode.next .pn-pulse { fill: none; stroke: var(--accent); stroke-width: 2; animation: pulse 2s ease-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes pulse { from { opacity: .8; transform: scale(1); } to { opacity: 0; transform: scale(1.5); } }

.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 16px; }
.feature { padding: 22px; }
.feature .f-ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 14%, transparent); color: var(--accent-text); margin-bottom: 14px; }
.feature .f-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { font-size: 17px; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 1000px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: st; }
.step { padding: 22px; position: relative; }
.step::before { counter-increment: st; content: "0" counter(st); font: 700 40px var(--display); color: color-mix(in srgb, var(--accent) 40%, transparent); position: absolute; right: 18px; top: 10px; }
.step h3 { font-size: 17px; margin-bottom: 6px; }
.step p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 800px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Darslar roʻyxati ---------- */
.page-title { display: flex; justify-content: space-between; align-items: end; gap: 18px; flex-wrap: wrap; margin-bottom: 22px; }
.page-title h1 { font-size: clamp(30px, 4vw, 44px); margin-top: 6px; }
.page-title p { margin: 8px 0 0; color: var(--muted); max-width: 620px; }
.seg { display: inline-flex; background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13.5px; }
.seg button.is-active { background: var(--panel-3); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-2); }
.lesson-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.lcard { display: flex; flex-direction: column; text-decoration: none; padding: 18px; gap: 12px; transition: transform .2s, border-color .2s; position: relative; overflow: hidden; }
.lcard:hover { transform: translateY(-3px); border-color: var(--line-2); }
.lcard-top { display: flex; align-items: center; justify-content: space-between; }
.lcard-ico { width: 52px; height: 52px; border-radius: 14px; background: var(--panel-3); display: grid; place-items: center; }
.lcard-ico svg { width: 28px; height: 28px; fill: none; stroke: var(--text); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.lcard.done .lcard-ico { background: var(--accent); }
.lcard.done .lcard-ico svg { stroke: var(--accent-ink); }
.lcard-num { font: 700 13px var(--display); color: var(--muted); }
.lcard h3 { font-size: 18px; }
.lcard p { margin: 0; color: var(--muted); font-size: 13.5px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lcard-foot { margin-top: auto; display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Dars sahifasi ---------- */
.lesson-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.crumbs { font-size: 13px; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--accent-text); }
.lesson-head h1 { font-size: clamp(26px, 3.4vw, 40px); margin-top: 6px; }
.lesson-head h1 span { color: var(--muted); font-weight: 600; }
.lesson-nav { display: flex; gap: 8px; }
.goals { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; padding: 0; list-style: none; }
.goals li { display: flex; align-items: center; gap: 8px; padding: 7px 13px; border-radius: 12px; background: var(--panel); border: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.goals li::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); flex-shrink: 0; }
.goals code { font-size: 12.5px; }

.lesson-grid-main { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(340px, 1fr); gap: 18px; align-items: start; }
.lesson-left, .lesson-right { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
@media (max-width: 1100px) { .lesson-grid-main { grid-template-columns: 1fr; } }

/* Sahna */
.scene-card { overflow: hidden; display: flex; flex-direction: column; }
.scene-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.state-pill { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 999px; background: var(--panel-3); font-size: 13px; font-weight: 600; }
.state-pill i { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); }
[data-state="uploading"] .state-pill i { background: var(--amber); animation: blink .4s steps(2) infinite; }
[data-state="running"] .state-pill i { background: var(--ok); box-shadow: 0 0 10px var(--ok); }
@keyframes blink { 50% { opacity: .2; } }
.scene-title { font-family: var(--display); font-weight: 600; font-size: 15px; color: var(--text-2); }
.sb-actions { margin-left: auto; display: flex; gap: 6px; flex-wrap: wrap; }
.sb-sep { width: 1px; background: var(--line); margin: 4px 2px; }
.scene-wrap { position: relative; background: var(--scene); touch-action: pan-y; }
.scene { width: 100%; height: auto; aspect-ratio: var(--ar, 1.55); max-height: 72vh; cursor: grab; user-select: none; -webkit-user-select: none; }
.scene.panning { cursor: grabbing; }
.scene-card:fullscreen { border-radius: 0; }
.scene-card:fullscreen .scene-wrap { flex: 1; }
.scene-card:fullscreen .scene { max-height: none; height: 100%; aspect-ratio: auto; }
.hud { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.hud div { background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px 10px; font-size: 12px; line-height: 1.25; }
.hud small { display: block; color: var(--muted); font-size: 9.5px; text-transform: uppercase; letter-spacing: .07em; }
.hud b { font-family: var(--mono); font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.hud .hot b { color: var(--accent-text); }
.scene-hint { position: absolute; right: 12px; bottom: 10px; font-size: 11.5px; color: var(--muted); background: color-mix(in srgb, var(--scene) 80%, transparent); padding: 3px 8px; border-radius: 8px; pointer-events: none; }
@media (max-width: 700px) { .scene-hint { display: none; } }
.scene-tip { position: absolute; pointer-events: none; max-width: 260px; background: var(--text); color: var(--bg); border-radius: 12px; padding: 8px 12px; font-size: 12.5px; line-height: 1.4; box-shadow: var(--shadow); z-index: 5; transform: translate(-50%, calc(-100% - 14px)); }
.scene-tip b { display: block; font-size: 13px; }
.scene-tip[hidden] { display: none; }

/* SVG sahna elementlari */
.scene text { font-family: var(--font); }
.sc-grid { fill: url(#dots); }
.no-grid .sc-grid { display: none; }
.pcb { fill: #0b7a85; stroke: #075a63; stroke-width: 2; }
.pcb-edge { fill: none; stroke: rgba(255, 255, 255, .12); stroke-width: 1; }
.silk { fill: #eafcff; opacity: .9; }
.silk-pin { font-size: 6.6px; font-weight: 600; letter-spacing: .02em; }
.silk-big { font: 700 30px var(--display); fill: #eafcff; opacity: .95; }
.silk-sm { font-size: 8px; font-weight: 700; letter-spacing: .08em; fill: #eafcff; opacity: .85; }
.silk-line { stroke: #eafcff; opacity: .7; fill: none; }
.hdr { fill: #15171c; }
.hdr-hole { fill: #000; stroke: #3b3f48; stroke-width: .8; }
.metal { fill: #c7ced8; stroke: #8a95a5; stroke-width: 1; }
.metal-in { fill: #a7b1bf; }
.jack { fill: #1a1c21; stroke: #000; }
.jack-hole { fill: #000; stroke: #555; }
.ic { fill: #1e2128; stroke: #0b0c0f; stroke-width: 1; }
.ic-pin { fill: #c7ced8; }
.ic-text { font-size: 7.5px; fill: #8b93a1; font-weight: 600; letter-spacing: .06em; }
.cap-top { fill: #d6dbe2; stroke: #8892a0; }
.cap-mark { fill: #1d1f24; }
.smd { fill: #d9c9a8; }
.smd-cap { fill: #b48a5a; }
.btn-base { fill: #d4d8de; stroke: #8b939f; }
.btn-cap-red { fill: #d23a3a; }
.mount { fill: var(--scene); stroke: #d5b46a; stroke-width: 2.5; }
.sled rect { fill: #e9e2cf; stroke: #a59a80; stroke-width: .6; }
.sled .sled-glow { opacity: 0; transition: opacity .05s; }
.sled.on .sled-glow { opacity: 1; }
.sled.on rect { fill: var(--sc); }

.bb-body { fill: #ecebe6; stroke: #c9c6bd; stroke-width: 1.5; }
:root[data-theme="light"] .bb-body { fill: #fbfaf6; }
.bb-channel { fill: #d7d4cb; }
.bb-hole { fill: #403d38; }
.bb-red { stroke: #e0473f; stroke-width: 1.6; }
.bb-blue { stroke: #3b7be0; stroke-width: 1.6; }
.bb-lab { font-size: 7.5px; fill: #8c887d; font-weight: 600; }
.bb-sign { font-size: 11px; font-weight: 700; }

.wire .w-shadow { fill: none; stroke: rgba(0, 0, 0, .45); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; }
.wire .w-core { fill: none; stroke: var(--wc); stroke-width: 4.2; stroke-linecap: round; stroke-linejoin: round; }
.wire .w-hi { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: 1.2; stroke-linecap: round; stroke-linejoin: round; transform: translate(-.8px, -.8px); }
.wire .w-flow { fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-dasharray: 1.5 13; opacity: 0; }
.wire .w-end { fill: var(--wc); stroke: rgba(0, 0, 0, .6); stroke-width: 1.2; }
.flow-on .wire.live .w-flow { opacity: .95; animation: flow .55s linear infinite; }
.flow-on .wire.live.rev .w-flow { animation-direction: reverse; }
@keyframes flow { to { stroke-dashoffset: -14.5; } }
.leg { stroke: #b9c0ca; stroke-width: 1.6; stroke-linecap: round; fill: none; }

.led .led-glow { fill: var(--lc); opacity: calc(var(--lv, 0) * .85); filter: url(#glow); }
.led .led-rim { fill: color-mix(in srgb, var(--lc) 55%, #222); stroke: rgba(0, 0, 0, .4); }
.led .led-dome { fill: color-mix(in srgb, var(--lc) 70%, #333); }
.led .led-hot { fill: color-mix(in srgb, var(--lc) 40%, #fff); opacity: calc(var(--lv, 0) * .9); }
.led .led-spec { fill: #fff; opacity: .55; }
.res-body { fill: #d9c49a; stroke: #a7905f; stroke-width: .8; }
.res-band { }
.tact-body { fill: #2b2f38; stroke: #111318; }
.tact-pin { fill: #9aa3af; }
.tact-cap { transition: transform .08s; transform-box: fill-box; transform-origin: center; }
.down .tact-cap { transform: scale(.88); filter: brightness(.75); }
.callout .co-box { fill: color-mix(in srgb, var(--panel) 92%, transparent); stroke: var(--line-2); stroke-width: 1; }
.callout .co-t { font-size: 12px; font-weight: 700; fill: var(--text); }
.callout .co-s { font-size: 10.5px; fill: var(--muted); }
.callout .co-line { stroke: var(--muted); stroke-width: 1; fill: none; stroke-dasharray: 3 3; }
.callout .co-dot { fill: var(--accent); stroke: var(--scene); stroke-width: 2; }
.no-labels .callout { display: none; }
.prop-label { font-size: 11px; fill: var(--muted); font-weight: 600; }
.val-label { font: 600 12px var(--mono); fill: var(--text); }
.ruler-line { stroke: var(--line-2); stroke-width: 1.4; }
.ruler-tick { stroke: var(--muted); stroke-width: 1; }
.ruler-text { font: 500 10px var(--mono); fill: var(--muted); }
[data-ia] { cursor: pointer; touch-action: none; }
[data-ia="drag"] { cursor: grab; }
.spin { transform-box: fill-box; transform-origin: center; }

/* Boshqaruv paneli */
.controls-card { padding: 18px; }
.controls-card h3, .panel-title { font-size: 15px; font-family: var(--display); margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.controls-card h3 svg, .panel-title svg { width: 18px; height: 18px; fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ctrl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px 22px; }
.ctrl label, .ctrl .ctrl-label { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); font-weight: 500; margin-bottom: 8px; gap: 8px; }
.ctrl output { font-family: var(--mono); color: var(--accent-text); font-size: 12.5px; }
.ctrl .hint { font-size: 12px; color: var(--muted); margin-top: 6px; min-height: 1em; }
.ctrl .seg { width: 100%; }
.ctrl .seg button { flex: 1; padding: 6px 10px; font-size: 13px; }
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 6px; background: linear-gradient(90deg, var(--accent) var(--pct, 50%), var(--line-2) var(--pct, 50%)); outline: none; margin: 8px 0; }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); cursor: pointer; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--text); border: 3px solid var(--accent); cursor: pointer; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatches button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--line-2); cursor: pointer; background: var(--sw); position: relative; }
.swatches button.is-active { border-color: var(--text); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sw) 40%, transparent); }
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 13.5px; color: var(--text-2); }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 23px; border-radius: 999px; background: var(--line-2); position: relative; cursor: pointer; transition: background .2s; flex-shrink: 0; margin: 0; }
.switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 17px; height: 17px; border-radius: 50%; background: #fff; transition: transform .2s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(17px); background: var(--accent-ink); }
.ctrl-action { display: flex; align-items: end; }
.ctrl-action .btn { width: 100%; justify-content: center; }
.ctrl-action .btn.is-down { background: var(--accent-2); }

/* Maʼlumot yorliqlari */
.info-card { overflow: hidden; }
.tabs { display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; cursor: pointer; color: var(--muted); font-weight: 600; font-size: 13.5px; white-space: nowrap; }
.tabs button.is-active { background: var(--panel-3); color: var(--text); }
.tab-body { padding: 18px; font-size: 14.5px; color: var(--text-2); }
.tab-body p { margin: 0 0 12px; }
.tab-body h4 { margin: 0 0 6px; font-family: var(--display); font-size: 15px; color: var(--text); }
.how-list { list-style: none; margin: 0; padding: 0; counter-reset: how; display: flex; flex-direction: column; gap: 12px; }
.how-list li { counter-increment: how; display: grid; grid-template-columns: 28px 1fr; gap: 10px; }
.how-list li::before { content: counter(how); width: 26px; height: 26px; border-radius: 8px; background: var(--panel-3); color: var(--accent-text); display: grid; place-items: center; font: 700 13px var(--display); }
.pin-table, .spec-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.pin-table th { text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; padding: 0 8px 8px 0; }
.pin-table td, .spec-table td { padding: 9px 8px 9px 0; border-top: 1px solid var(--line); vertical-align: top; }
.pin-table td:first-child { white-space: nowrap; }
.pin-tag { font-family: var(--mono); font-size: 12px; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent-text); padding: 2px 7px; border-radius: 6px; font-weight: 600; }
.spec-table td:first-child { color: var(--muted); width: 45%; }
.spec-table td:last-child { color: var(--text); font-weight: 500; }
.tab-note { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: var(--panel-2); border: 1px dashed var(--line-2); font-size: 13.5px; }

/* Kod va serial monitor */
.code-card { overflow: hidden; display: flex; flex-direction: column; }
.code-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.code-head h3 { font-size: 15px; margin-right: auto; }
.file-tab { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.run-btn { display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: var(--accent-ink); border: 0; padding: 8px 15px; border-radius: 999px; font-weight: 700; cursor: pointer; font-size: 13.5px; }
.run-btn svg { width: 14px; height: 14px; fill: currentColor; }
.run-btn.is-running { background: var(--bad); color: #fff; }
.code-pre { margin: 0; background: var(--code-bg); font: 12.8px/1.65 var(--mono); padding: 14px 0; overflow: auto; max-height: 380px; counter-reset: ln; tab-size: 2; }
.code-pre.expanded { max-height: none; }
.code-pre .ln { display: block; padding: 0 16px 0 0; white-space: pre; }
.code-pre .ln::before { counter-increment: ln; content: counter(ln); display: inline-block; width: 40px; padding-right: 14px; text-align: right; color: var(--com); opacity: .6; user-select: none; }
.code-pre.flash { animation: codeflash .6s; }
@keyframes codeflash { from { background: color-mix(in srgb, var(--accent) 10%, var(--code-bg)); } }
.t-kw { color: var(--kw); }
.t-fn { color: var(--fn); }
.t-num { color: var(--num); }
.t-str { color: var(--str); }
.t-com { color: var(--com); font-style: italic; }
.t-const { color: var(--const); }
.t-pre { color: var(--pre); }
.serial { background: var(--term); border-top: 1px solid var(--line); }
.serial-head { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid #1a2130; color: #8a96aa; font-size: 12px; font-family: var(--mono); }
.serial-head .dot { width: 8px; height: 8px; border-radius: 50%; background: #4b5567; }
[data-state="running"] .serial-head .dot { background: var(--term-text); box-shadow: 0 0 8px var(--term-text); }
[data-state="uploading"] .serial-head .dot { background: var(--amber); }
.serial-head .s-title { color: #c9d3e2; font-weight: 600; }
.serial-head .s-baud { margin-left: auto; }
.serial-head button { background: transparent; border: 1px solid #263045; color: #8a96aa; border-radius: 8px; font-size: 11.5px; padding: 3px 8px; cursor: pointer; font-family: var(--mono); }
.serial-lines { height: 170px; overflow-y: auto; padding: 10px 14px; font: 12.5px/1.55 var(--mono); color: var(--term-text); }
.serial-lines .sys { color: #7f8aa0; }
.serial-lines .empty { color: #4f5a6e; }
.serial-lines div { white-space: pre-wrap; word-break: break-word; }

/* Test */
.quiz-card { padding: 22px; }
.quiz-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.quiz-head h2 { font-size: 22px; }
.quiz-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 1000px) { .quiz-list { grid-template-columns: 1fr; } }
.q { background: var(--panel-2); border: 1px solid var(--line); border-radius: 14px; padding: 16px; }
.q p { margin: 0 0 12px; font-weight: 600; font-size: 14.5px; }
.q .opts { display: flex; flex-direction: column; gap: 8px; }
.q .opt { text-align: left; border: 1px solid var(--line-2); background: var(--panel); padding: 9px 12px; border-radius: 10px; cursor: pointer; font-size: 13.5px; transition: border-color .2s, background .2s; }
.q .opt:hover:not([disabled]) { border-color: var(--accent); }
.q .opt.right { border-color: var(--ok); background: color-mix(in srgb, var(--ok) 14%, var(--panel)); }
.q .opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, var(--panel)); }
.q .opt[disabled] { cursor: default; }
.q .why { margin-top: 10px; font-size: 13px; color: var(--muted); }
.quiz-done { margin-top: 16px; padding: 14px 16px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 14%, var(--panel)); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-weight: 600; }

.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 22px; }
.pager a { flex: 1; max-width: 420px; text-decoration: none; padding: 16px 18px; }
.pager a small { display: block; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.pager a b { font-family: var(--display); font-size: 17px; }
.pager .next { text-align: right; margin-left: auto; }

/* ---------- Komponentlar ---------- */
.parts-tools { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 18px; }
.search { flex: 1; min-width: 220px; position: relative; }
.search input { width: 100%; padding: 11px 14px 11px 40px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; outline: none; }
.search input:focus { border-color: var(--accent); }
.search svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; }
.parts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.pcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.pcard-art { background: var(--scene); height: 150px; display: grid; place-items: center; border-bottom: 1px solid var(--line); }
.pcard-art svg { width: 100%; height: 100%; }
.pcard-body { padding: 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.pcard-body h3 { font-size: 16.5px; }
.pcard-body p { margin: 0; font-size: 13.5px; color: var(--muted); }
.pcard-cat { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--accent-text); font-weight: 700; }
.pcard-lessons { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.pcard-lessons a { font-size: 12px; text-decoration: none; padding: 3px 9px; border-radius: 999px; background: var(--panel-3); color: var(--text-2); border: 1px solid var(--line); }
.pcard-lessons a:hover { border-color: var(--accent); color: var(--accent-text); }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- Simulyator ---------- */
.sim-pick { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.select { padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font: inherit; min-width: 240px; }

/* ---------- Sozlamalar ---------- */
.settings { max-width: 760px; }
.set-group { padding: 6px 20px; margin-bottom: 18px; }
.set-group h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 16px 0 6px; font-family: var(--font); }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.set-row:first-of-type { border-top: 0; }
.set-row b { display: block; font-weight: 600; }
.set-row span { color: var(--muted); font-size: 13.5px; }

/* Harakatni kamaytirish */
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; scroll-behavior: auto !important; }
@media (prefers-reduced-motion: reduce) {
  .page { animation: none; }
}
.scene-hint { animation: hint-fade .6s 7s forwards; }
@keyframes hint-fade { to { opacity: 0; visibility: hidden; } }
@media (min-width: 1101px) { .sticky-col { position: sticky; top: 84px; } .sticky-col .serial-lines { height: 210px; } }
[hidden] { display: none !important; }
@media (max-width: 560px) {
  .code-head .file-tab, .code-head [data-act="expand"] { display: none; }
  .scene { max-height: none; }
  .sb-actions .sb-sep, .sb-actions [data-act="labels"] { display: none; }
}

/* ---------- 3D koʻrinish ---------- */
.seg-mini { padding: 3px; }
.seg-mini button { padding: 5px 11px; font-size: 12.5px; font-weight: 700; }
.seg-mini button.is-active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.scene-wrap.is3d { aspect-ratio: 16 / 10; max-height: 76vh; min-height: 340px; overflow: hidden; }
.scene-wrap.is3d .scene { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.scene-wrap:not(.is3d) .scene3d, .scene-wrap:not(.is3d) .labels3d { display: none; }
.scene3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; outline: none; }
.scene3d:active { cursor: grabbing; }
.scene-card:fullscreen .scene-wrap.is3d { aspect-ratio: auto; max-height: none; flex: 1; }
.labels3d { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.lbl3d { position: absolute; left: 0; top: 0; will-change: transform; }
.lbl3d.co::before { content: ""; position: absolute; left: -4.5px; top: -4.5px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px rgba(0, 0, 0, .45); }
.lbl3d.co::after { content: ""; position: absolute; left: -.5px; bottom: 4px; width: 1px; height: var(--stem, 26px); background: linear-gradient(transparent, var(--accent)); }
.lbl3d.co .in span { display: none; }
.lbl3d.co .in { position: absolute; bottom: calc(var(--stem, 26px) + 4px); left: 0; transform: translateX(-50%); width: max-content; max-width: 210px; background: color-mix(in srgb, var(--panel) 90%, transparent); backdrop-filter: blur(6px); border: 1px solid var(--line-2); border-radius: 10px; padding: 5px 9px; font-size: 11px; line-height: 1.3; color: var(--muted); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.lbl3d.co .in b { display: block; color: var(--text); font-size: 12px; }
.labels3d.no-labels .lbl3d.co { display: none; }
.lbl3d.val { translate: -50% -50%; font: 600 12px var(--mono); color: var(--text); background: color-mix(in srgb, var(--panel) 85%, transparent); border: 1px solid var(--line); border-radius: 8px; padding: 2px 8px; white-space: nowrap; }
@media (max-width: 560px) {
  .scene-wrap.is3d { aspect-ratio: 1 / 1; }
  .labels3d .lbl3d.co { display: none; }
}
.scene-card:not(.mode3d) .only3d { display: none; }
.serial-lines .err { color: #ff7b7b; }


/* ---------- Loyiha konstruktori ---------- */
.b-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.b-actions .select { min-width: 200px; padding: 8px 12px; }
.toolbox { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.tb-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; justify-content: space-between; }
.tools button { display: inline-flex; align-items: center; gap: 6px; }
.tools button .i { width: 16px; height: 16px; }
.tools button.is-active { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.wire-colors button { width: 24px; height: 24px; }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
.pal { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 6px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--text-2); transition: border-color .15s, background .15s, transform .1s; }
.pal .i { width: 26px; height: 26px; color: var(--text); }
.pal:hover { border-color: var(--line-2); }
.pal:active { transform: scale(.97); }
.pal.is-active { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, var(--panel-2)); color: var(--accent-text); }
.tb-hint { margin: 0; font-size: 13px; color: var(--muted); min-height: 1.4em; }
.tb-hint b { color: var(--text); }
.props-card { padding: 18px; }
.props-card .pin-table { margin-bottom: 12px; }
.prop-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 8px 0; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--text-2); }
.prop-row input[type="range"] { flex: 1; min-width: 160px; max-width: 320px; }
.prop-row output { font-family: var(--mono); color: var(--accent-text); margin-left: 6px; }
.prop-row .seg button { padding: 6px 10px; font-size: 12.5px; }
.prop-row .btn.is-down { background: var(--accent-2); }
.prop-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.wire-ends { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 0 8px; }
.checks-card { padding: 16px 18px; }
.checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13.5px; }
.checks li { padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-2); line-height: 1.45; }
.checks li.bad { border-color: color-mix(in srgb, var(--bad) 55%, transparent); background: color-mix(in srgb, var(--bad) 10%, var(--panel-2)); }
.checks li.warn { border-color: color-mix(in srgb, var(--amber) 55%, transparent); background: color-mix(in srgb, var(--amber) 10%, var(--panel-2)); }
.checks li.ok { border-color: color-mix(in srgb, var(--ok) 45%, transparent); color: var(--ok); }

/* Sahnadagi tanlash va oldindan koʻrish */
.scene .bpart.sel > g, .scene .bwire.sel .w-core { filter: drop-shadow(0 0 3px var(--cyan)) drop-shadow(0 0 6px var(--cyan)); }
.scene .bwire.sel .w-core { stroke-width: 5.4; }
.scene .wend circle { fill: transparent; stroke: transparent; stroke-width: 2; cursor: grab; }
.scene .wend:hover circle, .scene .wend.sel circle { fill: color-mix(in srgb, var(--cyan) 25%, transparent); stroke: var(--cyan); }
.scene .ghost { opacity: .6; }
.scene .ghost.bad { opacity: .5; filter: drop-shadow(0 0 4px #ff5d5d) sepia(1) hue-rotate(-50deg) saturate(4); }
.scene .wire-preview { fill: none; stroke-width: 4; stroke-dasharray: 8 6; stroke-linecap: round; opacity: .85; }
.scene .port-ring { fill: color-mix(in srgb, var(--accent) 25%, transparent); stroke: var(--accent); stroke-width: 2; }
.scene .port-ring.start { stroke: var(--cyan); fill: color-mix(in srgb, var(--cyan) 25%, transparent); }
.scene .port-label { font: 700 11px var(--font); fill: var(--text); paint-order: stroke; stroke: var(--scene); stroke-width: 4px; }
.scene-card[data-tool="wire"] .scene, .scene-card[data-tool="wire"] .scene3d, .scene-card[data-tool="place"] .scene, .scene-card[data-tool="place"] .scene3d { cursor: crosshair; }
.scene-card[data-tool="delete"] .scene, .scene-card[data-tool="delete"] .scene3d { cursor: not-allowed; }

/* Kod muharriri */
.editor { position: relative; height: 380px; background: var(--code-bg); }
.editor.expanded { height: 640px; }
.editor .ed-hl { position: absolute; inset: 0; margin: 0; max-height: none; overflow: hidden; pointer-events: none; }
.editor .ed-input { position: absolute; inset: 0; width: 100%; height: 100%; resize: none; border: 0; outline: none; background: transparent; color: transparent; caret-color: var(--accent); font: 12.8px/1.65 var(--mono); padding: 14px 16px 14px 54px; white-space: pre; overflow: auto; tab-size: 2; }
.editor .ed-input::selection { background: color-mix(in srgb, var(--cyan) 35%, transparent); color: transparent; }
.editor .ed-hl .ln { padding-right: 16px; }

/* ---------- Platalar ---------- */
.board-pick { display: inline-flex; align-items: center; gap: 6px; }
.board-pick .i { width: 20px; height: 20px; color: var(--accent-text); }
.board-pick .select { min-width: 230px; }
.fam-title { font-size: 15px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; margin: 18px 0 10px; font-family: var(--font); }
.boards-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.bcard { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.bcard-art { background: var(--scene); height: 170px; display: grid; place-items: center; border-bottom: 1px solid var(--line); padding: 10px; }
.bcard-art svg { width: 100%; height: 100%; }
.bcard .btn { align-self: flex-start; margin-top: auto; }
.bspecs { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 8px; }
.bspecs span { font-size: 11.5px; padding: 3px 8px; border-radius: 999px; background: var(--panel-3); border: 1px solid var(--line); color: var(--text-2); }
.v33 { color: var(--amber); }
.cmp-card { margin-top: 18px; padding: 14px 18px; }
.cmp-card summary { cursor: pointer; font-weight: 700; font-family: var(--display); }
.cmp-wrap { overflow-x: auto; margin-top: 12px; }
.cmp { min-width: 900px; }
.cmp td, .cmp th { white-space: nowrap; padding-right: 14px; }
.volt-warn { margin: 0 0 12px; padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--amber) 14%, var(--panel-2)); border: 1px solid color-mix(in srgb, var(--amber) 50%, transparent); font-size: 13px; }

/* ---------- Silliq sudrash ---------- */
.scene .wend .wend-hit { fill: transparent; stroke: none; cursor: grab; }
.scene .wend .wend-dot { fill: transparent; stroke: transparent; stroke-width: 2; pointer-events: none; transition: fill .15s, stroke .15s; }
.scene .wend:hover .wend-dot, .scene .wend.sel .wend-dot { fill: color-mix(in srgb, var(--cyan) 30%, transparent); stroke: var(--cyan); }
.scene-card[data-tool="wire"] .scene .wend .wend-dot { stroke: var(--accent); fill: color-mix(in srgb, var(--accent) 25%, transparent); }
.scene .bpart.dragging { opacity: .9; filter: drop-shadow(0 8px 10px rgba(0, 0, 0, .45)); cursor: grabbing; }
.scene .bpart.dragging.bad { filter: drop-shadow(0 0 6px #ff5d5d); }
.scene .bwire.dragging .w-core { stroke-dasharray: 10 5; }

/* ---------- Elektr sxemasi ---------- */
.sch-card { padding: 16px 18px; }
.sch-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.sch-head .panel-title { margin: 0; }
.sch-actions { display: flex; gap: 6px; }
.sch-note { margin: 6px 0 10px; font-size: 13px; }
.sch-view { background: var(--scene); border: 1px solid var(--line); border-radius: 12px; padding: 10px; overflow-x: auto; }
.sch-view svg { display: block; max-width: 100%; height: auto; min-width: 520px; }

/* ---------- Loyihalar galereyasi ---------- */
.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.proj-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.proj-sch { background: var(--scene); border-bottom: 1px solid var(--line); padding: 12px; height: 210px; display: grid; place-items: center; }
.proj-sch svg { max-width: 100%; max-height: 186px; width: auto; height: auto; }
.proj-top { display: flex; align-items: center; gap: 8px; }
.proj-num { font: 700 22px var(--display); color: var(--accent-text); }
.proj-parts { margin: 0; padding-left: 18px; font-size: 13px; color: var(--text-2); }
.proj-code summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.proj-code .code-pre { max-height: 260px; border-radius: 10px; margin-top: 8px; }
.proj-card .btn { align-self: flex-start; margin-top: 6px; }

/* ---------- Sxema paneli (sahna kartasi ichida) ---------- */
.sch-pane { display: none; flex-direction: column; border-top: 1px solid var(--line); background: var(--scene); min-height: 0; }
.builder-scene.sch-split .sch-pane, .builder-scene.sch-only .sch-pane { display: flex; }
.sch-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--panel); }
.sch-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; font-size: 14px; }
.sch-title svg { width: 18px; height: 18px; color: var(--accent-text); }
.sch-stat { font-size: 12.5px; color: var(--muted); }
.sch-stat.ok { color: var(--accent-text); }
.sch-stat.bad { color: var(--amber); font-weight: 600; }
.sch-bar .sch-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.sch-canvas { position: relative; overflow: hidden; height: clamp(250px, 38vh, 480px); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; }
.sch-canvas.panning { cursor: grabbing; }
.sch-canvas .sch-view { position: absolute; inset: 0; transform-origin: 0 0; background: none; border: 0; border-radius: 0; padding: 12px; overflow: visible; }
.sch-canvas .sch-view svg { width: 100%; height: 100%; min-width: 0; max-width: none; display: block; }
.builder-scene.sch-split .scene-wrap.is3d { aspect-ratio: auto; height: clamp(300px, 46vh, 600px); min-height: 0; max-height: none; }
.builder-scene.sch-split .scene-wrap:not(.is3d) .scene { max-height: 46vh; }
.builder-scene.sch-only .scene-wrap { display: none; }
.builder-scene.sch-only .sch-pane { border-top: 0; }
.builder-scene.sch-only .sch-canvas { height: clamp(380px, 72vh, 860px); }
.builder-scene.sch-only .sb-actions .icon-btn[data-act]:not([data-act="full"]), .builder-scene.sch-only .sb-actions .sb-sep { display: none; }
.scene-card:fullscreen.sch-split .sch-pane, .scene-card:fullscreen.sch-only .sch-pane { flex: 1; }
.scene-card:fullscreen .sch-canvas { height: auto; flex: 1; }
.scene-card:fullscreen.sch-split .scene-wrap, .scene-card:fullscreen.sch-split .scene-wrap.is3d { height: auto; flex: 1.2; }
.seg-mini [data-sch] svg { width: 14px; height: 14px; margin-right: 4px; vertical-align: -2px; }
@media (max-width: 640px) { .sch-bar .sch-actions .btn { padding-inline: 8px; } .sch-canvas { height: 300px; } }

/* ---------- Qismlar palitrasi guruhlari ---------- */
.pal-group { display: flex; flex-direction: column; gap: 6px; }
.pal-group + .pal-group { margin-top: 10px; }
.pal-head { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toolbox .palette { grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); }
.toolbox .pal span { text-align: center; line-height: 1.2; font-size: 12px; }
.prop-note { font-size: 12.5px; margin: 8px 0 0; }
.prop-note code { font-size: 11.5px; }

/* ---------- Loyihalar: daraja filtri ---------- */
.proj-filter { margin: 0 0 16px; flex-wrap: wrap; }
.proj-filter b { font-weight: 700; opacity: .65; margin-left: 4px; }
.chip.lv-1 { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: color-mix(in srgb, var(--ok) 10%, transparent); }
.chip.lv-2 { color: var(--cyan); border-color: color-mix(in srgb, var(--cyan) 40%, transparent); background: color-mix(in srgb, var(--cyan) 10%, transparent); }
.chip.lv-3 { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.proj-icons { margin-left: auto; display: inline-flex; gap: 4px; color: var(--muted); }
.proj-icons .i { width: 18px; height: 18px; }

/* ---------- Aloqa ---------- */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
.contact-form { display: flex; flex-direction: column; gap: 16px; padding: 22px; }
.cf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 640px) { .cf-row { grid-template-columns: 1fr; } }
.contact-form .field { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; border: 0; padding: 0; margin: 0; min-width: 0; }
.contact-form .field i { color: var(--bad); font-style: normal; }
.contact-form .field small { color: var(--muted); font-weight: 500; font-size: 12.5px; }
.contact-form legend { padding: 0; margin-bottom: 6px; }
.contact-form input:not([type="radio"]), .contact-form textarea { width: 100%; background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px; color: var(--text); padding: 11px 13px; font: inherit; font-weight: 400; resize: vertical; transition: border-color .15s; }
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.contact-form .invalid { border-color: var(--bad) !important; }
.contact-form .cf-count { align-self: flex-end; }
.topics { display: flex; flex-wrap: wrap; gap: 8px; }
.topics label { cursor: pointer; }
.topics input { position: absolute; opacity: 0; pointer-events: none; }
.topics span { display: inline-block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); font-weight: 600; font-size: 13.5px; color: var(--text-2); transition: all .15s; }
.topics input:checked + span { background: var(--accent); color: var(--accent-ink, #0b1018); border-color: transparent; }
.topics input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.cf-error { margin: 0; padding: 10px 14px; border-radius: 10px; color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); border: 1px solid color-mix(in srgb, var(--bad) 40%, transparent); font-size: 14px; }
.cf-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.contact-side { padding: 22px; font-size: 14px; }
.contact-side h3 { display: flex; align-items: center; gap: 8px; font-size: 15px; margin: 0 0 8px; }
.contact-side h3 + ol, .contact-side h3 + ul { margin: 0 0 18px; padding-left: 20px; color: var(--text-2); }
.contact-side li { margin: 4px 0; }
.contact-side .i { width: 18px; height: 18px; color: var(--accent-text); }
.contact-done { padding: 34px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.contact-done .cd-ico { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.contact-done .cd-ico .i { width: 32px; height: 32px; }
.contact-done h2 { margin: 6px 0 0; }
.contact-done p { margin: 0 0 8px; color: var(--text-2); max-width: 460px; }

/* ---------- Bosh sahifa: 3D rasm ---------- */
.hero-stage { position: relative; }
.hero-stage.is3d { aspect-ratio: 16 / 10; margin: -28px -18px 0; }
.hero-stage.is3d > svg { position: absolute; inset: 0; visibility: hidden; pointer-events: none; }
.hero-stage .scene3d { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; border-radius: 28px 28px 0 0; }
.hero-stage .scene3d:active { cursor: grabbing; }
@media (pointer: coarse) { .hero-stage .scene3d { pointer-events: none; } }

/* ---------- Tarmoq paneli (ESP) ---------- */
.net-card { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.net-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.net-head .panel-title { margin: 0; display: flex; gap: 8px; align-items: center; }
.net-st.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); }
.net-tabs button { position: relative; }
.net-tabs button.has-new i { position: absolute; top: 4px; right: 4px; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.net-empty { margin: 0; padding: 18px; text-align: center; font-size: 13.5px; }
.phone { max-width: 420px; margin: 0 auto; border: 10px solid #111418; border-radius: 26px; background: #111418; box-shadow: var(--shadow); overflow: hidden; }
.phone-bar { display: flex; gap: 6px; align-items: center; padding: 6px 8px; background: #1d2129; color: #cfd6e2; font-size: 12.5px; }
.phone-bar .url-host { font-family: var(--mono); color: #9fb4e6; white-space: nowrap; }
.phone-bar .url-path { flex: 1; min-width: 60px; background: #0d1117; border: 1px solid #2c3442; color: #e7edf6; border-radius: 8px; padding: 4px 8px; font: 12.5px var(--mono); }
.phone-bar .btn { padding: 4px 8px; }
.phone-screen { height: 380px; background: #fff; overflow: auto; }
.phone-screen iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }
.phone-screen .net-empty { color: #5b6577; }
.net-err { padding: 18px; color: #b42318; font-size: 14px; }
.net-err p { color: #5b6577; }
.net-raw { margin: 0; padding: 12px; font: 13px/1.5 var(--mono); color: #111; white-space: pre-wrap; word-break: break-word; }
.tg-chat { max-width: 520px; margin: 0 auto; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); background: linear-gradient(#9cc4a1, #87b28d); }
.tg-msgs { height: 300px; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.tg-m { max-width: 80%; padding: 7px 10px 18px; border-radius: 12px; font-size: 14px; position: relative; color: #111; background: #fff; align-self: flex-start; white-space: normal; }
.tg-m.me { align-self: flex-end; background: #e2ffc7; }
.tg-m time { position: absolute; right: 8px; bottom: 3px; font-size: 10.5px; color: #6b7a6d; }
.tg-m small { display: block; color: #8a6d00; font-size: 11px; }
.tg-send { display: flex; gap: 6px; padding: 8px; background: #fff; }
.tg-send input { flex: 1; border: 1px solid #d5dbe3; border-radius: 10px; padding: 7px 10px; font: inherit; color: #111; background: #fff; }
.tg-id { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 2px 6px; font: 12.5px var(--mono); }
.mq-grid, .cl-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 760px) { .mq-grid, .cl-grid { grid-template-columns: 1fr; } }
.mq-grid h4, .cl-grid h4 { margin: 0 0 8px; font-size: 14px; }
.mq-v { display: grid; grid-template-columns: 1fr auto; gap: 2px 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; background: var(--panel-2); }
.mq-v span { font: 12.5px var(--mono); color: var(--muted); }
.mq-v b { font-size: 16px; }
.mq-v .spark { grid-column: 1 / -1; width: 100%; height: 24px; color: var(--accent-text); }
.mq-pub { display: flex; flex-direction: column; gap: 6px; }
.mq-pub input, .cl-row select { background: var(--panel-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 7px 10px; font: inherit; }
.mq-pub .btn { align-self: flex-start; }
.cl-row { display: flex; flex-direction: column; gap: 4px; font-weight: 600; font-size: 13.5px; margin-bottom: 10px; }
.cl-data ul, .net-log { list-style: none; margin: 0; padding: 0; max-height: 300px; overflow-y: auto; font-size: 13px; }
.cl-data li, .net-log li { padding: 5px 0; border-bottom: 1px dashed var(--line); }
.cl-data time, .net-log time { color: var(--muted); font: 11.5px var(--mono); margin-right: 8px; }
.net-log .lg-wifi { color: var(--cyan); } .net-log .lg-tg { color: #6cb6ff; } .net-log .lg-mqtt { color: var(--accent-text); }

/* ---------- Hisob tugmasi ---------- */
.acct { position: relative; }
.acct-btn { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); color: var(--text); font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.acct-btn:hover { border-color: var(--line-2); }
.acct-btn .i { width: 18px; height: 18px; color: #2aabee; }
.ava { width: 26px; height: 26px; border-radius: 50%; object-fit: cover; display: inline-grid; place-items: center; background: var(--accent); color: var(--accent-ink, #10140a); font-weight: 700; font-size: 13px; flex: none; }
.ava.lg { width: 40px; height: 40px; font-size: 17px; }
.ava.xl { width: 72px; height: 72px; font-size: 30px; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); padding: 8px; z-index: 50; display: flex; flex-direction: column; gap: 2px; }
.acct-menu[hidden] { display: none !important; }
.acct-who { display: flex; gap: 10px; align-items: center; padding: 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.acct-who small { display: block; color: var(--muted); }
.acct-menu a, .acct-menu button { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 10px; color: var(--text); text-decoration: none; font: inherit; font-size: 14px; background: none; border: 0; cursor: pointer; text-align: left; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--panel-2); }
.acct-menu .i { width: 17px; height: 17px; color: var(--muted); }
@media (max-width: 760px) { .acct-btn span { display: none; } }

/* ---------- Kirish sahifasi ---------- */
.login-page { display: grid; place-items: center; min-height: 60vh; }
.login-card { max-width: 480px; width: 100%; text-align: center; padding: 34px 28px; display: flex; flex-direction: column; gap: 14px; align-items: center; }
.login-ico { width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center; background: #2aabee; color: #fff; }
.login-ico .i { width: 36px; height: 36px; }
.login-card h1 { margin: 0; font-size: 26px; }
.tg-login { background: #2aabee !important; color: #fff !important; border-color: transparent !important; }
.btn-lg { padding: 12px 22px; font-size: 16px; }
.login-wait { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 14px; border-radius: 14px; background: var(--panel-2); border: 1px solid var(--line); }
.login-wait p { margin: 0; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: #2aabee; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-err { color: var(--bad); margin: 0; }
.login-why { list-style: none; padding: 0; margin: 6px 0 0; text-align: left; display: flex; flex-direction: column; gap: 6px; font-size: 14px; color: var(--text-2); }
.login-why .i { width: 16px; height: 16px; color: var(--ok); margin-right: 6px; vertical-align: -3px; }

/* ---------- Pro katalog ---------- */
.pro-hero { display: grid; grid-template-columns: 1fr auto; gap: 20px; padding: 26px; align-items: center; margin-bottom: 18px; }
.pro-hero h1 { margin: 6px 0 10px; font-size: clamp(26px, 3.4vw, 40px); }
.pro-hero p { color: var(--text-2); max-width: 680px; }
.pro-hello { display: flex; align-items: center; gap: 8px; }
.pro-stats { display: flex; gap: 22px; }
.pro-stats div { display: flex; flex-direction: column; align-items: center; }
.pro-stats b { font: 700 30px var(--display); color: var(--accent-text); }
.pro-stats span { color: var(--muted); font-size: 13px; }
@media (max-width: 800px) { .pro-hero { grid-template-columns: 1fr; } }
.pro-bar { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.pro-bar .seg a { text-decoration: none; }
.pro-bar b { opacity: .6; margin-left: 4px; }
.sec-title { font-size: 20px; margin: 22px 0 12px; }
.pack-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.pack-card { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-color: color-mix(in srgb, var(--accent) 35%, var(--line)); }
.pack-top { display: flex; gap: 12px; }
.pack-top h3 { margin: 0 0 4px; }
.pack-top p { margin: 0; font-size: 13.5px; }
.pack-ico, .pc-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 16%, var(--panel-2)); color: var(--accent-text); flex: none; }
.pack-list { margin: 0; padding-left: 18px; font-size: 13.5px; }
.pack-list a { color: var(--text-2); }
.pack-foot { display: flex; align-items: center; gap: 10px; margin-top: auto; flex-wrap: wrap; }
.price { font: 700 20px var(--display); color: var(--accent-text); }
.chip.warn { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); background: color-mix(in srgb, var(--amber) 10%, transparent); }
.chip.lock { color: var(--text-2); }
.pro-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }
.pro-card { display: flex; flex-direction: column; gap: 8px; padding: 16px; text-decoration: none; color: var(--text); transition: border-color .15s, transform .15s; }
.pro-card:hover { border-color: var(--line-2); transform: translateY(-2px); }
.pro-card h3 { margin: 0; font-size: 16px; }
.pro-card p { margin: 0; color: var(--text-2); font-size: 13.5px; flex: 1; }
.pc-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.pc-top .pc-ico { width: 32px; height: 32px; border-radius: 10px; }
.pc-foot { display: flex; justify-content: space-between; font-size: 12.5px; }

/* ---------- Pro loyiha sahifasi ---------- */
.pp-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(260px, 1fr); gap: 18px; align-items: start; }
@media (max-width: 900px) { .pp-grid { grid-template-columns: minmax(0, 1fr); } }
.pp-main, .pp-side { display: flex; flex-direction: column; gap: 16px; }
.pp-main > .card, .pp-side > .card { padding: 20px 22px; }
.pp-main > .card h2, .pp-side > .card h3 { margin-top: 0; display: flex; align-items: center; gap: 8px; }
.pp-side > .card ul { padding-left: 18px; margin: 8px 0 0; }
.steps-list li > div ul { margin: 6px 0; padding-left: 18px; color: var(--text-2); }
.steps-list li > div ul li { margin: 3px 0; }
.steps-list { margin: 0; padding-left: 0; list-style: none; counter-reset: st; display: flex; flex-direction: column; gap: 14px; }
.steps-list > li { counter-increment: st; position: relative; padding-left: 44px; }
.steps-list > li::before { content: counter(st); position: absolute; left: 0; top: -2px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); color: var(--accent-text); }
.steps-list li > div p { margin: 6px 0; color: var(--text-2); }
.steps-list > li.blur { filter: blur(4px); user-select: none; pointer-events: none; }
.lock-box { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; padding: 18px; border-color: color-mix(in srgb, var(--amber) 40%, var(--line)); font-size: 28px; }
.lock-box > div { flex: 1; min-width: 220px; font-size: 14px; }
.lock-box h3 { margin: 0 0 4px; font-size: 17px; }
.pp-parts { margin: 0; padding-left: 18px; font-size: 14px; color: var(--text-2); }
.real-tips p, .real-tips li { color: var(--text-2); font-size: 14px; }

/* ---------- Xarid oynasi ---------- */
.buy-dlg { border: 1px solid var(--line); border-radius: 18px; background: var(--panel); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.buy-dlg::backdrop { background: rgba(5, 8, 14, .6); backdrop-filter: blur(3px); }
.buy-form { padding: 20px 22px; display: flex; flex-direction: column; gap: 12px; }
.buy-form header, .buy-form footer { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.buy-form footer { justify-content: flex-end; }
.buy-form h2 { margin: 0; font-size: 19px; }
.buy-price { font: 700 28px var(--display); color: var(--accent-text); }
.buy-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.card-num { display: flex; align-items: center; gap: 10px; margin: 6px 0 2px; font: 600 18px var(--mono); letter-spacing: .06em; }
.file-drop { display: block; margin-top: 6px; border: 1.5px dashed var(--line-2); border-radius: 12px; padding: 14px; text-align: center; cursor: pointer; color: var(--text-2); }
.file-drop input { display: none; }
.buy-steps textarea { width: 100%; margin-top: 6px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; color: var(--text); padding: 8px 10px; font: inherit; }
.buy-err { color: var(--bad); margin: 0; }
.buy-done { text-align: center; padding: 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.buy-done > .i { width: 48px; height: 48px; color: var(--ok); }

/* ---------- Profil ---------- */
.prof-head { display: flex; align-items: center; gap: 18px; padding: 22px; margin-bottom: 16px; }
.prof-head h1 { margin: 0; }
.prof-head .btn { margin-left: auto; }
.grid2c { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 800px) { .grid2c { grid-template-columns: 1fr; } }
.own-list, .pay-list { list-style: none; padding: 0; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; }
.pay-list li { display: flex; align-items: center; gap: 10px; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.pay-list small { display: block; }

/* Konstruktordagi qadamlar */
.steps-card { padding: 14px 16px; }
.steps-head { display: flex; align-items: center; gap: 8px; }
.steps-head .panel-title { margin: 0; }
.steps-head .btn { margin-left: auto; }
.bsteps { margin: 6px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; max-height: 520px; overflow-y: auto; }
.bsteps > li { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; background: var(--panel-2); }
.bsteps > li.done { opacity: .62; }
.bsteps label { display: flex; gap: 8px; align-items: flex-start; cursor: pointer; font-size: 14px; }
.bsteps input { margin-top: 3px; accent-color: var(--accent); }
.bs-d { font-size: 13px; color: var(--text-2); margin: 4px 0 0 24px; }
.bs-d p { margin: 3px 0; }
.bs-d ul { margin: 3px 0; padding-left: 16px; list-style: disc; }
.bs-d li { margin: 2px 0; }

/* Telegram bot klaviaturasi */
.tg-kb { display: flex; flex-direction: column; gap: 4px; padding: 4px 0; }
.tg-kb:empty { display: none; }
.tg-kb-row { display: flex; gap: 4px; }
.tg-kb-row .btn { flex: 1; justify-content: center; }

/* Mikrokontroller oilasi tanlovi (IoT · Pi katalogi) */
.fam-tabs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; margin: 4px 0 14px; }
.fam-tab { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-radius: 16px; border: 2px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s, box-shadow .15s; }
.fam-tab:hover { border-color: var(--line-2); transform: translateY(-1px); }
.fam-tab .fam-ico { flex: none; width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--panel-2); }
.fam-tab .fam-ico .i { width: 26px; height: 26px; }
.fam-txt { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.fam-txt b { font-size: 17px; }
.fam-txt small { color: var(--text-2); font-size: 12.5px; }
.fam-txt .fam-boards { opacity: .8; }
.fam-count { flex: none; text-align: center; font: 700 26px var(--display); line-height: 1; }
.fam-count small { display: block; font-family: inherit; font-size: 11px; font-weight: 500; color: var(--text-2); margin-top: 3px; }
.fam-sel { position: absolute; top: -10px; right: 14px; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; color: #fff; }
.fam-esp { --fam: #2f7cf6; }
.fam-rpi { --fam: #c51a4a; }
.fam-tab.is-active { border-color: var(--fam); box-shadow: 0 0 0 4px color-mix(in srgb, var(--fam) 16%, transparent); }
.fam-tab.is-active .fam-ico { background: var(--fam); color: #fff; }
.fam-tab.is-active .fam-sel { background: var(--fam); }
.fam-tab:not(.is-active) { opacity: .78; }
.fam-head { display: flex; gap: 14px; align-items: center; padding: 14px 18px; margin-bottom: 14px; border-radius: 14px; border-left: 5px solid var(--fam); background: color-mix(in srgb, var(--fam) 8%, var(--panel)); }
.fam-head .fam-ico { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--fam); color: #fff; }
.fam-head h2 { margin: 0 0 2px; font-size: 19px; }
.fam-head p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.board-chip { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 3px 10px 3px 8px; border-radius: 999px; font-size: 12px; font-weight: 600;
  color: var(--fam); background: color-mix(in srgb, var(--fam) 12%, transparent); border: 1px solid color-mix(in srgb, var(--fam) 35%, transparent); }
.board-chip .i { width: 14px; height: 14px; }

/* Konstruktor sahnasi: telefonda barcha teginishlar sahnaga (sim/qism sudrash, ikki barmoq bilan zoom) */
.builder-scene .scene-wrap, .builder-scene svg.scene { touch-action: none; }

/* Konstruktor: tanlangan qism uchun sahna ustidagi tugmalar (telefon uchun asosiy boshqaruv) */
.sel-bar { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); z-index: 6; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px);
  padding: 6px 6px 6px 14px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 92%, transparent); border: 1px solid var(--line-2); box-shadow: var(--shadow); backdrop-filter: blur(8px); }
.sel-bar[hidden] { display: none; }
.sel-bar b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-right: 4px; }
.sel-bar button { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); border-radius: 999px; padding: 8px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.sel-bar button .i { width: 16px; height: 16px; }
.sel-bar button.danger { color: #ff6b6b; }
@media (max-width: 700px) {
  /* palitra: har guruh — gorizontal suriladigan qator */
  .toolbox .palette { display: flex; overflow-x: auto; gap: 8px; padding-bottom: 6px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
  .toolbox .pal { flex: 0 0 86px; scroll-snap-align: start; padding: 8px 4px; }
  .toolbox .pal .i { width: 22px; height: 22px; }
  .toolbox .pal span { font-size: 11px; }
  .toolbox .tb-row { flex-wrap: wrap; gap: 8px; }
  .builder-page .b-actions { gap: 6px; }
  .builder-page .b-actions .select { width: 100%; }
  .sel-bar { bottom: 8px; }
}
@media (max-width: 700px) {
  /* telefonda konstruktor sahnasi balandroq (kenglik kichik — tik nisbat) */
  .builder-scene .scene-wrap:not(.is3d) .scene { aspect-ratio: 0.95; max-height: 64vh; }
  .builder-scene.sch-split .scene-wrap:not(.is3d) .scene { aspect-ratio: 0.95; max-height: 60vh; }
  .builder-scene .scene-wrap.is3d, .builder-scene.sch-split .scene-wrap.is3d { aspect-ratio: auto; height: 62vh; min-height: 320px; }
}

/* Ilova sahifasi */
.app-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; margin-bottom: 16px; }
.app-card { padding: 22px; display: flex; flex-direction: column; gap: 10px; }
.app-card h2 { margin: 0; font-size: 20px; }
.app-card p { margin: 0; }
.app-ico { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 18%, var(--panel-2)); color: var(--accent-text); }
.app-ico .i { width: 28px; height: 28px; }
.app-dl { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; margin-top: 4px; }
.app-steps { margin: 4px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--text-2); }
.app-ok { display: flex; gap: 8px; align-items: center; color: var(--ok, #3ddc84); font-weight: 600; margin: 0; }
.app-ok .i { width: 18px; height: 18px; }
.app-help summary { cursor: pointer; color: var(--text-2); font-size: 13px; }
.app-feat { padding: 22px; }
.app-feat h2 { margin-top: 0; }
.app-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.app-list li { display: flex; gap: 10px; align-items: center; }
.app-list .i { width: 18px; height: 18px; color: var(--accent-text); flex: none; }

/* Bosh sahifa: yuklab olish tugmasi */
.hero-dl .i { color: var(--accent-text); }
.hero-dl-more { flex-basis: 100%; font-size: 12.5px; color: var(--muted); text-decoration: none; margin-top: -2px; }
.hero-dl-more:hover { color: var(--text); text-decoration: underline; }
