:root {
  --topbarH: 64px; /* JS ကနေ dynamic update လုပ်ပေးမယ် */
  --container: 1080px;
  --containerW: 95%;
  --underbarMax: 60vh;
  --bg: #fff;
  --hover: #f3f4f6; /* hover background */
  --brand: #a16207;
  --fg: #e9ecef;
  --ink: #111;
  --muted: #666;
  --card: #ffffff;
  --accent: #6a3b2d;
  --radius: 16px;
  --border: #e9ded0;
  font-size: clamp(14px, 1.8vw, 16px);
  color-scheme: light dark;
}
:root[data-theme="dark"] {
  --bg: #0e0b09;
  --fg: #eee3d1;
  --card: #1a1410;
  --muted: #b8a99a;
  --accent: #d28d6a;
}
:root[data-theme="pali"] {
  --bg: #f6efe1;
  --fg: #2a1e13;
  --card: #ffffff;
  --muted: #6b5b4a;
  --accent: #6a3b2d;
}
:root[data-fs="sm"] {
  font-size: 14px;
}
:root[data-fs="md"] {
  font-size: 16px;
}
:root[data-fs="lg"] {
  font-size: 18px;
}
:root[data-fs="xl"] {
  font-size: 20px;
}

:root[data-theme="dark"] .mobile-panel {
  background: #14171a;
  color: #e6ecf0;
  border-top-color: #2a3138;
}
:root[data-theme="pali"] .mobile-panel {
  background: #ffffff;
  color: #2a1e13;
  border-top-color: #efe6d8;
}

/* Dark mode friendly */
[data-theme="dark"] .auth-card {
  background: #1f1f23;
  color: #f1f1f1;
}
[data-theme="dark"] .icon-btn.close {
  color: #f4f4f4;
}
[data-theme="dark"] .icon-btn.close:hover {
  background: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] label.pw .eye {
  color: #ccc;
}
[data-theme="dark"] .btn.ghost {
  color: #f4f4f4;
  border-color: #555;
}
[data-theme="dark"] .btn.ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

* {
  box-sizing: border-box;
}
html,
body {
  background: var(--bg);
  color: var(--fg);
  margin: 0;
  width: 100%;
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, Segoe UI, Roboto, Noto Sans,
    sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

main {
  width: 100%;
  padding: 1rem;
  padding-top: var(--topbarH);
  box-sizing: border-box;
}

main#app {
  position: relative;
  z-index: 1;
  padding: 12px;
  padding-bottom: 64px;
  min-height: 50vh;
}

/* Headings */
.h2 {
  font-size: clamp(1.1rem, 1.8rem, 1.8rem);
  margin: 0.2rem 0 0.6rem;
}
.h3 {
  font-weight: 700;
  font-size: 1.05rem;
}
.tight {
  margin: 0.1rem 0 0.2rem;
}

.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--bg, #0c0c0c);
}

.topbar {
  /* ✅ အမြဲတမ်း တူညီတဲ့ height */
  height: var(--topbarH);
  min-height: var(--topbarH);
  max-height: var(--topbarH);
  overflow: hidden; /* wrap ဖြစ်သွားရင်တောင် အပေါ်မှာမကြီးစေဘူး */
  position: sticky;
  top: 0;
  z-index: 1000;
  /* display: grid; */
  display: flex;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.8rem;
  padding: 0.6rem 0.9rem;
  background: var(--card);
  /* background:#fff;  */
  border-bottom: 1px solid var(--border);
  backdrop-filter: saturate(160%) blur(10px);
}
.topbar-inner {
  display: grid;
  /* flex-wrap: nowrap; */
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  /* padding: 0.5rem 1rem; */
  padding: 0 0.75rem;
  grid-template-columns: 1fr auto 1fr;
  /* min-height: calc(var(--topbarH) * 1px); */
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
}
.topbar .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1rem;
  min-height: var(--topbarH);
}

.topbar .brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
}
.topbar img {
  width: 28px;
  height: 28px;
}
.topbar nav {
  margin-left: auto;
  display: flex;
  gap: 0.4rem;
}

/* Buttons & inputs (bigger touch targets on iPhone) */
.btn {
  padding: 0.65rem 0.85rem;
  border: none;
  border-radius: 0.65rem;
  border: 1px solid #ffffff26;
  background: #0000;
  color: inherit;
  cursor: pointer;
  font-weight: 600;
  font-size: 1rem;
}
.btn:hover {
  background: #0000004a;
}
.btn.ghost {
  background: transparent;
  border: 1px solid #ddd;
}
.btn.ghost:hover {
  background: var(--hover);
}
.btn.danger {
  border-color: #ff5c5c55;
  color: #ff7a7a;
}
.btn.danger.ghost:hover {
  background: #ff5c5c22;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
}
input,
select,
textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  border-radius: 0.6rem;
  border: 1px solid #2a3138;
  background: #0e1114;
  color: #e9ecef;
  -webkit-appearance: none;
  appearance: none;
}

/* Ensure dropdowns aren't clipped on small screens */
select {
  max-width: 100%;
}

/* File input pretty */
label.file {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}
label.file input[type="file"] {
  display: none;
}
label.file span {
  padding: 0.55rem 0.8rem;
  border: 1px dashed #ffffff33;
  border-radius: 0.6rem;
}

