/* ============================================================
   EASY SCORM — Sistema de diseño (Google Workspace / Gemini)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500;700&family=Google+Sans+Code&display=swap');

:root {
  /* Marca */
  --brand: #4F46E5;          /* índigo EASY SCORM */
  --brand-strong: #4338CA;
  --brand-tint: #ECECFE;     /* fondo suave índigo */
  --brand-tint-2: #F4F4FF;

  /* Gemini sparkle (IA) */
  --ai-1: #4285F4;
  --ai-2: #9334E6;
  --ai-3: #D96570;
  --ai-grad: linear-gradient(105deg, #4285F4 0%, #9334E6 52%, #D96570 100%);

  /* Neutros Google */
  --ink: #1F1F1F;
  --ink-2: #444746;
  --ink-3: #5E5E5E;
  --ink-4: #80868B;
  --line: #DADCE0;
  --line-soft: #E8EAED;
  --surface: #FFFFFF;
  --surface-1: #F8F9FA;
  --surface-2: #F0F4F9;   /* superficie Gemini */
  --surface-3: #E9EEF6;

  /* Estado (paleta Google) */
  --green: #1E8E3E;
  --green-tint: #E6F4EA;
  --amber: #E37400;
  --amber-tint: #FEF7E0;
  --red: #D93025;
  --red-tint: #FCE8E6;
  --blue: #1A73E8;
  --blue-tint: #E8F0FE;

  /* Radios */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 28px;
  --r-pill: 999px;

  /* Sombras (Material elev) */
  --e1: 0 1px 2px rgba(60,64,67,.08), 0 1px 3px rgba(60,64,67,.10);
  --e2: 0 1px 2px rgba(60,64,67,.10), 0 2px 6px rgba(60,64,67,.12);
  --e3: 0 1px 3px rgba(60,64,67,.10), 0 4px 12px rgba(60,64,67,.14);
  --e4: 0 4px 8px rgba(60,64,67,.10), 0 12px 28px rgba(60,64,67,.18);

  --rail-w: 264px;
  --topbar-h: 64px;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Roboto', system-ui, sans-serif;
  color: var(--ink);
  background: var(--surface-2);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button { font-family: inherit; }
::selection { background: var(--brand-tint); }

/* Material symbols (icon font fallback handled via inline SVG mostly) */
.mono { font-family: 'Google Sans Code', 'Roboto Mono', monospace; }

/* ---------- App shell ---------- */
.app {
  display: grid;
  grid-template-columns: var(--rail-w) 1fr;
  height: 100vh;
  background: var(--surface-2);
}

/* ---------- Rail / sidebar ---------- */
.rail {
  background: var(--surface);
  border-right: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  padding: 14px 12px;
  gap: 4px;
  overflow-y: auto;
}
.brand {
  display: flex; align-items: center; gap: 11px;
  padding: 8px 10px 14px;
}
.brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--ai-grad);
  display: grid; place-items: center;
  color: #fff; flex: none;
  box-shadow: 0 2px 8px rgba(79,70,229,.32);
}
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.3px; line-height: 1; white-space: nowrap; }
.brand-sub { font-size: 11px; color: var(--ink-4); margin-top: 3px; letter-spacing: .2px; white-space: nowrap; }

.rail-btn {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 14px; border-radius: var(--r-pill);
  color: var(--ink-2); font-size: 14px; font-weight: 500;
  cursor: pointer; border: none; background: none; text-align: left;
  width: 100%; transition: background .12s;
}
.rail-btn:hover { background: var(--surface-1); }
.rail-btn.active { background: var(--brand-tint); color: var(--brand-strong); }
.rail-btn.active svg { color: var(--brand-strong); }
.rail-btn svg { color: var(--ink-3); flex: none; }
.rail-sep { height: 1px; background: var(--line-soft); margin: 10px 12px; }
.rail-label { font-size: 11px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .7px; padding: 6px 16px 4px; }

.rail-cta {
  margin: 4px 6px 12px; white-space: nowrap;
  display: flex; align-items: center; gap: 10px; justify-content: center;
  padding: 13px 18px; border-radius: var(--r-pill);
  background: var(--ai-grad); color: #fff; border: none;
  font-size: 14px; font-weight: 500; cursor: pointer;
  box-shadow: var(--e2); transition: box-shadow .15s, transform .05s;
}
.rail-cta:hover { box-shadow: var(--e3); }
.rail-cta:active { transform: translateY(1px); }

/* ---------- Topbar ---------- */
.main { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.topbar {
  height: var(--topbar-h); flex: none;
  display: flex; align-items: center; gap: 16px;
  padding: 0 28px; background: var(--surface-2);
}
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-3); }
.crumbs b { color: var(--ink); font-weight: 500; }
.crumbs .sep { color: var(--ink-4); }
.search {
  margin-left: auto; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid transparent;
  border-radius: var(--r-pill); padding: 9px 16px; width: 340px;
  color: var(--ink-4); font-size: 14px; box-shadow: var(--e1);
}
.search:focus-within { border-color: var(--line); }
.search input { border: none; background: none; outline: none; flex: 1; font-size: 14px; color: var(--ink); }
.iconbtn {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: none;
  display: grid; place-items: center; color: var(--ink-2); cursor: pointer; transition: background .12s;
}
.iconbtn:hover { background: rgba(31,31,31,.06); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--ai-grad); color: #fff; display: grid; place-items: center;
  font-size: 13px; font-weight: 500; cursor: pointer;
}

