/* =========================
   OpenLearn • Clean Styles
   ========================= */

/* === THEME TOKENS === */
:root {
  --bg: #0b0f17;
  --fg: #eaf1ff;
  --card: #111827;
  --muted: #9fb0c3;
  --border: #1f2a3b;
  --btnBg: #0f172a;
  --btnFg: #eaf1ff;
  --btnPrimaryBg: #2563eb;
  --btnPrimaryFg: #fff;
  --fontSize: 16px;
  --radius: 14px;

  --topbar-offset: 64px;
  --topbar-h: 56px;

  --sidebar-w: 72px; /* collapsed (icons only) */
  --sidebar-w-exp: 220px; /* expanded (icons + labels) */
  --content-max: 1200px; /* max width of inner content */
  --gutter: 16px; /* page side padding */

  /* Pills */
  --pill-ann: #1f2a44;
  --pill-ann-txt: #d6dcff;
  /* ❌ finals pill removed */
  scrollbar-gutter: stable both-edges;

  --shadow-soft: 0 4px 12px rgba(0, 0, 0, 0.15);
  --shadow-medium: 0 6px 20px rgba(0, 0, 0, 0.18);
  --shadow-strong: 0 8px 30px rgba(0, 0, 0, 0.22);

  --cert-logo-size: 84px; /* logo+QR size; change once to resize both */
}

/* Reset / base */
* {
  box-sizing: border-box;
}
html {
  font-size: var(--fontSize);
  height: 100%;
}
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto,
    Helvetica, Arial, Noto Sans, sans-serif;
  -webkit-overflow-scrolling: touch;
  overflow-x: hidden;
}

html,
body {
  height: 100%;
  background: var(--bg);
  margin: 0;
}

/* Helpers */
.hidden,
.ol-hidden {
  display: none !important;
}
.muted {
  color: var(--muted);
}
.row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.grow {
  flex: 1;
}
.h4 {
  font-size: 1.1rem;
  margin: 0;
}
a {
  color: var(--btnPrimaryBg);
  text-decoration: none;
}
a:hover {
  opacity: 0.9;
  text-decoration: underline;
}

/* ===== TOPBAR ===== */
#logo {
  margin-left: -27px;
}
#topbar {
  position: fixed;
  /* position: sticky; */
  top: 0;
  left: 0;
  right: 0;
  z-index: 1200;
  /* z-index: 1200; */
  background: var(--card);
  color: var(--fg);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
  backdrop-filter: saturate(120%) blur(6px);
}
.topbar-row {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 12px;
  align-items: center;
  height: var(--topbar-h);
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 14px;
}
.logo {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 18px;
}
.logo::before {
  content: "";
  width: 32px;
  height: 32px;
  background: url("./icons/plant.png") center/contain no-repeat;
  margin-right: 8px;
}

#btn-burger {
  display: none;
  width: 44px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
  /* display: grid; */
  place-items: center;
}

/* Search */
#topSearchWrap {
  display: flex;
  align-items: center;
  justify-content: center;
}
#topSearch {
  margin: 0 27px;
  display: block;
  width: min(560px, 62vw);
  height: 40px;
  border-radius: 10px;
  border: none; /* remove border line */
  outline: none; /* focus outline off */
  box-shadow: none; /* any inner shadow off */
  /* border: 1px solid var(--border); */
  /* background: var(--card); was #0b1220 */
  background: #fff;
  color: #111; /* ✅ စာအရောင် နက် */
  caret-color: #111; /* ✅ cursor အရောင် */
  padding: 10px 12px;
}
#topSearch::placeholder {
  color: #666;
} /* ✅ placeholder လည်း မြင်ရ */
/* focus state (optional subtle) */
#topSearch:focus {
  box-shadow: 0 0 0 2px rgba(76, 110, 245, 0.25);
}
.search-ico {
  display: none;
  width: 44px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  color: var(--fg);
  place-items: center;
}

/* Pills + auth */
.top-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.icon-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.2s ease, border-color 0.2s ease;
}
.icon-pill:hover {
  transform: translateY(-1px);
}
.pill-ann {
  /* was: background: var(--pill-ann); color: var(--pill-ann-txt); border-color: #334155; */
  background: rgba(var(--fg-r), var(--fg-g), var(--fg-b), 0.08);
  color: var(--fg);
  border-color: var(--border);
}
/* ❌ .pill-final removed */

#page-admin.page.visible {
  min-height: calc(100vh - var(--topbar-offset, 60px));
}

/* ===== SIDEBAR ===== */
#sidebar {
  position: fixed;
  left: 0;
  bottom: 0;
  z-index: 1100;
  top: var(--topbar-offset);
  width: var(--sidebar-w);
  background: var(--card);
  color: var(--fg);
  border-right: 1px solid var(--border);
  overflow: auto;
  transform: translateX(-100%);
  transition: transform 0.25s ease, width 0.2s ease;
  max-height: calc(100vh - var(--topbar-offset, 60px));
}
#sidebar.expanded {
  width: var(--sidebar-w-exp);
}
@media (hover: hover) {
  #sidebar:not(.show):hover {
    width: var(--sidebar-w-exp);
  }
}

#sidebar nav {
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
#sidebar .navbtn {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
  border-radius: 12px;
  cursor: pointer;
  padding: 0 12px;
  justify-content: left;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#sidebar .navbtn.active {
  background: rgba(255, 255, 255, 0.08);
  border-color: var(--btnPrimaryBg);
}
#sidebar .navbtn:hover {
  background: rgba(255, 255, 255, 0.08);
}
#sidebar .navbtn i {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  font-size: 22px;
  line-height: 1;
  margin-left: 2px;
}

