/* RoboLab — muhandislik ish maydoni uslubi (qorong'i va yorug' mavzu). */
:root { color-scheme: dark light; }
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { overflow: hidden; }

.rl {
  --rl-bg: #0d1117; --rl-panel: #151b23; --rl-panel-2: #1b222c; --rl-line: #283241; --rl-line-2: #364152;
  --rl-text: #e6edf3; --rl-muted: #8b98a9; --rl-accent: #14b8a6; --rl-accent-2: #0ea5e9; --rl-ok: #22c55e; --rl-warn: #f59e0b; --rl-bad: #ef4444;
  --rl-canvas: #0b0f14; --rl-grid: #1f2937; --rl-grid-2: #18202b; --rl-shadow: 0 10px 30px -12px rgba(0, 0, 0, .7);
  --rl-font: "Golos Text", system-ui, -apple-system, "Segoe UI", sans-serif; --rl-mono: "JetBrains Mono", ui-monospace, Consolas, monospace;
  position: fixed; inset: 0; display: grid; grid-template-rows: 52px 1fr; background: var(--rl-bg); color: var(--rl-text); font: 14px/1.45 var(--rl-font);
}
.rl[data-theme="light"] {
  --rl-bg: #eef1f5; --rl-panel: #ffffff; --rl-panel-2: #f5f7fa; --rl-line: #dde3ea; --rl-line-2: #c8d1dc;
  --rl-text: #16202c; --rl-muted: #5b6878; --rl-canvas: #f7f9fb; --rl-grid: #cfd8e3; --rl-grid-2: #e4e9ef; --rl-shadow: 0 10px 30px -14px rgba(20, 40, 70, .35);
}
.rl button, .rl input, .rl select, .rl textarea { font: inherit; color: inherit; }
.rl a { color: var(--rl-accent); }
.rl-muted { color: var(--rl-muted); }
.rl-pad { padding: 0 14px; }
.is-hidden { display: none !important; }

/* ------------------------------------------------------------- yuqori panel */
.rl-top { display: flex; align-items: center; gap: 10px; padding: 0 12px; background: var(--rl-panel); border-bottom: 1px solid var(--rl-line); min-width: 0; }
.rl-back { display: inline-flex; align-items: center; gap: 6px; color: var(--rl-muted) !important; text-decoration: none; padding: 6px 10px; border-radius: 8px; }
.rl-back:hover { background: var(--rl-panel-2); color: var(--rl-text) !important; }
.rl-logo { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; cursor: pointer; font-weight: 700; font-size: 17px; letter-spacing: -.01em; padding: 4px 6px; }
.rl-logo b { color: var(--rl-accent); }
.rl-logo__mark { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: #fff; background: linear-gradient(135deg, #00979d, #0f766e); box-shadow: 0 6px 16px -6px #14b8a6; }
.rl-crumb { display: flex; align-items: center; gap: 8px; color: var(--rl-muted); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rl-crumb i { font-size: 10px; }
.rl-crumb span { color: var(--rl-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.rl-crumb__link { background: none; border: 0; color: var(--rl-muted); cursor: pointer; padding: 0; }
.rl-crumb__link:hover { color: var(--rl-accent); }
.rl-top__spacer, .rl-tools__spacer { flex: 1; }
.rl-seg { display: inline-flex; border: 1px solid var(--rl-line); border-radius: 9px; overflow: hidden; }
.rl-seg button { background: none; border: 0; padding: 5px 9px; cursor: pointer; color: var(--rl-muted); font-size: 12px; font-weight: 600; }
.rl-seg button.is-active { background: var(--rl-accent); color: #04211e; }
.rl-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 8px; border: 1px solid transparent; background: none; cursor: pointer; color: var(--rl-muted); }
.rl-icon:hover:not(:disabled) { background: var(--rl-panel-2); color: var(--rl-text); border-color: var(--rl-line); }
.rl-icon:disabled { opacity: .35; cursor: default; }
.rl-icon--danger:hover:not(:disabled) { color: var(--rl-bad); }
.rl-user { display: inline-flex; align-items: center; gap: 6px; color: var(--rl-muted); font-size: 13px; max-width: 180px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.rl-user--login { color: var(--rl-accent) !important; text-decoration: none; }

/* ------------------------------------------------------------- tugmalar, maydonlar */
.rl-btn { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 9px; padding: 8px 14px; background: var(--rl-accent); color: #04211e; font-weight: 600; cursor: pointer; }
.rl-btn:hover { filter: brightness(1.08); }
.rl-btn--ghost { background: var(--rl-panel-2); color: var(--rl-text); border: 1px solid var(--rl-line); }
.rl-input { width: 100%; border-radius: 8px; border: 1px solid var(--rl-line); background: var(--rl-panel-2); padding: 7px 10px; outline: none; }
.rl-input:focus { border-color: var(--rl-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rl-accent) 25%, transparent); }
.rl-link { background: none; border: 0; padding: 0; color: var(--rl-accent); cursor: pointer; text-align: left; }
.rl-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; background: var(--rl-panel-2); color: var(--rl-muted); border: 1px solid var(--rl-line); white-space: nowrap; }
.rl-badge--ok { color: var(--rl-ok); border-color: color-mix(in srgb, var(--rl-ok) 40%, transparent); background: color-mix(in srgb, var(--rl-ok) 10%, transparent); }
.rl-badge--beta { color: var(--rl-warn); border-color: color-mix(in srgb, var(--rl-warn) 40%, transparent); }

/* ------------------------------------------------------------- katalog */
.rl-main { min-height: 0; position: relative; }
.rl-main--catalog { overflow: auto; }
.rl-cat { max-width: 1180px; margin: 0 auto; padding: 32px 20px 60px; }
.rl-cat__hero { padding: 28px; border-radius: 20px; background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--rl-accent) 28%, transparent), transparent 60%), var(--rl-panel); border: 1px solid var(--rl-line); margin-bottom: 22px; }
.rl-cat__hero h1 { margin: 6px 0 8px; font-size: clamp(24px, 3.2vw, 34px); letter-spacing: -.02em; }
.rl-cat__hero p { margin: 0 0 16px; color: var(--rl-muted); max-width: 720px; }
.rl-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--rl-accent); }
.rl-progress { height: 8px; border-radius: 99px; background: var(--rl-panel-2); overflow: hidden; max-width: 420px; margin-bottom: 6px; }
.rl-progress span { display: block; height: 100%; background: linear-gradient(90deg, var(--rl-accent), var(--rl-accent-2)); }
.rl-cat__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.rl-card { text-align: left; display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 16px; background: var(--rl-panel); border: 1px solid var(--rl-line); cursor: pointer; transition: transform .15s, border-color .15s, box-shadow .15s; }
.rl-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--rl-accent) 55%, var(--rl-line)); box-shadow: var(--rl-shadow); }
.rl-card h3 { margin: 0; font-size: 16px; }
.rl-card p { margin: 0; color: var(--rl-muted); font-size: 13px; flex: 1; }
.rl-card.is-done { border-color: color-mix(in srgb, var(--rl-ok) 45%, var(--rl-line)); }
.rl-card--free { background: linear-gradient(135deg, color-mix(in srgb, var(--rl-accent) 18%, var(--rl-panel)), var(--rl-panel)); }
.rl-card__top { display: flex; align-items: center; gap: 8px; }
.rl-card__icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: color-mix(in srgb, var(--rl-accent) 16%, transparent); color: var(--rl-accent); font-size: 17px; flex: none; }
.rl-card__num { font: 600 12px var(--rl-mono); color: var(--rl-muted); }
.rl-card__meta { display: flex; gap: 10px; font-size: 12px; color: var(--rl-muted); align-items: center; }
.rl-card__go { margin-left: auto; color: var(--rl-accent); font-weight: 600; }
.rl-cat__about { color: var(--rl-muted); font-size: 12.5px; margin-top: 24px; }