/* Profile block */
.profile-head {
  display: flex;
  gap: 0.8rem;
  align-items: center;
  margin-bottom: 0.6rem;
}
.avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid #ffffff22;
  background: #222;
}

/* Key/Value rows */
.kv {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.5rem;
  padding: 0.25rem 0;
  align-items: start;
}
.kv-k {
  color: var(--muted);
}
.kv + .kv {
  border-top: 1px dashed #ffffff18;
}

.hamburger {
  display: inline-flex; /* ensure visible on mobile */
  justify-content: center;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0.4rem;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.8rem;
  transition: transform 0.2s ease;
}
.hamburger:hover {
  transform: scale(1.1);
}
/* ===== Mobile / Tablet (≤ 860px) ===== */
@media (max-width: 860px) {
  /* ✅ Desktop nav ကို လုံး၀လိမ့်ချ: nav links လုံးဝမပေါ် */
  .nav-desktop,
  .auth-actions {
    display: none !important;
    visibility: hidden !important;
  } /* ✅ mobile မှာ links မပေါ် */

  /* ✅ Burger icon ကို မြင်အောင် */
  .btn-icon.burger {
    display: flex !important;
    width: 48px;
    height: 48px; /* touch-friendly */
    align-items: center;
    justify-content: center;
  }

  /* ✅ Mobile overlay panel */
  .mobile-panel {
    position: fixed;
    top: var(--topbarH);
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem 1rem;
    background: var(--bg);
    color: var(--ink);
    border-top: 1px solid #eee;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
    z-index: 2000;
  }
  .mobile-panel.open {
    display: flex !important;
  }
  .mobile-panel .nav-link {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 1.05rem;
  }
  .mobile-panel .nav-link:hover,
  .mobile-panel .nav-link:focus-visible {
    background: var(--hover);
    outline: none;
  }
  .mobile-panel .btn {
    margin-top: 0.25rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
  }
  .grid-2,
  .two-col,
  .split,
  .layout-2 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }

  /* Admin/Dashboard cards ကိုတောင် 100% ပြ */
  .card,
  .admin-card,
  .dash-card {
    width: 100% !important;
    max-width: 100% !important;
  }

  .admin-shell {
    grid-template-columns: 1fr !important;
  }
}
.auth-actions {
  display: flex;
  gap: 0.5rem;
  justify-self: end;
}
.btn.small {
  padding: 0.35rem 0.6rem;
  font-size: 0.9rem;
  border-radius: 10px;
}

.btn.block {
  width: 100%;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.cards {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  backdrop-filter: blur(6px);
  box-shadow: 0 1px 15px #0001;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 8px 0;
}

h1,
h2,
h3 {
  margin: 0.3rem 0;
}

/* Rows / grids */
.row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.row.wrap {
  flex-wrap: wrap;
}
.gap {
  gap: 0.6rem;
}
.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}
.grid-2.sm1 {
  grid-template-columns: 1fr;
}

.card.maxw {
  width: min(980px, 92vw);
}
@media (min-width: 720px) {
  .grid-2 {
    grid-template-columns: 1fr 1fr;
  }
}
.blk {
  padding: 0.75rem;
  border: 1px solid #ffffff15;
  border-radius: 0.75rem;
  margin: 0.8rem 0;
}

.col-2 {
  grid-column: 1 / -1;
}
.spacer {
  flex: 1;
}
#bannerH,
#bannerP {
  margin: 0;
  padding: 0;
  color: #fff;
}
.hero {
  margin-bottom: 12px;
  display: grid;
  gap: 0.6rem;
  align-items: center;
  grid-template-columns: 72px 1fr;
  position: relative;
  overflow: hidden;
}
.hero img {
  width: 72px;
  height: 72px;
  border-radius: 18px;
}
.card.hero {
  width: 95%;
  max-width: 1200px;
  margin: 1rem auto 1.25rem;
  display: block;
  position: relative;
  overflow: hidden;
  padding: 0; /* hero text ကို အထဲမှာပဲ spacing ပေးမယ် */
}
.hero .banner {
  position: relative;
  width: 100%;
  height: 50vh; /* ✅ full viewport height */
  overflow: hidden;
  background: #111;
}
.hero .slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
  will-change: opacity;
}
.hero .slide img {
  width: 100%;
  height: 100%;
  /* object-fit: cover;           /* ပုံ အပြည့် (crop) */
  object-fit: contain; /* ✅ Show full image (no cropping) */
  object-position: center;
  background: #000; /* for letterboxing (top/bottom bars) */
  display: block;
}

.hero .slide.is-active {
  opacity: 1;
  z-index: 1;
}
/* hero text overlay */
.hero .overlay {
  position: absolute;
  inset: 0; /* Cover whole banner */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end; /* Text at bottom (can be center) */
  padding-bottom: 1.5rem;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.55), transparent 40%);
  color: #fff;
  text-align: center;
  z-index: 5; /* ✅ Always on top of images */
  pointer-events: none; /* ✅ Allow clicks to pass through if needed */
}

.hero .overlay h1 {
  margin: 0 0 0.4rem 0;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  font-weight: 700;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.7);
}

.hero .overlay p {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  opacity: 0.9;
}
/* dots (optional) */
.hero .dots {
  position: absolute;
  inset: auto 0 8px 0;
  display: flex;
  gap: 8px;
  justify-content: center;
}
.hero .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
}
.hero .dot.is-active {
  background: #fff;
}