/* ---------- Content scroll area ---------- */
.content { flex: 1; overflow-y: auto; padding: 8px 28px 48px; }
.content-inner { max-width: 1180px; margin: 0 auto; }
.page-head { display: flex; align-items: flex-end; gap: 16px; margin: 14px 0 24px; }
.page-title { font-size: 28px; font-weight: 400; letter-spacing: -.5px; margin: 0; }
.page-sub { color: var(--ink-3); font-size: 14px; margin: 4px 0 0; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  padding: 10px 22px; border-radius: var(--r-pill); font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: box-shadow .15s, background .12s, transform .05s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: var(--e1); }
.btn-primary:hover { background: var(--brand-strong); box-shadow: var(--e2); }
.btn-tonal { background: var(--brand-tint); color: var(--brand-strong); }
.btn-tonal:hover { background: #E0E0FB; }
.btn-ghost { background: none; color: var(--brand-strong); }
.btn-ghost:hover { background: var(--brand-tint-2); }
.btn-outline { background: var(--surface); color: var(--ink-2); border-color: var(--line); }
.btn-outline:hover { background: var(--surface-1); }
.btn-ai { background: var(--ai-grad); color: #fff; box-shadow: var(--e1); }
.btn-ai:hover { box-shadow: var(--e3); }
.btn-lg { padding: 13px 28px; font-size: 15px; }
.btn-sm { padding: 7px 16px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- Cards ---------- */
.card {
  background: var(--surface); border-radius: var(--r-md);
  border: 1px solid var(--line-soft);
}
.card-pad { padding: 22px 24px; }
.card-hover { transition: box-shadow .15s, border-color .15s, transform .12s; cursor: pointer; }
.card-hover:hover { box-shadow: var(--e3); border-color: transparent; transform: translateY(-2px); }

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line); color: var(--ink-2); background: var(--surface); white-space: nowrap;
}
.chip.sel { background: var(--brand-tint); border-color: transparent; color: var(--brand-strong); }
.chip.clickable { cursor: pointer; transition: background .12s, border-color .12s; }
.chip.clickable:hover { background: var(--surface-1); }
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: var(--r-pill); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 7px; height: 7px; border-radius: 50%; }
.badge-green { background: var(--green-tint); color: var(--green); }
.badge-amber { background: var(--amber-tint); color: var(--amber); }
.badge-red { background: var(--red-tint); color: var(--red); }
.badge-blue { background: var(--blue-tint); color: var(--blue); }
.badge-gray { background: var(--surface-1); color: var(--ink-3); }
.badge-brand { background: var(--brand-tint); color: var(--brand-strong); }

.scratch-field {
  display: grid;
  gap: 7px;
}
.scratch-field > span {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .45px;
}
.scratch-field input,
.scratch-field select,
.scratch-field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  outline: none;
}
.scratch-field textarea {
  min-height: 94px;
  resize: vertical;
}
.scratch-field input:focus,
.scratch-field select:focus,
.scratch-field textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}

/* ---------- Progress ---------- */
.bar { height: 6px; border-radius: var(--r-pill); background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: var(--r-pill); background: var(--brand); transition: width .5s cubic-bezier(.2,.8,.2,1); }
.bar.ai > i { background: var(--ai-grad); }

/* ---------- Table ---------- */
.tbl { width: 100%; border-collapse: collapse; }
.tbl th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--ink-4);
  text-transform: uppercase; letter-spacing: .5px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft);
}
.tbl td { padding: 14px 16px; border-bottom: 1px solid var(--line-soft); font-size: 14px; color: var(--ink-2); }
.tbl tr.row { cursor: pointer; transition: background .1s; }
.tbl tr.row:hover { background: var(--surface-1); }
.tbl tr:last-child td { border-bottom: none; }