/* hide labels only when collapsed AND not hovered */
#sidebar:not(.show):not(:hover) .navbtn span {
  display: none;
  opacity: 0;
}
/* show labels on hover, on drawer (.show), or when body has expanded flag */
#sidebar:hover .navbtn span,
#sidebar.show .navbtn span {
  display: inline-block !important;
  opacity: 1 !important;
}

#sidebar.show {
  width: var(--sidebar-w-exp);
  transform: translateX(0);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

/* Overlay scrim (optional but nice) */
/* body.sidebar-expanded::after {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  z-index: 1050; /* sidebar အောက်, content အပေါ်
} */

/* Main pages container သည် sidebar အောက် မဝင်အောင် */
/* .page,
#pages,
main,
#content {
  position: relative;
  z-index: 0;
} */

/* --- FIX: Sidebar labels show/hide nicely and stay interactive --- */
#sidebar .navbtn span {
  white-space: nowrap;
  opacity: 1;
  transition: opacity 0.12s ease;
}

/* ===== MAIN ===== */
.with-topbar {
  padding-top: var(--topbar-offset);
}
#main {
  margin-top: -43px;
  box-sizing: border-box;
  width: 100%;
  position: relative;
  min-height: 100vh;
  background: var(--bg);
  padding-top: calc(
    var(--topbar-offset) + 16px
  ); /* keep your extra 16px breathing room */
  transition: margin-left 0.2s ease, padding 0.2s ease;
  max-width: none;
  z-index: 1;
  /* padding-left: calc(var(--sidebar-w) + 8px);
  padding-right: 16px;
  padding-bottom: 60px; */
}
body.sidebar-expanded #main {
  padding-left: calc(var(--sidebar-w-exp) + 16px);
}

/* Pages */
.page {
  display: none; /* ✅ hide by default */
  position: relative;
  max-width: calc(var(--content-max) + var(--gutter) * 2);
  margin: 0 auto;
  padding: 16px var(--gutter) 24px;
  /* padding-bottom: 24px; */
  background: var(--bg);
  min-height: calc(100vh - var(--topbar-offset, 0px) - 68px);
}

/* make sure nothing sits under the fixed sidebar accidentally */
.page,
#pages,
main,
#content {
  position: relative;
  z-index: 0;
}

.page.visible {
  padding: 16px;
  display: block; /* ✅ only the active page shows */
}

/* Grids / tables */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.ol-table {
  width: 100%;
  border-collapse: collapse;
}
.ol-table th,
.ol-table td {
  border-bottom: 1px solid var(--border);
  padding: 10px 8px;
  text-align: left;
}
.ol-table th {
  color: var(--muted);
  font-weight: 600;
}

#adminTable a {
  color: #1ea2b6;
}
#adminTable a:hover {
  color: #4c909b;
  text-decoration: none;
}

#pay-with-paypal {
  padding-bottom: 12px;
  text-align: center;
}

#paypalNote {
  color: rgb(128, 109, 0);
  text-align: center;
}

/* Cards */
.card {
  line-height: 24px;
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-soft); /* 🌟 soft glow */
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-medium); /* lift on hover */
  transform: translateY(-2px);
}

/* Buttons / inputs */
.btn {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--btnBg);
  color: var(--btnFg);
  cursor: pointer;
}
.btn:hover {
  filter: brightness(0.97);
}
.btn.primary {
  background: var(--btnPrimaryBg);
  color: var(--btnPrimaryFg);
  border-color: transparent;
}
.btn.small {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
}
.input,
select,
textarea {
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}
.input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

/* Course cards */
.course-cover {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: contain; /* contain → ပုံကို ဖြတ်မတတ် */
  background: #0d0f12; /* ဖုံးပိတ်နေတဲ့ နေရာအဖြူမနေအောင် */
  border-radius: 10px 10px 0 0;
  display: block;
}
.course .course-body {
  margin-top: 8px;
  padding: .75rem 1rem;
}

/* Reader */
.progress {
  background: #0b1020;
  border-radius: 999px;
  height: 6px;
  overflow: hidden;
}
.progress .bar {
  height: 6px;
  background: #22d3ee;
}

/* Toast */
#toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: #0c1424;
  color: #eaf1ff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.9rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
  z-index: 2000;
}
#toast.show {
  opacity: 1;
}

/* Lock / gate */
body.locked #sidebar,
body.locked #main,
body.locked .top-icons,
body.locked .icon-pill,
body.locked .search-wrap,
body.locked .auth-slot #btn-logout {
  pointer-events: none;
  filter: grayscale(40%);
  opacity: 0.55;
}

/* --- FIX: Auth-gated elements should still be clickable to open modal --- */
/* ---- state-based gating for auth-required controls ---- */
/* logged out: dim visually but keep clickable (JS will open login modal) */
body.anon [data-requires-auth] {
  pointer-events: auto;
  opacity: 0.55;
  filter: grayscale(40%);
}

/* logged in: fully active */
body.logged [data-requires-auth] {
  pointer-events: auto;
  opacity: 1;
  filter: none;
}

/* (မ login ရသေးသူတွေ့တွင် [data-requires-auth] ကို click လုပ်ရင် modal ဖေါ်ချင်တယ်,
   pointer-events: none; မသုံးပါ—visual dim ပဲထားပါ) */
[data-requires-auth] {
  opacity: 0.9;
  filter: grayscale(10%);
  pointer-events: auto; /* ✅ allow clicks — JS gate ပြောမယ် */
}

/* app-side gated state (eg. chat input only) ကိုပဲจริงๆ disable */
.gated {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(40%);
}
/* 
.gated,
[data-requires-auth] {
  pointer-events: none;
  opacity: 0.55;
  filter: grayscale(40%);
} */