#homeFeed .card {
  margin-top: 0.75rem;
}
.badge {
  display: inline-block;
  background: #0000000e;
  border: 1px solid #00000014;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  font-size: 0.8rem;
}
.list {
  display: grid;
  gap: 0.6rem;
}
.item {
  border: 1px solid #ffffff15;
  border-radius: 0.75rem;
  padding: 0.7rem 0.8rem;
  display: grid;
  gap: 0.35rem;
}
.progress {
  height: 8px;
  border-radius: 999px;
  background: #ffffff15;
  overflow: hidden;
}
.progress > i {
  display: block;
  height: 100%;
  background: #e0b15c;
  width: 0%;
}
.item .row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
}
.hidden {
  display: none !important;
}
.footer {
  /* padding: 2rem 1rem; */
  color: var(--muted);
  text-align: center;
}

.dialog::backdrop {
  background: #0008;
}
.dialog {
  border: 0;
  padding: 0;
}

/* width ~90% center */
.card.max {
  width: min(960px, 100%);
  margin: 12px auto;
}
.card.sub {
  padding: 12px;
  border-radius: 12px;
}
.topbar .brand img {
  width: 28px;
  height: 28px;
  vertical-align: middle;
  margin-right: 0.4rem;
}
.logo {
  display: block;
  border-radius: 8px;
  font-size: 18px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  /* color: inherit; */
  color: var(--ink);
  min-width: 0;
  margin-right: auto;
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}
.brand-text {
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.brand img {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}
.brand-name {
  font-weight: 700;
  letter-spacing: 0.2px;
}

.underbar {
  display: grid;
  gap: 0.25rem;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.25s ease;
}
.underbar.open {
  max-height: 60vh;
  padding: 0.5rem 0.6rem;
}

.nav {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.desktop-only {
  display: none;
}
.mobile-panel {
  position: fixed; /* absolute -> fixed */
  /* top: calc(var(--topbarH) * 1px); */
  top: var(--topbarH);
  left: 0;
  right: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: #fff; /* light theme */
  color: #111;
  border-top: 1px solid #eee;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.mobile-panel.open {
  display: flex;
} /* toggled by JS */

.burger {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  width: 48px;
  height: 48px;
  border: 0;
  background: transparent;
  cursor: pointer;
}
.burger span {
  display: block;
  width: 30px;
  height: 3px;
  background: #222;
  border-radius: 2px;
}

.nav-links {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}
.btn-icon.burger {
  justify-self: center; /* ✅ center column */
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 24px;
  line-height: 1;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 10px;
}
.btn-icon.burger:hover {
  background: var(--hover);
}
.btn-icon.burger:active {
  transform: scale(0.97);
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  /* color: inherit; */
  color: var(--ink);
  text-decoration: none;
}
.nav-link:hover {
  background: var(--hover);
}

.nav-cta {
  justify-content: right;
  display: flex;
  gap: 0.4rem;
  margin-left: 0.6rem;
}

/* helpers */
.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (max-width: 960px) {
  .nav-links {
    position: fixed;
    inset: 56px 0 auto 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    display: none;
    flex-direction: column;
    gap: 6px;
  }
  .nav-links.open {
    display: flex;
  }
}

/* Desktop ≥ 860px — put links inline with topbar */
@media (min-width: 861px) {
  .mobile-panel {
    display: none !important;
  }
  .desktop-only {
    display: flex;
  }
  .btn-icon.burger,
  #navLinks {
    display: none !important;
  }
  .mobile-panel {
    display: none !important;
  }
  .underbar {
    max-height: none;
    overflow: visible;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.45rem 0.9rem;
  }
}

.summary-lg {
  min-height: 120px;
}
/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  margin-bottom: 1rem;
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory; padding-bottom: .25rem;
}
.tabs .tab {
  white-space: nowrap; scroll-snap-align: start;
  user-select: none; -webkit-user-select: none;
}
.tab {
  border: none;
  /* background: #0000; */
  background: #f2f2f2;
  color: inherit;
  cursor: pointer;
  padding: 0.45rem 0.75rem;
  border-radius: 0.6rem;
  min-width: 84px;
  font-weight: 600;
}
.tab.active {
  background: #0b5ed7;
  color: #fff;
}
.tab.is-active {
  background: var(--muted-3, #897a31);
  font-weight: 600;
}

/* ===== Auth Modal ===== */
.auth-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(2px);
}
.auth-modal {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(620px, 94vw);
}
/* Big, solid card */
.auth-card {
  width: 100%;
  max-width: 560px;
  position: relative;
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  background: #497578;
  color: #111;
  border: 1px solid #1f242a;
  border-radius: 16px;
  padding: 24px 20px 18px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}
/* Header inside modal */
.auth-header {
  text-align: center;
  margin-bottom: 1.5rem;
  display: grid;
  place-items: center;
  gap: 0.25rem;
}
.auth-header img {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  /* border: 1px solid #2a3138; */
  margin-bottom: 0.5rem;
}
.auth-header h3 {
  color: #f6f7f9;
  margin: 0.2rem 0 0;
  font-size: 1.2rem;
}
.muted {
  color: var(--muted);
}
.auth-header .muted {
  color: #fdfdfc;
}

.auth-card label {
  color: #e1e6ea;
}

