/* =========================================================
   SOS Plus — premium layer for the 2027 portal
   Loaded after style.css + sos-extras.css on every portal page.
   ========================================================= */
:root{
  --plus-ease: cubic-bezier(.22,.8,.2,1);
  --plus-gold-grad: linear-gradient(135deg,#E9CF8A 0%,#C9A24B 45%,#9C7420 100%);
  --plus-ink-grad: linear-gradient(135deg,#1B2430 0%,#12161D 100%);
  --plus-glass: rgba(255,255,255,.78);
  --plus-ring: 0 0 0 3px rgba(201,162,75,.28);
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: no-preference){
  main > *{ animation: plus-rise .5s var(--plus-ease) both; }
  main > *:nth-child(2){ animation-delay:.04s } main > *:nth-child(3){ animation-delay:.08s }
  main > *:nth-child(4){ animation-delay:.12s } main > *:nth-child(5){ animation-delay:.16s }
  .overlay.open .modal{ animation: plus-pop .32s var(--plus-ease) both; }
}
@keyframes plus-rise{ from{ opacity:0; transform:translateY(10px) } to{ opacity:1; transform:none } }
@keyframes plus-pop{ from{ opacity:0; transform:translateY(14px) scale(.97) } to{ opacity:1; transform:none } }
@keyframes plus-shine{ from{ background-position:-200% 0 } to{ background-position:200% 0 } }
@keyframes plus-float{ 0%{ opacity:0; transform:translate(-50%,8px) scale(.8) } 15%{ opacity:1; transform:translate(-50%,0) scale(1.05) } 80%{ opacity:1 } 100%{ opacity:0; transform:translate(-50%,-46px) scale(1) } }
@keyframes plus-pulse{ 0%,100%{ box-shadow:0 0 0 0 rgba(201,162,75,.45) } 50%{ box-shadow:0 0 0 10px rgba(201,162,75,0) } }
@keyframes plus-spin{ to{ transform:rotate(360deg) } }

.btn{ transition: transform .18s var(--plus-ease), box-shadow .18s var(--plus-ease), background .18s, border-color .18s; }
.btn:active{ transform: scale(.97); }
.btn-gold{ background:var(--plus-gold-grad); color:#1B1405; border:none; font-weight:600; box-shadow:0 6px 18px rgba(156,116,32,.28); }
.btn-gold:hover{ box-shadow:0 10px 24px rgba(156,116,32,.36); transform:translateY(-1px); }
.btn-ghost{ background:transparent; border:1px dashed var(--line); color:var(--ink-2); }
.btn-ghost:hover{ border-color:var(--gold); }
.btn[disabled]{ opacity:.55; cursor:not-allowed; }

/* ---------- view-as banner ---------- */
.viewas-bar{
  position:sticky; top:0; z-index:60; display:flex; gap:12px; align-items:center; justify-content:center; flex-wrap:wrap;
  padding:8px 14px; background:repeating-linear-gradient(135deg,#1B2430 0 14px,#222c3a 14px 28px); color:#F3E7C6;
  font-size:13px; border-bottom:2px solid var(--gold);
}
.viewas-bar b{ color:#fff; }
.viewas-bar button{ background:var(--gold); color:#1b1405; border:0; border-radius:999px; padding:5px 14px; font-weight:600; font-size:13px; }

/* ---------- toasts / xp ---------- */
.plus-toasts{ position:fixed; right:16px; bottom:16px; z-index:200; display:flex; flex-direction:column; gap:8px; max-width:min(380px, calc(100vw - 32px)); }
.plus-toast{ background:#12161D; color:#F6F1E4; padding:12px 16px; border-radius:12px; box-shadow:0 12px 30px rgba(0,0,0,.25); font-size:14px;
  display:flex; gap:10px; align-items:flex-start; animation:plus-pop .3s var(--plus-ease) both; border-left:4px solid var(--gold); }
.plus-toast.error{ border-left-color:var(--red); }
.plus-toast.success{ border-left-color:#5DBB85; }
.xp-float{ position:fixed; left:50%; top:38%; z-index:220; pointer-events:none; font-weight:700; font-size:26px; color:#9C7420;
  text-shadow:0 2px 0 #fff, 0 6px 20px rgba(201,162,75,.6); animation:plus-float 1.9s var(--plus-ease) forwards; white-space:nowrap; }

/* ---------- celebration modal ---------- */
.celebrate{ position:fixed; inset:0; z-index:210; display:flex; align-items:center; justify-content:center; padding:16px; background:rgba(18,22,29,.55); backdrop-filter:blur(3px); }
.celebrate-card{ background:#fff; border-radius:22px; width:min(380px,100%); padding:30px 26px 24px; text-align:center; position:relative; overflow:hidden;
  box-shadow:0 30px 80px rgba(0,0,0,.35); animation:plus-pop .45s var(--plus-ease) both; }
.celebrate-card::before{ content:""; position:absolute; inset:0 0 auto; height:120px; background:radial-gradient(120% 120px at 50% 0,#F8EBC8,transparent 70%); }
.celebrate-icon{ position:relative; font-size:62px; line-height:1; width:104px; height:104px; margin:0 auto 12px; display:grid; place-items:center; border-radius:50%;
  background:radial-gradient(circle at 30% 30%,#fff,#F3E2B4 60%,#E2C579); box-shadow:0 10px 30px rgba(156,116,32,.35); animation:plus-pulse 2s infinite; }
.celebrate h3{ position:relative; margin:0 0 6px; font-size:22px; color:var(--ink-2); font-weight:600; }
.celebrate p{ position:relative; margin:0 0 18px; color:var(--muted); font-size:14px; }
.celebrate-confetti{ position:fixed; inset:0; pointer-events:none; z-index:230; }

/* ---------- progress ---------- */
.plus-progress{ height:8px; border-radius:999px; background:#EFE9DA; overflow:hidden; }
.plus-progress > span{ display:block; height:100%; border-radius:inherit; background:var(--plus-gold-grad); transition:width .8s var(--plus-ease); }
.ring{ --p:0; --size:64px; width:var(--size); height:var(--size); border-radius:50%; display:grid; place-items:center; flex-shrink:0;
  background:conic-gradient(#C9A24B calc(var(--p)*1%), #EFE9DA 0); transition:--p .8s; }
.ring > span{ width:calc(var(--size) - 12px); height:calc(var(--size) - 12px); border-radius:50%; background:#fff; display:grid; place-items:center;
  font-size:14px; font-weight:700; color:var(--ink-2); }

/* ---------- course hero (student) ---------- */
.course-hero{ display:grid; grid-template-columns:1fr auto; gap:18px; align-items:center; padding:26px; border-radius:18px; color:#F6F1E4;
  background:radial-gradient(140% 120% at 100% 0,rgba(201,162,75,.35),transparent 55%), var(--plus-ink-grad); position:relative; overflow:hidden; }
.course-hero::after{ content:""; position:absolute; right:-60px; bottom:-80px; width:240px; height:240px; border-radius:50%; border:1px solid rgba(233,207,138,.25); box-shadow:0 0 0 30px rgba(233,207,138,.05),0 0 0 60px rgba(233,207,138,.03); }
.course-hero h2{ margin:0 0 6px; font-size:26px; font-weight:600; color:#fff; }
.course-hero p{ margin:0 0 12px; color:#D9D2C1; font-size:14px; max-width:62ch; }
.course-hero .chips{ display:flex; gap:8px; flex-wrap:wrap; }
.course-hero .chip{ font-size:12px; padding:4px 10px; border-radius:999px; background:rgba(255,255,255,.1); border:1px solid rgba(255,255,255,.14); }
.course-hero .ring{ --size:92px; background:conic-gradient(#E9CF8A calc(var(--p)*1%), rgba(255,255,255,.12) 0); }
.course-hero .ring > span{ background:#161C25; color:#fff; font-size:18px; flex-direction:column; line-height:1.1; }
.course-hero .ring small{ display:block; font-size:10px; color:#C9BFA6; font-weight:400; }
@media (max-width:560px){ .course-hero{ grid-template-columns:1fr; padding:20px; } .course-hero .ring{ --size:76px; } }

/* ---------- sessions / topics ---------- */
.session-card{ transition: box-shadow .25s var(--plus-ease), transform .25s var(--plus-ease); }
.session-card:hover{ box-shadow:var(--shadow-md); }
.session-card.is-open{ box-shadow:var(--shadow-md); border-color:var(--gold-soft); }
.session-card.is-done .topic-num{ background:var(--plus-gold-grad); color:#1b1405; border-color:transparent; }
.topic-num{ width:36px; height:36px; border-radius:50%; display:grid; place-items:center; flex-shrink:0; font-size:13px; font-weight:700;
  border:1.5px solid var(--gold-soft); color:var(--amber); background:#FFFCF4; }
.topic-head{ display:flex; gap:12px; align-items:flex-start; min-width:0; }
.topic-head strong{ display:block; }
.topic-meter{ margin-top:8px; max-width:280px; }
.session-body{ overflow:hidden; }
.session-body.anim{ animation:plus-rise .35s var(--plus-ease) both; }
.topics-toolbar{ display:flex; gap:10px; align-items:center; flex-wrap:wrap; margin:6px 0 12px; }
.topics-toolbar input[type=search]{ flex:1; min-width:180px; padding:10px 14px; border:1px solid var(--line); border-radius:999px; background:#fff; font:inherit; font-size:14px; }
.topics-toolbar .filter-pill{ font-size:13px; }

.content-row{ transition: background .2s; border-radius:10px; }
.content-row:hover{ background:#FBF8F0; }
.content-row.is-done .content-title{ color:var(--muted); }
.done-toggle{ appearance:none; -webkit-appearance:none; width:24px; height:24px; border-radius:50%; border:2px solid var(--gold-soft); background:#fff; flex-shrink:0;
  display:grid; place-items:center; cursor:pointer; transition:all .2s var(--plus-ease); margin:2px 0 0; }
.done-toggle:checked{ background:var(--plus-gold-grad); border-color:transparent; }
.done-toggle:checked::after{ content:"✓"; color:#1b1405; font-size:13px; font-weight:700; }
.done-toggle:focus-visible{ box-shadow:var(--plus-ring); outline:none; }
.content-line{ display:flex; gap:12px; align-items:flex-start; width:100%; }
.content-line .content-main{ flex:1; min-width:0; }
.content-title{ font-weight:600; color:var(--ink-2); overflow-wrap:anywhere; }
.content-actions-plus{ display:flex; gap:8px; flex-wrap:wrap; margin-top:6px; }
.pill-btn{ border:1px solid var(--line); background:#fff; border-radius:999px; padding:6px 12px; font-size:13px; color:var(--ink-2); display:inline-flex; gap:6px; align-items:center; }
.pill-btn:hover{ border-color:var(--gold); background:#FFFCF4; }
.pill-btn.primary{ background:var(--ink); color:#fff; border-color:var(--ink); }
.type-tag{ font-size:11px; text-transform:uppercase; letter-spacing:.06em; color:var(--amber); }

/* ---------- reader (pdf / drive / video) ---------- */
.reader{ position:fixed; inset:0; z-index:180; background:rgba(12,15,20,.86); display:flex; flex-direction:column; animation:plus-rise .25s var(--plus-ease) both; }
.reader-bar{ display:flex; align-items:center; gap:12px; padding:10px 14px; color:#F3E7C6; background:#12161D; border-bottom:1px solid rgba(201,162,75,.35); }
.reader-bar h3{ margin:0; font-size:15px; font-weight:600; flex:1; min-width:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:#fff; }
.reader-bar a, .reader-bar button{ color:#F3E7C6; background:rgba(255,255,255,.08); border:1px solid rgba(255,255,255,.14); border-radius:999px; padding:6px 12px; font-size:13px; white-space:nowrap; }
.reader-frame{ flex:1; background:#1a1f27; position:relative; }
.reader-frame iframe, .reader-frame video{ position:absolute; inset:0; width:100%; height:100%; border:0; background:#fff; }
.reader-frame .spinner-wrap{ position:absolute; inset:0; display:grid; place-items:center; color:#ccc; font-size:14px; }
.reader-frame.is-video{ display:grid; place-items:center; }
.reader-frame.is-video iframe{ position:relative; width:min(100%, 1100px); height:auto; aspect-ratio:16/9; inset:auto; background:#000; }

/* ---------- assignment studio ---------- */
.modal.modal-wide{ width:min(760px, 96vw); }
.studio-tabs{ display:flex; gap:6px; padding:4px; background:#F4EFE3; border-radius:12px; margin:14px 0; overflow-x:auto; }
.studio-tab{ flex:1; border:0; background:transparent; border-radius:9px; padding:10px 12px; font-size:14px; color:var(--muted); white-space:nowrap; }
.studio-tab.is-active{ background:#fff; color:var(--ink-2); box-shadow:var(--shadow-sm); font-weight:600; }
.studio-pane{ animation:plus-rise .25s var(--plus-ease) both; }
.studio-editor{ width:100%; min-height:220px; border:1px solid var(--line); border-radius:12px; padding:14px; font:inherit; font-size:15px; line-height:1.6; resize:vertical; background:#FFFDF8; }
.studio-editor:focus{ outline:none; box-shadow:var(--plus-ring); border-color:var(--gold); }
.studio-meta{ display:flex; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); margin-top:6px; flex-wrap:wrap; }
.dropzone{ display:block; border:2px dashed var(--gold-soft); border-radius:14px; padding:26px 16px; text-align:center; background:#FFFCF4; transition:all .2s; cursor:pointer; }
.dropzone.is-over{ background:#F8EBC8; border-color:var(--gold); transform:scale(1.01); }
.dropzone b{ color:var(--ink-2); }
.dropzone small{ display:block; color:var(--muted); margin-top:6px; }
.file-chips{ display:flex; flex-direction:column; gap:8px; margin-top:12px; }
.file-chip{ display:flex; align-items:center; gap:10px; padding:8px 10px; border:1px solid var(--line); border-radius:10px; background:#fff; font-size:14px; }
.file-chip img{ width:44px; height:44px; object-fit:contain; background:#fff; border-radius:6px; border:1px solid var(--line); }
.file-chip .name{ flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.file-chip button{ border:0; background:none; color:var(--red); font-size:13px; }
.upload-bar{ height:4px; background:#EFE9DA; border-radius:4px; overflow:hidden; margin-top:8px; }
.upload-bar span{ display:block; height:100%; width:0; background:var(--plus-gold-grad); transition:width .2s; }

.sketch-wrap{ border:1px solid var(--line); border-radius:14px; overflow:hidden; background:#fff; }
.sketch-tools{ display:flex; gap:6px; align-items:center; padding:8px; background:#FAF6EC; border-bottom:1px solid var(--line); flex-wrap:wrap; }
.sketch-tools .sw{ width:26px; height:26px; border-radius:50%; border:2px solid #fff; box-shadow:0 0 0 1px var(--line); cursor:pointer; }
.sketch-tools .sw.is-on{ box-shadow:0 0 0 2px var(--gold); }
.sketch-tools button{ border:1px solid var(--line); background:#fff; border-radius:8px; padding:5px 9px; font-size:13px; }
.sketch-tools button.is-on{ border-color:var(--gold); background:#FFF6DF; }
.sketch-tools input[type=range]{ width:90px; accent-color:#C9A24B; }
.sketch-canvas{ display:block; width:100%; height:min(56vh, 420px); touch-action:none; cursor:crosshair;
  background-image:radial-gradient(#E9E2D0 1px, transparent 1px); background-size:22px 22px; }

.thread{ display:flex; flex-direction:column; gap:10px; margin-top:8px; }
.bubble{ max-width:88%; padding:10px 12px; border-radius:14px; font-size:14px; background:#F4EFE3; white-space:pre-wrap; overflow-wrap:anywhere; }
.bubble.me{ align-self:flex-end; background:#12161D; color:#F6F1E4; }
.bubble.private{ background:#FFF4D6; border:1px dashed #E0C277; }
.bubble small{ display:block; font-size:11px; opacity:.7; margin-bottom:3px; }
.thread-form{ display:flex; gap:8px; margin-top:10px; }
.thread-form textarea{ flex:1; min-height:44px; max-height:140px; border:1px solid var(--line); border-radius:12px; padding:10px; font:inherit; font-size:14px; resize:vertical; }

.grade-card{ display:flex; gap:14px; align-items:center; padding:14px; border-radius:14px; background:linear-gradient(135deg,#FFF9EA,#F7EBCB); border:1px solid #EBD7A0; }
.grade-card .ring{ --size:70px; }

/* ---------- checkout ---------- */
.pay-methods{ display:grid; gap:10px; margin:14px 0; }
.pay-method{ display:flex; gap:12px; align-items:center; padding:14px; border:1.5px solid var(--line); border-radius:14px; background:#fff; text-align:left; width:100%; transition:all .2s var(--plus-ease); }
.pay-method:hover{ border-color:var(--gold); transform:translateY(-1px); box-shadow:var(--shadow-sm); }
.pay-method.is-on{ border-color:var(--gold); box-shadow:var(--plus-ring); background:#FFFCF4; }
.pay-method .pm-ico{ width:44px; height:44px; border-radius:12px; display:grid; place-items:center; font-size:22px; background:#F4EFE3; flex-shrink:0; }
.pay-method .pm-ico.mpesa{ background:#E6F4EA; color:#2E7D32; font-weight:800; font-size:13px; }
.pay-method b{ display:block; color:var(--ink-2); }
.pay-method small{ color:var(--muted); font-size:12px; }
.test-ribbon{ display:inline-block; font-size:11px; font-weight:700; letter-spacing:.06em; background:#FFF0C2; color:#8A6410; border-radius:999px; padding:2px 8px; margin-left:6px; vertical-align:middle; }

.phone-sim{ width:min(260px,100%); margin:12px auto; border-radius:30px; background:#0F1318; padding:14px 12px 18px; box-shadow:0 20px 50px rgba(0,0,0,.35); color:#fff; }
.phone-sim .notch{ width:70px; height:6px; border-radius:6px; background:#222a35; margin:0 auto 12px; }
.phone-sim .stk{ background:#F2F4F5; color:#111; border-radius:14px; padding:14px; font-size:13px; animation:plus-pop .4s var(--plus-ease) both; }
.phone-sim .stk b{ color:#1B5E20; }
.phone-sim input{ width:100%; margin:10px 0; padding:10px; border-radius:8px; border:1px solid #cfd6da; font-size:18px; letter-spacing:.4em; text-align:center; }
.phone-sim .stk-actions{ display:flex; gap:8px; }
.phone-sim .stk-actions button{ flex:1; border:0; border-radius:8px; padding:9px; font-weight:600; }
.phone-sim .ok{ background:#2E7D32; color:#fff; }
.phone-sim .cancel{ background:#e3e7ea; color:#333; }
.wait-dots{ display:inline-flex; gap:4px; }
.wait-dots i{ width:7px; height:7px; border-radius:50%; background:var(--gold); animation:plus-pulse 1.2s infinite; }
.wait-dots i:nth-child(2){ animation-delay:.2s } .wait-dots i:nth-child(3){ animation-delay:.4s }
.card-sim{ display:grid; gap:10px; }
.card-sim .card-face{ height:150px; border-radius:16px; padding:16px; color:#fff; background:linear-gradient(135deg,#283447,#12161D); position:relative; box-shadow:0 14px 34px rgba(0,0,0,.25); }
.card-sim .card-face .chip{ width:38px; height:28px; border-radius:6px; background:var(--plus-gold-grad); }
.card-sim .card-face .num{ position:absolute; left:16px; bottom:42px; letter-spacing:.14em; font-size:16px; }
.card-sim .card-face .exp{ position:absolute; left:16px; bottom:16px; font-size:12px; opacity:.8; }
.success-burst{ text-align:center; padding:10px 0; }
.success-burst .tick{ width:84px; height:84px; margin:0 auto 10px; border-radius:50%; background:var(--plus-gold-grad); display:grid; place-items:center; font-size:40px; color:#1b1405; animation:plus-pop .5s var(--plus-ease) both, plus-pulse 2s .5s infinite; }

/* ---------- gamification widgets ---------- */
.xp-card{ display:grid; grid-template-columns:auto 1fr; gap:16px; align-items:center; padding:20px; border-radius:18px; color:#F6F1E4; background:radial-gradient(120% 140% at 0 0,rgba(201,162,75,.4),transparent 60%), var(--plus-ink-grad); }
.xp-card .lvl{ width:76px; height:76px; border-radius:20px; display:grid; place-items:center; background:var(--plus-gold-grad); color:#1b1405; font-weight:800; font-size:26px; box-shadow:0 10px 30px rgba(156,116,32,.4); line-height:1; text-align:center; }
.xp-card .lvl small{ display:block; font-size:10px; font-weight:600; letter-spacing:.08em; }
.xp-card h3{ margin:0; color:#fff; font-size:19px; font-weight:600; }
.xp-card .sub{ font-size:13px; color:#CFC6B1; margin:2px 0 10px; }
.xp-card .plus-progress{ background:rgba(255,255,255,.12); }
.streak-strip{ display:flex; gap:4px; margin-top:12px; }
.streak-strip span{ flex:1; height:8px; border-radius:3px; background:rgba(255,255,255,.12); }
.streak-strip span.on{ background:linear-gradient(90deg,#F59E0B,#EF4444); }
.mini-stats{ display:grid; grid-template-columns:repeat(4,1fr); gap:10px; margin-top:12px; }
.mini-stats div{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:12px; text-align:center; }
.mini-stats b{ display:block; font-size:22px; color:var(--ink-2); }
.mini-stats span{ font-size:12px; color:var(--muted); }
@media (max-width:560px){ .mini-stats{ grid-template-columns:repeat(2,1fr); } .xp-card{ grid-template-columns:1fr; text-align:left; } }
.badge-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(140px,1fr)); gap:12px; }
.badge-tile{ border:1px solid var(--line); border-radius:16px; padding:16px 12px; text-align:center; background:#fff; transition:transform .2s var(--plus-ease), box-shadow .2s; position:relative; }
.badge-tile:hover{ transform:translateY(-3px); box-shadow:var(--shadow-md); }
.badge-tile .ico{ font-size:34px; width:62px; height:62px; margin:0 auto 8px; display:grid; place-items:center; border-radius:50%; background:radial-gradient(circle at 30% 30%,#fff,#F3E2B4 60%,#E2C579); }
.badge-tile.locked{ opacity:.55; filter:grayscale(1); }
.badge-tile.locked .ico{ background:#EEE; }
.badge-tile b{ display:block; font-size:14px; color:var(--ink-2); }
.badge-tile small{ display:block; font-size:12px; color:var(--muted); margin-top:4px; }
.badge-tile .plus-progress{ margin-top:8px; height:5px; }
.lb-row{ display:flex; align-items:center; gap:12px; padding:10px 6px; border-bottom:1px solid var(--line); }
.lb-row:last-child{ border-bottom:0; }
.lb-row .rk{ width:30px; text-align:center; font-weight:700; color:var(--amber); }
.lb-row .nm{ flex:1; min-width:0; }
.lb-row .nm small{ display:block; color:var(--muted); font-size:12px; }
.lb-row.me{ background:#FFF8E6; border-radius:10px; }
.lb-row .xp{ font-weight:700; color:var(--ink-2); }

/* ---------- admin CMS / settings ---------- */
.tabs-row{ display:flex; gap:6px; flex-wrap:wrap; margin-bottom:16px; }
.tabs-row button{ border:1px solid var(--line); background:#fff; padding:8px 14px; border-radius:999px; font-size:14px; color:var(--ink-2); }
.tabs-row button.is-active{ background:var(--ink); color:#fff; border-color:var(--ink); }
.tabs-row button .n{ font-size:11px; opacity:.7; margin-left:4px; }
.cms-list{ display:grid; gap:10px; }
.cms-item{ display:grid; grid-template-columns:auto 64px 1fr auto; gap:12px; align-items:center; padding:12px; border:1px solid var(--line); border-radius:14px; background:#fff; }
.cms-item .thumb{ width:64px; height:48px; border-radius:8px; background:#F4EFE3 center/cover; display:grid; place-items:center; font-size:20px; }
.cms-item .drag{ cursor:grab; color:var(--muted); padding:4px; user-select:none; }
.cms-item.dragging{ opacity:.5; }
.cms-item .t{ font-weight:600; color:var(--ink-2); overflow-wrap:anywhere; }
.cms-item .m{ font-size:12px; color:var(--muted); }
.cms-item .acts{ display:flex; gap:6px; }
@media (max-width:620px){ .cms-item{ grid-template-columns:auto 1fr; } .cms-item .thumb{ display:none } .cms-item .acts{ grid-column:1 / -1; justify-content:flex-end; } }
.form-grid{ display:grid; grid-template-columns:1fr 1fr; gap:0 14px; }
.form-grid .full{ grid-column:1 / -1; }
@media (max-width:560px){ .form-grid{ grid-template-columns:1fr; } }
.switch{ display:inline-flex; align-items:center; gap:10px; cursor:pointer; font-size:14px; white-space:nowrap; } white-space:nowrap; }
.switch input{ appearance:none; -webkit-appearance:none; width:42px; height:24px; border-radius:999px; background:#DCD5C4; position:relative; transition:background .2s; flex-shrink:0; margin:0; }
.switch input::after{ content:""; position:absolute; top:3px; left:3px; width:18px; height:18px; border-radius:50%; background:#fff; transition:transform .2s var(--plus-ease); box-shadow:0 1px 3px rgba(0,0,0,.2); }
.switch input:checked{ background:var(--gold); }
.switch input:checked::after{ transform:translateX(18px); }
.gw-card{ border:1px solid var(--line); border-radius:16px; padding:18px; background:#fff; margin-bottom:14px; }
.gw-card h3{ margin:0; font-size:17px; font-weight:600; color:var(--ink-2); display:flex; align-items:center; gap:10px; }
.gw-card .gw-head{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin-bottom:10px; }
.mode-switch{ display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.mode-switch label{ border:1.5px solid var(--line); border-radius:14px; padding:14px; cursor:pointer; display:block; }
.mode-switch input{ display:none; }
.mode-switch input:checked + span{ color:var(--ink-2); }
.mode-switch label:has(input:checked){ border-color:var(--gold); box-shadow:var(--plus-ring); background:#FFFCF4; }
.mode-switch b{ display:block; }
.mode-switch small{ color:var(--muted); font-size:12px; }
.code-box{ font-family:ui-monospace,Menlo,Consolas,monospace; font-size:12px; background:#F4EFE3; border-radius:8px; padding:8px 10px; overflow-wrap:anywhere; }
.user-row{ display:flex; gap:12px; align-items:center; padding:10px 0; border-bottom:1px solid var(--line); }
.user-row:last-child{ border-bottom:0; }
.user-row .av{ width:36px; height:36px; border-radius:50%; display:grid; place-items:center; background:#F4EFE3; color:var(--amber); font-weight:700; }
.user-row .nm{ flex:1; min-width:0; }
.user-row .nm small{ display:block; color:var(--muted); font-size:12px; overflow:hidden; text-overflow:ellipsis; }
.perm-chips{ display:flex; gap:6px; flex-wrap:wrap; }
.perm-chips label{ font-size:12px; border:1px solid var(--line); border-radius:999px; padding:4px 10px; display:inline-flex; gap:6px; align-items:center; cursor:pointer; background:#fff; }
.perm-chips input{ accent-color:#C9A24B; }
.preview-cards{ display:grid; grid-template-columns:repeat(auto-fit,minmax(220px,1fr)); gap:14px; }
.preview-card{ border-radius:18px; padding:20px; color:#F6F1E4; background:var(--plus-ink-grad); position:relative; overflow:hidden; }
.preview-card h3{ margin:0 0 6px; color:#fff; font-weight:600; }
.preview-card p{ margin:0 0 14px; font-size:13px; color:#CFC6B1; }
.preview-card .emoji{ position:absolute; right:14px; top:10px; font-size:42px; opacity:.85; }

/* marking */
.mark-grid{ display:grid; grid-template-columns:minmax(0,1.4fr) minmax(0,1fr); gap:16px; }
@media (max-width:900px){ .mark-grid{ grid-template-columns:1fr; } }
.work-view{ border:1px solid var(--line); border-radius:14px; padding:16px; background:#FFFDF8; white-space:pre-wrap; overflow-wrap:anywhere; font-size:15px; line-height:1.65; max-height:50vh; overflow:auto; }
.att-grid{ display:grid; grid-template-columns:repeat(auto-fill,minmax(120px,1fr)); gap:10px; margin-top:12px; }
.att{ border:1px solid var(--line); border-radius:12px; overflow:hidden; background:#fff; font-size:12px; display:block; }
.att img{ width:100%; height:100px; object-fit:contain; display:block; background:#fff; border-bottom:1px solid var(--line); }
.att .ph{ height:100px; display:grid; place-items:center; font-size:30px; background:#F4EFE3; }
.att span{ display:block; padding:6px 8px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.review-card{ border:1px solid var(--line); border-radius:12px; padding:10px 12px; background:#fff; margin-bottom:8px; font-size:14px; }
.review-card .who{ display:flex; justify-content:space-between; gap:8px; font-size:12px; color:var(--muted); }
.review-card .score{ font-weight:700; color:var(--ink-2); }
.sub-row{ display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; padding:12px; border-bottom:1px solid var(--line); }
.sub-row:last-child{ border-bottom:0; }
.sub-row .icons{ display:flex; gap:6px; flex-wrap:wrap; margin-top:4px; }
.kpi{ display:grid; grid-template-columns:repeat(auto-fit,minmax(130px,1fr)); gap:10px; margin-bottom:16px; }
.kpi div{ background:#fff; border:1px solid var(--line); border-radius:14px; padding:14px; }
.kpi b{ display:block; font-size:24px; color:var(--ink-2); }
.kpi span{ font-size:12px; color:var(--muted); }

/* small screens: full-height modals */
@media (max-width:560px){
  .overlay{ padding:0; align-items:flex-end; }
  .modal, .modal.modal-wide{ width:100vw; max-height:92vh; border-radius:18px 18px 0 0; }
  .reader-bar h3{ font-size:14px; }
}

.attend-row{ display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap; margin:10px 0 4px; padding:10px 12px; border:1px dashed var(--gold-soft); border-radius:12px; background:#FFFCF4; font-size:14px; color:var(--ink-2); }
.topics-toolbar .switch{ flex:0 0 auto; }