/* Chat */
#chatBox {
  height: 80vh; /* taller: 60% of viewport height */
  max-height: 90vh; /* never exceed 70% */
  min-height: 550px; /* at least 300px */
  overflow-y: auto;
  padding: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}
#chatBox .msg {
  padding: 6px 8px;
  margin-bottom: 6px;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 6px;
}
#chatInput {
  flex: 1;
}
#chatSend {
  margin-left: 6px;
}

/* ≤1199px (i.e., when grid is 3/2/1): hide input, show icon */
@media (max-width: 1199px) {
  #topSearch {
    display: none;
  }
  .search-ico {
    display: inline-grid;
  }
}

@media (min-width: 1025px) {
  /* sidebar always visible on desktop */
  #sidebar {
    transform: none !important; /* no off-canvas */
    width: var(--sidebar-w);
    box-shadow: none;
  }

  #main {
    margin-left: var(--sidebar-w);
    transition: margin-left 0.2s ease;
  }
  /* when sidebar expands on hover, push content too (requires #sidebar before #main in DOM) */
  #sidebar:hover ~ #main {
    margin-left: var(--sidebar-w-exp);
  }
}

/* Responsive */
@media (max-width: 1024px) {
  #sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-w-exp); /* 220–260px drawer is fine */
  }
  #sidebar.show {
    transform: translateX(0);
  }
  #main {
    margin-left: 0;
  }
  #btn-burger {
    display: grid;
  }
}

@media (max-width: 768px) {
  .topbar-row {
    grid-template-columns: auto 1fr auto auto;
    gap: 8px;
  }
  .logo {
    font-size: 16px;
  }
  #topSearch {
    display: none;
  }
  .search-ico {
    display: inline-grid;
  }
  .search-open #topSearch {
    display: block;
    position: fixed;
    left: 8px;
    right: 8px;
    top: calc(var(--topbar-h) + 6px);
    z-index: 60;
    width: auto;
  }
  .grid {
    grid-template-columns: 1fr !important;
  }
  .course-cover {
    height: 150px;
  }
}
@media (max-width: 520px) {
  .icon-pill .txt {
    display: none;
  }
}
@media (max-width: 480px) {
  .filters-wrap {
    grid-template-columns: 1fr;
  }
  #courseGrid {
    grid-template-columns: 1fr;
  }
}

/* Components & Modals */
.filters-wrap {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  align-items: center;
}

dialog.ol-modal {
  border: none;
  padding: 0;
}
dialog.ol-modal::backdrop {
  background: rgba(10, 14, 25, 0.64);
}
.ol-modal.card,
.auth-modern {
  background: var(--card);
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
}

/* --- Auth modal polish: labels, inputs, link spacing --- */
.auth-modern .authpane label {
  display: block;
  font-weight: 600;
  margin: 8px 0 4px;
}
.auth-modern .authpane .input {
  width: 100%;
  margin-top: 4px;
}
.auth-modern .authpane .input::placeholder {
  color: var(--muted);
  opacity: 0.9;
}

/* Links row: space them out, avoid "glued" look */
.auth-links {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}
.auth-links.single {
  justify-content: flex-end;
}
.auth-links a {
  padding: 2px 0;
}

/* Make primary actions stand out and fill width in modals */
.authpane .btn.wide,
.authpane .btn.primary.wide {
  width: 100%;
  margin-top: 10px;
}

.modal-title {
  font-weight: 700;
}
dialog.ol-modal,
#authModal,
#courseModal,
#postModal,
#profileEditModal,
#detailsModal {
  background: var(--card) !important;
  color: var(--fg) !important;
  border: 1px solid var(--border) !important;
  border-radius: 16px;
  padding: 20px 22px;
  width: min(92vw, 760px);
  max-width: 760px;
  max-height: 80vh;
  overflow: auto;
  box-shadow: var(--shadow-strong); /* 🌟 floating layer */
  animation: modalPop 0.25s ease;
}
@keyframes modalPop {
  from {
    transform: scale(0.96);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

dialog::backdrop {
  background: rgba(0, 0, 0, 0.45);
}
dialog::backdrop + .button-group {
  display: none;
}
label {
  color: var(--fg) !important;
  font-weight: 600;
}
.authpane,
.modal-body form,
#courseForm,
#postForm,
#profileForm {
  display: grid;
  gap: 10px;
}
dialog.ol-modal textarea {
  min-height: 120px;
  resize: vertical;
}

.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.table-responsive .ol-table {
  min-width: 720px;
}
.table-responsive .ol-table thead th {
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}

#courseGrid {
  display: grid;
  grid-template-columns: repeat(1, minmax(0, 1fr)); /* 1 col default */
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  gap: 12px;
}

@media (min-width: 600px) {
  #courseGrid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  #courseGrid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1200px) {
  #courseGrid {
    grid-template-columns: repeat(4, 1fr);
  }
}

@media (max-width: 600px) {
  #courseGrid {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .card.course {
    border-radius: 12px;
    margin: 0;
  }
  .course-body {
    padding: 14px !important;
  }
}

/* Keep inputs cursor correct */
#chatInput,
#ccInput,
input.input,
textarea {
  cursor: text;
}
input:disabled,
textarea:disabled,
button:disabled {
  cursor: not-allowed;
}

/* ---- Modal forms polish: labels + fields + placeholders ---- */
.authpane label,
#courseForm label,
#postForm label,
#profileForm label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  line-height: 1.2;
  margin: 6px 0;
}

