/* Amnon design lab — panel, tree presets, backgrounds, inline edit */

body.is-design-lab {
  cursor: crosshair;
}
body.is-design-lab .staff-lock {
  display: none !important;
}
body.is-design-lab.is-admin .top,
body.is-design-lab.is-admin .grove-page {
  display: none !important;
}
body.is-design-lab .design-editable-hover {
  outline: 2px dashed #41d9f8;
  outline-offset: 2px;
  cursor: text;
}
body.is-design-lab [contenteditable="true"] {
  outline: 2px solid #ffd400;
  outline-offset: 2px;
  cursor: text;
  white-space: pre-wrap;
}

.design-lab-banner {
  position: fixed;
  top: calc(var(--lab-strip-h, 0px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(2, 16, 43, 0.88);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(2, 16, 43, 0.25);
}
body:not(.is-design-lab) .design-lab-banner {
  display: none !important;
}

.design-lab-panel {
  position: fixed;
  z-index: 99996;
  width: min(360px, calc(100vw - 24px));
  max-height: min(78vh, 720px);
  display: grid;
  grid-template-rows: auto auto 1fr;
  border-radius: 16px;
  background: #fff;
  border: 2px solid #1c4b8c;
  box-shadow: 0 20px 50px rgba(2, 16, 43, 0.28);
  overflow: hidden;
  touch-action: none;
}
.design-lab-panel[hidden] {
  display: none !important;
}
.design-lab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(135deg, #1c4b8c, #484dd2);
  color: #fff;
  cursor: grab;
  user-select: none;
}
.design-lab-head:active {
  cursor: grabbing;
}
.design-lab-head strong {
  font-size: 15px;
}
.design-lab-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}
.design-lab-close:hover {
  background: rgba(255, 255, 255, 0.3);
}
.design-lab-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px;
  background: #eef3fa;
  border-bottom: 1px solid #d5dff5;
}
.design-lab-tabs button {
  flex: 1 1 auto;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  background: #fff;
  color: #1c2430;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.design-lab-tabs button.is-on {
  background: #1c4b8c;
  border-color: #1c4b8c;
  color: #fff;
}
.design-lab-body {
  overflow: auto;
  padding: 12px;
  display: grid;
  gap: 12px;
  align-content: start;
  min-height: 0;
}
.design-lab-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px 12px 12px;
  border-top: 1px solid #d5dff5;
  background: #f8faff;
}
.design-lab-footer button {
  flex: 1 1 auto;
  min-width: 120px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #c5d5e8;
  background: #fff;
  font-weight: 800;
  cursor: pointer;
  font-size: 12px;
}
.design-lab-footer button.design-primary {
  background: #1c4b8c;
  border-color: #1c4b8c;
  color: #fff;
}
.design-lab-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: #5b6b80;
  font-weight: 600;
}
.design-lab-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  color: #1c2430;
}
.design-style-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.design-style-card {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 2px solid #d5dff5;
  border-radius: 12px;
  background: #f8faff;
  cursor: pointer;
  text-align: right;
}
.design-style-card.is-on {
  border-color: #484dd2;
  box-shadow: 0 0 0 2px rgba(72, 77, 210, 0.2);
}
.design-style-card b {
  font-size: 12px;
  color: #1c2430;
}
.design-style-preview {
  height: 52px;
  border-radius: 8px;
  overflow: hidden;
  display: grid;
  gap: 3px;
  padding: 4px;
  background: #e8eef8;
}
.design-style-preview span {
  display: block;
  height: 12px;
  border-radius: 4px;
}
.design-field-grid {
  display: grid;
  gap: 10px;
}
.design-tier-fieldset {
  border: 1px solid #e4e8ee;
  border-radius: 12px;
  padding: 10px;
  margin: 0;
  background: #fafbfd;
}
.design-tier-fieldset legend {
  padding: 0 6px;
  font-size: 12px;
  font-weight: 800;
  color: #02102b;
}
.design-tier-fieldset label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  color: #003a7d;
  margin-top: 8px;
}
.design-tier-fieldset label:first-of-type {
  margin-top: 0;
}
.design-tier-fieldset select,
.design-tier-fieldset input[type="color"] {
  width: 100%;
  min-height: 32px;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 4px 8px;
  font: inherit;
  box-sizing: border-box;
}
.design-tier-fieldset input[type="color"] {
  padding: 2px;
  cursor: pointer;
}
.design-field-grid label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #1c2430;
}
.design-field-grid select,
.design-field-grid input[type="color"],
.design-field-grid input[type="file"] {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #c5d5e8;
  border-radius: 10px;
  font: inherit;
  background: #fff;
}
.design-bg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.design-bg-swatch {
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  border: 2px solid #d5dff5;
  cursor: pointer;
  padding: 0;
}
.design-bg-swatch.is-on {
  border-color: #484dd2;
  box-shadow: 0 0 0 2px rgba(72, 77, 210, 0.25);
}
.design-lab-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.design-lab-actions button {
  flex: 1 1 auto;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid #c5d5e8;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}
.design-lab-actions button.design-primary {
  background: #1c4b8c;
  border-color: #1c4b8c;
  color: #fff;
}
.design-tip-list {
  margin: 0;
  padding: 0 18px 0 0;
  display: grid;
  gap: 8px;
  font-size: 12px;
  line-height: 1.45;
  color: #3a4658;
}

.design-text-mini {
  position: fixed;
  z-index: 99997;
  width: min(280px, calc(100vw - 24px));
  padding: 0;
  border-radius: 12px;
  background: #fff;
  border: 2px solid #ffd400;
  box-shadow: 0 12px 30px rgba(2, 16, 43, 0.22);
  display: grid;
  gap: 8px;
  overflow: hidden;
  touch-action: none;
}
.design-mini-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  background: linear-gradient(135deg, #1c4b8c, #484dd2);
  color: #fff;
  cursor: grab;
  user-select: none;
}
.design-mini-head:active {
  cursor: grabbing;
}
.design-mini-title {
  font-size: 13px;
  font-weight: 800;
}
.design-mini-close {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
}
.design-mini-close:hover {
  background: rgba(255, 255, 255, 0.35);
}
.design-mini-key {
  margin: 0;
  padding: 0 10px;
  font-size: 10px;
  font-weight: 600;
  color: #5b6b80;
  word-break: break-all;
}
.design-text-mini label {
  padding: 0 10px;
}
.design-mini-done {
  margin: 0 10px 10px;
  padding: 9px 12px;
  border: 0;
  border-radius: 10px;
  background: #1c4b8c;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}
.design-mini-done:hover {
  filter: brightness(1.06);
}
.design-text-mini label {
  display: grid;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
}
.design-text-mini[hidden] {
  display: none !important;
}
.design-text-mini select,
.design-text-mini textarea {
  padding: 6px 8px;
  border-radius: 8px;
  border: 1px solid #c5d5e8;
}
.design-text-mini textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  direction: rtl;
}

/* CSS vars — fonts & colors */
body.design-applied {
  --dl-font-domain: "Rubik", sans-serif;
  --dl-font-topic: "Rubik", sans-serif;
  --dl-font-lesson: "Rubik", sans-serif;
  --dl-color-domain: #02102b;
  --dl-color-topic: #003a7d;
  --dl-color-lesson: #1a1a3a;
}
body.design-applied .tree-domain-name {
  font-family: var(--dl-font-domain);
  color: var(--dl-color-domain);
}
body.design-applied .tree-topic-name {
  font-family: var(--dl-font-topic);
  color: #ffffff;
}
body.design-applied .learn-side .tree-topic-btn,
body.design-applied .learn-side .tree-topic-btn .tree-caret,
body.design-applied .learn-side .tree-topic-btn .tree-topic-name,
body.design-applied .learn-side .tree-topic.is-open > .tree-topic-btn,
body.design-applied .learn-side .tree-topic.is-open > .tree-topic-btn .tree-caret,
body.design-applied .learn-side .tree-topic.is-open > .tree-topic-btn .tree-topic-name {
  color: #ffffff;
}
body.design-applied .tree-lesson-title {
  font-family: var(--dl-font-lesson);
  color: var(--dl-color-lesson);
}
body.design-applied.design-fx-domain-shadow .tree-domain-name {
  text-shadow: 0 2px 0 rgba(0, 0, 0, 0.12);
}
body.design-applied.design-fx-domain-glow .tree-domain-name {
  text-shadow: 0 0 14px rgba(65, 217, 248, 0.85);
}
body.design-applied.design-fx-domain-outline .tree-domain-name {
  -webkit-text-stroke: 0.6px rgba(0, 58, 125, 0.35);
}
body.design-applied.design-fx-domain-gradient .tree-domain-name {
  background: linear-gradient(90deg, #41d9f8, #484dd2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.design-applied.design-fx-topic-shadow .tree-topic-name { text-shadow: 0 1px 0 rgba(0,0,0,.1); }
body.design-applied.design-fx-topic-glow .tree-topic-name { text-shadow: 0 0 10px rgba(72,77,210,.55); }
body.design-applied.design-fx-topic-outline .tree-topic-name { -webkit-text-stroke: .5px rgba(0,58,125,.25); }
body.design-applied.design-fx-topic-gradient .tree-topic-name {
  background: linear-gradient(90deg, #6b3fd4, #2ec4b6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
body.design-applied.design-fx-lesson-shadow .tree-lesson-title { text-shadow: 0 1px 0 rgba(0,0,0,.08); }
body.design-applied.design-fx-lesson-glow .tree-lesson-title { text-shadow: 0 0 8px rgba(46,196,182,.45); }
body.design-applied.design-fx-lesson-outline .tree-lesson-title { -webkit-text-stroke: .4px rgba(26,26,58,.2); }
body.design-applied.design-fx-lesson-gradient .tree-lesson-title {
  background: linear-gradient(90deg, #003a7d, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* Per-text inline overrides */
[data-design-style] {
  /* filled by JS */
}

/* Backgrounds */
body.design-bg-soft-sky { background: linear-gradient(180deg, #eef7ff 0%, #f6f8ff 40%, #fff 100%) fixed; }
body.design-bg-math-purple { background: radial-gradient(120% 80% at 100% 0%, rgba(107,63,212,.18), transparent 55%), linear-gradient(180deg, #f3efff, #fff) fixed; }
body.design-bg-calm-mint { background: linear-gradient(180deg, #eafff8, #f7fffc 45%, #fff) fixed; }
body.design-bg-sunset { background: linear-gradient(180deg, #fff4e8, #ffe8f0 50%, #fff) fixed; }
body.design-bg-night { background: linear-gradient(180deg, #0b1b3a, #1a1450 55%, #2a1f6e) fixed; color-scheme: dark; }
body.design-bg-dots {
  background-color: #f6f8ff;
  background-image: radial-gradient(circle, rgba(72,77,210,.12) 1px, transparent 1px);
  background-size: 18px 18px;
  background-attachment: fixed;
}
body.design-bg-waves {
  background: linear-gradient(135deg, #dff7fc 0%, #d6ebff 35%, #efe9ff 70%, #fff 100%) fixed;
}
body.design-bg-paper {
  background: linear-gradient(180deg, #faf7f2, #fff) fixed;
}

.design-style-card small.design-style-hint {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.35;
  color: #5b6b80;
}

/* ── Tree layout themes (structure only — text colors from pickers) ── */

/* classic = no overrides — uses app.css as-is */

/* Windows 98 */
body.design-applied.design-tree-style-win98 .learn-side {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  border-radius: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 6px;
  font-family: Tahoma, "Segoe UI", Arial, sans-serif;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-domain-btn,
body.design-applied.design-tree-style-win98 .learn-side .tree-topic-btn,
body.design-applied.design-tree-style-win98 .learn-side .tree-lesson {
  border-radius: 0;
  box-shadow: none;
  filter: none;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-domain-btn {
  background: #c0c0c0;
  border: 2px solid;
  border-color: #fff #808080 #808080 #fff;
  padding: 6px 10px;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-domain.is-open > .tree-domain-btn,
body.design-applied.design-tree-style-win98 .learn-side .tree-domain-btn:active {
  border-color: #808080 #fff #fff #808080;
  background: #b0b0b0;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-topic-btn {
  background: #dcdcdc;
  border: 1px solid #808080;
  padding: 5px 8px;
  margin-top: 4px;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-lesson {
  background: #fff;
  border: 1px solid #808080;
  padding: 6px 8px;
  border-radius: 0;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-topics,
body.design-applied.design-tree-style-win98 .learn-side .tree-lessons {
  border-inline-start: 0;
  padding-inline-start: 12px;
  margin-inline-start: 8px;
}
body.design-applied.design-tree-style-win98 .learn-side .tree-domain-btn .tree-count {
  border-radius: 0;
  background: #000080;
  min-width: 1.5rem;
  min-height: 1.5rem;
  font-size: 12px;
}

/* Schooler — flat course list */
body.design-applied.design-tree-style-schooler .learn-side {
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  backdrop-filter: none;
  padding: 0;
}
body.design-applied.design-tree-style-schooler .lesson-tree {
  gap: 0;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-domain-btn {
  border-radius: 0;
  background: #f5f5f5;
  border: 0;
  border-bottom: 1px solid #e0e0e0;
  box-shadow: none;
  padding: 14px 16px;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-domain.is-open > .tree-domain-btn {
  background: #fff;
  border-inline-start: 4px solid #2563eb;
  box-shadow: none;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-topic-btn {
  border-radius: 0;
  background: #fafafa;
  border: 0;
  border-bottom: 1px solid #eee;
  box-shadow: none;
  padding: 11px 16px 11px 24px;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-topic.is-open > .tree-topic-btn {
  background: #f0f4ff;
  border-inline-start: 3px solid #93c5fd;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-lesson {
  border-radius: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f0f0f0;
  box-shadow: none;
  padding: 10px 16px 10px 32px;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-lesson.is-on {
  background: #eff6ff;
  border-inline-start: 3px solid #2563eb;
}
body.design-applied.design-tree-style-schooler .learn-side .tree-topics,
body.design-applied.design-tree-style-schooler .learn-side .tree-lessons {
  border-inline-start: 0;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* Moodle / LMS blocks */
body.design-applied.design-tree-style-moodle .learn-side {
  background: #f5f5f5;
  border: 0;
  border-radius: 4px;
  backdrop-filter: none;
  padding: 8px;
}
body.design-applied.design-tree-style-moodle .lesson-tree {
  gap: 12px;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-domain {
  border: 1px solid #ccc;
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-domain-btn {
  border-radius: 0;
  background: #444;
  color: #fff;
  border: 0;
  padding: 12px 14px;
  box-shadow: none;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-domain.is-open > .tree-domain-btn {
  background: #333;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-domain-btn .tree-caret {
  color: inherit;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-domain-btn .tree-count {
  background: rgba(255, 255, 255, 0.25);
  border-radius: 4px;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-topic-btn {
  border-radius: 0;
  background: #eee;
  border: 0;
  border-bottom: 1px solid #ddd;
  box-shadow: none;
  padding: 10px 12px;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-lesson {
  border-radius: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #eee;
  box-shadow: none;
  padding: 10px 12px 10px 28px;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-lesson::before {
  content: "◦";
  margin-inline-end: 6px;
  opacity: 0.5;
}
body.design-applied.design-tree-style-moodle .learn-side .tree-topics,
body.design-applied.design-tree-style-moodle .learn-side .tree-lessons {
  border-inline-start: 0;
  padding: 0;
  margin: 0;
}

/* Explorer file tree */
body.design-applied.design-tree-style-explorer .learn-side {
  background: #fff;
  border: 1px solid #a0a0a0;
  border-radius: 0;
  backdrop-filter: none;
  font-family: Tahoma, Arial, sans-serif;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-domain-btn,
body.design-applied.design-tree-style-explorer .learn-side .tree-topic-btn,
body.design-applied.design-tree-style-explorer .learn-side .tree-lesson {
  border-radius: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 4px 8px;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-domain-btn:hover,
body.design-applied.design-tree-style-explorer .learn-side .tree-topic-btn:hover,
body.design-applied.design-tree-style-explorer .learn-side .tree-lesson:hover {
  background: #316ac5;
  color: #fff;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-domain-btn:hover .tree-domain-name,
body.design-applied.design-tree-style-explorer .learn-side .tree-topic-btn:hover .tree-topic-name,
body.design-applied.design-tree-style-explorer .learn-side .tree-lesson:hover .tree-lesson-title {
  color: #fff;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-caret::before {
  content: "▶ ";
  font-size: 10px;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-domain.is-open > .tree-domain-btn .tree-caret::before,
body.design-applied.design-tree-style-explorer .learn-side .tree-topic.is-open > .tree-topic-btn .tree-caret::before {
  content: "▼ ";
}
body.design-applied.design-tree-style-explorer .learn-side .tree-caret {
  font-size: 0;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-topics {
  border-inline-start: 1px dotted #808080;
  margin-inline-start: 14px;
  padding-inline-start: 12px;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-lessons {
  border-inline-start: 1px dotted #808080;
  margin-inline-start: 10px;
  padding-inline-start: 10px;
}
body.design-applied.design-tree-style-explorer .learn-side .tree-domain-btn .tree-count {
  background: transparent;
  color: inherit;
  min-width: 0;
  padding: 0;
  font-size: 11px;
}

/* macOS sidebar */
body.design-applied.design-tree-style-mac-sidebar .learn-side {
  background: rgba(246, 246, 246, 0.95);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 10px;
  backdrop-filter: blur(12px);
  padding: 8px;
}
body.design-applied.design-tree-style-mac-sidebar .lesson-tree {
  gap: 2px;
}
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-domain-btn,
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-topic-btn,
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-lesson {
  border-radius: 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 8px 12px;
}
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-domain.is-open > .tree-domain-btn,
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-lesson.is-on {
  background: rgba(0, 122, 255, 0.15);
}
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-topic.is-open > .tree-topic-btn {
  background: rgba(0, 0, 0, 0.04);
}
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-topics,
body.design-applied.design-tree-style-mac-sidebar .learn-side .tree-lessons {
  border-inline-start: 0;
  padding-inline-start: 16px;
  margin-inline-start: 0;
  gap: 2px;
}

/* Browser tabs */
body.design-applied.design-tree-style-tabs .learn-side {
  background: #ece9d8;
  border: 1px solid #aca899;
  border-radius: 0;
  backdrop-filter: none;
  padding: 8px 6px 6px;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-domain-btn {
  border-radius: 8px 8px 0 0;
  background: linear-gradient(180deg, #fff 0%, #ece9d8 100%);
  border: 1px solid #aca899;
  border-bottom: 0;
  margin-bottom: -1px;
  box-shadow: none;
  position: relative;
  z-index: 1;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-domain.is-open > .tree-domain-btn {
  background: #fff;
  border-bottom: 1px solid #fff;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-topics {
  background: #fff;
  border: 1px solid #aca899;
  padding: 8px;
  border-radius: 0 0 4px 4px;
  border-inline-start: 1px solid #aca899;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-topic-btn {
  border-radius: 6px 6px 0 0;
  background: #f5f5f5;
  border: 1px solid #ccc;
  border-bottom: 0;
  box-shadow: none;
  font-size: 13px;
  padding: 8px 10px;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-lessons {
  background: #fafafa;
  border: 1px solid #ddd;
  padding: 6px;
  border-inline-start: 1px solid #ddd;
}
body.design-applied.design-tree-style-tabs .learn-side .tree-lesson {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  box-shadow: none;
}

/* Notebook */
body.design-applied.design-tree-style-notebook .learn-side {
  background:
    linear-gradient(transparent 23px, #e8d5d5 24px, transparent 25px) 0 0 / 100% 25px,
    #fffef8;
  border: 1px solid #d4c4a8;
  border-radius: 4px;
  backdrop-filter: none;
  padding: 12px 12px 12px 28px;
  box-shadow: inset 28px 0 0 #ffe4e4;
}
body.design-applied.design-tree-style-notebook .learn-side .tree-domain-btn,
body.design-applied.design-tree-style-notebook .learn-side .tree-topic-btn,
body.design-applied.design-tree-style-notebook .learn-side .tree-lesson {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  border-bottom: 1px dashed #e8d5d5;
  padding: 8px 4px;
}
body.design-applied.design-tree-style-notebook .learn-side .tree-topics,
body.design-applied.design-tree-style-notebook .learn-side .tree-lessons {
  border-inline-start: 2px solid #ffc9c9;
  padding-inline-start: 10px;
}

/* Terminal style removed */

/* iOS Settings groups */
body.design-applied.design-tree-style-ios-settings .learn-side {
  background: #f2f2f7;
  border: 0;
  border-radius: 12px;
  backdrop-filter: none;
  padding: 8px;
}
body.design-applied.design-tree-style-ios-settings .lesson-tree {
  gap: 16px;
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-domain {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-domain-btn {
  border-radius: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #e5e5ea;
  box-shadow: none;
  padding: 14px 16px;
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-topic-btn {
  border-radius: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f2f2f7;
  box-shadow: none;
  padding: 12px 16px 12px 28px;
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-lesson {
  border-radius: 0;
  background: #fff;
  border: 0;
  border-bottom: 1px solid #f2f2f7;
  box-shadow: none;
  padding: 12px 16px 12px 36px;
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-lesson:last-child {
  border-bottom: 0;
}
body.design-applied.design-tree-style-ios-settings .learn-side .tree-topics,
body.design-applied.design-tree-style-ios-settings .learn-side .tree-lessons {
  border-inline-start: 0;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* Dashboard cards */
body.design-applied.design-tree-style-dashboard .learn-side {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}
body.design-applied.design-tree-style-dashboard .lesson-tree {
  gap: 14px;
}
body.design-applied.design-tree-style-dashboard .learn-side .tree-domain {
  background: #fff;
  border-radius: 16px;
  padding: 10px;
  box-shadow: 0 8px 24px rgba(2, 16, 43, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.06);
}
body.design-applied.design-tree-style-dashboard .learn-side .tree-domain-btn {
  border-radius: 12px;
  background: #f8fafc;
  border: 0;
  box-shadow: none;
}
body.design-applied.design-tree-style-dashboard .learn-side .tree-topic-btn {
  border-radius: 10px;
  background: #f1f5f9;
  border: 0;
  box-shadow: none;
  margin-top: 6px;
}
body.design-applied.design-tree-style-dashboard .learn-side .tree-lesson {
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}
body.design-applied.design-tree-style-dashboard .learn-side .tree-topics,
body.design-applied.design-tree-style-dashboard .learn-side .tree-lessons {
  border-inline-start: 0;
  padding-inline-start: 4px;
}

/* School board */
body.design-applied.design-tree-style-school-board .learn-side {
  background: #2d4a3e;
  border: 8px solid #8b6914;
  border-radius: 4px;
  backdrop-filter: none;
  padding: 0;
  box-shadow: inset 0 0 40px rgba(0, 0, 0, 0.3);
}
body.design-applied.design-tree-style-school-board .learn-side .tree-domain-btn {
  border-radius: 0;
  background: #1a3328;
  border: 0;
  border-bottom: 3px solid #ffd400;
  box-shadow: none;
  padding: 12px 14px;
}
body.design-applied.design-tree-style-school-board .learn-side .tree-topic-btn {
  border-radius: 0;
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
body.design-applied.design-tree-style-school-board .learn-side .tree-lesson {
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.15);
  border-radius: 0;
  box-shadow: none;
}
body.design-applied.design-tree-style-school-board .learn-side .tree-topics,
body.design-applied.design-tree-style-school-board .learn-side .tree-lessons {
  border-inline-start-color: rgba(255, 212, 0, 0.35);
}

/* Preview thumbnails — structure hints */
.design-style-preview.style-classic span:nth-child(1) { background: linear-gradient(135deg, #dff7fc, #d6ebff); border-radius: 10px; }
.design-style-preview.style-classic span:nth-child(2) { background: linear-gradient(135deg, #484dd2, #41d9f8); width: 75%; margin-inline-start: auto; border-radius: 8px; }
.design-style-preview.style-win98 span:nth-child(1) { background: #c0c0c0; border: 2px outset #fff; border-radius: 0; height: 14px; }
.design-style-preview.style-win98 span:nth-child(2) { background: #dcdcdc; border: 1px solid #808080; border-radius: 0; width: 70%; margin-inline-start: auto; }
.design-style-preview.style-schooler span:nth-child(1) { background: #f5f5f5; border-bottom: 2px solid #2563eb; border-radius: 0; }
.design-style-preview.style-schooler span:nth-child(2) { background: #fff; border-bottom: 1px solid #eee; width: 80%; margin-inline-start: auto; border-radius: 0; }
.design-style-preview.style-moodle span:nth-child(1) { background: #444; border-radius: 2px 2px 0 0; }
.design-style-preview.style-moodle span:nth-child(2) { background: #eee; border: 1px solid #ccc; width: 85%; margin-inline-start: auto; border-radius: 0; }
.design-style-preview.style-explorer span:nth-child(1) { background: transparent; border-bottom: 1px dotted #888; height: 8px; }
.design-style-preview.style-explorer span:nth-child(2) { background: transparent; border-inline-start: 1px dotted #888; width: 60%; margin-inline-start: 20%; height: 20px; }
.design-style-preview.style-mac-sidebar span:nth-child(1) { background: rgba(0,122,255,.2); border-radius: 6px; }
.design-style-preview.style-mac-sidebar span:nth-child(2) { background: transparent; width: 70%; margin-inline-start: auto; border-radius: 6px; }
.design-style-preview.style-tabs span:nth-child(1) { background: #fff; border: 1px solid #aca899; border-radius: 6px 6px 0 0; height: 12px; }
.design-style-preview.style-tabs span:nth-child(2) { background: #fafafa; border: 1px solid #ddd; width: 80%; margin-inline-start: auto; border-radius: 0; }
.design-style-preview.style-notebook span:nth-child(1) { background: repeating-linear-gradient(transparent 0 4px, #e8d5d5 4px 5px); }
.design-style-preview.style-notebook span:nth-child(2) { background: #fffef8; box-shadow: inset 8px 0 #ffe4e4; width: 75%; margin-inline-start: auto; }
.design-style-preview.style-ios-settings span:nth-child(1) { background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.design-style-preview.style-ios-settings span:nth-child(2) { background: #fff; border-radius: 8px; width: 85%; margin-inline-start: auto; border-top: 1px solid #eee; }
.design-style-preview.style-dashboard span:nth-child(1) { background: #fff; border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.12); }
.design-style-preview.style-dashboard span:nth-child(2) { background: #f1f5f9; border-radius: 6px; width: 75%; margin-inline-start: auto; }
.design-style-preview.style-school-board span:nth-child(1) { background: #2d4a3e; border-bottom: 3px solid #ffd400; border-radius: 0; }
.design-style-preview.style-school-board span:nth-child(2) { background: rgba(255,255,255,.1); width: 72%; margin-inline-start: auto; border-radius: 0; }

.design-lab-entry {
  margin-bottom: 12px;
}
.design-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 0;
  background: linear-gradient(135deg, #6b3fd4, #484dd2);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(72, 77, 210, 0.25);
}
.design-open-btn:hover {
  filter: brightness(1.06);
}

@media (max-width: 759px) {
  .design-lab-panel {
    width: min(340px, calc(100vw - 16px));
    max-height: 62vh;
  }
}

/* סרגל שיעורים — גרירה והוספה (רק מעבדת עיצוב) */
body:not(.is-design-lab) .tree-lesson-grip,
body:not(.is-design-lab) .tree-add-lesson,
body:not(.is-design-lab) .tree-lesson-row:not(.is-product-edit) {
  display: contents;
}
body.is-design-lab .tree-lesson-row {
  display: flex;
  align-items: stretch;
  gap: 2px;
  margin-bottom: 4px;
}
body.is-design-lab .tree-lesson-grip {
  flex: 0 0 auto;
  width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  user-select: none;
  color: #6b7280;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -3px;
  line-height: 1;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}
body.is-design-lab .tree-lesson-grip:active {
  cursor: grabbing;
}
body.is-design-lab .tree-lesson-row .tree-lesson {
  flex: 1;
  min-width: 0;
}
body.is-design-lab .tree-lesson-row.is-dragging {
  opacity: 0.45;
}
body.is-design-lab .tree-lesson-row.is-drop-target .tree-lesson {
  outline: 2px dashed #41d9f8;
  outline-offset: 1px;
}
body.is-design-lab .tree-lesson-drop-line {
  height: 3px;
  margin: 2px 4px 2px 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, #41d9f8, #ffd400);
  pointer-events: none;
}
body.is-design-lab .tree-add-lesson {
  display: block;
  width: calc(100% - 8px);
  margin: 6px 4px 2px;
  padding: 8px 10px;
  border: 1px dashed rgba(65, 217, 248, 0.55);
  border-radius: 8px;
  background: rgba(65, 217, 248, 0.08);
  color: #b8ecff;
  font: inherit;
  font-size: 0.82rem;
  cursor: pointer;
  text-align: center;
}
body.is-design-lab .tree-add-lesson:hover {
  background: rgba(65, 217, 248, 0.16);
  border-color: #41d9f8;
}
body.is-design-lab .tree-lesson.is-lesson-hidden {
  opacity: 0.72;
  border-style: dashed;
}
body.is-design-lab .tree-lesson-badge {
  font-style: normal;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 1px 5px;
  margin-inline-start: 4px;
  border-radius: 4px;
  background: rgba(255, 212, 0, 0.22);
  color: #ffd400;
  vertical-align: middle;
}
body.is-design-lab .tree-lesson-badge.is-manual {
  background: rgba(65, 217, 248, 0.2);
  color: #7de8ff;
}

/* ===== כפתור צף לפתיחת המעבדה + עיפרון עריכה ישירה ===== */
.design-lab-fab{
  position:fixed; z-index:99998; display:flex; align-items:center; gap:8px;
  padding:10px 14px; border:0; border-radius:999px; cursor:grab;
  background:linear-gradient(90deg,#003a7d,#484dd2); color:#fff;
  font:600 14px/1 Rubik, "Noto Sans Hebrew", sans-serif;
  box-shadow:0 10px 26px rgba(0,58,125,.35); touch-action:none; user-select:none;
}
.design-lab-fab:active{ cursor:grabbing }
.design-lab-fab.is-open{ background:linear-gradient(90deg,#b3123a,#e0245e) }
.design-lab-fab b{ font-weight:700 }

.design-pencil{
  position:absolute; z-index:99999; width:26px; height:26px; padding:0;
  border:1px solid rgba(0,58,125,.25); border-radius:50%;
  background:#fff56a; color:#02102b; font-size:14px; line-height:24px;
  cursor:pointer; box-shadow:0 4px 12px rgba(0,0,0,.18);
}
.design-pencil:hover{ transform:scale(1.08) }
.design-editable-hover{ outline:1px dashed rgba(72,77,210,.55); outline-offset:2px }
.design-mini-capsule{
  border:1px solid rgba(0,58,125,.2); border-radius:12px; padding:8px 10px; margin:6px 0;
}
.design-mini-capsule legend{ font-size:12px; font-weight:700; color:#003a7d }

/* תיקון: בעריכת שיעורים יחד עם עיצוב הסרגל, כלי השורה יורדים לשורה נפרדת ולא מוחצים את הכיתוב */
body.is-design-lab .tree-lesson-row {
  flex-wrap: wrap;
}
body.is-design-lab .tree-lesson-row > .tree-lesson {
  flex: 1 1 auto;
  min-width: calc(100% - 26px);
}
body.is-design-lab .tree-lesson-row > .lm-tools {
  flex: 1 0 100%;
  justify-content: flex-end;
}