/* ---------- Misc helpers ---------- */
.row { display: flex; align-items: center; }
.col { display: flex; flex-direction: column; }
.gap-4 { gap: 4px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-24 { gap: 24px; }
.spread { justify-content: space-between; }
.mut { color: var(--ink-3); }
.mut2 { color: var(--ink-4); }
.tiny { font-size: 12px; }
.sm { font-size: 13px; }
.fade-in { animation: fade .35s ease both; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.pop { animation: pop .3s cubic-bezier(.2,.9,.3,1.2) both; }
@keyframes pop { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

/* scrollbars */
.content::-webkit-scrollbar, .logwrap::-webkit-scrollbar, .rail::-webkit-scrollbar { width: 10px; }
.content::-webkit-scrollbar-thumb, .logwrap::-webkit-scrollbar-thumb, .rail::-webkit-scrollbar-thumb {
  background: #C9CDD3; border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
.content::-webkit-scrollbar-thumb:hover { background: #AEB3BA; background-clip: content-box; }

/* spinner */
.spin { width: 16px; height: 16px; border: 2px solid rgba(255,255,255,.4); border-top-color: #fff; border-radius: 50%; animation: rot .7s linear infinite; }
.spin.brand { border-color: var(--brand-tint); border-top-color: var(--brand); }
@keyframes rot { to { transform: rotate(360deg); } }

/* ---------- Course slide HTML editor/renderer ---------- */
.slide-html-render,
.slide-rich-editor {
  color: var(--ink);
}
.slide-html-render .slide-html,
.slide-rich-editor .slide-html {
  --slide-accent: var(--brand);
  --slide-accent-soft: var(--brand-tint);
  --slide-second: var(--green);
}
.slide-html h2,
.slide-html-render h2,
.slide-rich-editor h2 {
  margin: 0 0 12px;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 600;
  color: var(--ink);
}
.slide-html .eyebrow {
  margin: 0 0 8px;
  color: var(--slide-accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .6px;
  text-transform: uppercase;
}
.slide-html .lead {
  margin: 0 0 16px;
  font-size: 17px;
  line-height: 1.62;
  color: var(--ink-2);
}
.slide-html ul,
.slide-html ol {
  margin: 14px 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.slide-html li {
  position: relative;
  padding: 12px 14px 12px 44px;
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  background: #fff;
  line-height: 1.45;
}
.slide-html li::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  width: 18px;
  height: 18px;
  border-radius: 7px;
  background: var(--slide-accent);
}
.slide-html .callout,
.slide-html .case-box,
.slide-html .warning-box {
  margin-top: 16px;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--slide-accent-soft);
  border-left: 4px solid var(--slide-accent);
  line-height: 1.5;
}
.slide-html .warning-box {
  background: var(--amber-tint);
  border-left-color: var(--amber);
  color: #7A3E00;
  font-weight: 600;
}
.slide-hero {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.slide-case .case-box p {
  margin: 8px 0 0;
}

.moodle-template {
  --app-primary: var(--slide-accent, var(--brand));
  --app-secondary: var(--slide-second, #0d9488);
  --app-accent: var(--amber);
  --app-bg: #f7f9fc;
  --app-card: #ffffff;
  --app-text: var(--ink);
  --app-muted: var(--ink-3);
  --radius: 22px;
  --shadow: 0 14px 34px rgba(20,35,60,.10);
  background: var(--app-bg);
  color: var(--app-text);
  padding: 22px;
  border-radius: var(--radius);
  line-height: 1.65;
}
.moodle-template.mt-page {
  max-width: 1200px;
  margin: 0 auto;
  background: #fff;
  padding: 20px 24px 28px;
  border-radius: 0;
}
.moodle-template .mt-estimate {
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-3);
  font-size: .94rem;
}
.moodle-template .mt-estimate span {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 9px;
  background: var(--app-primary);
  color: #fff;
  font-size: .82rem;
  font-weight: 800;
}
.moodle-template .prom-box {
  margin: 1.2em 0 0;
  padding: 16px 18px;
  border-left: 5px solid var(--app-secondary);
  background: color-mix(in srgb, var(--slide-accent-soft), #fff 55%);
  border-radius: 0 12px 12px 0;
}
.moodle-template .prom-box h4 {
  margin: 0 0 6px;
  color: var(--app-secondary);
}
.moodle-template .prom-box p {
  margin: 0;
}
.moodle-template .mt-wide-image {
  margin: 0 0 18px;
  min-height: 300px;
}
.moodle-template .mt-compare-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}
.moodle-template .mt-compare-grid > div {
  padding: 0 4px;
}
.moodle-template .mt-compare-grid h4 {
  margin: .5em 0 12px;
  padding-bottom: 10px;
  text-align: center;
  color: var(--app-primary);
  border-bottom: 2px solid var(--app-primary);
}
.moodle-template .mt-compare-grid > div:nth-child(2) h4 {
  color: #B45563;
  border-bottom-color: #EAC7C7;
}
.moodle-template .mt-card {
  background: var(--app-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  border: 1px solid rgba(47,95,159,.08);
}
.moodle-template .mt-title {
  color: var(--app-primary);
  font-weight: 800;
  letter-spacing: 0;
  margin: 0 0 12px;
}
.moodle-template .mt-subtitle {
  color: var(--app-muted);
  font-size: 1.05rem;
}
.moodle-template .mt-badge {
  display: inline-block;
  border-radius: 999px;
  padding: 7px 13px;
  font-weight: 700;
  font-size: .82rem;
  margin: 0 5px 10px 0;
}
.moodle-template .b-basic { background: var(--slide-accent-soft); }
.moodle-template .bloom-recordar { background: #D7E3FC; }
.moodle-template .bloom-comprender { background: #CFF1E4; }
.moodle-template .bloom-aplicar { background: #F6E6B8; }
.moodle-template .bloom-analizar { background: #FADADD; }
.moodle-template .mt-alert,
.moodle-template .mt-action {
  border-left: 7px solid var(--app-accent);
  background: #fff8ec;
  border-radius: 14px;
  padding: 16px;
}
.moodle-template .mt-action {
  display: inline-flex;
  margin-top: 10px;
  border-left: 0;
  background: var(--app-primary);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 10px 18px;
}
.moodle-template .mt-img {
  width: 100%;
  max-height: 360px;
  object-fit: cover;
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.moodle-template .square-img { aspect-ratio: 16 / 10; }
.moodle-template .mt-grid-50 {
  display: grid;
  grid-template-columns: minmax(220px, .9fr) minmax(0, 1.1fr);
  gap: 26px;
  align-items: center;
}
.moodle-template .mt-image-slot {
  min-height: 260px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  background: linear-gradient(135deg, var(--slide-accent-soft), #fff);
  border: 1px dashed rgba(31,31,31,.12);
}
.moodle-template .mt-image-slot:empty { display: none; }
.moodle-template .mt-image-slot:empty::after { content: ""; }
.moodle-template .mt-screen-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.moodle-template .mt-screen-meta span {
  border-radius: 999px;
  padding: 5px 10px;
  background: #fff;
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--line-soft);
}
.moodle-template .mt-template-head {
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line-soft);
}
.moodle-template .mt-template-head h4 {
  margin: 0 0 3px;
  padding: 0;
  color: var(--app-primary);
  font-size: .88rem;
  font-weight: 800;
  letter-spacing: .2px;
  text-transform: uppercase;
}
.moodle-template .mt-template-head p {
  margin: 0;
  color: var(--ink-4);
  font-size: .86rem;
  line-height: 1.35;
}
.moodle-template .mt-banner {
  min-height: 280px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: linear-gradient(135deg, #fff, var(--slide-accent-soft));
}
.moodle-template .mt-process-grid,
.moodle-template .mt-flip-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}
.moodle-template .mt-step-card {
  padding: 20px;
  min-height: 170px;
  border-radius: 18px;
  background: linear-gradient(160deg, var(--slide-accent-soft), #fff);
  text-align: center;
  border: 1px solid var(--line-soft);
}
.moodle-template .mt-step-number,
.moodle-template .mt-time-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--app-primary);
  color: #fff;
  font-weight: 800;
  margin: 0 auto 10px;
}
.moodle-template details {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  padding: 12px 14px;
  margin: 10px 0;
}
.moodle-template summary {
  cursor: pointer;
  color: var(--app-primary);
  font-weight: 800;
}
.moodle-template .mt-tabset input { display: none; }
.moodle-template .mt-tab-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 12px 0;
}
.moodle-template .mt-tab-nav label {
  cursor: pointer;
  border-radius: 999px;
  padding: 9px 14px;
  background: var(--surface-1);
  color: var(--ink-2);
  font-weight: 700;
}
.moodle-template .mt-tab-pane {
  display: none;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.moodle-template .mt-tabset input:nth-of-type(1):checked ~ .mt-tab-nav label:nth-child(1),
.moodle-template .mt-tabset input:nth-of-type(2):checked ~ .mt-tab-nav label:nth-child(2),
.moodle-template .mt-tabset input:nth-of-type(3):checked ~ .mt-tab-nav label:nth-child(3) {
  background: var(--app-primary);
  color: #fff;
}
.moodle-template .mt-tabset input:nth-of-type(1):checked ~ .mt-tab-content .pane-0,
.moodle-template .mt-tabset input:nth-of-type(2):checked ~ .mt-tab-content .pane-1,
.moodle-template .mt-tabset input:nth-of-type(3):checked ~ .mt-tab-content .pane-2 {
  display: block;
}
.moodle-template .mt-flip { perspective: 1000px; min-height: 190px; }
.moodle-template .mt-flip-inner {
  position: relative;
  width: 100%;
  min-height: 190px;
  transition: transform .6s;
  transform-style: preserve-3d;
}
.moodle-template .mt-flip:hover .mt-flip-inner { transform: rotateY(180deg); }
.moodle-template .mt-flip-front,
.moodle-template .mt-flip-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  border-radius: 18px;
  padding: 20px;
  background: var(--slide-accent-soft);
  border: 1px solid var(--line-soft);
}
.moodle-template .mt-flip-back {
  transform: rotateY(180deg);
  background: #fff8ec;
}
.moodle-template .mt-check-list {
  display: grid;
  gap: 10px;
}
.moodle-template .mt-check-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.moodle-template .mt-time-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 14px 0;
}
.moodle-template .mt-time-dot {
  flex: none;
  margin: 0;
}
@media(max-width:900px) {
  .moodle-template .mt-grid-50,
  .moodle-template .mt-process-grid,
  .moodle-template .mt-flip-grid {
    grid-template-columns: 1fr;
  }
}

/* sparkle pulse */
@keyframes sparkle { 0%,100% { opacity: 1; transform: scale(1);} 50% { opacity:.55; transform: scale(.86);} }
.sparkling { animation: sparkle 1.3s ease-in-out infinite; }

/* ---------- Visual Direction Prototypes ---------- */
.visual-direction-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  background: #fff;
  width: fit-content;
  max-width: 100%;
  flex-wrap: wrap;
}

.preview-scorm-shell {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  overflow: hidden;
  --menu-ink: var(--brand);
  --menu-ink-soft: var(--brand-tint);
}
.preview-course-menu {
  border-right: 1px solid #d9dddf;
  background: #fff;
  padding: 0 14px 0 26px;
  overflow: auto;
}
.preview-menu-logo-area {
  padding: 20px 18px 18px;
  background: #f4f5f6;
  border-bottom: 1px solid #d9dddf;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 88px;
}
.preview-menu-logo-img {
  width: 80%;
  max-height: 68px;
  object-fit: contain;
}
.preview-menu-logo-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
}
.preview-menu-logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--menu-ink);
  color: #fff;
  font-size: 20px;
  font-weight: 900;
}
.preview-menu-logo-fallback b {
  color: var(--menu-ink);
  font-size: 16px;
  line-height: 1;
  font-weight: 900;
}
.preview-course-menu ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.preview-course-menu li {
  border-bottom: 0;
}
.preview-course-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  border-radius: 0;
  padding: 8px 4px;
  min-height: auto;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  color: var(--ink);
}
.preview-course-menu button:hover {
  background: var(--menu-ink-soft);
}
.preview-course-menu button:disabled {
  cursor: not-allowed;
}
.preview-course-menu li.active button {
  background: var(--menu-ink-soft);
  box-shadow: none;
}
.preview-course-menu li.locked button {
  opacity: .48;
  background: var(--surface-1);
}
.preview-course-menu button > span:not(.preview-page-progress):not(.preview-tick):not(.preview-item-num) {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.preview-course-menu button b {
  order: 1;
  color: #3f464d;
  font-size: 10.8px;
  line-height: 1.25;
  font-weight: 650;
  text-transform: none;
}
.preview-course-menu button small {
  order: 0;
  color: var(--menu-ink);
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
}
.preview-course-menu li.active button b,
.preview-course-menu li.active button small {
  color: #202124;
  font-weight: 850;
}
.preview-tick {
  flex: none;
  width: 11px;
  height: 11px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: #fff;
  border: 1px solid #cfd6df;
  color: transparent;
  font-weight: 900;
}
.preview-course-menu li.done .preview-tick {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.preview-course-menu li.done .preview-tick::after {
  content: "";
  width: 5px;
  height: 3px;
  border-left: 1.5px solid #fff;
  border-bottom: 1.5px solid #fff;
  transform: rotate(-45deg);
  display: block;
}

/* grouped menu — sections & numbering */
.preview-menu-root {
  margin: 0;
  padding: 0;
}
.preview-menu-section {
  border-bottom: 0;
  padding: 0;
}
.preview-menu-section > ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  border-left: 0;
}
.preview-menu-section > ol > li {
  border-bottom: none;
}
.preview-menu-section > ol > li:last-child {
  border-bottom: none;
}
.preview-menu-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 4px 9px;
  background: transparent;
  font-size: 12.5px;
  font-weight: 850;
  text-transform: none;
  letter-spacing: 0;
  color: #202124;
  border-bottom: none;
  pointer-events: none;
  user-select: none;
  line-height: 1.2;
}
.preview-unit-progress {
  --pct: 0;
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 999px;
  background: conic-gradient(var(--menu-ink) calc(var(--pct) * 1%), #e8edf3 0);
  display: grid;
  place-items: center;
}
.preview-unit-progress i {
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: #fff;
  display: block;
}
.preview-item-num {
  flex: none;
  min-width: 22px;
  font-size: 10px;
  font-weight: 800;
  color: var(--menu-ink);
  opacity: .55;
  letter-spacing: .1px;
  line-height: 1;
  margin-top: 1px;
}
.preview-course-menu li.active .preview-item-num {
  color: var(--menu-ink);
  opacity: 1;
}
.preview-page-progress {
  --pct: 0;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: conic-gradient(var(--menu-ink) calc(var(--pct) * 1%), #e8edf3 0);
  display: grid;
  place-items: center;
  flex: none;
  margin: 1px 2px 0 auto;
  color: var(--menu-ink);
  font-size: 10px;
  font-weight: 850;
}
.preview-page-progress b {
  width: 17px;
  height: 17px;
  border-radius: 999px;
  background: #fff;
  display: grid;
  place-items: center;
  line-height: 1;
}
.preview-course-menu li.done .preview-page-progress {
  background: var(--menu-ink);
  color: #fff;
}
.preview-course-menu li.done .preview-page-progress b {
  background: transparent;
  color: #fff;
}

.preview-slide-stage {
  padding: 24px 28px;
  overflow-y: auto;
  min-width: 0;
}
.template-preview > .moodle-template {
  margin: 0 auto;
}
.template-preview .moodle-template .body {
  white-space: normal;
}
.template-preview .moodle-template .body ul,
.template-preview .moodle-template .box ul {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 10px;
}
.template-preview .moodle-template .body li,
.template-preview .moodle-template .box li {
  padding: 10px 12px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid rgba(31,41,51,.08);
}
.template-preview .bp-page {
  max-width: 1200px;
  margin: 0 auto;
  color: #1f2933;
  line-height: 1.6;
}
.bp-course-strip {
  background: var(--bp-primary-soft, var(--brand-tint));
  border-top: 5px solid var(--bp-primary, var(--brand));
  border-radius: 8px;
  padding: 10px 30px;
  margin: 0 0 18px;
}
.bp-course-strip h1 {
  margin: 0;
  color: #111;
  font-size: 1.5em;
  font-weight: 700;
}
.bp-unit {
  padding: 0;
  margin: 0 0 8px;
  font-size: .9em;
  color: #1f2933;
  font-weight: 700;
  text-transform: uppercase;
}
.bp-title {
  margin: 0 0 18px;
  color: var(--bp-primary, var(--brand));
  font-size: 1.2em;
  font-weight: 800;
}
.bp-wide-img {
  width: 100%;
  aspect-ratio: 20 / 3;
  object-fit: cover;
  border-radius: 6px;
}
.bp-rect-img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
}
.bp-image-card {
  height: 100%;
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 0;
  padding: 0;
}
.bp-list {
  display: grid;
  gap: 10px;
  margin: 1em 0;
  padding: 0;
  list-style: none;
}
.bp-list li {
  padding: 2px 0 2px 18px;
  border-radius: 0;
  background: transparent;
  border-left: 0;
  position: relative;
}
.bp-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .8em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--bp-primary, var(--brand));
}
.prom-box-default {
  background: #f8fafc;
  border-left: 6px solid var(--bp-secondary, var(--brand));
  border-radius: 0 14px 14px 0;
  padding: 16px 18px;
}
.prom-box-default h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 800;
}
.prom-box-default p {
  margin: 0;
}
.bp-page-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 28px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.bp-page-footer span {
  display: inline-flex;
  border-radius: 999px;
  background: var(--bp-primary, var(--brand));
  color: #fff;
  padding: 8px 14px;
  font-weight: 800;
}
@media(max-width:900px) {
  .preview-scorm-shell {
    grid-template-columns: 1fr;
  }
  .preview-course-menu {
    max-height: 210px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .cs-corporate-grid,
  .cs-practical-grid,
  .cs-editorial-points,
  .template-preview .mt-grid-50 {
    grid-template-columns: 1fr !important;
  }
  .course-slide-corporate img,
  .cs-scenario img,
  .template-preview .mt-image-slot,
  .template-preview .bp-image-card {
    order: -1;
    min-height: 220px;
  }
  .course-slide h2 {
    font-size: 26px;
  }
}
.template-preview .bp-course-strip,
.template-preview .bp-unit,
.template-preview .mt-template-head,
.template-preview .screen-topline,
.template-preview .es-unit-label {
  display: none !important;
}
.template-preview .mt-image-slot:empty,
.template-preview .bp-image-card:empty,
.template-preview .es-img-col:empty {
  display: none !important;
}
.visual-direction-switch span {
  padding: 0 8px;
  color: var(--ink-4);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .6px;
}
.visual-direction-switch button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  background: transparent;
  color: var(--ink-2);
  font-weight: 700;
  cursor: pointer;
}
.visual-direction-switch button.active {
  background: linear-gradient(135deg, var(--brand), #fff);
  color: #1f2933;
}
.course-slide {
  --slide-accent: var(--brand);
  --slide-accent-soft: var(--brand-tint);
  --slide-second: var(--green);
  color: var(--ink);
}
.course-slide-meta {
  display: none;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.course-slide-meta span {
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(255,255,255,.88);
  border: 1px solid rgba(218,220,224,.65);
  color: var(--ink-3);
  font-size: 12px;
  font-weight: 700;
}
.cs-kicker {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--slide-accent);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .7px;
}
.course-slide h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.12;
  font-weight: 800;
}
.course-slide p {
  margin: 0;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.65;
}
.cs-corporate-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(240px, .88fr);
  gap: 26px;
  align-items: stretch;
}
.course-slide-corporate {
  padding: 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, #fff 0%, var(--slide-accent-soft) 100%);
  border: 1px solid var(--line-soft);
}
.course-slide-corporate .cs-copy {
  padding: 12px 6px 6px;
}
.course-slide-corporate img {
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(20,35,60,.10);
}
.cs-points {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.cs-points div {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  border: 1px solid var(--line-soft);
}
.cs-points i {
  width: 28px;
  height: 28px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  flex: none;
  background: linear-gradient(135deg, var(--slide-accent), var(--slide-second));
  color: #1f2933;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}
.course-slide-editorial .cs-hero {
  position: relative;
  min-height: 420px;
  border-radius: 26px;
  overflow: hidden;
  background: #111827;
}
.course-slide-editorial .cs-hero img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.course-slide-editorial .cs-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17,24,39,.88), rgba(17,24,39,.45) 46%, rgba(17,24,39,.12));
}
.cs-hero-overlay {
  position: relative;
  z-index: 1;
  max-width: 620px;
  padding: 34px;
  color: #fff;
}
.course-slide-editorial .course-slide-meta span {
  color: rgba(255,255,255,.86);
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.18);
}
.course-slide-editorial h2,
.course-slide-editorial p {
  color: #fff;
}
.course-slide-editorial .cs-kicker {
  color: #fff;
}
.cs-editorial-points {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 14px;
}
.cs-editorial-points article {
  padding: 16px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--line-soft);
}
.cs-editorial-points b {
  display: block;
  color: var(--slide-accent);
  margin-bottom: 8px;
}
.cs-editorial-points span {
  color: var(--ink-2);
  line-height: 1.45;
}
.cs-practical-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, .8fr);
  gap: 18px;
  align-items: stretch;
}
.course-slide-practical {
  padding: 22px;
  border-radius: 24px;
  background: linear-gradient(135deg, #fff, var(--slide-accent-soft));
}
.cs-practical-panel,
.cs-scenario {
  background: #fff;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  padding: 22px;
  box-shadow: var(--e2);
}
.cs-checks {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}
.cs-checks label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface-1);
  border: 1px solid var(--line-soft);
  cursor: pointer;
}
.cs-scenario {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.cs-scenario img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 16px;
}
.cs-scenario div {
  padding: 14px;
  border-radius: 14px;
  color: #1f2933;
  background: linear-gradient(135deg, var(--slide-accent), var(--slide-second));
}
.cs-scenario b,
.cs-scenario span {
  display: block;
}