/* inputs */
.auth-card input {
  background: #0e1114;
  border: 1px solid #2a3138;
  color: #e9ecef;
  padding: 0.7rem 0.85rem;
  border-radius: 0.6rem;
}
.auth-card input::placeholder {
  color: #95a1ad;
}

/* tabs */
.auth-card .tab {
  color: #e9ecef;
  border: 1px solid #2a3138;
  background: #0000;
}
.auth-card .tab.active {
  background: #1b2128;
  border-color: #36404a;
}

/* password eye button */
.auth-card .icon-btn.eye {
  color: #cbd5df;
  background: transparent;
}
.auth-card .icon-btn.eye:hover {
  color: #ffffff;
}

/* primary button */
.auth-card .btn.primary {
  background: #e0b15c;
  color: #111;
  border-color: #dba948;
}

/* Fields */
.fields {
  display: grid;
  gap: 0.6rem;
  margin-top: 0.25rem;
}
label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 0.6rem;
  background: #0e1114;
  border: 1px solid #28303a;
  color: #eaecef;
}
.fields label {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.75rem;
}
.fields input {
  margin-top: 0.3rem;
  padding: 0.55rem 0.75rem;
  border-radius: 0.4rem;
  border: 1px solid #ccc;
  font-size: 1rem;
}
.fields input:focus {
  border-color: #0b5ed7;
  outline: none;
}

.pw {
  position: relative;
}
label.pw {
  position: relative;
}
label.pw .eye {
  position: absolute;
  right: 10px;
  top: 72%;
  transform: translateY(-50%);
  font-size: 1rem;
  border: none;
  background: transparent;
  cursor: pointer;
  color: #333;
}
.icon-btn.eye {
  position: absolute;
  right: 8px;
  top: 70%;
  transform: translateY(-50%);
  min-width: 45px;
  min-height: 45px;
  border: 0;
  background: transparent;
  cursor: pointer;
}

/* Actions */
.actions {
  display: flex;
  gap: 0.6rem;
  justify-content: flex-end;
  margin-top: 0.25rem;
}
.btn.primary {
  background: #2563eb;
  color: #fff;
  border-color: #2563eb;
}
.btn[disabled] {
  background: #e5e7eb !important;
  border-color: #e5e7eb !important;
  color: #9ca3af !important;
  cursor: not-allowed !important;
  opacity: 1 !important;
}
.btn.primary:hover {
  filter: brightness(0.98);
  background: #094ec1;
  color: #fff;
}
.icon-btn.close {
  position: absolute;
  right: 8px;
  top: 8px;
  font-size: 1.5rem;
  line-height: 1;
  background: transparent;
  color: #111;
  border: 1px solid #ffffff22;
  border-radius: 8px;
  padding: 4px 8px;
  width: 36px;
  height: 36px;
  cursor: pointer;
}
.icon-btn.close:hover {
  background: rgba(0, 0, 0, 0.08);
}

.error {
  /* color: #ff8383;
  margin: 0.25rem 0 0; */
  color: #d32f2f;
  font-weight: 500;
  margin-top: 0.8rem;
  text-align: center;
}

/* ထပ်တိုး */
/* ===== THEME TOKENS (solid contrast) ===== */
:root {
  --topbarH: 64px;
  --container: 1080px;
  /* default fallback = light */
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --hover: #f3f4f6;
  --line: #e5e7eb;
  --brand: #a16207;
}

html[data-theme="light"] {
  --bg: #ffffff;
  --surface: #ffffff;
  --ink: #111111;
  --muted: #666666;
  --hover: #f3f4f6;
  --line: #e5e7eb;
  --brand: #a16207; /* amber-ish */
}

html[data-theme="dark"] {
  --bg: #0b0b0c;
  --surface: #151516;
  --ink: #f5f5f5;
  --muted: #c3c3c3;
  --hover: #1f2937;
  --line: #2a2a2a;
  --brand: #f59e0b;
}

/* ===== GLOBAL RESET ===== */
html,
body {
  height: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--ink);
  text-decoration: none;
}
a:hover {
  text-decoration: none;
}

/* Containers */
main {
  width: 100%;
  padding: 1rem;
  padding-top: var(--topbarH);
  box-sizing: border-box;
}
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
}

/* Topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
  height: var(--topbarH);
  min-height: var(--topbarH);
  max-height: var(--topbarH);
  overflow: hidden;
}
.topbar-inner {
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  display: grid;
  align-items: center;
  gap: 8px;
  grid-template-columns: 1fr auto 1fr;
  padding: 0 0.75rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
}
.brand .logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-self: end;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 0.7rem;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
}
.nav-link:hover {
  background: var(--hover);
}
.nav-link.active {
  background: #77776a;
  color: #111;
}

/* Burger */
.btn-icon.burger {
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  font-size: 22px;
  line-height: 1;
  border: none;
  background: transparent;
  color: var(--ink);
  border-radius: 10px;
  cursor: pointer;
}
.btn-icon.burger:hover {
  background: var(--hover);
}
.btn-icon.burger:active {
  transform: scale(0.97);
}

