/* RoboLab GBX — interface styles */
:root {
  --rl-ink: #0f1b2d;
  --rl-ink-2: #172a44;
  --rl-ink-3: #22395c;
  --rl-accent: #20c3e8;
  --rl-accent-2: #0a8fb0;
  --rl-run: #ff7a1a;
  --rl-run-2: #f05d00;
  --rl-ok: #22c55e;
  --rl-bg: #e9eef4;
  --rl-panel: #ffffff;
  --rl-line: #dde4ec;
  --rl-text: #1d2a3a;
  --rl-muted: #6b7a8c;
  --rl-radius: 12px;
  --rl-font: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --rl-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;
}

html, body { height: 100%; }
.rl-body {
  margin: 0;
  font-family: var(--rl-font);
  color: var(--rl-text);
  background: var(--rl-bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ---------------- top bar ---------------- */
.rl-top {
  height: 58px;
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 14px;
  background: linear-gradient(180deg, var(--rl-ink-2), var(--rl-ink));
  color: #e8f4fb;
  box-shadow: 0 2px 0 rgba(32, 195, 232, .25);
  position: relative;
  z-index: 20;
}
.rl-brand { display: flex; align-items: center; gap: 9px; color: inherit; text-decoration: none; margin-right: 6px; }
.rl-brand-txt { display: flex; flex-direction: column; line-height: 1.05; }
.rl-brand-txt b { font-size: 19px; font-weight: 900; letter-spacing: .2px; }
.rl-brand-txt small { font-size: 11px; color: #8fb3c9; font-weight: 700; }
.rl-top-group { display: flex; align-items: center; gap: 4px; }
.rl-tbtn {
  color: #cfe3ef; background: transparent; border: 0; border-radius: 9px;
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; padding: 6px 10px;
}
.rl-tbtn:hover, .rl-tbtn:focus-visible, .rl-tbtn.show { color: #fff; background: rgba(255, 255, 255, .09); }
.rl-tbtn:disabled { color: #5d7790; background: transparent; }
.rl-tbtn.rl-icon { padding: 6px 9px; }
.rl-tbtn .bi { font-size: 16px; }
.rl-name {
  width: 190px; margin-left: 6px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .12);
  color: #fff; font-weight: 700; border-radius: 9px; height: 34px;
}
.rl-name::placeholder { color: #7f9ab0; }
.rl-name:focus { background: rgba(255, 255, 255, .12); color: #fff; border-color: var(--rl-accent); box-shadow: 0 0 0 3px rgba(32, 195, 232, .25); }

.rl-top-run { display: flex; align-items: center; gap: 8px; margin-left: 10px; }
.rl-run, .rl-stop {
  border: 0; border-radius: 11px; font-weight: 900; font-size: 15px; padding: 7px 18px 7px 14px;
  display: inline-flex; align-items: center; gap: 6px; color: #fff; letter-spacing: .2px;
}
.rl-run { background: linear-gradient(180deg, var(--rl-run), var(--rl-run-2)); box-shadow: 0 3px 0 #b84500, 0 6px 16px rgba(255, 122, 26, .35); }
.rl-run:hover { color: #fff; filter: brightness(1.06); }
.rl-run:active { transform: translateY(2px); box-shadow: 0 1px 0 #b84500; }
.rl-run:disabled { opacity: .7; color: #fff; }
.rl-run .bi, .rl-stop .bi { font-size: 20px; }
.rl-stop { background: linear-gradient(180deg, #ef4444, #c62828); box-shadow: 0 3px 0 #8e1b1b; }
.rl-stop:hover { color: #fff; filter: brightness(1.06); }
.rl-status {
  display: inline-flex; align-items: center; gap: 7px; font-size: 13px; font-weight: 800; color: #9fbdd0;
  background: rgba(255, 255, 255, .06); border-radius: 999px; padding: 5px 12px;
}
.rl-status-dot { width: 9px; height: 9px; border-radius: 50%; background: #5d7790; }
.rl-status[data-state="running"] { color: #b9f6ca; }
.rl-status[data-state="running"] .rl-status-dot { background: var(--rl-ok); box-shadow: 0 0 0 0 rgba(34, 197, 94, .6); animation: rl-pulse 1.4s infinite; }
.rl-status[data-state="compiling"] .rl-status-dot { background: #ffc107; animation: rl-blink .6s infinite alternate; }
.rl-speed { font-family: var(--rl-mono); font-weight: 400; font-size: 12px; color: #8fb3c9; }
.rl-speed:empty { display: none; }
@keyframes rl-pulse { 70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); } 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); } }
@keyframes rl-blink { to { opacity: .3; } }

.rl-ex-menu { width: 360px; max-height: 70vh; overflow: auto; padding: 6px; border-radius: 12px; }
.rl-ex-item { display: grid !important; grid-template-columns: 28px 1fr auto; align-items: center; gap: 8px; border-radius: 9px; padding: 8px 10px; white-space: normal; }
.rl-ex-item .bi { font-size: 20px; color: var(--rl-accent-2); }
.rl-ex-item strong { display: block; font-weight: 800; font-size: 14px; }
.rl-ex-item small { display: block; color: var(--rl-muted); font-size: 12px; line-height: 1.25; }
.rl-level { font-style: normal; font-size: 10.5px; font-weight: 800; padding: 2px 7px; border-radius: 999px; background: #eef2f7; color: #51637a; white-space: nowrap; }
.rl-level-1 { background: #e3f9e9; color: #18794e; }
.rl-level-2 { background: #fff4d6; color: #9a6200; }
.rl-level-3 { background: #fde6ea; color: #b4233c; }
.dropdown-item .bi { margin-right: 4px; }

/* ---------------- main grid ---------------- */
.rl-main {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr) 430px;
}

/* palette */
.rl-palette { background: var(--rl-panel); border-right: 1px solid var(--rl-line); display: flex; flex-direction: column; min-height: 0; }
.rl-pal-head { padding: 12px 12px 8px; border-bottom: 1px solid var(--rl-line); }
.rl-pal-head h2 { font-size: 13px; font-weight: 900; text-transform: uppercase; letter-spacing: .8px; color: var(--rl-muted); margin: 0 0 8px; }
.rl-search { position: relative; }
.rl-search .bi { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--rl-muted); font-size: 13px; }
.rl-search input { padding-left: 30px; border-radius: 9px; }
.rl-pal-list { flex: 1; overflow: auto; padding: 8px 10px 4px; }
.rl-cat { margin-bottom: 10px; }
.rl-cat-title { font-size: 11.5px; font-weight: 900; color: var(--rl-accent-2); text-transform: uppercase; letter-spacing: .6px; margin: 4px 2px 6px; }
.rl-cat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.rl-pal-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 7px 4px 6px;
  border: 1px solid var(--rl-line); background: #f8fafc; border-radius: 11px; cursor: grab; touch-action: none;
  transition: transform .12s, border-color .12s, box-shadow .12s, background .12s; user-select: none;
}
.rl-pal-item:hover { border-color: var(--rl-accent); background: #fff; box-shadow: 0 4px 12px rgba(15, 27, 45, .08); transform: translateY(-1px); }
.rl-pal-item:active { cursor: grabbing; }
.rl-pal-prev { height: 54px; display: flex; align-items: center; justify-content: center; pointer-events: none; }
.rl-pal-name { font-size: 12px; font-weight: 800; text-align: center; line-height: 1.15; color: var(--rl-text); pointer-events: none; }
.rl-pal-hint { font-size: 11.5px; color: var(--rl-muted); padding: 8px 12px 10px; margin: 0; border-top: 1px solid var(--rl-line); }

.rl-ghost { position: fixed; z-index: 2000; pointer-events: none; transform: translate(-50%, -50%) scale(.6); opacity: 0; transition: opacity .1s, transform .1s; filter: drop-shadow(0 8px 14px rgba(0, 0, 0, .25)); }
.rl-ghost.on { opacity: .95; transform: translate(-50%, -50%) scale(1); }

/* stage */
.rl-stage { position: relative; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.rl-canvas { position: relative; flex: 1; min-height: 0; overflow: hidden; background: #f3f6f9; }
.rl-svg { display: block; width: 100%; height: 100%; touch-action: none; outline: none; user-select: none; -webkit-user-select: none; }
.rl-grid-dot { fill: #c6d0db; }
.rl-part { cursor: move; }
.rl-part-breadboard, .rl-part-uno { filter: drop-shadow(0 3px 4px rgba(15, 27, 45, .14)); }
.rl-selbox { fill: none; stroke: var(--rl-accent); stroke-width: 1.2; stroke-dasharray: 4 3; pointer-events: none; vector-effect: non-scaling-stroke; }
.rl-flash { animation: rl-flash 1s ease 2; }
@keyframes rl-flash { 50% { filter: drop-shadow(0 0 6px #ff7a1a) drop-shadow(0 0 2px #ff7a1a); } }

.rl-wire { cursor: pointer; }
.rl-wire .w-hit { stroke: transparent; stroke-width: 9; fill: none; pointer-events: stroke; }
.rl-wire .w-out { stroke-width: 3.4; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.rl-wire .w-main { stroke-width: 2.2; fill: none; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.rl-wire .w-end { pointer-events: none; }
.rl-wire:hover .w-out { stroke-width: 4.4; }
.rl-wire.selected .w-out { stroke: var(--rl-accent) !important; stroke-width: 5; }
.rl-draft { fill: none; stroke: var(--rl-accent-2); stroke-width: 2.2; stroke-dasharray: 5 4; stroke-linecap: round; pointer-events: none; }
.rl-pin-hl { fill: rgba(32, 195, 232, .18); stroke: var(--rl-accent-2); stroke-width: 1.2; pointer-events: none; }
.rl-hint-ok { fill: rgba(34, 197, 94, .35); stroke: #16a34a; stroke-width: 1.2; pointer-events: none; }
.rl-hint-free { fill: rgba(239, 68, 68, .2); stroke: #ef4444; stroke-width: .8; pointer-events: none; }
.rl-overlay { pointer-events: none; }

.rl-pin-tip {
  display: none; position: absolute; z-index: 5; pointer-events: none; background: var(--rl-ink); color: #e8f4fb;
  font-size: 12.5px; font-weight: 700; padding: 5px 9px; border-radius: 8px; box-shadow: 0 6px 16px rgba(0, 0, 0, .2); white-space: nowrap;
}

.rl-float { position: absolute; z-index: 6; background: rgba(255, 255, 255, .96); border: 1px solid var(--rl-line); border-radius: var(--rl-radius); box-shadow: 0 8px 24px rgba(15, 27, 45, .1); }
.rl-float-tools { left: 12px; top: 12px; display: flex; align-items: center; gap: 2px; padding: 4px; }
.rl-float-tools .btn { border: 0; border-radius: 8px; padding: 5px 9px; color: var(--rl-text); }
.rl-float-tools .btn:hover { background: #eef3f8; }
.rl-sep { width: 1px; height: 22px; background: var(--rl-line); margin: 0 3px; }
.rl-wire-dot { display: inline-block; width: 16px; height: 16px; border-radius: 50%; vertical-align: -3px; border: 2px solid #fff; box-shadow: 0 0 0 1px #c3ccd6; background: conic-gradient(#e53935, #f2a900, #2e9e4f, #1e63d6, #8e24aa, #e53935); }
.rl-swatches { display: grid; grid-template-columns: repeat(6, 26px); gap: 6px; }
.rl-swatch { width: 26px; height: 26px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px #c3ccd6; padding: 0; cursor: pointer; }
.rl-swatch.active { box-shadow: 0 0 0 2px var(--rl-accent-2); }
.rl-swatch-auto { background: #eef3f8; font-size: 11px; font-weight: 900; color: var(--rl-muted); }

.rl-props { right: 12px; top: 12px; width: 250px; padding: 0; overflow: hidden; }
.rl-props-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px 9px 12px; border-bottom: 1px solid var(--rl-line); background: #f6f9fc; }
.rl-props-title { display: flex; align-items: center; gap: 7px; font-weight: 900; font-size: 14.5px; }
.rl-props-title svg { flex: 0 0 auto; }
.rl-props-body { padding: 10px 12px 12px; }
.rl-props-body .form-label { font-size: 12px; font-weight: 800; color: var(--rl-muted); margin: 8px 0 3px; }
.rl-props-desc, .rl-whatis p { font-size: 12.5px; color: #3c4c60; margin: 0; line-height: 1.4; }
.rl-whatis summary { font-size: 12.5px; font-weight: 800; color: var(--rl-accent-2); cursor: pointer; list-style: none; }
.rl-whatis summary::-webkit-details-marker { display: none; }
.rl-whatis p { margin-top: 6px; background: #f1f8fb; border-radius: 8px; padding: 8px 9px; }
.rl-range-val { font-family: var(--rl-mono); font-size: 12px; min-width: 38px; text-align: right; color: var(--rl-muted); }
.rl-props-actions { display: flex; gap: 6px; margin-top: 12px; }
.rl-props-actions .btn { border-radius: 8px; }

.rl-statusbar {
  flex: 0 0 auto; height: 30px; display: flex; align-items: center; gap: 7px; padding: 0 12px;
  font-size: 12px; color: var(--rl-muted); background: var(--rl-panel); border-top: 1px solid var(--rl-line); white-space: nowrap; overflow: hidden;
}
.rl-statusbar span:not(.rl-cursor) { overflow: hidden; text-overflow: ellipsis; }
.rl-cursor { font-family: var(--rl-mono); }

/* side panel */
.rl-side { background: var(--rl-panel); border-left: 1px solid var(--rl-line); display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.rl-tabs { flex: 0 0 auto; display: flex; flex-wrap: nowrap; gap: 2px; padding: 8px 8px 0; border-bottom: 1px solid var(--rl-line); background: #f6f9fc; }
.rl-tabs .nav-link {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 13.5px; color: var(--rl-muted);
  border: 1px solid transparent; border-bottom: 0; border-radius: 10px 10px 0 0; padding: 8px 11px; position: relative; white-space: nowrap;
}
.rl-tabs .nav-link:hover { color: var(--rl-text); }
.rl-tabs .nav-link.active { background: var(--rl-panel); color: var(--rl-ink); border-color: var(--rl-line); margin-bottom: -1px; }
.rl-tabs .badge { font-size: 10.5px; }
.rl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--rl-ok); display: none; }
.rl-dot.on { display: inline-block; }
.rl-panes { flex: 1; min-height: 0; position: relative; }
.rl-panes > .tab-pane { height: 100%; flex-direction: column; min-height: 0; }
.rl-panes > .tab-pane.active { display: flex; }

.rl-code-bar { display: flex; align-items: center; gap: 6px; padding: 7px 10px; background: #1e1f22; color: #c6cdd6; font-size: 12.5px; }
.rl-file { font-family: var(--rl-mono); margin-right: auto; }
.rl-mini { color: #c6cdd6; border: 0; padding: 2px 7px; }
.rl-mini:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.rl-font { width: 64px; background-color: #2a2c30; border-color: #3a3d42; color: #c6cdd6; font-size: 12px; padding-top: 1px; padding-bottom: 1px; }
.rl-code-wrap { flex: 1; min-height: 0; background: #212121; }
.rl-code-wrap .CodeMirror { height: 100%; font-family: var(--rl-mono); font-size: 14px; line-height: 1.55; }
.rl-err-gutter { width: 16px; }
.rl-err-mark { color: #ff5252; font-size: 12px; line-height: 1.6; padding-left: 2px; cursor: help; }
.rl-err-line { background: rgba(255, 82, 82, .16); }
.rl-compile-out { display: none; flex: 0 0 auto; max-height: 34%; overflow: auto; font-size: 13px; border-top: 1px solid var(--rl-line); }
.rl-compile-out.ok { background: #ecfdf3; color: #146c3b; }
.rl-compile-out.err { background: #fff4f4; color: #8b1d1d; }
.rl-out-title { font-weight: 900; padding: 8px 12px; }
.rl-out-row { padding: 5px 12px 6px; border-top: 1px solid rgba(139, 29, 29, .1); cursor: pointer; font-family: var(--rl-mono); font-size: 12px; }
.rl-out-row:hover { background: rgba(139, 29, 29, .06); }
.rl-out-row.warn { color: #8a5a00; }
.rl-out-line { font-weight: 700; background: rgba(139, 29, 29, .1); border-radius: 5px; padding: 0 5px; margin-right: 4px; }
.rl-compile-out pre { margin: 0; padding: 8px 12px; font-size: 11.5px; white-space: pre-wrap; }

.rl-serial { flex: 1; min-height: 0; position: relative; background: #101418; }
.rl-serial pre { height: 100%; margin: 0; padding: 12px 14px; overflow: auto; color: #b6f3c3; font-family: var(--rl-mono); font-size: 13px; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }
.rl-serial-empty { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 30px; color: #5f7180; font-size: 13.5px; pointer-events: none; }
.rl-serial-bar, .rl-ai-bar { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; padding: 8px; border-top: 1px solid var(--rl-line); background: #f6f9fc; }
.rl-serial-bar .form-control { font-family: var(--rl-mono); }

.rl-tips { flex: 1; overflow: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.rl-tip { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 11px; font-size: 13.5px; font-weight: 600; line-height: 1.4; border: 1px solid transparent; }
.rl-tip .bi { font-size: 17px; margin-top: 1px; }
.rl-tip.clickable { cursor: pointer; }
.rl-tip.clickable:hover { filter: brightness(.97); }
.rl-tip-danger { background: #fff1f1; border-color: #fecaca; color: #8b1d1d; }
.rl-tip-danger .bi { color: #dc2626; }
.rl-tip-warning { background: #fffaeb; border-color: #fde68a; color: #7a4b00; }
.rl-tip-warning .bi { color: #d97706; }
.rl-tip-info { background: #eff8fc; border-color: #cbeaf5; color: #19465a; }
.rl-tip-info .bi { color: var(--rl-accent-2); }
.rl-tips-foot { font-size: 12px; color: var(--rl-muted); text-align: center; margin-top: 2px; }
.rl-empty { text-align: center; color: var(--rl-muted); padding: 40px 20px; }
.rl-empty .bi { font-size: 42px; color: var(--rl-ok); }
.rl-empty p { margin-top: 10px; font-weight: 700; }

.rl-chat { flex: 1; min-height: 0; overflow: auto; padding: 14px 12px; display: flex; flex-direction: column; gap: 10px; background: linear-gradient(180deg, #f6fbfe, #fff 220px); }
.rl-msg { display: flex; gap: 8px; align-items: flex-end; max-width: 92%; }
.rl-msg-user { align-self: flex-end; }
.rl-avatar { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; background: #e3f2fd; display: flex; align-items: center; justify-content: center; }
.rl-bubble { padding: 9px 12px; border-radius: 14px; font-size: 14px; line-height: 1.45; word-break: break-word; }
.rl-msg-assistant .rl-bubble { background: #fff; border: 1px solid var(--rl-line); border-bottom-left-radius: 4px; }
.rl-msg-user .rl-bubble { background: var(--rl-accent-2); color: #fff; border-bottom-right-radius: 4px; }
.rl-typing .rl-bubble { color: var(--rl-muted); font-style: italic; }
.rl-chat-code { background: #1e1f22; color: #e3e6ea; border-radius: 8px; padding: 8px 10px; margin: 6px 0; font-size: 12px; white-space: pre-wrap; }
.rl-bubble code { background: #eef3f8; color: #b4233c; padding: 0 4px; border-radius: 4px; }
.rl-quick { flex: 0 0 auto; display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 10px 0; border-top: 1px solid var(--rl-line); }
.rl-quick .btn { background: #eef6fb; color: var(--rl-accent-2); font-weight: 800; font-size: 12px; border-radius: 999px; padding: 3px 11px; border: 1px solid #d3ebf5; }
.rl-quick .btn:hover { background: #e0f2fa; }
.rl-ai-bar { border-top: 0; }
.rl-ai-bar textarea { resize: none; border-radius: 11px; }
.rl-ai-bar .btn { border-radius: 11px; }

/* toasts & help */
.rl-toast { border: 0; border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 27, 45, .2); font-weight: 700; font-size: 14px; }
.rl-toast .bi { font-size: 18px; }
.rl-toast-success .bi { color: var(--rl-ok); }
.rl-toast-warning .bi { color: #d97706; }
.rl-toast-danger .bi { color: #dc2626; }
.rl-toast-info .bi { color: var(--rl-accent-2); }
.rl-help { border-radius: 16px; border: 0; }
.rl-help .modal-title { font-weight: 900; }
.rl-help-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.rl-help-list li { display: flex; gap: 12px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.rl-help-list .bi { flex: 0 0 34px; height: 34px; border-radius: 10px; background: #e6f7fc; color: var(--rl-accent-2); display: flex; align-items: center; justify-content: center; font-size: 17px; }

.btn-primary { --bs-btn-bg: var(--rl-accent-2); --bs-btn-border-color: var(--rl-accent-2); --bs-btn-hover-bg: #087a97; --bs-btn-hover-border-color: #087a97; --bs-btn-active-bg: #076a83; }

/* ---------------- responsive ---------------- */
@media (max-width: 1280px) {
  .rl-main { grid-template-columns: 210px minmax(0, 1fr) 370px; }
  .rl-name { width: 140px; }
  .rl-tbtn span { display: none; }
  .rl-tbtn.dropdown-toggle span#rl-lang-label { display: inline; }
}
@media (max-width: 900px) {
  .rl-body { overflow: auto; height: auto; }
  .rl-top { height: auto; flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .rl-brand-txt small { display: none; }
  .rl-top-run { order: 3; margin-left: 0; }
  .rl-name { width: 120px; }
  .rl-main { display: flex; flex-direction: column; }
  .rl-palette { border-right: 0; border-bottom: 1px solid var(--rl-line); }
  .rl-pal-list { display: flex; overflow-x: auto; overflow-y: hidden; gap: 10px; padding: 8px; }
  .rl-cat { margin: 0; flex: 0 0 auto; }
  .rl-cat-grid { display: flex; gap: 6px; }
  .rl-pal-item { width: 84px; touch-action: pan-x; }
  .rl-pal-hint { display: none; }
  .rl-stage { height: 62vh; }
  .rl-side { height: 70vh; border-left: 0; border-top: 1px solid var(--rl-line); }
  .rl-props { width: 220px; top: auto; bottom: 42px; }
  .rl-tabs .nav-link span:not(.badge):not(.rl-dot) { display: none; }
}

/* account */
.rl-user { padding: 4px 6px; }
.rl-avatar-sm { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--rl-accent), var(--rl-accent-2)); color: #fff; font-weight: 900; font-size: 12.5px; }
.rl-login { border: 1px solid rgba(255, 255, 255, .2); }

/* lessons */
.rl-mission { flex: 1; min-height: 0; overflow: auto; padding: 16px 16px 24px; }
.rl-mission-course { font-size: 12.5px; font-weight: 800; color: var(--rl-accent-2); text-decoration: none; }
.rl-mission-title { font-weight: 900; font-size: 21px; margin: 6px 0 10px; }
.rl-mission-body { font-size: 14.5px; line-height: 1.55; color: #2b3a4c; }
.rl-mission-body code { background: #eef3f8; color: #b4233c; padding: 0 4px; border-radius: 4px; font-size: 13px; }
.rl-mission-body blockquote { border-left: 4px solid #f2a900; background: #fffaeb; padding: 8px 12px; border-radius: 0 10px 10px 0; margin: 10px 0; }
.rl-mission-body blockquote p { margin: 0; }
.rl-mission-body ul, .rl-mission-body ol { padding-left: 20px; }
.rl-mission-checks { margin-top: 16px; background: #f6f9fc; border: 1px solid var(--rl-line); border-radius: 12px; padding: 12px 14px; }
.rl-mission-h { font-weight: 900; font-size: 13px; text-transform: uppercase; letter-spacing: .5px; color: var(--rl-muted); margin-bottom: 8px; }
#rl-checks { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
#rl-checks li { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 14px; color: #3c4c60; }
.rl-ck { flex: 0 0 22px; height: 22px; border-radius: 50%; border: 2px solid #c3ccd6; display: inline-flex; align-items: center; justify-content: center; color: transparent; transition: all .2s; }
#rl-checks li.ok { color: #146c3b; }
#rl-checks li.ok .rl-ck { background: var(--rl-ok); border-color: var(--rl-ok); color: #fff; transform: scale(1.08); }
.rl-mission-ok { display: flex; gap: 12px; align-items: center; margin-top: 14px; background: linear-gradient(120deg, #e7f8ee, #fff); border: 1px solid #b7ebc9; border-radius: 12px; padding: 12px 14px; color: #146c3b; }
.rl-mission-ok .bi { font-size: 30px; color: #f2a900; }
.rl-mission-ok p { margin: 2px 0 0; font-size: 13px; }
.rl-mission-next { display: block; margin-top: 10px; background: linear-gradient(180deg, var(--rl-run), var(--rl-run-2)); color: #fff; font-weight: 900; border-radius: 11px; }
.rl-mission-next:hover { color: #fff; filter: brightness(1.05); }
.rl-confetti { position: absolute; top: -10px; width: 8px; height: 12px; border-radius: 2px; z-index: 30; pointer-events: none; animation: rl-fall 2.2s ease-in forwards; }
@keyframes rl-fall { to { top: 100%; opacity: .2; margin-left: 40px; } }

/* plan limits */
.rl-ex-item.locked { opacity: .65; }
.rl-ex-item.locked .bi { color: #9aa6b4; }
.rl-upsell { display: flex; gap: 12px; background: linear-gradient(120deg, #fff4e6, #fff); border: 1px solid #ffd3a8; border-radius: 14px; padding: 12px 14px; }
.rl-upsell > .bi { font-size: 24px; color: var(--rl-run); }
.rl-upsell p { font-size: 13.5px; margin: 4px 0 8px; color: #6b4a1f; }
.rl-upsell-btn { background: var(--rl-run); color: #fff; font-weight: 800; border-radius: 9px; }
.rl-upsell-btn:hover { background: var(--rl-run-2); color: #fff; }
.rl-toast-link { font-weight: 900; color: var(--rl-accent-2); margin-left: 4px; }
.rl-tabs { overflow-x: auto; scrollbar-width: none; }
.rl-tabs::-webkit-scrollbar { display: none; }
.rl-has-lesson .rl-tabs .nav-link { padding: 8px 8px; gap: 4px; font-size: 13px; }
.rl-ex-courses { display: grid !important; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; border-radius: 9px; padding: 8px 10px; white-space: normal; }
.rl-ex-courses .bi { font-size: 20px; color: var(--rl-run-2); }
.rl-ex-courses strong { display: block; font-weight: 800; font-size: 14px; }
.rl-ex-courses small { display: block; color: var(--rl-muted); font-size: 12px; }

/* ---------------- dropdown theme (no Bootstrap blue) ---------------- */
.rl-body .dropdown-menu {
  color-scheme: light;
  --bs-dropdown-bg: #fff;
  --bs-dropdown-color: var(--rl-text);
  --bs-dropdown-border-color: #e3eaf1;
  --bs-dropdown-border-radius: 14px;
  --bs-dropdown-padding-x: 6px;
  --bs-dropdown-padding-y: 6px;
  --bs-dropdown-spacer: 8px;
  --bs-dropdown-divider-bg: #edf1f5;
  --bs-dropdown-divider-margin-y: 6px;
  --bs-dropdown-link-color: #2a3a4e;
  --bs-dropdown-link-hover-color: var(--rl-ink);
  --bs-dropdown-link-hover-bg: #eef7fb;
  --bs-dropdown-link-active-color: #0a7a97;
  --bs-dropdown-link-active-bg: #e0f4fa;
  --bs-dropdown-item-padding-x: 12px;
  --bs-dropdown-item-padding-y: 8px;
  border: 1px solid #e3eaf1;
  box-shadow: 0 14px 38px rgba(15, 27, 45, .18), 0 2px 6px rgba(15, 27, 45, .06) !important;
  animation: rl-menu-in .14s ease-out;
}
@keyframes rl-menu-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.rl-body .dropdown-item { font-weight: 700; font-size: 14px; border-radius: 9px; transition: background .12s, color .12s; }
.rl-body .dropdown-item .bi { color: #7b8b9e; margin-right: 8px; transition: color .12s; }
.rl-body .dropdown-item:hover .bi, .rl-body .dropdown-item:focus .bi,
.rl-body .dropdown-item.active .bi, .rl-body .dropdown-item:active .bi { color: var(--rl-accent-2); }
.rl-body .dropdown-item:focus-visible { outline: 2px solid rgba(32, 195, 232, .5); outline-offset: -2px; }
.rl-body .form-control:focus, .rl-body .form-select:focus { border-color: var(--rl-accent); box-shadow: 0 0 0 .25rem rgba(32, 195, 232, .2); }
.rl-body .form-check-input:checked { background-color: var(--rl-accent-2); border-color: var(--rl-accent-2); }
.rl-body .btn-primary { --bs-btn-bg: #0a8fb0; --bs-btn-border-color: #0a8fb0; --bs-btn-hover-bg: #087a97; --bs-btn-hover-border-color: #087a97; --bs-btn-active-bg: #076a83; }

.rl-menu { min-width: 15.5rem; }
.rl-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid #edf1f5; }
.rl-menu-head div { min-width: 0; line-height: 1.2; }
.rl-menu-head strong { display: block; font-weight: 900; color: var(--rl-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.rl-menu-head small { display: block; color: var(--rl-muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 170px; }
.rl-body .dropdown-item.rl-item-danger { color: #c0283f; }
.rl-body .dropdown-item.rl-item-danger .bi { color: #d9475d; }
.rl-body .dropdown-item.rl-item-danger:hover { background: #fdecee; color: #a51d33; }
.rl-user { padding: 3px 8px 3px 4px !important; }
.rl-user::after { opacity: .7; }
.rl-user img, .rs-avatar-img { border-radius: 50%; object-fit: cover; }
.rl-user .rl-avatar-sm { box-shadow: 0 0 0 2px rgba(32, 195, 232, .45); }