.es-final-infographic .es-info-list {
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
.infographic-download {
  display: inline-flex;
  margin-top: 14px;
  border-radius: 999px;
  background: var(--app-primary, var(--brand));
  color: #fff;
  text-decoration: none;
  padding: 10px 15px;
  font-size: .85rem;
  font-weight: 800;
}
.es-final-infographic .es-info-list li {
  display: grid;
  gap: 7px;
  padding: 16px 18px;
  border-left: 5px solid var(--app-primary);
  background: #f8fafd;
}
.es-final-infographic .es-info-list b {
  color: var(--app-primary);
}
.es-final-infographic .es-info-list span {
  color: var(--ink-2);
  line-height: 1.45;
}
.es-completion {
  text-align: center;
  min-height: 420px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}
.es-completion-art {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 8px;
}
.es-completion-art svg {
  width: 100%;
  height: 100%;
}
.es-completion-art span {
  position: absolute;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  background: var(--app-primary);
}
.es-completion-art span:nth-child(1) { left: 10px; top: 24px; transform: rotate(18deg); }
.es-completion-art span:nth-child(2) { right: 14px; top: 12px; background: var(--app-secondary); transform: rotate(-22deg); }
.es-completion-art span:nth-child(3) { right: 26px; bottom: 20px; transform: rotate(35deg); }
@media(max-width:760px) {
  .es-final-infographic .es-info-list {
    grid-template-columns: 1fr;
  }
}

.editor-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(31,31,31,.34);
  backdrop-filter: blur(8px);
}
.editor-modal {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--e4);
}
.editor-modal-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}
.editor-modal-header > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.editor-modal-header span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 800;
}
.editor-modal-header small {
  color: var(--mut);
  font-size: 13px;
  line-height: 1.35;
}
.editor-close {
  margin-left: auto;
  flex: none;
}
.editor-modal-body {
  padding: 16px 20px 18px;
  overflow-y: auto;
  min-height: 0;
}
.editor-field-label {
  display: block;
  margin: 0 0 6px;
  color: var(--mut);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.editor-title-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  margin-bottom: 10px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
}
.editor-title-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.moodle-editor-tabs {
  display: flex;
  gap: 8px;
  margin: 8px 0 12px;
  padding: 4px;
  width: max-content;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-1);
}
.moodle-editor-tabs button,
.moodle-editor-toolbar button,
.moodle-editor-toolbar select {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 7px;
  min-height: 34px;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}