/* Auth buttons */
.auth-actions {
  display: flex;
  gap: 0.5rem;
  justify-self: end;
}
.btn {
  background: var(--ink);
  color: var(--bg);
  border: none;
  padding: 0.55rem 0.9rem;
  border: 1px solid var(--ink);
  color: #fff;
  border-radius: 10px;
  cursor: pointer;
}
.btn:hover {
  filter: brightness(0.95);
}
.btn.ghost {
  background: transparent;
  /* color: var(--ink);
  border: 1px solid var(--line); */
  color: #111;
  border: 1px solid #ccc;
}
.btn.ghost:hover {
  /* background: var(--hover); */
  background: rgba(0, 0, 0, 0.05);
}

/* Mobile overlay menu */
.mobile-panel {
  position: fixed;
  top: var(--topbarH);
  left: 0;
  right: 0;
  z-index: 2000;
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border-top: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.mobile-panel.open {
  display: flex;
}
.mobile-panel .nav-link {
  padding: 0.85rem 1rem;
  border-radius: 12px;
  font-size: 1.05rem;
  color: var(--ink);
}
.mobile-panel .nav-link:hover {
  background: var(--hover);
}

/* Dialog / modal (login form) */
dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}
dialog {
  border: none;
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  color: var(--ink);
  max-width: 480px;
  width: min(92vw, 480px);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}
dialog .card {
  background: var(--surface);
  color: var(--ink);
}

input,
select,
textarea {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  width: 100%;
  box-sizing: border-box;
}
input::placeholder,
textarea::placeholder {
  color: var(--muted);
}

/* Responsive */
@media (max-width: 860px) {
  .nav-desktop,
  .auth-actions {
    display: none !important;
  }
  .btn-icon.burger {
    display: flex !important;
  }
}

@media (min-width: 861px) {
  .btn-icon.burger,
  #navLinks {
    display: none !important;
  }
}

/* === Courses grid & equal-height cards === */
.course-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  align-items: stretch; /* stretch children to equal height */
}

/* Card skeleton */
.course-card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border, #ccc);
  border-radius: 14px;
  background: var(--card, #fff1);
  /* box-shadow:var(--shadow-sm); */
  box-shadow: 0 2px 4px #0002;
  overflow: hidden;
  min-height: 360px; /* ensure a solid, even height */
  transition: transform 0.2s ease;
}

.course-card:hover {
  transform: translateY(-3px);
}

/* Image */
.course-card .cover {
  width: 100%;
  height: 160px;
  /* aspect-ratio: 16 / 9; */
  object-fit: cover;
  border-radius: 0.75rem 0.75rem 0 0;
  display: block;
  background: #f3f3f3;
}

/* Body: flex column so footer can stick to bottom */
.course-card .body {
  display: flex;
  flex-direction: column;
  padding: 0.9rem 1rem 1rem;
  justify-content: space-between;
  gap: 0.5rem;
  flex: 1;
}

.course-card .body p.desc {
  display: -webkit-box;
  -webkit-line-clamp: 3; /* ✅ 3 lines only */
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--muted);
  min-height: 3.6em; /* keep space even when shorter text */
}

.course-card h3 {
  margin: 0;
}

.course-card h3.title {
  margin: 0;
  font-size: 1.05rem;
  line-height: 1.25;
}

/* clamp long summary so height stays equal */
.course-card .desc {
  color: var(--muted, #555);
  font-size: 0.95rem;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 3; /* show 3 lines */
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 3.9em; /* keep area constant across cards */
}

.course-card .chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.chip {
  display: inline-block;
  font-size: 0.8rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--chip-bg, #f1f1f1);
  border: 1px solid rgba(0, 0, 0, 0.06);
}

/*
.chip.free {
  background: #10b98122;
  color: #065f46;
  border: 1px solid #10b98155;
}
.chip.paid {
  background: #f59e0b22;
  color: #92400e;
  border: 1px solid #f59e0b55;
} 
*/
/* details modal */
#courseDlg::backdrop {
  background: rgba(0, 0, 0, 0.4);
}
#courseDlg {
  border: none;
  border-radius: 16px;
  padding: 0;
  max-width: min(780px, 92vw);
  width: 100%;
}
#courseDlg .sheet {
  padding: 1rem 1.25rem;
}
#courseDlg .meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 1rem;
}
#courseDlg .benefits {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.5rem;
}
#courseDlg .benefits .pill {
  background: #eee;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
}

/* meta row (level/credits/price) */
.course-card .meta {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding: 0;
  margin: 0.4rem 0;
  color: var(--muted, #666);
  font-size: 0.85rem;
  list-style: none;
}

/* footer buttons stay at bottom */
.course-card .footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.35rem;
}

.course-card .benefits {
  margin: 0.5rem 0 0.75rem;
  padding-left: 1.1rem; /* bullet indent */
}
.course-card .benefits li {
  list-style: disc;
  line-height: 1.25rem; /* for max-height fallback */
}
/* 3-line clamp (modern) */
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3; /* show up to 3 lines */
  overflow: hidden;
}

/* Details modal: make body area scroll when long */
#courseDetails .cd-scroll {
  max-height: min(56vh, 520px);
  overflow: auto;
  padding-right: 0.25rem;
}

/* Benefits list bullets */
#courseDetails .benefits {
  margin: 0.25rem 0 0;
  padding-left: 1.1rem;
}
#courseDetails .benefits li {
  list-style: disc;
  line-height: 1.25rem;
}

/* Price chip colors (already used elsewhere) */
/* .badge.price-free  { background: #e8f7ed; color: #1a7f42; }
.badge.price-paid  { background: #fff4e5; color: #a45500; } */