/* ------------------------------------------------------------- ish maydoni joylashuvi */
.rl-main--work { display: grid; grid-template-columns: 250px minmax(0, 1fr) 330px; }
.rl-lib, .rl-side { background: var(--rl-panel); border-right: 1px solid var(--rl-line); min-height: 0; display: flex; flex-direction: column; }
.rl-side { border-right: 0; border-left: 1px solid var(--rl-line); }
.rl-stage { display: grid; grid-template-rows: 46px minmax(0, 1fr) 6px var(--bottom, 260px); min-width: 0; min-height: 0; }
.rl-stage > .rl-views { grid-row: 2; }

/* kutubxona */
.rl-lib__head { padding: 12px; border-bottom: 1px solid var(--rl-line); display: grid; gap: 8px; }
.rl-lib__head h2 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .1em; color: var(--rl-muted); }
.rl-lib__list { overflow: auto; padding: 6px 8px 20px; }
.rl-lib__cat h3 { font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--rl-muted); margin: 14px 6px 6px; }
.rl-item { width: 100%; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 9px; background: none; border: 1px solid transparent; cursor: pointer; text-align: left; }
.rl-item:hover:not(.is-disabled) { background: var(--rl-panel-2); border-color: var(--rl-line); }
.rl-item.is-active { border-color: color-mix(in srgb, var(--rl-accent) 50%, transparent); background: color-mix(in srgb, var(--rl-accent) 8%, transparent); }
.rl-item.is-disabled { opacity: .55; cursor: default; }
.rl-item__name { flex: 1; min-width: 0; font-size: 13px; display: flex; flex-direction: column; }
.rl-item__name small { color: var(--rl-muted); font-size: 11px; }
.rl-item__thumb { width: 46px; height: 34px; flex: none; display: grid; place-items: center; background: var(--rl-canvas); border-radius: 7px; border: 1px solid var(--rl-line); }
.rl-thumb { width: 42px; height: 30px; overflow: visible; }
.rl-item__icon--board { width: 46px; height: 34px; flex: none; display: grid; place-items: center; border-radius: 7px; background: linear-gradient(135deg, #00979d, #005c62); color: #fff; }
.rl-more { margin: 6px 4px; }
.rl-more summary { cursor: pointer; font-size: 12px; color: var(--rl-muted); padding: 4px; }

/* asboblar */
.rl-tools { display: flex; align-items: center; gap: 6px; padding: 0 10px; background: var(--rl-panel); border-bottom: 1px solid var(--rl-line); min-width: 0; overflow-x: auto; }
.rl-run { display: inline-flex; align-items: center; gap: 8px; padding: 7px 16px; border-radius: 9px; border: 0; background: linear-gradient(135deg, #16a34a, #22c55e); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; box-shadow: 0 6px 16px -8px #22c55e; }
.rl-run.is-running { background: linear-gradient(135deg, #dc2626, #ef4444); box-shadow: 0 6px 16px -8px #ef4444; }
.rl-run.is-building { background: var(--rl-panel-2); color: var(--rl-text); box-shadow: none; border: 1px solid var(--rl-line); }
.rl-speed { display: inline-flex; align-items: center; gap: 4px; color: var(--rl-muted); }
.rl-speed select { background: var(--rl-panel-2); border: 1px solid var(--rl-line); border-radius: 7px; padding: 4px; }
.rl-status { font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.rl-status[data-state="running"] { color: var(--rl-ok); background: color-mix(in srgb, var(--rl-ok) 12%, transparent); }
.rl-status[data-state="running"]::before { content: "● "; animation: rl-blink 1s infinite; }
.rl-status[data-state="paused"] { color: var(--rl-warn); background: color-mix(in srgb, var(--rl-warn) 12%, transparent); }
.rl-clock { font: 12px var(--rl-mono); color: var(--rl-muted); white-space: nowrap; }
.rl-save { font-size: 11.5px; color: var(--rl-muted); white-space: nowrap; margin-left: 4px; }
.rl-save[data-state="saving"] { color: var(--rl-warn); }
@keyframes rl-blink { 50% { opacity: .3; } }

/* sxema va robot maydoni bitta katakda */
.rl-views { position: relative; min-height: 0; overflow: hidden; }
.rl-views > .rl-canvas, .rl-views > .rl-arena { position: absolute; inset: 0; }
.rl-viewsw { flex: none; }
.rl-viewsw button { display: inline-flex; align-items: center; gap: 5px; padding: 6px 10px; white-space: nowrap; }
.rl-arena__bar button { white-space: nowrap; }
.rl-arena { background: #0b1017; }
.rl-arena__3d { position: absolute; inset: 0; }
.rl-arena__3d canvas { display: block; width: 100% !important; height: 100% !important; }
.rl-arena__bar { position: absolute; left: 12px; top: 12px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rl-arena__bar .rl-input { width: auto; background: color-mix(in srgb, var(--rl-panel) 92%, transparent); }
.rl-arena__bar .rl-seg { background: color-mix(in srgb, var(--rl-panel) 92%, transparent); }
.rl-arena__bar .rl-seg button { padding: 6px 10px; }
.rl-arena__stats { position: absolute; right: 12px; bottom: 12px; display: grid; grid-template-columns: repeat(4, minmax(86px, auto)); gap: 6px; }
.rl-arena__stat { background: color-mix(in srgb, var(--rl-panel) 90%, transparent); border: 1px solid var(--rl-line); border-radius: 10px; padding: 6px 10px; display: grid; }
.rl-arena__stat b { font: 700 16px var(--rl-mono); color: var(--rl-accent); }
.rl-arena__stat span { font-size: 11px; color: var(--rl-muted); }
.rl-arena__hint { position: absolute; left: 12px; bottom: 14px; font-size: 11.5px; color: #9fb0c3; background: rgba(10, 16, 24, .6); padding: 4px 8px; border-radius: 7px; }
.rl-arena__empty { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; gap: 10px; padding: 20px; color: var(--rl-muted); }
.rl-arena__empty > i { font-size: 46px; color: var(--rl-accent); }
.rl-arena__empty h3 { margin: 0; color: #e6edf3; }
.rl-arena__empty p { margin: 0 auto; max-width: 520px; }
.rl-arena__kits { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 6px; }
.rl-arena__msg { color: #e6edf3; padding: 30px; text-align: center; }

/* sxema maydoni */
.rl-canvas { position: relative; background: var(--rl-canvas); overflow: hidden; min-height: 0; }
.rl-svg { width: 100%; height: 100%; display: block; cursor: default; outline: none; touch-action: none; user-select: none; }
.rl-svg.is-panning { cursor: grabbing; }
.rl-grid-dot { fill: var(--rl-grid); }
.rl-grid-line { fill: none; stroke: var(--rl-grid-2); stroke-width: .6; }
.rl-hint { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); background: color-mix(in srgb, var(--rl-panel) 92%, transparent); border: 1px solid var(--rl-line); padding: 8px 14px; border-radius: 10px; color: var(--rl-muted); font-size: 12.5px; max-width: min(640px, 90%); text-align: center; pointer-events: none; box-shadow: var(--rl-shadow); }
.rl-tip { position: absolute; display: none; pointer-events: none; background: #0b1220; color: #e6edf3; font: 12px var(--rl-mono); padding: 5px 9px; border-radius: 7px; box-shadow: var(--rl-shadow); white-space: nowrap; z-index: 5; }
.rl-warnbar { position: absolute; left: 12px; right: 12px; bottom: 12px; display: grid; gap: 6px; pointer-events: none; }
.rl-warn { pointer-events: auto; display: flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 10px; font-size: 13px; background: color-mix(in srgb, var(--rl-warn) 16%, var(--rl-panel)); border: 1px solid color-mix(in srgb, var(--rl-warn) 50%, transparent); box-shadow: var(--rl-shadow); }
.rl-warn--error { background: color-mix(in srgb, var(--rl-bad) 18%, var(--rl-panel)); border-color: color-mix(in srgb, var(--rl-bad) 55%, transparent); }
.rl-warn__x { margin-left: auto; background: none; border: 0; font-size: 18px; cursor: pointer; color: var(--rl-muted); }

.rl-part { cursor: grab; }
.rl-selbox { fill: none; stroke: none; }
.rl-part.is-selected > .rl-selbox { stroke: var(--rl-accent); stroke-width: 1.5; stroke-dasharray: 5 4; fill: color-mix(in srgb, var(--rl-accent) 5%, transparent); }
.is-simulating .rl-part { cursor: pointer; }
.rl-pin { fill: transparent; stroke: transparent; stroke-width: 1.5; cursor: crosshair; transition: r .1s; }
.rl-pin:hover { fill: color-mix(in srgb, var(--rl-accent) 45%, transparent); stroke: var(--rl-accent); r: 6; }
.rl-pin.is-used { fill: color-mix(in srgb, var(--rl-accent) 25%, transparent); }
.rl-wire { cursor: pointer; }
.rl-wire__hit { fill: none; stroke: transparent; stroke-width: 12; }
.rl-wire__shadow { fill: none; stroke: rgba(0, 0, 0, .35); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; transform: translate(.8px, 1.4px); }
.rl-wire__line { fill: none; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.rl-wire.is-selected .rl-wire__line { stroke-width: 4; filter: drop-shadow(0 0 4px var(--rl-accent)); }
.rl-wire-preview { fill: none; stroke: var(--rl-accent); stroke-width: 2.5; stroke-dasharray: 6 5; stroke-linecap: round; }

/* ------------------------------------------------------------- plata grafikasi (boardart.js) */
.rb-pcb { stroke: rgba(0, 0, 0, .35); stroke-width: 1; }
.rb-outline { fill: none; stroke: rgba(255, 255, 255, .28); stroke-width: .8; }
.rb-traces path { fill: none; stroke: rgba(160, 255, 250, .12); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.rb-mount { fill: #d8b25c; stroke: #a37f2a; stroke-width: .6; }
.rb-mount-hole { fill: #0b0f14; }
.rb-usb { stroke: #6f7882; stroke-width: .8; }
.rb-usb-in { fill: #2b2f35; stroke: #111; stroke-width: .6; }
.rb-usb-tongue { fill: #e9edf1; }
.rb-jack { stroke: #000; stroke-width: .8; }
.rb-jack-ring { fill: #1b1d20; stroke: #4a4e54; stroke-width: 1.2; }
.rb-jack-pin { fill: #9aa3ac; }
.rb-hdr-base { stroke: #000; stroke-width: .6; }
.rb-sock { fill: #1c1f23; stroke: #3a3f46; stroke-width: .5; }
.rb-sock-in { stroke: #6b5313; stroke-width: .4; }
.rb-pad { stroke: #8a6714; stroke-width: .5; }
.rb-pad-hole { fill: #10161c; }
.rb-chip { stroke: #000; stroke-width: .6; }
.rb-chip-notch { fill: #0c0d0f; stroke: #3a3d42; stroke-width: .5; }
.rb-chip-dot { fill: #3d4249; }
.rb-chip-text { fill: #c9ced5; font: 700 7px var(--rl-mono); letter-spacing: .06em; }
.rb-chip-sub { fill: #8e959d; font: 600 5px var(--rl-font); letter-spacing: .12em; text-transform: uppercase; }
.rb-crystal { stroke: #7d868f; stroke-width: .6; }
.rb-crystal-text { fill: #4b535c; font: 700 4.6px var(--rl-mono); }
.rb-cap { stroke: #6b7682; stroke-width: .6; }
.rb-cap-mark { fill: none; stroke: #2b3a7a; stroke-width: 2.4; }
.rb-cap-cross { stroke: rgba(60, 70, 80, .55); stroke-width: .8; }
.rb-icsp-base { fill: #15181c; stroke: #000; stroke-width: .5; }
.rb-btn-frame { stroke: #7c858e; stroke-width: .6; }
.rb-reset-btn { fill: #c62828; stroke: #7f1515; stroke-width: .8; }
.rb-reset-btn--white { fill: #f1f3f5; stroke: #9aa3ad; }
/* Yozuvlar: oq, qalin, to'q kontur bilan — har qanday masshtabda o'qiladi */
.rb-silk { fill: #f5fbfb; font-family: var(--rl-mono); font-weight: 700; paint-order: stroke; stroke: rgba(0, 45, 48, .75); stroke-width: 1.5px; stroke-linejoin: round; letter-spacing: .02em; text-rendering: geometricPrecision; }
.rb-silk--num { font-weight: 800; }
.rb-silk--narrow { letter-spacing: -.06em; }
.rb-silk--pwm { fill: #ffe08a; font-weight: 800; }
.rb-silk--title { font-family: var(--rl-font); font-weight: 800; letter-spacing: .12em; fill: #e9f7f6; }
.rb-bracket { fill: none; stroke: rgba(240, 252, 252, .85); stroke-width: .9; }
.rb-logo-inf circle { fill: none; stroke: #f4fbfb; stroke-width: 3.2; }
.rb-logo-sign { stroke: #f4fbfb; stroke-width: 1.8; stroke-linecap: round; }
.rb-logo-big { fill: #f7fcfc; font: 800 italic 26px var(--rl-font); letter-spacing: .01em; paint-order: stroke; stroke: rgba(0, 40, 44, .45); stroke-width: 1px; }
.rb-logo-big--sm { font-size: 18px; }
.rb-logo-small { fill: #eaf7f6; font: 800 9px var(--rl-font); letter-spacing: .32em; }
.rb-smd-led { fill: #e6e9ed; stroke: #8f979f; stroke-width: .5; transition: fill .05s; }
.rb-smd-led.is-on[data-color="amber"] { fill: #ffcc33; stroke: #ffe58a; filter: drop-shadow(0 0 5px #ffcc33); }
.rb-smd-led.is-on[data-color="green"] { fill: #4dff88; stroke: #b6ffcf; filter: drop-shadow(0 0 5px #4dff88); }
.rb-smd-led.is-on[data-color="red"] { fill: #ff5544; stroke: #ffb3aa; filter: drop-shadow(0 0 5px #ff5544); }
.rl-board.is-selected > .rl-selbox { stroke-width: 2; }

/* ------------------------------------------------------------- qurilmalar grafikasi */
.pt-leg { stroke: #a9b1ba; stroke-width: 2; fill: none; stroke-linecap: round; }
.pt-glow { filter: url(#rl-glow); pointer-events: none; }
.pt-led-body { stroke: rgba(0, 0, 0, .35); stroke-width: .8; opacity: .92; transition: filter .05s; }
.pt-led-rim { opacity: .8; }
.pt-shine { stroke: rgba(255, 255, 255, .7); stroke-width: 1.6; fill: none; stroke-linecap: round; }
.pt-crack { stroke: #111; stroke-width: 1.6; fill: none; }
.pt-rgb-body { fill: #e8eef2; stroke: #9aa3ad; stroke-width: .8; opacity: .95; }
.pt-rgb-rim { fill: #cfd6dc; }
.pt-res-body { fill: #e3cfa5; stroke: #b39a6a; stroke-width: .8; }
.pt-btn-base { fill: #2b2f35; stroke: #111; }
.pt-btn-cap { fill: #3d79c8; stroke: #234b80; stroke-width: 1.2; cursor: pointer; transition: transform .05s; transform-origin: 20px 18px; }
.pt-btn-cap.is-down { transform: scale(.88); fill: #2a5ea3; }
.pt-sw-base { fill: #1f2937; }
.pt-sw-slot { fill: #0b0f14; }
.pt-sw-knob { fill: #e5e7eb; transition: x .1s; }
.pt-pot-base { fill: #1f6fb2; stroke: #134a78; }
.pt-pot-knob { fill: #d3d8de; stroke: #8f99a4; stroke-width: 1.2; }
.pt-pot-mark { fill: #333; }
.pt-ldr-body { fill: #e9d8b4; stroke: #b49a62; }
.pt-ldr-track { stroke: #b2442b; stroke-width: 1.4; }
.pt-buzz-body { fill: #1a1a1a; stroke: #000; }
.pt-buzz-hole { fill: #444; }
.pt-wave, .pt-sound { fill: none; stroke: var(--rl-accent); stroke-width: 2; stroke-linecap: round; }
.pt-sound { stroke-dasharray: 4 4; animation: rl-dash .4s linear infinite; }
@keyframes rl-dash { to { stroke-dashoffset: -8; } }
.pt-mini { fill: var(--rl-text); font: 600 8px var(--rl-mono); }
.pt-mini--light { fill: #f2f6f8; }
.pt-mini--xs { font-size: 5.5px; }
.pt-seg-body { fill: #1a1a1a; stroke: #000; }
.pt-seg { fill: none; stroke: #3a1414; stroke-width: 6; stroke-linecap: round; }
.pt-seg--dp { fill: #3a1414; stroke: none; }
.pt-seg.is-on { stroke: #ff3b30; filter: drop-shadow(0 0 4px #ff3b30); }
.pt-seg--dp.is-on { fill: #ff3b30; stroke: none; }
.pt-wire3 { stroke-width: 3; fill: none; }
.pt-servo-body { fill: #2457a6; stroke: #163a72; }
.pt-servo-top { fill: #2c64bb; stroke: #163a72; }
.pt-servo-horn { stroke: #f2f2f2; stroke-width: 7; stroke-linecap: round; }
.pt-servo-hub { fill: #ddd; stroke: #999; }
.pt-sr-pcb { fill: #1c5fa6; stroke: #0f3e70; }
.pt-sr-can { fill: #c8ced5; stroke: #8e98a3; }
.pt-sr-mesh { fill: #2b2f35; }
.pt-wall { fill: #8b5e3c; stroke: #5c3d26; }
.pt-dht { stroke: rgba(0, 0, 0, .3); }
.pt-dht--11 { fill: #2f7fd1; }
.pt-dht--22 { fill: #f2f2f2; }
.pt-dht-hole { fill: rgba(0, 0, 0, .35); }
.pt-lcd-pcb { fill: #1f7a3f; stroke: #0f4d26; }
.pt-lcd-frame { fill: #111; }
.pt-lcd-glass { fill: #355f2a; transition: fill .2s; }
.pt-lcd-glass.is-lit { fill: #8fd14f; }
.pt-lcd-cell { fill: rgba(0, 0, 0, .08); }
.pt-lcd-text { fill: #0e2108; font: 700 11px var(--rl-mono); }
.pt-hdr-base { fill: #15181c; }
.pt-pir-dome { fill: #f4f4f4; stroke: #cfcfcf; }
.pt-pir-lens { fill: none; stroke: #dcdcdc; }
.pt-ir-tx { fill: #dfe7f0; stroke: #9aa3ad; }
.pt-ir-rx { fill: #1a1a1a; stroke: #000; }
.pt-smd-led-off { fill: #4b5563; }
.pt-smd-led-off.is-on { fill: #4dff88; filter: drop-shadow(0 0 4px #4dff88); }
.pt-l298-pcb { fill: #b4232a; stroke: #7a141a; }
.pt-heatsink { fill: #2b2b2b; }
.pt-fin { fill: #444; }
.pt-term { fill: #2a7de1; stroke: #134f99; }
.pt-motor { fill: #f2c94c; stroke: #c49a1c; }
.pt-chassis { fill: rgba(92, 200, 255, .35); stroke: #3a9fd8; stroke-width: 1.4; }
.pt-tread { fill: #3a3a3a; }
.pt-arrow { fill: #f2f6f8; opacity: .8; }
.pt-caster { fill: #c8ced5; stroke: #8e98a3; }
.pt-tcrt { fill: #1a1a1a; }
.pt-oled-pcb { fill: #1b4fa0; stroke: #10336b; }
.pt-oled-glass { fill: #05080c; stroke: #2a2f36; }
.pt-chip-sq { fill: #1d1f22; stroke: #000; }
.pt-axis { stroke: #ffd166; stroke-width: 2; fill: none; marker-end: none; }
.pt-relay-pcb { fill: #1f5fa8; stroke: #133e70; }
.pt-relay-box { fill: #3b82f6; stroke: #1e40af; }
.pt-relay-arm { stroke: #e5e7eb; stroke-width: 2.4; stroke-linecap: round; transition: transform .08s; }
.pt-relay-dot { fill: #c9a24a; }
.pt-uln-pcb { fill: #127a3e; stroke: #0b4f27; }
.pt-stepper { fill: #c8ced5; stroke: #7d868f; stroke-width: 1.2; }
.pt-stepper-face { fill: #2b5cab; stroke: #1b3c73; }
.pt-stepper-hub { fill: #f2c230; stroke: #a57d00; }
.pt-stepper-pointer { fill: #f2c230; }
.pt-stepper-wire { fill: none; stroke: #e53935; stroke-width: 4; stroke-linecap: round; }
.pt-keypad { fill: #1f2937; stroke: #0b0f14; }
.pt-ribbon { stroke: #cfd6dc; stroke-width: 2.4; }
.pt-key { cursor: pointer; }
.pt-key-cap { fill: #e5e7eb; stroke: #9ca3af; stroke-width: 1; transition: transform .05s; }
.pt-key-cap--fn { fill: #fca5a5; stroke: #ef4444; }
.pt-key.is-down .pt-key-cap { fill: #14b8a6; stroke: #0f766e; }
.pt-key-text { fill: #111827; font: 800 12px var(--rl-font); pointer-events: none; }
.pt-tyre { fill: #222; }
.pt-rim { fill: #f2c94c; }
.pt-spoke { fill: #c49a1c; }
.pt-batt { fill: #2b2b2b; stroke: #111; }
.pt-batt-top { fill: #c49a1c; }
.pt-batt-term { fill: #c0c6cc; stroke: #8e98a3; }
.pt-meter { fill: #f2b705; stroke: #a57d00; }
.pt-meter-lcd { fill: #c6d6b4; stroke: #5b6b4c; }
.pt-meter-text { fill: #18240f; font: 700 13px var(--rl-mono); }
.pt-jack-com { fill: #111; }
.pt-jack-v { fill: #c62828; }

/* ------------------------------------------------------------- pastki panel */
.rl-split { cursor: row-resize; background: var(--rl-line); }
.rl-split:hover { background: var(--rl-accent); }
.rl-bottom { display: grid; grid-template-rows: 36px minmax(0, 1fr); background: var(--rl-panel); min-height: 0; }
.rl-bottom__tabs { display: flex; gap: 2px; padding: 0 8px; border-bottom: 1px solid var(--rl-line); }
.rl-bottom__tabs button { background: none; border: 0; border-bottom: 2px solid transparent; padding: 0 12px; cursor: pointer; color: var(--rl-muted); font-weight: 600; font-size: 13px; }
.rl-bottom__tabs button.is-active { color: var(--rl-text); border-bottom-color: var(--rl-accent); }
.rl-count { display: inline-block; min-width: 16px; margin-left: 4px; padding: 0 5px; border-radius: 99px; background: var(--rl-bad); color: #fff; font-size: 10px; line-height: 16px; }
.rl-count:empty { display: none; }
.rl-bottom__pane { min-height: 0; overflow: hidden; display: flex; flex-direction: column; }
.rl-editor { flex: 1; min-height: 0; overflow: hidden; }
.rl-editor .cm-editor { height: 100%; font-size: 13.5px; }
.rl-editor .cm-scroller { font-family: var(--rl-mono); }
.rl-serial { flex: 1; margin: 0; padding: 10px 12px; overflow: auto; font: 12.5px/1.5 var(--rl-mono); background: var(--rl-canvas); color: var(--rl-text); white-space: pre-wrap; }
.rl-serial__in { display: flex; gap: 6px; padding: 6px 8px; border-top: 1px solid var(--rl-line); }
.rl-plot { flex: 1; width: 100%; min-height: 0; }
.rl-plot__hint { position: absolute; margin: 16px; font-size: 12.5px; }
.rl-bottom__pane[data-pane="plot"] { position: relative; }
.rl-log { overflow: auto; padding: 6px 0; font-size: 13px; flex: 1; }
.rl-log__row { display: flex; gap: 10px; padding: 3px 12px; }
.rl-log__row time { color: var(--rl-muted); font: 11.5px var(--rl-mono); flex: none; padding-top: 1px; }
.rl-log__row--ok span { color: var(--rl-ok); }
.rl-log__row--warn span { color: var(--rl-warn); }
.rl-log__row--error span { color: var(--rl-bad); font-weight: 600; }
.rl-log__compiler { margin: 4px 12px; padding: 8px 10px; background: var(--rl-canvas); border-radius: 8px; font: 12px/1.5 var(--rl-mono); white-space: pre-wrap; color: var(--rl-muted); }
.rl-errline { color: var(--rl-bad); text-decoration: underline dotted; }
.rl-errline--warning { color: var(--rl-warn); }
.rl-errline--note { color: var(--rl-accent-2); }

/* ------------------------------------------------------------- o'ng panel */
.rl-side__tabs { display: flex; border-bottom: 1px solid var(--rl-line); }
.rl-side__tabs button { flex: 1; background: none; border: 0; border-bottom: 2px solid transparent; padding: 11px 6px; cursor: pointer; color: var(--rl-muted); font-weight: 600; }
.rl-side__tabs button.is-active { color: var(--rl-text); border-bottom-color: var(--rl-accent); }
.rl-side__pane { overflow: auto; flex: 1; min-height: 0; padding-bottom: 24px; }
.rl-props__head { display: flex; align-items: center; gap: 4px; padding: 12px 10px 6px 14px; }
.rl-props__head h3 { margin: 0; font-size: 15px; flex: 1; }
.rl-desc { color: var(--rl-muted); font-size: 12.5px; margin: 0 0 10px; }
.rl-field { display: grid; gap: 5px; margin-bottom: 12px; font-size: 13px; }
.rl-field__row { display: flex; justify-content: space-between; gap: 8px; }
.rl-field output { font: 600 12px var(--rl-mono); color: var(--rl-accent); }
.rl-field input[type="range"] { width: 100%; accent-color: var(--rl-accent); }
.rl-field--check { display: flex; align-items: center; gap: 8px; }
.rl-field--check input { width: 18px; height: 18px; accent-color: var(--rl-accent); }
.rl-field.is-live { background: color-mix(in srgb, var(--rl-accent) 6%, transparent); border-left: 3px solid var(--rl-accent); padding-top: 8px; padding-bottom: 8px; }
.rl-live { font-style: normal; font-size: 10.5px; color: var(--rl-accent); margin-left: 4px; }
.rl-side h4 { margin: 14px 0 6px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--rl-muted); }
.rl-pinlist { display: grid; }
.rl-pinrow { display: grid; grid-template-columns: 70px 1fr auto; gap: 8px; padding: 5px 14px; border-top: 1px solid var(--rl-line); font-size: 12.5px; align-items: center; }
.rl-pinrow b { font: 600 12px var(--rl-mono); }
.rl-volt { font: 12px var(--rl-mono); color: var(--rl-accent); white-space: nowrap; }
.rl-swatches { display: flex; flex-wrap: wrap; gap: 6px; }
.rl-swatch { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--rl-line); cursor: pointer; }
.rl-swatch.is-active { border-color: var(--rl-text); }
.rl-boardcard { margin-top: 12px; }
.rl-boardcard h4 { margin: 0; color: var(--rl-text); text-transform: none; letter-spacing: 0; font-size: 14px; }
.rl-boardcard p { margin: 4px 0; font-size: 12.5px; }

/* laboratoriya paneli */
.rl-lab { padding: 14px; display: grid; gap: 12px; }
.rl-lab__head { display: flex; gap: 10px; align-items: center; }
.rl-lab__head small { color: var(--rl-muted); font: 11.5px var(--rl-mono); }
.rl-lab__head h2 { margin: 2px 0 0; font-size: 17px; }
.rl-done { padding: 8px 12px; border-radius: 10px; background: color-mix(in srgb, var(--rl-ok) 14%, transparent); color: var(--rl-ok); font-weight: 600; }
.rl-lab__sec h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--rl-muted); }
.rl-lab__sec p { margin: 0; font-size: 13.5px; }
.rl-lab__sec b { color: var(--rl-accent); font-family: var(--rl-mono); font-weight: 600; }
.rl-partlist, .rl-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; font-size: 13.5px; }
.rl-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13px; }
.rl-checks li { display: flex; gap: 8px; align-items: baseline; padding: 7px 10px; border-radius: 9px; background: var(--rl-panel-2); color: var(--rl-muted); }
.rl-checks li.is-ok { color: var(--rl-text); background: color-mix(in srgb, var(--rl-ok) 12%, transparent); }
.rl-checks li.is-ok i { color: var(--rl-ok); }
.rl-q { padding: 10px; border-radius: 10px; background: var(--rl-panel-2); display: grid; gap: 4px; font-size: 13.5px; margin-bottom: 8px; }
.rl-q p { margin: 0 0 4px; font-weight: 600; }
.rl-q__opt { display: flex; gap: 6px; align-items: center; padding: 3px 6px; border-radius: 7px; cursor: pointer; }
.rl-q__opt.is-right { background: color-mix(in srgb, var(--rl-ok) 15%, transparent); }
.rl-q__opt.is-wrong { background: color-mix(in srgb, var(--rl-bad) 15%, transparent); }
.rl-ok { color: var(--rl-ok); } .rl-bad { color: var(--rl-bad); } .rl-warntext { color: var(--rl-warn); }
.rl-item__name em { font-style: normal; font-weight: 600; }
.rl-lab__actions { display: flex; flex-wrap: wrap; gap: 6px; }

/* bildirishnomalar */
.rl-toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.rl-toast { background: var(--rl-panel); border: 1px solid var(--rl-line); border-left: 4px solid var(--rl-accent); padding: 10px 14px; border-radius: 10px; box-shadow: var(--rl-shadow); max-width: 360px; transition: opacity .4s, transform .4s; }
.rl-toast--ok { border-left-color: var(--rl-ok); }
.rl-toast--warn { border-left-color: var(--rl-warn); }
.rl-toast--error { border-left-color: var(--rl-bad); }
.rl-toast.is-out { opacity: 0; transform: translateY(8px); }

/* hisobot */
.rl-modal { position: fixed; inset: 0; z-index: 60; background: rgba(5, 10, 18, .6); display: grid; place-items: start center; overflow: auto; padding: 30px 12px; }
.rl-report { width: min(860px, 100%); background: #fff; color: #111; border-radius: 12px; padding: 28px 34px; font: 14px/1.55 var(--rl-font); }
.rl-report h1 { margin: 0 0 4px; font-size: 22px; }
.rl-report h2 { margin: 0 0 14px; font-size: 17px; color: #0f766e; }
.rl-report h3 { margin: 18px 0 6px; font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: #475569; }
.rl-report__bar { display: flex; gap: 8px; justify-content: flex-end; margin-bottom: 10px; }
.rl-report__meta { display: grid; grid-template-columns: 120px 1fr; gap: 2px 12px; margin: 0; }
.rl-report__meta dt { color: #64748b; }
.rl-report__meta dd { margin: 0; font-weight: 600; }
.rl-report__svg svg { width: 100%; height: auto; max-height: 520px; background: #f7f9fb; border: 1px solid #e2e8f0; border-radius: 8px; }
.rl-report__code { background: #f1f5f9; border-radius: 8px; padding: 10px; font: 12px/1.5 var(--rl-mono); white-space: pre-wrap; }
.rl-report__notes { background: #fff; color: #111; border-color: #cbd5e1; }
@media print {
  body > *:not(.rl-modal), .rl > * { display: none !important; }
  .rl-modal { position: static; background: none; padding: 0; display: block !important; }
  .rl-report { box-shadow: none; width: 100%; padding: 0; }
  .rl-report__bar { display: none; }
  .rl { position: static; display: block; background: #fff; }
}

/* ------------------------------------------------------------- moslashuvchanlik */
@media (max-width: 1180px) {
  .rl-main--work { grid-template-columns: 210px minmax(0, 1fr) 290px; }
  .rl-arena__stats { grid-template-columns: repeat(2, minmax(86px, auto)); }
  .rl-arena__hint { display: none; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  .rl { position: static; min-height: 100%; }
  .rl-main--work { grid-template-columns: 1fr; grid-auto-rows: auto; }
  .rl-stage { grid-template-rows: auto 60vh 6px 320px; }
  .rl-lib { max-height: 260px; border-right: 0; border-bottom: 1px solid var(--rl-line); }
  .rl-side { border-left: 0; border-top: 1px solid var(--rl-line); }
  .rl-crumb, .rl-back span { display: none; }
}