.moodle-editor-tabs button,
.moodle-editor-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}
.moodle-editor-tabs button.active {
  background: #fff;
  color: var(--brand-strong);
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(31,31,31,.08);
  font-weight: 700;
}
.moodle-editor-toolbar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding: 8px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
  background: var(--surface-1);
}
.slide-rich-editor {
  min-height: 340px;
  max-height: min(52vh, 560px);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  padding: 16px;
  outline: none;
  background: #fff;
  line-height: 1.55;
}
.html-editor-area {
  width: 100%;
  min-height: 430px;
  max-height: min(56vh, 620px);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  resize: vertical;
  font-family: 'Google Sans Code', monospace;
  line-height: 1.5;
  outline: none;
}
.html-editor-area:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-tint);
}
.quiz-editor-area {
  min-height: 180px;
}
.editor-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 -8px 18px rgba(31,31,31,.04);
}
.editor-modal-footer .btn {
  min-height: 40px;
  white-space: nowrap;
}
@media(max-width:760px) {
  .editor-modal-backdrop {
    padding: 10px;
  }
  .editor-modal {
    max-height: 96vh;
    border-radius: 10px;
  }
  .editor-modal-header,
  .editor-modal-body,
  .editor-modal-footer {
    padding-left: 14px;
    padding-right: 14px;
  }
  .moodle-editor-tabs {
    width: 100%;
  }
  .moodle-editor-tabs button {
    flex: 1;
  }
  .moodle-editor-toolbar {
    max-height: 132px;
    overflow-y: auto;
  }
  .slide-rich-editor,
  .html-editor-area {
    min-height: 320px;
  }
}
.cs-scenario span {
  margin-top: 4px;
  opacity: .9;
  line-height: 1.45;
}
.segmented {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 10px;
  background: #f8fafc;
  border: 1px solid var(--line-soft);
}
.segmented button {
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--ink-3);
  padding: 9px 15px;
  font-weight: 700;
  cursor: pointer;
}
.segmented button.active {
  background: var(--brand);
  color: #fff;
}
.planning-layout {
  display: grid;
  grid-template-columns: minmax(420px, 1.15fr) minmax(420px, .85fr);
  gap: 16px;
  align-items: start;
}
.plan-unit {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 8px 14px;
  align-items: start;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.plan-unit-index {
  color: var(--brand-strong);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .6px;
}
.plan-unit input,
.plan-unit textarea,
.plan-image-row select,
.plan-image-prompt,
.planning-title-input {
  width: 100%;
  border: 1px solid transparent;
  border-bottom-color: var(--line);
  border-radius: 0;
  padding: 7px 0;
  font: inherit;
  background: transparent;
}
.plan-unit input:focus,
.plan-unit textarea:focus,
.plan-image-row select:focus,
.plan-image-prompt:focus,
.planning-title-input:focus {
  outline: none;
  border-bottom-color: var(--brand);
}
.planning-title-input {
  font-size: 20px;
  font-weight: 700;
}
.plan-unit textarea {
  grid-column: 2 / 3;
  min-height: 88px;
  resize: none;
  overflow: hidden;
  line-height: 1.45;
}
.plan-unit-actions {
  grid-row: 1 / span 2;
  grid-column: 3;
  display: flex;
  gap: 6px;
}
.unit-build-card {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-sm);
}
.unit-build-card.done {
  border-color: #CDEBD6;
  background: linear-gradient(120deg, var(--green-tint), #fff 70%);
}
.unit-build-card.error {
  border-color: #F5C8CC;
  background: linear-gradient(120deg, var(--red-tint), #fff 70%);
}
.unit-build-main {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
}
.unit-build-index {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 800;
}
.unit-build-card h2 {
  margin: 0 0 6px;
  font-size: 18px;
  line-height: 1.25;
}
.unit-build-card p {
  margin: 0;
  color: var(--ink-2);
  font-size: 14px;
  line-height: 1.55;
  white-space: pre-wrap;
}
.unit-build-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}
.plan-image-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr);
  gap: 10px;
  align-items: start;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}