/* Fallback (non-webkit) – keeps about 3 lines height */
.clamp-3-fallback {
  max-height: calc(1.25rem * 3);
  overflow: hidden;
}
.course-card .benefit {
  line-height: 1.5;
  opacity: 0.9;
}

.course-card .price {
  font-weight: 700;
  padding: 0.25rem 0.6rem;
  border: 1px solid var(--border);
  border-radius: 999px;
}

.course-card .actions {
  display: flex;
  gap: 0.4rem;
}

.course-card .btn {
  flex: 1;
}

/* Details dialog */
dialog#courseDetails {
  width: min(960px, 96vw);
  max-width: 960px;
  max-height: 92vh;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
  background: var(--surface, #fff);
}

.price {
  display: inline-block;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.35rem 0.6rem;
  border-radius: 999px;
  line-height: 1;
  border: 1px solid transparent;
}
/* .price-free {
  background: #e8f7ee;
  color: #0b6b2b;
  border-color: #c7ebd5;
}

.price-paid {
  background: #efe9ff;
  color: #3a1c7a;
  border-color: #d9ccff;
} */

.btn-details {
  background: #f6f7f8;
  color: #222;
  border-color: #d7dadd;
}

.btn-details:hover {
  filter: brightness(0.98);
}

.btn-enroll {
  background: #16a34a; /* green */
  border-color: #148c40;
  color: #fff;
}

.btn-enroll:hover {
  filter: brightness(0.95);
}

.btn-buy {
  background: #1f4fd6; /* indigo/blue */
  border-color: #1a43b6;
  color: #fff;
}

.btn-buy:hover {
  filter: brightness(0.95);
}

#courseDetails .dlg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
#courseDetails .dlg-body {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1rem;
  padding: 1rem 1.1rem;
}
#courseDetails .dlg-foot {
  padding: 0.9rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  display: flex;
  gap: 0.5rem;
}
#courseDetails .dlg-cover {
  width: 100%;
  height: 220px;
  object-fit: contain; /* ပုံမပြတ်အောင် */
  background: #f6f6f6;
  border-radius: 12px;
}
#courseDetails .dlg-scroll {
  max-height: 62vh; /* content သာ scroll ပေါ် */
  overflow: auto;
  padding-right: 0.25rem; /* scrollbar space */
}

/* Course/Post cards – show full image without cropping */
.course-card .cover,
#adminCourseList .course-card .cover {
  width: 100%;
  height: 200px; /* မလိုချင်ဘူးဆို အောက်က aspect-ratio ကိုသုံး */
  object-fit: contain; /* ✅ full image, no crop */
  object-position: center;
  background: #f6f6f6; /* letterbox အဖြူ/မီးခိုးနေရာ */
  border-radius: 12px;
}

/* (ရွေးချယ်စရာ) Height ထဲမပြင်ချင်ရင် aspect-ratio သုံးလို့ရ */
.course-card .media {
  aspect-ratio: 16 / 9; /* သင့် UI အတိုင်း 1/1, 4/3… ပြောင်းလို့ရ */
  background: #f6f6f6;
  border-radius: 12px;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.course-card .media > img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* ✅ full image, no crop */
  object-position: center;
}

/* ====== General Layout Fixes ====== */

/* Whole app container */
main,
#app {
  /* width: var(--containerW); */
  max-width: var(--containerW);
  max-width: 95%;
  margin: 0 auto; /* Center horizontally */
  padding: 0; /* Remove extra padding if any */
}

/* Topbar area */
#topbar,
header.topbar {
  width: var(--containerW);
  max-width: var(--containerW);
  margin: 0 auto; /* keep it centered */
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

/* Routes that were still capped by old wrappers */
#app > section,
#app > .card,
#app > .page,
#app > .page-wrap,
#app > .shell,
#app > .container,
section.card.max,
.wrap,
.container,
.shell {
  width: var(--containerW) !important;
  max-width: var(--containerW) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Inside-page grids should stretch fully within the container */
.grid,
.grid-2,
.course-grid,
.stack {
  width: 100%;
}

/* Cards should fill the available width properly */
.course-card,
.card {
  margin: 12px 0;
  max-width: 100%;
}

/* For wide screens, avoid clipping to middle */
@media (min-width: 1200px) {
  main,
  #app,
  #topbar,
  header.topbar {
    /* width: var(--containerW); */
    max-width: var(--containerW);
  }
}

/* For mobile screens, make sure it’s full width */
@media (max-width: 768px) {
  :root {
    --containerW: 100%;
  }
  .nav-search {
    width: 100%;
    margin: 0.5rem 0 0;
    justify-content: center;
  }
  .nav-search input {
    flex: 1;
    width: 100%;
    min-width: 0;
  }
  body { overscroll-behavior-y: contain; }
  #topbar,
  header.topbar,
  main,
  #app {
    width: var(--containerW) !important;
    max-width: var(--containerW) !important;
  }
}

.nav-search {
  display: flex;
  width: 88.3%;
  /* max-width: 600px;            optional: search box max width */
  margin: 12px auto; /* center horizontally */
  gap: 0.4rem;
  align-items: center;
  justify-content: center;
}

.nav-search input {
  flex: 1;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  /* min-width: 220px; */
}

.nav-search .icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.icon-btn {
  border: 1px solid var(--border);
  background: var(--card);
  padding: 0.45rem 0.65rem;
  border-radius: 0.5rem;
  cursor: pointer;
}

.card.post img.cover,
.card.post video.cover {
  width: 100%;
  height: auto;
  border-radius: 0.75rem;
  display: block;
  margin: 0.25rem 0 0.5rem;
}
.card.post .desc {
  margin-top: 0.25rem;
}

.post-img,
.post-video,
.post-audio {
  width: 100%;
  display: block;
  border-radius: 0.75rem;
  max-height: 480px; /* prevent ultra-tall */
  object-fit: cover; /* keep aspect; crop if too tall */
}
.post-audio {
  max-height: none;
  object-fit: contain;
}

/* Dialog backdrop */
dialog.modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
}