.authpane input.input,
.authpane select.input,
.authpane textarea.input,
#courseForm .input,
#postForm .input,
#profileForm .input,
#courseForm select.input {
  width: 100%;
  height: 42px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--fg);
}

#courseForm textarea.input,
#postForm textarea.input,
#profileForm textarea.input {
  min-height: 120px;
  height: auto;
  padding: 12px;
  resize: vertical;
}

.input::placeholder,
textarea::placeholder {
  color: var(--muted);
  opacity: 0.85;
}

/* focus state: clearer but subtle */
.authpane .input:focus,
#courseForm .input:focus,
#postForm .input:focus,
#profileForm .input:focus,
.authpane select.input:focus {
  outline: none;
  border-color: color-mix(in oklab, var(--btnPrimaryBg) 60%, var(--border));
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
}

/* course form: responsive grid for neat alignment */
#courseForm {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}
#courseForm label[style*="grid-column: 1/-1"] {
  /* keep existing full-width fields full */
  grid-column: 1 / -1 !important;
}

.cert-doc {
  box-sizing: border-box;
  width: 100%; /* dialog အကျယ်ထဲကို အပြည့် */
  max-width: 1000px; /* print အတွက် control (A4 landscape ~ 1000px) */
  height: auto; /* fixed height မသုံးပါ */
  min-height: 650px; /* အနည်းဆုံး အမြင့် */
  margin: 0 auto;
  padding: 30px 40px 80px; /* ပေါ်30px / ညာ40px / အောက်80px => logo/title မပြတ်, signatures margin ရ */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: var(--shadow-strong); /* 🌟 same as modals */
  position: relative; /* logo absolute positioning သုံးမယ်ဆိုရင်လိုတယ် */
  overflow: hidden; /* scroll မဖြစ်အောင် */
}

.cert-head {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-top: 46px;
  color: #222;
}
.cert-sub {
  text-align: center;
  color: #555;
  margin: 4px 0 10px;
}
.cert-name {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin: 8px 0 4px;
  color: #222;
}
.cert-course {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 2px;
  color: #222;
}
.cert-meta {
  text-align: center;
  color: #555;
  margin-top: 6px;
}
.cert-seal {
  width: 90px;
  height: 90px;
  border-radius: 50%;
  background: linear-gradient(135deg, #8c7851, #a88b63);
}
.cert-photo {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #eee;
  margin: 14px auto 8px; /* centered under headers */
  background: #f6f6f6;
}
.cert-signs {
  position: absolute;
  left: 60px;
  right: 60px;
  bottom: 46px;
  display: flex;
  gap: 24px;
  justify-content: space-between;
}
.cert-signs .sig {
  text-align: center;
  flex: 1;
}
.cert-signs .sig-label {
  margin-top: 6px;
  font-size: 12px;
  color: #444;
}
.sig-img {
  width: 120px;
  height: auto;
  object-fit: contain;
}
/* Logo */
.cert-wrap {
  position: relative;
  overflow: visible;
}

.cert-logo {
  margin-top: 4mm;
  width: var(--cert-logo-size);
  height: var(--cert-logo-size);
  object-fit: contain;
  position: absolute;
  top: 25px; /* ပိုနည်းခဲ့ရင် logo ပြတ်သွားမယ် */
  left: 25px;
}
.sig {
  text-align: center;
  flex: 1;
  font-size: 12px;
  color: #444;
}
/* screen view မှာ modal အောက်က ခလုတ် row ကို အပေါ်ယံချည်းပဲပြ (print မှာတှာ် hidden already) */
/* Controls row in modal (screen only; print မှာ already hidden) */
#certModal .row {
  width: min(1123px, 96vw);
  margin: 10px auto 0;
}

/* Announcements card items already use .card */
/* If inner text looked too pale, ensure: */
#annList .card {
  background: var(--card);
  color: var(--fg);
  border-color: var(--border);
}
#annList .muted {
  color: var(--muted);
}

/* hide controls when printing */

/* ===== Certificate: FULL VIEW (screen) ===== */
body.cert-open {
  overflow: hidden;
} /* background scroll lock */

#certModal {
  /* dialog ကို viewport အပြည့် */
  inset: 0 !important;
  width: min(95vw, 1200px);
  /* width: 100vw !important; */
  height: 100vh !important;
  max-width: none !important;
  max-height: none !important;
  padding: 0 !important;
  margin: 0 !important;
  background: #0b0f17; /* dark canvas behind cert */
  display: grid;
  place-items: center; /* center the cert */
  overflow: hidden; /* ❗ no scrollbars in modal */
}

#certBody {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center; /* center child */
  overflow: hidden; /* ❗ no inner scroll */
  max-height: calc(90vh - 60px);
}

/* A4 landscape canvas (design size ~1123×794 @96dpi) */
.cert-doc {
  position: relative;
  width: 100%;
  aspect-ratio: 297 / 210; /* A4 landscape canvas proportion */
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.22);
  padding: 24px 28px;
  overflow: hidden;

  /* 🚀 scale-to-fit viewport so no scrollbars */
  transform: scale(var(--certScale, 1));
  transform-origin: center center;
}

/* anti-forgery footer inside certificate */
.cert-forgery {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 10px;
  color: #666;
  font-size: 10px;
  text-align: center;
}

/* brand/logo + photo + name layout */

.cert-qr {
  position: absolute;
  top: 16px;
  right: 16px;
  width: var(--cert-logo-size);
  height: var(--cert-logo-size);
  display: grid;
  place-items: center;
}
.cert-qr img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  margin: 24px 24px 0 0;
}
img.qr {
  display: none !important;
}

