/* ============ Argus — white theme, brand arc palette ============ */
:root {
  --bg: #faf9fc;
  --panel: #ffffff;
  --panel2: #f5f2f9;
  --border: #ece7f3;
  --fg: #1d1528;
  --muted: #6e6382;
  --accent: #a936a4;
  --accent2: #ea3d8e;
  --safe: #21924d;
  --warn: #b06a00;
  --danger: #dc2626;
  --radius: 14px;
  --brand-green: #43a35f;
  --brand-purple: #7c3aa4;
  --brand-magenta: #b13399;
  --brand-pink: #ea3d8e;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}

/* inline line-icons sit nicely with text */
.ic-svg { vertical-align: -2px; flex-shrink: 0; }
.btn .ic-svg { vertical-align: -2.5px; }

::selection { background: rgba(169, 54, 164, 0.4); }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
}
/* segmented brand line, echoing the arc mark */
.topbar::after {
  content: ""; display: block; height: 3px;
  background: linear-gradient(90deg,
    var(--brand-green) 0 10%,
    var(--brand-purple) 10% 42%,
    var(--brand-magenta) 42% 72%,
    var(--brand-pink) 72% 100%);
}
.topbar-inner {
  width: 100%; padding: 12px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand-mark {
  width: 34px; height: 34px; border-radius: 10px;
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: 0 1px 3px rgba(29, 21, 40, 0.06);
  display: flex; align-items: center; justify-content: center;
}
.brand-name { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; }
.brand-sub { font-size: 11px; color: var(--muted); margin-top: 3px; }

.tabs { display: flex; gap: 6px; }
.tab {
  padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: all 0.15s;
}
.tab:hover { color: var(--fg); background: var(--panel2); }
.tab.active {
  color: var(--fg); background: var(--panel);
  border: 1px solid var(--border); box-shadow: 0 1px 3px rgba(29, 21, 40, 0.06);
  font-weight: 600;
}

/* ---------- layout (full screen) ---------- */
.container { width: 100%; padding: 32px 40px 72px; }
@media (max-width: 700px) { .container { padding: 24px 18px 56px; } .topbar-inner { padding: 12px 18px; } }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.025em; }
.page-head .sub { color: var(--muted); font-size: 14px; margin-top: 4px; }
.page-head .actions { display: flex; gap: 8px; }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04);
}

.grid2 { display: grid; grid-template-columns: 1fr 340px; gap: 24px; align-items: start; }
@media (max-width: 900px) { .grid2 { grid-template-columns: 1fr; } }

.empty {
  text-align: center; padding: 48px 24px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: var(--radius);
}
.empty b { color: var(--fg); display: block; margin-bottom: 6px; font-size: 15px; }

/* ---------- buttons & forms ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 18px; border-radius: 999px; font-size: 14px; font-weight: 500;
  border: 1px solid transparent; cursor: pointer; transition: all 0.15s; text-decoration: none;
  font-family: inherit; color: var(--fg); background: transparent;
}
/* accent lives on the border, not the fill */
.btn-primary { background: var(--panel); color: var(--accent); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: rgba(169, 54, 164, 0.06); box-shadow: 0 2px 8px rgba(169, 54, 164, 0.12); }
.btn-secondary { background: var(--panel); border-color: var(--border); box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04); }
.btn-secondary:hover { border-color: #d8cfe4; box-shadow: 0 2px 8px rgba(29, 21, 40, 0.07); }
.btn-danger { background: var(--panel); color: var(--danger); border-color: rgba(220, 38, 38, 0.35); }
.btn-danger:hover { background: rgba(220, 38, 38, 0.05); }
.btn-sm { padding: 5px 12px; font-size: 12.5px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.field { margin-bottom: 14px; }
.field label { display: block; font-size: 12px; font-weight: 500; color: var(--muted); margin-bottom: 6px; }
.field input[type="text"], .field textarea, .field select {
  width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg);
  font-family: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none; border-color: rgba(169, 54, 164, 0.7);
  box-shadow: 0 0 0 3px rgba(169, 54, 164, 0.15);
}

.file-row { display: flex; align-items: center; gap: 10px; }
.file-row input[type="file"] { font-size: 12px; color: var(--muted); }
.avatar-thumb { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--panel2); border: 1px solid var(--border); }