/* The dialog "card" */
dialog.modal .sheet {
  /* width: min(960px, 96vw); */
  max-height: 90vh;
  padding: 0;
  border: none;
  border-radius: 16px;
  overflow: hidden; /* contain internal scrolling */
  display: grid;
  grid-template-rows: auto 1fr auto; /* header | body (scroll) | footer */
  background: var(--cardBg, #fff);
}

/* header */
.sheet .sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}
.sheet .close {
  background: transparent;
  border: 0;
  font-size: 1.25rem;
  cursor: pointer;
}

/* 2-column content that scrolls as a whole */
.sheet .sheet-main {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 1rem;
  padding: 1rem;
  overflow: auto; /* <— long descriptions scroll here */
}

/* image pane: keep full image visible (no cropping) */
.sheet .media {
  background: #000; /* letterbox bars look neat */
  border-radius: 12px;
  display: grid;
  place-items: center;
  min-height: 220px;
}
.sheet .media img {
  width: 100%;
  height: 100%;
  object-fit: contain; /* <— NO CROPPING */
  aspect-ratio: 16 / 9; /* keeps a nice box on wide screens */
  border-radius: 12px;
}

/* text pane */
.sheet .body {
  overflow: auto;
  padding-right: 0.25rem;
}
.sheet .body .desc {
  white-space: pre-wrap;
  line-height: 1.5;
}

/* footer */
.sheet menu {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
}

/* Mobile: stack */
@media (max-width: 720px) {
  .sheet .sheet-main {
    grid-template-columns: 1fr;
  }
  .sheet .media img {
    aspect-ratio: 16/9;
  }
  .row-2 {
    grid-template-columns: 1fr;
  }
  #courseDetails .dlg-body {
    grid-template-columns: 1fr;
  }
  #courseDetails .dlg-cover {
    height: 200px;
  }
}

/* Dashboard course-card footer two buttons layout */
.course-card .footer .actions.two-btns {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

/* Left button: Open */
.btn-open {
  flex: 1;
  background: #1e3a8a; /* deep blue */
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  transition: 0.2s ease;
  box-shadow: 0 2px 4px rgba(30, 58, 138, 0.3);
}
.btn-open:hover {
  background: #2d4fc4;
  transform: translateY(-1px);
}

/* Right button: Unenroll */
.btn-unenroll {
  flex: 1;
  background: #991b1b; /* dark red */
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 0.4rem 0.6rem;
  transition: 0.2s ease;
  box-shadow: 0 2px 4px rgba(153, 27, 27, 0.3);
}
.btn-unenroll:hover {
  background: #b91c1c;
  transform: translateY(-1px);
}
.two-btn-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  gap: 1rem;
}

.two-btn-footer .btn {
  flex: 1;
  text-align: center;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.1s ease;
}

.post-body {
  line-height: 1.6;
  margin: 0.5rem 0;
  word-wrap: break-word;
}
.post-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
  margin: 0.5rem 0;
}
.post-body ul,
.post-body ol {
  margin-left: 1.25rem;
}
.post-body pre {
  white-space: pre-wrap;
  background: #f7f7f7;
  padding: 0.5rem;
  border-radius: 6px;
  overflow: auto;
}

.post-body h1,
.post-body h2,
.post-body h3 {
  margin: 0.6rem 0 0.3rem;
}
.post .post-media {
  margin: 0.5rem 0;
}
.post .post-media img,
.post .post-media video {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}
.post .post-body p {
  margin: 0.35rem 0;
}

/* certificate & transcript */
.certificate {
  text-align: center;
  border: 10px solid gold;
  padding: 40px;
  border-radius: 20px;
  background: #fffef7;
  max-width: 700px;
  margin: 2rem auto;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
}
.certificate h1 {
  font-size: 2em;
  color: #b58900;
}
.signatures {
  display: flex;
  justify-content: space-around;
  margin-top: 2rem;
}
.signatures hr {
  width: 150px;
  border: 1px solid #333;
}

.transcript {
  max-width: 800px;
  margin: 2rem auto;
  background: #fff;
  border: 2px solid #444;
  border-radius: 10px;
  padding: 30px;
}
.transcript h1 {
  text-align: center;
  margin-bottom: 20px;
}
.transcript table {
  width: 100%;
  border-collapse: collapse;
}
.transcript th,
.transcript td {
  border: 1px solid #aaa;
  padding: 10px;
  text-align: center;
}
.transcript th {
  background: #f4f4f4;
}

/* ===== Course card badges & CTA colors ===== */
.badge.price-free {
  background: #e8f8ee;
  color: #0a7a3c;
  border: 1px solid #b6e8c8;
}
.badge.price-paid {
  background: #fff4e5;
  color: #a14b00;
  border: 1px solid #ffd6a6;
}