.cert-head {
  font-size: 26px;
  font-weight: 800;
  text-align: center;
  margin-top: 60px;
  color: #222;
}
.cert-sub {
  text-align: center;
  color: #555;
  margin: 4px 0 10px;
}

.cert-photo {
  display: block;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #eee;
  margin: 14px auto 8px; /* centered under headers */
  background: #f6f6f6;
}

.cert-name {
  text-align: center;
  font-size: 28px;
  font-weight: 800;
  margin: 16px 0 4px;
  color: #222;
}

.cert-course {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  margin: 6px 0 2px;
  color: #222;
}

.cert-meta {
  text-align: center;
  color: #555;
  margin-top: 6px;
}

/* Signatures section */
.cert-signs {
  margin-bottom: 6mm;
  display: flex;
  justify-content: space-between;
  gap: 40px;
  margin-top: 60px; /* body ကနေနည်းငယ် အထက်တင်ထား */
  padding: 0 40px;
}

.sig {
  text-align: center;
  flex: 1;
  font-size: 12px;
  color: #444;
}
.sig-img {
  width: 120px;
  height: auto;
  object-fit: contain;
}

/* Controls row in modal (screen only; print မှာ already hidden) */
#certModal .row {
  width: min(1123px, 96vw);
  margin: 10px auto 0;
}

/* ===== PRINT: certificate only, full page ===== */
/* ==== CERT PRINT — A4 landscape, single page, slight margins ==== */
/* A4 landscape + ကွာဟချက် 12mm (အပေါ်အောက်နှစ်ဖက်ပေါင်း 24mm) */
/* A4 landscape + safe margins */
@page {
  size: A4 landscape;
  margin: 14mm;
} /* များလွန်းရင် 8mm အထိလျှော့နိုင် */

@media print {
  body * {
    visibility: hidden !important;
  }
  body {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Only dialog contents */
  body > :not(#certModal) {
    display: none !important;
  }
  #certModal,
  #certModal * {
    visibility: visible !important;
  }
  #certModal::backdrop {
    display: none !important;
  }

  #certModal {
    position: static !important;
    inset: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
  }
  #certBody {
    display: block;
    overflow: visible;
  }

  /* one-page fit inside usable area (297x210 − margins) */
  .cert-doc {
    box-sizing: border-box;
    width: calc(297mm - 20mm);
    height: calc(210mm - 20mm);
    margin: 0 auto !important;
    transform: none !important;
    padding: 10mm 12mm 8mm; /* top/side/bottom → bottom နည်းနည်းများ */
    background: #fff !important;
    box-shadow: none !important;
    overflow: hidden !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  /* hide any UI controls */
  .no-print,
  .btn {
    display: none !important;
  }
}

/* certificate dialog မဖွင့်ခင်에는 controls မပေါ်အောင် */
#certModal:not([open]) #certPrint,
#certModal:not([open]) #certClose,
#page-mylearning #certPrint,
#page-mylearning #certClose {
  display: none !important;
}

/* Buttons sit at the bottom of every course card */
/* make each course card a vertical flex box */
.card.course {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* body fills remaining height */
.card.course .course-body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
}

/* push the last actions row to the bottom */
.card.course .course-body .row:last-child {
  margin-top: auto;
}

.card.course ul.benefits {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.2rem;
  list-style: disc;
}
.card.course ul.benefits li {
  line-height: 1.3;
}

/* Ensure all primary action buttons remain clickable */
button,
.btn {
  pointer-events: auto !important;
}

/* Specific for New Course button */
#btn-new-course,
#btn-course-cancel,
#btn-course-save {
  pointer-events: auto !important;
  opacity: 1 !important;
}

/* Announcements badge */
.icon-pill .badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 6px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  background: #ef4444; /* red-500 */
  color: #fff;
  border: 1px solid rgba(0, 0, 0, 0.2);
  transform: translateY(-1px);
  margin-left: 6px;
}

/* ===== Auth Lock ===== */
.locked-main {
  pointer-events: none !important;
  filter: blur(1px) saturate(0.8);
}

.disabled,
[aria-disabled="true"] {
  pointer-events: none !important;
  opacity: 0.5;
  cursor: not-allowed;
}

/* optional overlay (main မှာသာ ပြ) */
#authGuardOverlay {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  z-index: 5;
}
.locked-main + #authGuardOverlay {
  display: flex;
}
#authGuardOverlay .msg {
  /* background: #fff; */
  padding: 14px 18px;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(211, 235, 134, 0.718);
  font-weight: 600;
  border: 1px solid var(--border);
}

/* === Global Search Results === */
.search-wrap {
  position: relative;
  display: inline-block;
}

.search-results {
  position: absolute;
  top: 100%; /* exactly below the input */
  left: 12.4%; /* align to input left */
  width: 75%; /* same width as input */
  max-height: 60vh;
  overflow: auto;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 8px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  z-index: 999;
}

.search-item {
  padding: 10px 12px;
  cursor: pointer;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

#searchResults {
  background: rgb(164, 164, 164);
  color: #de5a07;
}

.search-item:last-child {
  border-bottom: none;
}

.search-item:hover {
  background: #f8fafc;
}

.search-type {
  font-size: 11px;
  font-weight: 700;
  color: #475569;
  text-transform: uppercase;
}

.search-title {
  font-weight: 600;
  color: #0f172a;
}