/* ---------- verdict buttons ---------- */
.vgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.vbtn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 13.5px; font-weight: 600; background: transparent; transition: all 0.12s;
}
.vbtn .ic { font-size: 18px; line-height: 1; }
.vbtn .key { font-size: 10px; font-weight: 400; opacity: 0.6; }
.vbtn.v-safe { border: 1px solid rgba(33, 146, 77, 0.4); color: var(--safe); }
.vbtn.v-safe:hover { background: rgba(33, 146, 77, 0.1); }
.vbtn.v-safe.sel { background: rgba(33, 146, 77, 0.2); border-color: var(--safe); box-shadow: 0 0 0 1px var(--safe); }
.vbtn.v-warn { border: 1px solid rgba(245, 158, 11, 0.4); color: var(--warn); }
.vbtn.v-warn:hover { background: rgba(245, 158, 11, 0.1); }
.vbtn.v-warn.sel { background: rgba(245, 158, 11, 0.2); border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.vbtn.v-danger { border: 1px solid rgba(220, 38, 38, 0.4); color: var(--danger); }
.vbtn.v-danger:hover { background: rgba(220, 38, 38, 0.1); }
.vbtn.v-danger.sel { background: rgba(220, 38, 38, 0.2); border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

/* ---------- badges ---------- */
.badge {
  display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 500; border: 1px solid var(--border);
  background: var(--panel2); color: var(--muted);
}
.badge.b-safe { background: rgba(33, 146, 77, 0.1); color: var(--safe); border-color: rgba(33, 146, 77, 0.3); }
.badge.b-warn { background: rgba(245, 158, 11, 0.1); color: var(--warn); border-color: rgba(245, 158, 11, 0.3); }
.badge.b-danger { background: rgba(220, 38, 38, 0.1); color: var(--danger); border-color: rgba(220, 38, 38, 0.3); }
.badge.b-accent { background: rgba(169, 54, 164, 0.1); color: var(--accent); border-color: rgba(169, 54, 164, 0.3); }

/* ---------- lists & tables ---------- */
.list { display: flex; flex-direction: column; gap: 10px; }
.row-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 15px 20px; transition: box-shadow 0.15s, transform 0.15s;
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04);
}
.row-card:hover { box-shadow: 0 5px 16px rgba(29, 21, 40, 0.08); transform: translateY(-1px); }
.row-card .info { min-width: 0; }
.row-card .title { font-weight: 600; font-size: 15px; }
.row-card .meta { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.row-card .side { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; color: var(--muted); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--border); }
td { padding: 10px 12px; border-bottom: 1px solid #f0ebf6; }
tr:last-child td { border-bottom: none; }

/* ---------- item chips in builder ---------- */
.item-chip {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color 0.15s;
}
.item-chip:hover { border-color: rgba(169, 54, 164, 0.5); }
.item-chip.editing { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.item-chip .nm { font-size: 13.5px; font-weight: 600; }
.item-chip .tg { font-size: 11.5px; color: var(--muted); }
.item-chip .rm { margin-left: auto; background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px; }
.item-chip .rm:hover { color: var(--danger); }

/* ---------- phone simulator ---------- */
.phone { width: 300px; margin: 0 auto; user-select: none; }
.phone-bezel {
  border-radius: 44px; border: 1px solid #241d2e; background: #000;
  padding: 10px; box-shadow: 0 22px 50px rgba(29, 21, 40, 0.3);
}
.phone-screen {
  position: relative; height: 560px; overflow: hidden;
  border-radius: 34px; background: #141824;
}
.p-island {
  position: absolute; left: 50%; top: 8px; transform: translateX(-50%);
  width: 90px; height: 22px; background: #000; border-radius: 999px; z-index: 20;
}
.p-status {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 28px 0; font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, 0.9);
}
.p-status .icons { display: flex; align-items: center; gap: 4px; }
.p-hero {
  margin-top: 12px; height: 96px;
  background: linear-gradient(135deg, rgba(124, 58, 164, 0.85), rgba(177, 51, 153, 0.65) 55%, rgba(234, 61, 142, 0.7));
}
.p-avatar-wrap { display: flex; justify-content: center; margin-top: -48px; position: relative; z-index: 10; }
.p-avatar {
  width: 96px; height: 96px; border-radius: 50%; border: 4px solid #141824;
  object-fit: cover; background: var(--panel2); display: block;
}
.p-avatar.fallback {
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 700; color: #fff;
}
.p-name-row { margin-top: 12px; display: flex; justify-content: center; padding: 0 24px; }
.p-name { font-size: 18px; font-weight: 700; color: #fff; padding: 2px 8px; text-align: center; }
.p-bio-row { margin-top: 6px; display: flex; justify-content: center; padding: 0 26px; }
.p-bio {
  padding: 4px 8px; text-align: center; font-size: 13px; line-height: 1.6;
  color: rgba(255, 255, 255, 0.72); white-space: pre-wrap; max-height: 176px; overflow: hidden;
}
.p-bio.none { font-style: italic; color: rgba(255, 255, 255, 0.3); }
.p-actions { position: absolute; bottom: 24px; left: 32px; right: 32px; display: flex; gap: 12px; }
.p-actions .pa {
  flex: 1; border-radius: 999px; padding: 10px 0; text-align: center;
  font-size: 14px; font-weight: 600;
}
.p-actions .pa.chat { background: linear-gradient(135deg, var(--brand-purple), var(--brand-pink)); color: #fff; }
.p-actions .pa.follow { border: 1px solid rgba(255, 255, 255, 0.2); color: rgba(255, 255, 255, 0.8); }
.hl { box-shadow: 0 0 0 3px #141824, 0 0 0 5px var(--accent2); border-radius: 10px; }
.p-avatar-wrap .hl { border-radius: 50%; }

/* ---------- test taking ---------- */
.quiz-wrap { max-width: 420px; margin: 0 auto; }
.progress { height: 6px; background: var(--panel2); border-radius: 999px; overflow: hidden; margin-bottom: 8px; }
.progress .fill { height: 100%; background: linear-gradient(90deg, var(--brand-green), var(--brand-purple), var(--brand-magenta), var(--brand-pink)); transition: width 0.25s; }
.quiz-meta { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 18px; }
.quiz-q { text-align: center; font-size: 15px; font-weight: 600; margin: 18px 0 12px; }
.quiz-q .badge { margin-left: 8px; }

/* ---------- results ---------- */
.score-hero { text-align: center; padding: 32px 20px 24px; }
.score-num { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; }
.score-num.good { color: var(--safe); }
.score-num.bad { color: var(--danger); }
.score-sub { color: var(--muted); font-size: 14px; margin-top: 4px; }

.review-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
}
.review-item.ok { border-left: 3px solid var(--safe); }
.review-item.ko { border-left: 3px solid var(--danger); }
.review-item .body { flex: 1; min-width: 0; }
.review-item .nm { font-weight: 600; font-size: 14px; }
.review-item .bio-line { color: var(--muted); font-size: 12.5px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.review-item .verdicts { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.review-item .rationale {
  margin-top: 8px; font-size: 13px; color: var(--muted);
  background: var(--panel2); border-radius: 8px; padding: 8px 12px;
}
.review-item .rationale b { color: var(--fg); font-weight: 600; }

.stat-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 24px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04); }
.stat .lbl { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.stat .val { font-size: 26px; font-weight: 700; margin-top: 4px; }
.stat .hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.bar-mini { height: 5px; border-radius: 999px; background: var(--panel2); overflow: hidden; margin-top: 6px; }
.bar-mini .f { height: 100%; border-radius: 999px; }

.section-title { font-size: 15px; font-weight: 600; margin: 26px 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }

/* ---------- admin sub-nav (underline tabs) ---------- */
.subnav { display: flex; gap: 26px; margin-bottom: 26px; border-bottom: 1px solid var(--border); }
.subnav a {
  padding: 10px 2px 12px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); text-decoration: none; transition: color 0.15s;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.subnav a:hover { color: var(--fg); }
.subnav a.on { color: var(--fg); font-weight: 600; border-bottom-color: var(--accent); }

/* ---------- assignment chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500;
  border: 1px solid var(--border); background: var(--panel); color: var(--muted);
  cursor: pointer; transition: all 0.12s; user-select: none;
}
.chip:hover { border-color: #d8cfe4; }
.chip.on { background: var(--panel); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ---------- countdown timer ---------- */
.timer { font-weight: 600; color: var(--accent2); font-variant-numeric: tabular-nums; }
.timer.low { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }

/* ---------- course builder blocks ---------- */
.block-card { padding: 14px 16px; }
.block-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.block-tools { display: flex; gap: 6px; }
.block-card textarea {
  width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg);
  font-family: inherit; resize: vertical;
}
.block-card textarea:focus { outline: none; border-color: rgba(169, 54, 164, 0.7); }

/* ---------- course lesson & quiz feedback ---------- */
.lesson { font-size: 14.5px; line-height: 1.8; color: var(--fg); }
.feedback { padding: 18px; }
.feedback .fb-head { font-size: 17px; font-weight: 700; }
.feedback.fb-ok { border-color: rgba(33, 146, 77, 0.45); }
.feedback.fb-ok .fb-head { color: var(--safe); }
.feedback.fb-ko { border-color: rgba(220, 38, 38, 0.45); }
.feedback.fb-ko .fb-head { color: var(--danger); }
.feedback .verdicts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.feedback .rationale {
  font-size: 13px; color: var(--muted);
  background: var(--panel2); border-radius: 8px; padding: 8px 12px;
}
.feedback .rationale b { color: var(--fg); }

/* ---------- question picker ---------- */
.picker-tools { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.picker-tools input[type="text"], .picker-tools select {
  flex: 1; min-width: 180px; padding: 9px 12px; border-radius: 10px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg); font-family: inherit;
}
.picker-tools input:focus, .picker-tools select:focus { outline: none; border-color: rgba(169, 54, 164, 0.7); }
.picker-list {
  margin-top: 12px; max-height: 380px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 8px;
}
.qpick {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  cursor: pointer; transition: border-color 0.12s, background 0.12s; user-select: none;
}
.qpick:hover { border-color: #d8cfe4; }
.qpick.on { border-color: var(--accent); background: var(--panel); }
.qpick .q-info { flex: 1; min-width: 0; }
.qpick .nm { font-size: 13.5px; font-weight: 600; }
.qpick .tg { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qcheck {
  width: 22px; height: 22px; border-radius: 6px; border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: #fff;
}
.qpick.on .qcheck { background: var(--accent); border-color: var(--accent); }
.block-card.picking { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }

/* ---------- full-screen course editor ---------- */
body.editor-mode .topbar { display: none; }
body.editor-mode .container { max-width: none; padding: 0; }

.fs-editor { display: flex; flex-direction: column; height: 100vh; }
.fs-top {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 18px; background: var(--panel);
}
.fs-back {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--panel); cursor: pointer;
  border-radius: 12px; color: var(--muted); text-decoration: none; font-size: 19px;
  font-family: inherit; transition: all 0.15s;
}
.fs-back:hover { background: var(--panel2); color: var(--fg); border-color: #d8cfe4; }
.fs-title { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.fs-title b { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }
.fs-brandline {
  height: 3px; flex-shrink: 0;
  background: linear-gradient(90deg,
    var(--brand-green) 0 10%,
    var(--brand-purple) 10% 42%,
    var(--brand-magenta) 42% 72%,
    var(--brand-pink) 72% 100%);
}
.fs-body { flex: 1; display: grid; grid-template-columns: var(--sidew, 300px) minmax(0, 1fr); min-height: 0; position: relative; }
.fs-body.side-hidden { grid-template-columns: minmax(0, 1fr); }
.fs-body.side-hidden .fs-side { display: none; }
.fs-side {
  border-right: 1px solid var(--border); background: var(--panel);
  overflow-y: auto; padding: 16px;
}
.fs-main { overflow-y: auto; background: var(--bg); }
.fs-main-inner { max-width: 860px; margin: 0 auto; padding: 30px 36px 60px; }
.fs-sec-title {
  width: 100%; font-size: 27px; font-weight: 700; letter-spacing: -0.02em;
  border: none; border-bottom: 2px solid transparent; background: transparent;
  color: var(--fg); padding: 4px 0 8px; margin-bottom: 18px; font-family: inherit;
}
.fs-sec-title::placeholder { color: #c9bfd6; }
.fs-sec-title:focus { outline: none; border-bottom-color: var(--brand-magenta); }

.outline-list { display: flex; flex-direction: column; gap: 4px; }
.outline-item {
  display: flex; align-items: center; gap: 6px; padding: 9px 10px;
  border-radius: 10px; cursor: pointer; border-left: 3px solid transparent;
  transition: background 0.12s;
}
.outline-item:hover { background: var(--panel2); }
.outline-item.on { background: var(--panel2); border-left-color: var(--brand-magenta); }
.outline-item .t { font-size: 13.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.outline-item .m { font-size: 11px; color: var(--muted); margin-top: 1px; }
.outline-tools { display: flex; gap: 2px; flex-shrink: 0; }
.ot-btn {
  width: 22px; height: 22px; border-radius: 6px; border: none; background: none;
  color: var(--muted); cursor: pointer; font-size: 12px; font-family: inherit;
  display: flex; align-items: center; justify-content: center;
}
.ot-btn:hover { background: var(--border); color: var(--fg); }
.ot-btn.ot-del:hover { background: rgba(220, 38, 38, 0.12); color: var(--danger); }
.ot-btn:disabled { opacity: 0.3; cursor: default; }

.add-row { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }

@media (max-width: 860px) {
  .fs-body { grid-template-columns: 1fr; }
  .fs-side { border-right: none; border-bottom: 1px solid var(--border); max-height: 40vh; }
  .side-resize { display: none; }
}

/* ---------- Canva-style course editor ---------- */
.editor { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .editor { grid-template-columns: 1fr; } .palette { position: static !important; max-height: none !important; } }
.palette {
  position: sticky; top: 76px; padding: 16px;
  max-height: calc(100vh - 100px); overflow-y: auto;
}
.pal-title { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.pal-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pal-btn {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border-radius: 10px; border: 1px solid var(--border);
  background: var(--panel2); color: var(--fg); font-family: inherit;
  font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.12s;
}
.pal-btn:hover { border-color: var(--accent); background: var(--panel); transform: translateY(-1px); }
.pal-btn .pi { font-size: 20px; line-height: 1; }
.pal-divider { height: 1px; background: var(--border); margin: 16px 0; }
.palette input[type="text"] {
  width: 100%; padding: 8px 11px; border-radius: 10px; font-size: 13.5px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg); font-family: inherit;
}
.palette input[type="text"]:focus { outline: none; border-color: rgba(169, 54, 164, 0.7); }
.pal-bank { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; }
.pal-bank .qpick { padding: 8px 10px; }
.canvas { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.canvas .block-card input[type="text"] {
  width: 100%; padding: 9px 12px; border-radius: 10px; font-size: 14px;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg); font-family: inherit;
}
.canvas .block-card input[type="text"]:focus { outline: none; border-color: rgba(169, 54, 164, 0.7); }
.canvas .block-card input[type="file"] { font-size: 12px; color: var(--muted); }
.lesson-img { max-width: 100%; max-height: 420px; border-radius: 10px; border: 1px solid var(--border); }
.vid { width: 100%; aspect-ratio: 16 / 9; border-radius: 10px; border: 1px solid var(--border); background: #000; }
.drop-hint {
  padding: 28px; border: 1px dashed var(--border); border-radius: 10px;
  color: var(--muted); text-align: center; font-size: 13px;
}

/* ---------- choice / TF questions ---------- */
.qcard { padding: 20px; }
.q-prompt { font-size: 15.5px; font-weight: 600; line-height: 1.6; }
.opts { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  padding: 12px 14px; border-radius: 12px; cursor: pointer; font-family: inherit;
  font-size: 14px; font-weight: 500; color: var(--fg);
  background: var(--panel2); border: 1px solid var(--border); transition: all 0.12s;
}
.opt:hover { border-color: rgba(169, 54, 164, 0.6); }
.opt.sel { border-color: var(--accent); background: rgba(169, 54, 164, 0.05); box-shadow: 0 0 0 1px var(--accent); }
.opt-key {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 600; color: var(--muted);
}
.opt.sel .opt-key { background: var(--accent); border-color: var(--accent); color: #fff; }

/* option rows in the question editor */
.opt-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.opt-row input[type="text"] { flex: 1; }
.opt-correct {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0; cursor: pointer;
  background: var(--panel2); border: 1px solid var(--border); color: #fff;
  font-size: 14px; font-weight: 700; transition: all 0.12s;
}
.opt-correct:hover { border-color: var(--safe); }
.opt-correct.on { background: var(--safe); border-color: var(--safe); }
.opt-fixed { font-size: 14px; font-weight: 500; }
.opt-row .rm { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 15px; padding: 4px; }
.opt-row .rm:hover { color: var(--danger); }

/* ---------- course sections in the editor ---------- */
.section-block {
  border: 1px solid var(--border); border-radius: 14px; padding: 14px;
  background: #fcfbfe; transition: border-color 0.15s;
}
.section-block.sec-active { border-color: rgba(169, 54, 164, 0.55); }
.sec-head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.sec-title {
  flex: 1; min-width: 0; padding: 8px 12px; border-radius: 10px; font-size: 15px; font-weight: 600;
  background: var(--panel2); border: 1px solid var(--border); color: var(--fg); font-family: inherit;
}
.sec-title:focus { outline: none; border-color: rgba(169, 54, 164, 0.7); }
.sec-blocks { display: flex; flex-direction: column; gap: 12px; }

/* ---------- course cover page ---------- */
.cover { padding: 28px; }
.cover h1 { font-size: 26px; letter-spacing: -0.02em; }
.cover-outline { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.cover-sec {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px;
  background: var(--panel2); border: 1px solid var(--border); border-radius: 10px;
  font-size: 14px; font-weight: 500;
}
.cover-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: rgba(169, 54, 164, 0.15); color: var(--brand-purple);
  font-size: 12px; font-weight: 700;
}

/* ---------- admin dashboard ---------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: start; }
@media (max-width: 1000px) { .dash-grid { grid-template-columns: 1fr; } }
.act-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 16px; border-bottom: 1px solid #f0ebf6;
}
.act-row:last-child { border-bottom: none; }
.act-ic {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel2); color: var(--accent); border: 1px solid var(--border);
}
.act-body { flex: 1; min-width: 0; }
.act-line { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-meta { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.brand-mark img { display: block; }

/* ---------- text formatting toolbar ---------- */
.fmt-wrap { display: flex; flex-direction: column; }
.fmt-bar {
  display: flex; gap: 2px; align-self: flex-start;
  background: var(--panel); border: 1px solid var(--border); border-bottom: none;
  border-radius: 8px 8px 0 0; padding: 3px 4px;
}
.fmt-btn {
  min-width: 26px; height: 24px; padding: 0 6px; border: none; border-radius: 5px;
  background: none; color: var(--muted); cursor: pointer; font-family: inherit; font-size: 12.5px;
  display: flex; align-items: center; justify-content: center;
}
.fmt-btn:hover { background: var(--panel2); color: var(--fg); }
.fmt-wrap textarea { border-top-left-radius: 0 !important; }
.lesson ul, .rationale ul { padding-left: 20px; margin: 4px 0; }
.lesson li { margin: 2px 0; }

/* ---------- section flow switch ---------- */
.seg { display: flex; align-items: center; gap: 0; }
.seg-btn {
  padding: 6px 14px; font-size: 12.5px; font-weight: 500; font-family: inherit;
  background: var(--panel); color: var(--muted); border: 1px solid var(--border); cursor: pointer;
}
.seg-btn:first-child { border-radius: 999px 0 0 999px; }
.seg-btn + .seg-btn { border-left: none; border-radius: 0 999px 999px 0; }
.seg-btn.on { color: var(--accent); border-color: var(--accent); background: rgba(169, 54, 164, 0.05); font-weight: 600; }
.seg-btn.on + .seg-btn { border-left: 1px solid var(--accent); margin-left: -1px; }

/* ---------- course banner ---------- */
.banner-thumb { width: 100%; max-height: 90px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.cover-banner { width: 100%; max-height: 190px; object-fit: cover; border-radius: 10px; margin-bottom: 16px; border: 1px solid var(--border); }

/* ---------- multi-block pages ---------- */
.page-stack { display: flex; flex-direction: column; gap: 14px; }

/* ---------- per-component verdicts (moderation cases) ---------- */
.mod-verdicts { display: flex; flex-direction: column; gap: 8px; }
.mv-row { display: flex; align-items: center; gap: 10px; }
.mv-label { width: 72px; font-size: 12.5px; font-weight: 600; color: var(--muted); flex-shrink: 0; }
.mv-btns { display: flex; gap: 6px; flex-wrap: wrap; flex: 1; }
.mvb {
  padding: 6px 11px; border-radius: 999px; font-size: 12px; font-weight: 600;
  font-family: inherit; background: var(--panel); cursor: pointer; transition: all 0.12s;
}
.mvb.v-safe { border: 1px solid rgba(33, 146, 77, 0.4); color: var(--safe); }
.mvb.v-safe:hover { background: rgba(33, 146, 77, 0.07); }
.mvb.v-safe.sel { background: rgba(33, 146, 77, 0.14); border-color: var(--safe); box-shadow: 0 0 0 1px var(--safe); }
.mvb.v-warn { border: 1px solid rgba(245, 158, 11, 0.45); color: var(--warn); }
.mvb.v-warn:hover { background: rgba(245, 158, 11, 0.08); }
.mvb.v-warn.sel { background: rgba(245, 158, 11, 0.15); border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); }
.mvb.v-danger { border: 1px solid rgba(220, 38, 38, 0.4); color: var(--danger); }
.mvb.v-danger:hover { background: rgba(220, 38, 38, 0.06); }
.mvb.v-danger.sel { background: rgba(220, 38, 38, 0.12); border-color: var(--danger); box-shadow: 0 0 0 1px var(--danger); }

.mod-breakdown { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mb-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.mb-comp { width: 58px; font-weight: 600; font-size: 12.5px; flex-shrink: 0; }

/* ---------- runner sidebar: collapsible, Easygenerator-style ---------- */
.fs-body.runner-body { grid-template-columns: auto minmax(0, 1fr); }
.fs-side.runner {
  position: relative; width: 292px; padding: 24px 18px 40px;
  transition: width 0.22s ease, padding 0.22s ease;
}
.fs-side.runner .side-course { padding-right: 34px; }
.side-toggle, .side-expand {
  width: 30px; height: 30px; border: none; background: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  color: #b0aabf; cursor: pointer; transition: all 0.15s; font-family: inherit;
}
.side-toggle:hover, .side-expand:hover { background: var(--panel2); color: var(--fg); }
.side-toggle { position: absolute; top: 20px; right: 12px; }
.side-expand { display: none; margin: 0 auto; }
.fs-side.runner.collapsed { width: 54px; padding: 16px 8px; overflow: hidden; }
.fs-side.runner.collapsed .side-content, .fs-side.runner.collapsed .side-toggle { display: none; }
.fs-side.runner.collapsed .side-expand { display: flex; }
.fs-editor[data-device="tablet"] .fs-side.runner { width: 230px; }

/* ---------- moderator full-screen runner ---------- */
.timer-banner {
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px 14px; margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04);
}
.timer-banner .tb-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.timer-banner .tb-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }
.timer-banner .tb-time b { font-size: 22px; font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.timer-banner .tb-total { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.timer-banner .tb-bar { height: 5px; border-radius: 999px; background: var(--panel2); overflow: hidden; margin-top: 10px; }
.timer-banner .tb-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--brand-purple), var(--brand-pink)); transition: width 0.3s linear; }
.timer-banner.low { border-color: rgba(220, 38, 38, 0.45); }
.timer-banner.low .tb-time b { color: var(--danger); animation: pulse 1s infinite; }
.timer-banner.low .tb-fill { background: var(--danger); }

.q-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel2); border: 1px solid var(--border);
  font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.outline-item.on .q-num { border-color: var(--accent); color: var(--accent); }
.q-num.done { background: rgba(33, 146, 77, 0.1); border-color: rgba(33, 146, 77, 0.4); color: var(--safe); }

.course-banner { width: 100%; height: 230px; overflow: hidden; border-bottom: 1px solid var(--border); }
.course-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }

.side-course { padding: 2px 4px 10px; }
.side-title { font-size: 15.5px; font-weight: 700; letter-spacing: -0.01em; margin: 3px 0; line-height: 1.35; }

.step-title { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }

.block-title {
  flex: 1; min-width: 0; margin: 0 10px; padding: 6px 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--panel2);
  font-size: 12.5px; font-family: inherit; color: var(--fg);
}
.block-title:focus { outline: none; border-color: rgba(169, 54, 164, 0.6); background: var(--panel); }

.run-sec { margin-bottom: 14px; }
.run-sec button.run-sec-title, button.run-sec-title {
  width: 100%; background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left; padding: 6px 6px; border-radius: 9px;
}
button.run-sec-title:hover { background: var(--panel2); }
.run-sec-title .chev { color: var(--muted); display: flex; transition: transform 0.15s; }
.run-sec-title .chev.open { transform: rotate(90deg); }
.rs-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-sec-title { display: flex; align-items: center; gap: 9px; font-size: 13.5px; font-weight: 700; margin-bottom: 6px; }
.run-sec-title .n {
  width: 24px; height: 24px; border-radius: 7px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid #e2e4ec; font-size: 11.5px; font-weight: 700; color: var(--muted);
}
.run-sec-title.cur .n { border-color: var(--accent); color: var(--accent); }
.run-sec-title.done .n { background: rgba(33, 146, 77, 0.1); border-color: rgba(33, 146, 77, 0.4); color: var(--safe); }
.run-sec-title .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.run-steps { margin-left: 10px; border-left: 2px solid var(--border); padding-left: 12px; display: flex; flex-direction: column; gap: 2px; }
/* the toggle sets the hidden attribute; without this, display:flex above wins
   over the UA's [hidden] rule and sections can never collapse */
.run-steps[hidden] { display: none; }
.run-step {
  display: flex; align-items: center; gap: 9px; padding: 7px 10px;
  font-size: 13px; color: #5b6272; border-radius: 8px;
}
.run-step svg { flex-shrink: 0; color: #a8adbc; }
.run-step.cur { color: var(--accent); font-weight: 600; background: rgba(169, 54, 164, 0.07); }
.run-step.cur svg { color: var(--accent); }
.run-step.done { color: var(--safe); }
.run-step.done svg { color: var(--safe); }

/* ---------- course page (Enhanced course page design) ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.fade-up { animation: fadeUp 0.45s ease both; }

.fs-progressline { height: 3px; flex-shrink: 0; background: var(--panel2); overflow: hidden; }
.fs-progressline > div {
  height: 100%;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-purple) 55%, var(--brand-pink));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.hd-progress { width: 120px; height: 8px; background: var(--panel2); border-radius: 20px; overflow: hidden; }
.hd-fill {
  height: 100%; border-radius: 20px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-purple) 55%, var(--brand-pink));
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.chips-row { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 600; color: var(--muted);
  background: var(--panel2); border: 1px solid var(--border);
  padding: 7px 13px; border-radius: 20px;
}
.learn-head { font-size: 12.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); margin-bottom: 14px; }
.learn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px 24px; }
@media (max-width: 640px) { .learn-grid { grid-template-columns: 1fr; } }
.learn-item { display: flex; gap: 9px; align-items: flex-start; font-size: 14.5px; line-height: 1.45; }
.learn-item .tick { color: var(--safe); font-weight: 800; flex-shrink: 0; }

.lesson-eyebrow { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--accent); margin-bottom: 10px; }
.lesson-h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.01em; margin-bottom: 8px; }
.tag-pill {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; color: var(--muted); background: var(--panel2);
  padding: 4px 12px; border-radius: 20px;
}

.pn-row { display: flex; justify-content: space-between; align-items: center; gap: 14px; margin-top: 28px; }
.btn-next {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 12px 28px; border-radius: 999px; font-size: 14.5px; font-weight: 700;
  border: 1.5px solid var(--accent); background: var(--accent); color: #fff;
  cursor: pointer; font-family: inherit; transition: all 0.18s ease; text-decoration: none;
}
.btn-next:hover { filter: brightness(0.9); }

.done-circle {
  width: 88px; height: 88px; margin: 0 auto 24px; border-radius: 50%;
  background: linear-gradient(135deg, var(--brand-green), #12b981);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 40px; box-shadow: 0 10px 30px rgba(33, 146, 77, 0.3);
}

button.run-step { width: 100%; background: none; border: none; font-family: inherit; cursor: pointer; text-align: left; font-size: 12.5px; }
button.run-step:hover { background: var(--panel2); }

/* ---------- tags & picker filters ---------- */
.tag-mini {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; color: var(--accent);
  background: rgba(169, 54, 164, 0.07); border: 1px solid rgba(169, 54, 164, 0.22);
  padding: 2px 8px; border-radius: 999px; font-family: inherit; cursor: pointer;
}
.tag-mini:hover { background: rgba(169, 54, 164, 0.14); }
.tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.picker-tools.compact { flex-direction: column; align-items: stretch; gap: 8px; }
.picker-tools.compact select, .picker-tools.compact input[type="text"] { width: 100%; max-width: none; }
.qp-selonly {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  cursor: pointer; user-select: none; white-space: nowrap;
}
.qp-selonly input { accent-color: var(--accent); }

/* ---------- course status chips & select ---------- */
.st-chip { border: none; }
.st-draft { background: #eef0f4; color: #5b6272; }
.st-review { background: #fdf3d7; color: #8a6a08; }
.st-ready { background: #e3effc; color: #1e5f9e; }
.st-pub { background: rgba(33, 146, 77, 0.12); color: var(--safe); }
.st-arch { background: #e9e7ee; color: #756f85; }
.status-select {
  appearance: none; -webkit-appearance: none;
  border: none; border-radius: 999px; padding: 6px 26px 6px 14px;
  font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%236e6382' fill='none' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
}
.status-select:focus { outline: 2px solid rgba(169, 54, 164, 0.3); }
.row-archived { opacity: 0.55; }

/* ---------- moderator home: rings, tabs, training cards ---------- */
.rings-row { display: flex; gap: 40px; justify-content: center; padding: 22px; margin-bottom: 18px; }
.ring { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.ring-svg { position: relative; width: 72px; height: 72px; }
.ring-bg { fill: none; stroke: var(--panel2); stroke-width: 7; }
.ring-fg { fill: none; stroke-width: 7; stroke-linecap: round; transition: stroke-dashoffset 0.6s ease; }
.ring-fg.rg-accent { stroke: var(--accent); }
.ring-fg.rg-danger { stroke: var(--danger); }
.ring-fg.rg-safe { stroke: var(--safe); }
.ring-num {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 800; letter-spacing: -0.02em;
}
.ring-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

.subtabs { display: flex; gap: 18px; border-bottom: 1px solid var(--border); margin-bottom: 20px; }
.subtab {
  padding: 9px 2px; border: none; background: none; font-family: inherit;
  font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer;
}
.subtab.on { color: var(--fg); font-weight: 600; box-shadow: inset 0 -2px 0 var(--accent); }

.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 16px; }
.t-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04); transition: box-shadow 0.15s, transform 0.15s;
  display: flex; flex-direction: column;
}
.t-card:hover { box-shadow: 0 6px 18px rgba(29, 21, 40, 0.09); transform: translateY(-2px); }
.tc-img { position: relative; height: 110px; background: linear-gradient(135deg, rgba(124, 58, 164, 0.75), rgba(234, 61, 142, 0.65)); }
.tc-img.test { background: linear-gradient(135deg, #4a3d8f, var(--brand-purple)); }
.tc-img.path { background: linear-gradient(135deg, var(--brand-green), #2a8a68 55%, var(--brand-purple)); }
.path-current { border-color: rgba(169, 54, 164, 0.45); box-shadow: 0 0 0 1px rgba(169, 54, 164, 0.25); }
.tc-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.tc-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; color: rgba(255, 255, 255, 0.85); }
.tc-type {
  position: absolute; top: 10px; left: 10px;
  background: rgba(255, 255, 255, 0.92); color: var(--fg);
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 3px 9px; border-radius: 999px;
}
.tc-body { padding: 14px 16px 14px; display: flex; flex-direction: column; flex: 1; }
.tc-title { font-size: 14.5px; font-weight: 700; line-height: 1.35; }
.tc-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.tc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 4px; }
.tc-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 4px; }

/* ---------- due dates & notifications ---------- */
.due-chip { border: none; background: #eef0f4; color: #5b6272; gap: 5px; }
.due-chip.soon { background: #fdf3d7; color: #8a6a08; }
.due-chip.over { background: rgba(220, 38, 38, 0.1); color: var(--danger); }

.notif-bell {
  position: relative; width: 38px; height: 38px; margin-left: auto; margin-right: 12px;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: all 0.15s; flex-shrink: 0;
}
.notif-bell:hover { background: var(--panel2); color: var(--fg); }
.notif-panel {
  position: fixed; top: 64px; right: 24px; width: 360px; max-height: 70vh; overflow-y: auto;
  background: var(--panel); border: 1px solid var(--border); border-radius: 16px;
  box-shadow: 0 20px 60px rgba(29, 21, 40, 0.18); z-index: 150; padding: 6px 0;
}
.np-head { padding: 12px 16px 8px; font-size: 14px; border-bottom: 1px solid var(--border); }
.np-row {
  display: flex; gap: 11px; align-items: flex-start; width: 100%;
  padding: 11px 16px; border: none; background: none; text-align: left;
  font-family: inherit; cursor: pointer; border-bottom: 1px solid #f0ebf6;
}
.np-row:hover { background: var(--panel2); }
.np-ic {
  width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel2); color: var(--accent); border: 1px solid var(--border);
}
.np-ic.soon { color: #8a6a08; background: #fdf3d7; border-color: #f3e3ac; }
.np-ic.over { color: var(--danger); background: rgba(220, 38, 38, 0.08); border-color: rgba(220, 38, 38, 0.25); }
.np-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.np-text { font-size: 13px; line-height: 1.45; color: var(--fg); }
.np-foot { padding: 10px 16px 8px; }

/* ---------- team page ---------- */
.r-super { background: rgba(169, 54, 164, 0.12); color: var(--accent); }
.r-admin { background: #e3effc; color: #1e5f9e; }
.r-user { background: #eef0f4; color: #5b6272; }
.bucket { margin-bottom: 30px; }
.bucket-head {
  font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  color: var(--muted); margin-bottom: 10px; display: flex; align-items: center; gap: 8px;
}
.bucket-count {
  background: var(--panel2); border: 1px solid var(--border); border-radius: 999px;
  padding: 1px 9px; font-size: 11.5px; color: var(--muted);
}
.role-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- editor icon buttons & internal comments ---------- */
.fs-iconbtn {
  position: relative; width: 38px; height: 38px; flex-shrink: 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); cursor: pointer; transition: all 0.15s;
}
.fs-iconbtn:hover, .fs-iconbtn.on { background: var(--panel2); color: var(--fg); border-color: #d8cfe4; }
.ib-count {
  position: absolute; top: -6px; right: -6px; min-width: 17px; height: 17px;
  background: var(--accent); color: #fff; border-radius: 999px;
  font-size: 10.5px; font-weight: 700; display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}
.cmt { display: flex; gap: 10px; padding: 9px 0; align-items: flex-start; }
.cmt-body { flex: 1; min-width: 0; }
.cmt-head { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.cmt-head .cmt-del { margin-left: auto; width: 22px; height: 22px; font-size: 12px; opacity: 0; transition: opacity 0.12s; }
.cmt:hover .cmt-del { opacity: 1; }
.cmt-text { font-size: 13px; line-height: 1.55; color: #3f4457; margin-top: 2px; overflow-wrap: break-word; }
.cmt-text ul { padding-left: 18px; }

/* ---------- collaborators drawer ---------- */
.collab-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: 320px; z-index: 60;
  background: var(--panel); border-left: 1px solid var(--border);
  box-shadow: -12px 0 40px rgba(29, 21, 40, 0.08);
  padding: 18px 20px; overflow-y: auto;
}
.cd-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; font-size: 15px; }
.cd-sec-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.cd-row { display: flex; align-items: center; gap: 11px; padding: 8px 0; }
.cd-avatar {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 15px; text-transform: uppercase;
}
.cd-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.cd-info b { font-size: 13.5px; }
.cd-info .badge { align-self: flex-start; }
.cd-empty { text-align: center; padding: 28px 10px; color: var(--muted); display: flex; flex-direction: column; gap: 8px; align-items: center; }
.cd-add { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; border-top: 1px solid var(--border); padding-top: 16px; }
.cd-add input, .cd-add select {
  width: 100%; padding: 8px 11px; border-radius: 10px; font-size: 13px;
  border: 1px solid var(--border); background: var(--panel2); color: var(--fg); font-family: inherit;
}

/* ---------- media library ---------- */
.media-wrap { display: flex; gap: 22px; align-items: flex-start; }
.media-rail {
  display: flex; flex-direction: column; gap: 6px; flex-shrink: 0;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px; padding: 8px;
}
.mr-btn {
  width: 42px; height: 42px; border: none; background: none; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.mr-btn.on { background: rgba(169, 54, 164, 0.1); color: var(--accent); }
.mr-btn.off { color: #c5bfd2; cursor: help; }
.folder-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 18px; }
.folder-card {
  display: flex; align-items: center; gap: 9px; padding: 11px 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px;
  font-family: inherit; font-size: 13.5px; cursor: pointer; color: var(--fg);
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04);
}
.folder-card:hover { border-color: #d8cfe4; box-shadow: 0 2px 8px rgba(29, 21, 40, 0.07); }
.folder-card .fc-name { font-weight: 600; }
.folder-card svg { color: var(--accent); }
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 14px;
  min-height: 200px; border-radius: 14px;
}
.media-grid.dragging { outline: 2px dashed var(--accent); outline-offset: 6px; background: rgba(169, 54, 164, 0.03); }
.media-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 12px; overflow: hidden;
  box-shadow: 0 1px 2px rgba(29, 21, 40, 0.04); font-family: inherit; text-align: left;
}
.media-card img { width: 100%; height: 120px; object-fit: cover; display: block; background: var(--panel2); }
.media-card .mc-body { padding: 10px 12px; }
.media-card .mc-name { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-card .mc-tools { display: flex; gap: 6px; margin-top: 8px; align-items: center; }
.media-card .mc-tools select {
  flex: 1; min-width: 0; padding: 4px 8px; border-radius: 8px; font-size: 11.5px;
  border: 1px solid var(--border); background: var(--panel2); font-family: inherit; color: var(--muted);
}
.media-card.pickable { cursor: pointer; border-width: 1px; padding: 0; }
.media-card.pickable:hover { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.media-empty {
  grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted);
  border: 1px dashed var(--border); border-radius: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}

/* ---------- device preview (course preview mode) ---------- */
.dev-bar {
  display: flex; justify-content: center; gap: 4px; padding: 7px 0;
  background: var(--panel); border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.dev-btn {
  width: 44px; height: 36px; border: none; background: none; border-radius: 9px;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  color: var(--muted); border-bottom: 2px solid transparent;
}
.dev-btn:hover { background: var(--panel2); }
.dev-btn.on { color: var(--fg); border-bottom-color: var(--fg); border-radius: 9px 9px 0 0; }
.fs-editor[data-device="tablet"] .fs-body,
.fs-editor[data-device="mobile"] .fs-body {
  flex: none; margin: 16px auto; min-height: 0; height: calc(100vh - 165px);
  border: 11px solid #e4e1ea; border-radius: 28px; overflow: hidden;
  box-shadow: 0 16px 44px rgba(29, 21, 40, 0.14); background: var(--bg);
  width: min(96vw, var(--devw));
}
.fs-editor[data-device="tablet"] .fs-body { --devw: 768px; grid-template-columns: 230px minmax(0, 1fr); }
.fs-editor[data-device="mobile"] .fs-body { --devw: 396px; display: flex; flex-direction: column; }
.fs-editor[data-device="mobile"] .fs-side { display: none; }
.fs-editor[data-device="mobile"] .course-banner { height: 140px; }
.fs-editor[data-device="tablet"] .course-banner { height: 170px; }

/* ---------- import modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(24, 16, 33, 0.45); backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal {
  background: var(--panel); border-radius: 16px; width: 100%; max-width: 580px;
  max-height: 86vh; overflow-y: auto; padding: 22px 26px 20px;
  box-shadow: 0 24px 70px rgba(24, 16, 33, 0.35);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.modal-head h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-x {
  width: 30px; height: 30px; border: none; background: none; border-radius: 8px;
  cursor: pointer; color: var(--muted); font-size: 15px; font-family: inherit;
}
.modal-x:hover { background: var(--panel2); color: var(--fg); }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; }

.fmt-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.fmt-table th { text-align: left; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.fmt-table td { padding: 6px 10px; border-bottom: 1px solid #f0ebf6; vertical-align: top; }
.fmt-table code { background: var(--panel2); padding: 2px 7px; border-radius: 6px; font-size: 12px; }
.fmt-sample {
  background: #f8f6fb; border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; font-size: 12px; line-height: 1.6; overflow-x: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; white-space: pre;
}
.err-box {
  margin-top: 14px; background: rgba(220, 38, 38, 0.06); border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 10px; padding: 12px 16px; font-size: 13px; color: #a52020;
}
.err-box ul { margin: 6px 0 0 18px; display: flex; flex-direction: column; gap: 4px; }
.ok-box {
  margin-top: 14px; background: rgba(33, 146, 77, 0.07); border: 1px solid rgba(33, 146, 77, 0.35);
  border-radius: 10px; padding: 12px 16px; font-size: 13.5px; color: var(--safe);
}

/* ---------- notices ---------- */
.notice { border-radius: var(--radius); padding: 12px 16px; font-size: 13.5px; margin-bottom: 18px; }
.notice.warn { background: rgba(245, 158, 11, 0.1); border: 1px solid rgba(245, 158, 11, 0.35); color: var(--warn); }

/* ---------- sign-in & user chip ---------- */
body.login-mode .topbar { display: none; }
.login-wrap { min-height: 82vh; display: flex; align-items: center; justify-content: center; }
.login-card { max-width: 380px; width: 100%; text-align: center; padding: 44px 36px; }
.login-card h1 { letter-spacing: -0.02em; }
.user-chip { display: flex; align-items: center; gap: 9px; margin-left: 14px; }
.uc-name { font-size: 13px; font-weight: 600; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uc-out { border: none; background: none; color: var(--muted); font-size: 12px; cursor: pointer; font-family: inherit; padding: 5px 8px; border-radius: 7px; }
.uc-out:hover { background: var(--panel2); color: var(--danger); }
body.role-user .tab[data-tab="admin"] { display: none; }


/* ---------- builder side panel: collapse + resize ---------- */
.fs-side.builder { position: relative; padding-top: 44px; }
.fs-side.builder .side-toggle { position: absolute; top: 10px; right: 10px; }
.side-resize {
  position: absolute; top: 0; bottom: 0; left: calc(var(--sidew, 300px) - 3px);
  width: 7px; cursor: col-resize; z-index: 6; border-radius: 4px; touch-action: none;
}
.side-resize:hover, .side-resize:active { background: rgba(169, 54, 164, 0.22); }
.side-float-expand {
  position: absolute; left: 12px; top: 14px; z-index: 8;
  width: 34px; height: 34px; border-radius: 9px; border: 1px solid var(--border);
  background: var(--panel); color: var(--muted); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 3px 10px rgba(29, 21, 40, 0.08);
}
.side-float-expand:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- nicer native form controls (date, file) ---------- */
input[type="date"] {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--panel2); font-family: inherit; font-size: 13.5px; color: var(--fg);
  transition: border-color 0.12s, background 0.12s;
}
input[type="date"]:focus { outline: none; border-color: var(--accent); background: #fff; }
input[type="date"]::-webkit-calendar-picker-indicator { cursor: pointer; opacity: 0.55; }
input[type="date"]::-webkit-calendar-picker-indicator:hover { opacity: 1; }
input[type="file"] { font-size: 12.5px; color: var(--muted); max-width: 100%; }
input[type="file"]::file-selector-button {
  border: 1px solid var(--accent); background: #fff; color: var(--accent);
  padding: 7px 14px; border-radius: 999px; font-family: inherit; font-size: 12.5px;
  font-weight: 600; cursor: pointer; margin-right: 10px;
  transition: background 0.12s;
}
input[type="file"]::file-selector-button:hover { background: rgba(169, 54, 164, 0.07); }

/* ---------- text-align controls in the fmt bar ---------- */
.fmt-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; display: inline-block; align-self: center; }
.fmt-btn.on { background: rgba(169, 54, 164, 0.12); color: var(--accent); }

/* ---------- learning path: locked steps + lock toggle ---------- */
.row-locked { opacity: 0.65; }
.row-locked .q-num { background: var(--panel2); color: var(--muted); }
.ot-btn.plock.on { background: rgba(169, 54, 164, 0.12); color: var(--accent); }
.pmark-wrap {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.pmark-input {
  width: 46px; padding: 3px 6px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--panel); color: var(--fg); font: inherit; font-size: 12px; text-align: center;
}
.pmark-input:focus { outline: none; border-color: var(--accent); }
.check-row, .field label.check-row {
  display: inline-flex; align-items: center; gap: 8px; margin-bottom: 0;
  font-size: 13px; font-weight: 500; color: var(--fg);
  cursor: pointer; user-select: none;
}
.check-row input { accent-color: var(--accent); width: 15px; height: 15px; }