/* CTA buttons */
.btn.btn-details {
  background: #eef2ff;
  color: #3730a3;
  border: 1px solid #dbe2ff;
}
.btn.btn-details:hover {
  filter: brightness(0.96);
}

.btn.btn-enroll {
  background: #e6fffa;
  color: #0f766e;
  border: 1px solid #b5f5ee;
}
.btn.btn-enroll:hover {
  filter: brightness(0.96);
}

.btn.btn-buy {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #ffc8cf;
}
.btn.btn-buy:hover {
  filter: brightness(0.96);
}

/* Footer layout spacing (keeps buttons tidy) */
.course-card .footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.course-card .actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* =========================
   QUIZ UI (clean + unified)
   ========================= */

/* Wrapper */
#quizHost .quiz-q {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border, #e5e7eb);
}
#quizHost .quiz-q:first-child {
  border-top: 0;
}
#quizHost .quiz-qtext {
  font-weight: 600;
  margin-bottom: 0.35rem;
}
#quizHost .q-num {
  color: #6b7280;
  margin-right: 0.25rem;
}

/* Choices layout */
#quizHost .quiz-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(160px, 1fr));
  gap: 0.5rem;
}
@media (min-width: 720px) {
  #quizHost .quiz-choices {
    grid-template-columns: repeat(4, minmax(140px, 1fr));
  }
}

/* Choice chip */
#quizHost .quiz-choice {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.5rem 0.6rem;
  border: 1px solid #e7e1d6;
  border-radius: 0.6rem;
  background: #fff;
  cursor: pointer;
  user-select: none;
  line-height: 1.2;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}
#quizHost .quiz-choice:hover {
  background: #f9f9f9;
}

/* Make inputs clickable & show native controls properly */
#quizHost input[type="radio"],
#quizHost input[type="checkbox"] {
  -webkit-appearance: auto;
  appearance: auto;
  width: 18px;
  height: 18px;
  margin: 0;
  pointer-events: auto;
  accent-color: #17803d; /* brand color */
}

/* Shape distinction (radio = circle, checkbox = square) */
#quizHost input[type="radio"] {
  border-radius: 50%;
}
#quizHost input[type="checkbox"] {
  border-radius: 4px;
}

/* Feedback */
#quizHost .quiz-feedback {
  margin-top: 0.25rem;
  font-size: 0.95rem;
  font-weight: 600;
}
#quizHost .quiz-feedback.good {
  color: #17803d;
}
#quizHost .quiz-feedback.bad {
  color: #b41e1e;
}
#quizHost #btnSubmitQuiz,
#quizHost #btnResetQuiz {
  margin-top: 0.25rem;
}

/* Correct / Wrong state colors */
#quizHost .quiz-choice.is-correct {
  background: #eaf7ef;
  border-color: #28a745;
  box-shadow: 0 0 0 2px #28a74533;
}
#quizHost .quiz-choice.is-wrong {
  background: #fdecec;
  border-color: #dc3545;
  box-shadow: 0 0 0 2px #dc354533;
}

/* Short answer */
#quizHost .quiz-textarea {
  width: 100%;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: 8px;
  padding: 0.5rem;
  font: inherit;
  resize: vertical;
}

/* Progress bar (course-wide) */
.progress-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.progress-bar {
  background: #eee;
  border-radius: 999px;
  overflow: hidden;
  height: 10px;
}
.progress-bar > span {
  display: block;
  height: 100%;
  background: #4caf50;
  transition: width 0.3s;
}
.progress-text {
  font-size: 0.9rem;
}

/* Small polish */
#quizHost .quiz-choice .quiz-choice-text {
  display: inline-block;
}

/* ========= Course Reader 1 ========= */

/* Congrats Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 1.25rem;
  width: min(520px, 92vw);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  text-align: center;
}
.modal-card img {
  max-width: 160px;
  height: auto;
  display: block;
  margin: 0.5rem auto;
}
.modal-card .row {
  gap: 0.5rem;
  justify-content: center;
}

/* ===== Admin tabs: mobile horizontal scroller ===== */
.admin-tabs {
  position: sticky;      /* menu ကို အပေါ်မှာ ထိန်း */
  top: 0;
  z-index: 20;
  display: flex;
  gap: .5rem;
  padding: .5rem .75rem;
  background: var(--card,#fff);
  border-bottom: 1px solid var(--border,#e5e7eb);

  overflow-x: auto;                    /* 横 scroll */
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;   /* iOS momentum */

  scroll-snap-type: x proximity;       /* snap-to-tab */
  touch-action: pan-x;                 /* ချိုင့်ချိုင့်ပေါက်: x ကိုပဲ allow */
  overscroll-behavior-x: contain;      /* parent ကို မပို့ */
}
.admin-tabs::-webkit-scrollbar { display: none; }

.admin-tab {
  flex: 0 0 auto;                      /* shrink မသွား */
  scroll-snap-align: center;
  white-space: nowrap;
  padding: .45rem .8rem;
  border: 1px solid var(--border,#e5e7eb);
  border-radius: .75rem;
  background: #fff;
  color: var(--text,#111);
}
.admin-tab.active {
  background: #eef6ff;
  border-color: #bfdbfe;
  color: #1d4ed8;
  font-weight: 600;
}