.search-snippet {
  font-size: 12px;
  color: #475569;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Guide & Help styles */
.help-body {
  font-size: 0.95rem;
  line-height: 1.6;
}
.help-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.help-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.help-card b {
  display: block;
  margin-bottom: 4px;
}
.kbd {
  display: inline-block;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85em;
}
.help-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(var(--fg-r), var(--fg-g), var(--fg-b), 0.06);
  border: 1px solid var(--border);
  padding: 6px 8px;
  border-radius: 8px;
}
.help-list {
  margin: 0.2rem 0 0.6rem;
  padding-left: 1.1rem;
}
details.help {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
}
details.help + details.help {
  margin-top: 10px;
}

/* Help & Guide visuals */
.help-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.9rem;
  margin-top: 0.75rem;
}
.help-card {
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 14px;
  padding: 0.9rem 1rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.help-card b {
  display: block;
  margin-bottom: 0.35rem;
}
.help-list {
  padding-left: 1.05rem;
  margin: 0.25rem 0 0;
}
.help-list li {
  margin: 0.18rem 0;
}
.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.85em;
  border: 1px solid #fae676;
  padding: 0 0.35rem;
  border-radius: 6px;
  color: #70faf5;
}
.icons-row .img-tip img {
  width: 100%;
  height: 84px;
  object-fit: contain;
  display: block;
  margin-bottom: 0.5rem;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.06));
}
.help-news {
  border-left: 4px solid #06b6d4;
}

.pw-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.pw-wrap .input {
  flex: 1;
  padding-right: 2.2rem;
}
.pw-toggle {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  font-size: 1rem;
  cursor: pointer;
  opacity: 0.75;
}
.pw-toggle:hover {
  opacity: 1;
}

#rdPage .ok {
  color: rgba(var(--fg-r), var(--fg-g), var(--fg-b), 0.95);
}
#rdPage .bad {
  color: #f87171;
} /* red-400-ish */

/* Full-width overlay dropdown */
#topSearchResults {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: calc(var(--header-height, 56px) + 8px);
  width: min(1200px, 92vw);
  max-height: 70vh;
  overflow: auto;

  background: #fff;
  color: #222;
  border: 1px solid #ddd;
  border-radius: 8px;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);

  z-index: 1000;
  margin: 0;
  padding: 6px;
  list-style: none;

  /* Default hidden — JS က ပြန်ဖွင့်မယ် */
  display: none;
}
#topSearchResults li {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid #eee;
}
#topSearchResults li:last-child {
  border-bottom: 0;
}
#topSearchResults li a {
  display: block;
  padding: 4px 6px;
  text-decoration: none;
  color: inherit;
  border-radius: 6px;
}
#topSearchResults li a:hover {
  background: #f6f7fb;
}

:root.dark #topSearchResults {
  background: #1f2937;
  color: #e5e7eb;
  border-color: #374151;
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.35);
}
:root.dark #topSearchResults li {
  border-bottom-color: #374151;
}
:root.dark #topSearchResults li a:hover {
  background: #2b3646;
}

:root.dark #topSearch {
  background: #111827; /* dark bg */
  color: #e5e7eb; /* light text */
  caret-color: #e5e7eb;
}
:root.dark #topSearch::placeholder {
  color: #9ca3af;
}

/* Search overlay default: HIDDEN until we have results */
#topSearchResults {
  display: none;
}

/* If lib/classlist သုံးချင်ရင်—hidden အခြေအနေမှာလည်း မပေါ်စေ */
#topSearchResults.hidden {
  display: none !important;
}

/* Results list အတွင်းမှာ content မရှိရင် မပေါ်စေ (border/padding ပါဖြတ်) */
#topSearchResults:empty {
  display: none !important;
  border: 0 !important;
  padding: 0 !important;
}

/* Wallet Panel */
.wallet-card {
  flex: 1;
  min-width: 280px;
  background: #dedbdb;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 4px 10px rgba(0,0,0,0.08);
  border: 1px solid #807f7f;
  animation: fadeIn 0.3s ease-in-out;
  text-align: center;   /* title ကို အလယ်ထားမယ် */
}

.wallet-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: #333;
  margin-bottom: 1rem;
  display: inline-block;
  border-bottom: 2px solid #3b82f6;
  padding-bottom: 4px;
}

.wallet-row {
  display: flex;
  flex-direction: column; /* row → column */
  gap: 16px;
  align-items: center;    /* center horizontally */
}

.wallet-qr-box {
  display: flex;
  justify-content: center;
  align-items: center;
}

.wallet-qr {
  width: 240px;
  height: 240px;
  object-fit: contain;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #fafafa;
  padding: 6px;
  transition: transform 0.2s ease;
}
.wallet-qr:hover {
  transform: scale(1.03);
}

.wallet-info {
  flex: 1;
  max-width: 300px;
  text-align: center; /* info ကိုလည်း အလယ်ထား */
}

.wallet-brand {
  font-weight: 700;
  font-size: 1.1rem;
  color: #c88d05;
  margin-bottom: 4px;
}

.wallet-acct {
  color: #6b7280;
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.wallet-hint {
  color: #4b5563;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

/* Fade animation */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.price-tag{
  font-size:.95rem;
  font-weight:700;
  color:#0ea5e9;          /* sky */
  background:#e0f2fe;     /* sky-100 */
  padding:4px 10px;
  border-radius:999px;
  line-height:1;
  white-space:nowrap;
}

/* ==== Profile Panel – Pretty UI ==== */

/* container card look */
#profilePanel {
  --pf-bg: #ffffff;
  --pf-muted: #374151;     /* gray-500 */
  --pf-border: #e5e7eb;    /* gray-200 */
  --pf-shadow: 0 8px 24px rgba(0,0,0,.08);
  background: var(--pf-bg) !important;
  color: #0f172a !important;               /* dark text */
  border: 1px solid var(--pf-border);
  border-radius: 16px;
  box-shadow: var(--pf-shadow);
  padding: 18px;
  max-width: 980px;
  margin: 12px auto;
}

#profilePanel a { 
  color: #0f172a;           /* slate-900 */
  text-decoration: none;
}
#profilePanel a:hover { 
  text-decoration: underline;
}