.plan-image-objective {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-width: 0;
}
.plan-image-objective input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
}
.plan-image-objective span {
  font-size: 13px;
  line-height: 1.45;
  color: var(--ink);
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}
.plan-image-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(150px, 1fr));
  gap: 12px;
  padding-left: 30px;
}
.plan-image-controls label {
  display: grid;
  gap: 4px;
  min-width: 0;
}
.plan-image-controls label > span {
  color: var(--ink-4);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.plan-image-prompt {
  width: auto;
  margin-left: 30px;
}
.plan-infographic {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  padding: 11px 0;
  border-radius: 0;
  background: transparent;
  border-top: 1px solid var(--line-soft);
  color: var(--ink);
  font-weight: 700;
  font-size: 13px;
}
@media(max-width:900px) {
  .planning-layout {
    grid-template-columns: 1fr;
  }
  .cs-corporate-grid,
  .cs-practical-grid,
  .cs-editorial-points {
    grid-template-columns: 1fr;
  }
  .plan-unit,
  .plan-image-row {
    grid-template-columns: 1fr;
  }
  .plan-unit textarea,
  .plan-unit-actions {
    grid-column: auto;
    grid-row: auto;
  }
  .plan-image-controls {
    grid-template-columns: 1fr;
    padding-left: 30px;
  }
  .course-slide h2 {
    font-size: 28px;
  }
}