/* header row */
#profilePanel > .row {
  align-items: center !important;
  gap: 16px !important;
}

/* avatar — override inline size softly */
#profilePanel img[style*="border-radius:50%"] {
  width: 86px !important;
  height: 86px !important;
  border-radius: 50%;
  border: 3px solid #f3f4f6;    /* gray-100 */
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
  background: #fff;
  object-fit: cover;
}

/* name */
#profilePanel .h4 {
  font-size: 1.35rem;
  line-height: 1.2;
  letter-spacing: .2px;
}

/* muted text */
#profilePanel .muted {
  color: var(--pf-muted) !important;
}

#profilePanel .small.muted {
  color: #4b5563 !important;               /* gray-600 */
}

/* small section blocks */
#profilePanel .profile-section {
  margin-top: 12px;
}
#profilePanel .profile-section .title {
  font-size: .85rem;
  color: #111827;           /* gray-900 */
}

/* chips for links */
#profilePanel .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--pf-border);
  background: #f3f4f6 !important;          /* gray-100 */
  border-color: #d1d5db !important;        /* gray-300 */
  color: #111827 !important;
  text-decoration: none;
  font-size: .85rem;
  transition: all .15s ease;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* #profilePanel .chip:hover {
  background: #e5e7eb !important; 
  border-color: #9ca3af !important;
} */

/* make link blocks look neat on their own lines too */
#profilePanel .profile-links {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}
@media (min-width: 520px) {
  #profilePanel .profile-links {
    grid-template-columns: repeat(2, minmax(0,1fr));
  }
}
@media (min-width: 840px) {
  #profilePanel .profile-links {
    grid-template-columns: repeat(3, minmax(0,1fr));
  }
}

/* transcript / cert tables */
#profilePanel .ol-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--pf-border);
  border-radius: 10px;
  overflow: hidden; /* for rounded corners */
  background: #fff;
}
#profilePanel .ol-table thead th {
  background: #e5e7eb !important;          /* gray-200 */
  color: #111827 !important;
  border-bottom-color: #d1d5db !important;
  font-weight: 600;
  padding: 10px 12px;
  font-size: .85rem;
  text-align: left;
  border-bottom: 1px solid var(--pf-border);
}
#profilePanel .ol-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid #f1f5f9; /* slate-100 */
  font-size: .9rem;
  background: #ffffff !important;
  color: #0f172a !important;
  border-bottom-color: #e5e7eb !important; /* gray-200 */
}
#profilePanel .ol-table tbody tr:nth-child(odd) td {
  background: #f9fafb !important;          /* slate-50 */
}

#profilePanel img[style*="border-radius:50%"] {
  border-color: #e5e7eb !important;        /* gray-200 */
}

#profilePanel .profile-section .title,
#profilePanel b.small,
#profilePanel .h4 {
  color: #0b1220 !important;               /* very dark */
}

/* buttons in the certificate row */
#profilePanel .btn.small {
  background: #ffffff;
  border: 1px solid #d1d5db;
  color: #111827;
  padding: 6px 10px;
  border-radius: 8px;
}

/* subtle section separators */
#profilePanel .grow > .small,
#profilePanel .grow > .muted,
#profilePanel .grow > .profile-section,
#profilePanel .grow > div[style*="margin-top:10px"] {
  margin-top: 10px !important;
}

#profilePanel .btn.small:hover {
  background: #f3f4f6;
}

/* responsive stack for header */
@media (max-width: 520px) {
  #profilePanel > .row {
    align-items: flex-start !important;
  }
}

@media (prefers-color-scheme: dark) {
  body { background-color: #0b1220; }
  #profilePanel {
    background: #0f172a !important;        /* dark slate */
    color: #e5e7eb !important;
    border-color: #1f2937 !important;
  }
  #profilePanel .muted,
  #profilePanel .small.muted { color: #cbd5e1 !important; }
  #profilePanel .chip {
    background: #1f2937 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
  }
  #profilePanel .chip:hover {
    background: #2b394b !important;
    border-color: #475569 !important;
  }
  #profilePanel .ol-table thead th {
    background: #1f2937 !important;
    color: #e5e7eb !important;
    border-bottom-color: #334155 !important;
  }
  #profilePanel .ol-table tbody td {
    background: #0f172a !important;
    color: #e5e7eb !important;
    border-bottom-color: #1f2937 !important;
  }
  #profilePanel .ol-table tbody tr:nth-child(odd) td {
    background: #111827 !important;
  }
  #profilePanel .btn.small {
    background: #111827;
    border-color: #334155;
    color: #e5e7eb;
  }
  #profilePanel a { color: #e5e7eb; }
}

/* === Profile: fix low-contrast hover on action buttons === */
#profilePanel .btn.small,
#profilePanel a.btn.small {
  background: #ffffff !important;
  border: 1px solid #d1d5db !important;
  color: #111827 !important;
  padding: 6px 10px;
  border-radius: 8px;
  line-height: 1.2;
}

/* Light mode hover/focus — keep high contrast */
#profilePanel .btn.small:hover,
#profilePanel a.btn.small:hover,
#profilePanel .btn.small:active,
#profilePanel a.btn.small:active {
  background: #111827 !important;   /* very dark */
  border-color: #111827 !important;
  color: #ffffff !important;         /* force readable text */
}

#profilePanel .btn.small:focus-visible,
#profilePanel a.btn.small:focus-visible {
  outline: 2px solid #2563eb !important; /* accessible focus ring */
  outline-offset: 2px;
}

/* Prevent any global .btn:hover color overrides inside profile */
#profilePanel .ol-table .btn.small,
#profilePanel .ol-table a.btn.small {
  color: inherit !important;
}

/* Dark mode versions */
@media (prefers-color-scheme: dark) {
  #profilePanel .btn.small,
  #profilePanel a.btn.small {
    background: #111827 !important;
    border-color: #334155 !important;
    color: #e5e7eb !important;
  }
  #profilePanel .btn.small:hover,
  #profilePanel a.btn.small:hover,
  #profilePanel .btn.small:active,
  #profilePanel a.btn.small:active {
    background: #2563eb !important;  /* blue hover for contrast */
    border-color: #2563eb !important;
    color: #ffffff !important;
  }
  #profilePanel .btn.small:focus-visible,
  #profilePanel a.btn.small:focus-visible {
    outline-color: #60a5fa !important;
  }
}

/* ======================
   Course Chat Styling
   ====================== */
#courseChat {
  --cc-bg: #0f172a;       /* dark background */
  --cc-card: #1e293b;     /* chat list bg */
  --cc-text: #f1f5f9;     /* text */
  --cc-muted: #94a3b8;    /* muted */
  --cc-accent: #22c55e;   /* green accent */
  --cc-accent-2: #38bdf8; /* cyan links */
  --cc-border: #334155;   /* border */

  background: var(--cc-bg);
  color: var(--cc-text);
  border: 1px solid var(--cc-border);
  border-radius: 14px;
  padding: 10px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}

#courseChat strong {
  color: var(--cc-accent);
  font-size: 1.1rem;
}

#courseChat .muted {
  color: var(--cc-muted) !important;
}

#courseChat #ccList {
  background: var(--cc-card);
  border-radius: 10px;
  padding: 8px;
  overflow-y: auto;
}
#courseChat #ccList::-webkit-scrollbar {
  width: 8px;
}
#courseChat #ccList::-webkit-scrollbar-thumb {
  background: #475569;
  border-radius: 8px;
}
#courseChat #ccList::-webkit-scrollbar-track {
  background: #0f172a;
}

/* Messages */
#courseChat .msg {
  padding: 8px 12px;
  border-radius: 12px;
  margin-bottom: 6px;
  display: inline-block;
  max-width: 80%;
  word-wrap: break-word;
  font-size: .9rem;
  line-height: 1.35;
}
#courseChat .msg.me {
  background: #1e3a8a; /* indigo */
  color: #f8fafc;
  align-self: flex-end;
}
#courseChat .msg.other {
  background: #064e3b; /* dark green */
  color: #f8fafc;
  align-self: flex-start;
}
#courseChat .msg.system {
  background: #3f3f46; /* neutral */
  color: #e5e7eb;
  font-style: italic;
  text-align: center;
  display: block;
  margin: 8px auto;
}

/* Input bar */
#courseChat .row:last-child {
  margin-top: 10px;
}
#courseChat #ccInput {
  background: #0f172a;
  border: 1px solid var(--cc-border);
  border-radius: 10px;
  color: var(--cc-text);
  padding: 8px 10px;
}
#courseChat #ccInput:focus {
  border-color: var(--cc-accent-2);
  outline: none;
  box-shadow: 0 0 0 3px rgba(56,189,248,.3);
}
#courseChat #ccSend {
  background: var(--cc-accent);
  color: #0b1220;
  font-weight: bold;
  border-radius: 10px;
  transition: all .15s ease;
}
#courseChat #ccSend:hover {
  filter: brightness(1.05);
}

/* Sticky Note UI + pointer */
#ol-note-layer { 
  position: fixed; inset: 0; z-index: 1000; display:none; 
}
#ol-note-backdrop {
  position:absolute; inset:0; background: rgba(0,0,0,.45);
}
#ol-note-card {
  position:absolute; left:50%; top:50%; transform: translate(-50%,-50%);
  width: min(640px, 92vw); background: #fff; color:#0f172a;
  border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
  padding: 14px;
}
#ol-note-card .hdr {
  display:flex; align-items:center; justify-content:space-between; margin-bottom:8px;
}
#ol-note-ta {
  width: 100%;
  min-height: 150px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #ffffff;        /* white */
  color: #111827;             /* dark text */
  font-size: 14px;
  line-height: 1.5;
}
#ol-note-card .hdr b { color: orange;; }
#ol-note-meta { color: #c1c6ce; }
#ol-note-ta::placeholder { color:#6b7280; } /* gray-500 */
#ol-note-card .row { margin-top:10px; justify-content:flex-end; gap:8px; }
#ol-note-card textarea{width:100%;min-height:180px;border:1px solid #d1d5db;border-radius:8px;padding:10px;font:inherit;resize:vertical;background:#faf3a9; color: rgb(39, 39, 39);}
#ol-note-card .row{display:flex;gap:8px;justify-content:flex-end;margin-top:10px}
#ol-note-card .btn{padding:6px 10px;border-radius:8px;border:1px solid #d1d5db;background:#4383a8}
#ol-note-card .btn.primary{background:#2563eb;color:#fff;border-color:#2563eb}
#rdNote, #rdBookmark, #bm-continue { cursor: pointer; background: rgb(88, 64, 18);}
/* Dark mode */
@media (prefers-color-scheme: dark) {
  #ol-note-card { background: #0f172a; color:#e5e7eb; }
  #ol-note-ta { background:#111827; color:#e5e7eb; border-color:#334155; }
  #ol-note-ta::placeholder { color:#9ca3af; }
}