@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@300;400;500;600;700&display=swap");

/* GrayMatters Academy — Styles
   Brand system (GM Branding Guidelines 2023.v1):
   Typography  — Oswald (display, ~Industria Inline) · Bookman Old Style/Georgia (body)
   Palette     — teal #0cb5ac · orange #f1803a · coral #f06278 · lime #a2b542 · slate #5d7192, on a clean cool-white canvas
   Layout      — sidebar + topbar dashboard shell */

:root {
  --gm-ink:        #26303f;
  --gm-ink-soft:   #46516a;
  --gm-muted:      #7a8494;
  --gm-line:       #e3e8ee;
  --gm-line-soft:  #eef1f4;
  --gm-cream:      #f6f8f9;      /* app canvas (cool near-white) */
  --gm-cream-deep: #eceff2;
  --gm-paper:      #FFFFFF;

  /* teal — brand signature (wordmark). Bright for accents; darkened for actions/text. */
  --gm-teal:       #0cb5ac;      /* brand teal, bright — accents, rings, gradients */
  --gm-primary:    #0a7d77;      /* action/button teal (AA on white text) */
  --gm-primary-d:  #06504a;      /* hover / heading accent */
  --gm-primary-l:  #e2f5f3;      /* light teal tint */
  --gm-primary-2:  #12a69d;      /* mid teal */

  /* orange — warm accent */
  --gm-accent:     #f1803a;
  --gm-accent-d:   #cf5f1e;
  --gm-accent-l:   #fdeee2;

  /* full brand palette */
  --gm-coral:      #f06278;  --gm-coral-d:  #d8455e;  --gm-coral-l:  #fde6ea;
  --gm-lime:       #a2b542;  --gm-lime-d:   #6f8f2f;  --gm-lime-l:   #eef4dd;
  --gm-slate:      #5d7192;  --gm-slate-d:  #455473;  --gm-slate-l:  #e7ebf1;

  /* semantic (mapped onto the brand palette) */
  --gm-success:    #6f8f2f;     /* lime */
  --gm-warn:       #c9701f;     /* orange */
  --gm-danger:     #cf3f57;     /* coral */

  /* brand gradient (Ψ logo: coral → orange → teal → lime) */
  --gm-gradient:   linear-gradient(120deg, #f06278 0%, #f1803a 32%, #0cb5ac 68%, #a2b542 100%);

  --gm-shadow-sm:  0 1px 2px rgba(38,48,63,.04);
  --gm-shadow:     0 1px 2px rgba(38,48,63,.04), 0 6px 18px rgba(38,48,63,.05);
  --gm-shadow-lg:  0 1px 2px rgba(38,48,63,.04), 0 16px 36px rgba(38,48,63,.08);
  --gm-radius:     14px;
  --gm-radius-sm:  10px;
  --gm-radius-lg:  20px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--gm-cream);
  color: var(--gm-ink);
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, "Times New Roman", serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
  font-family: "Oswald", "DM Sans", system-ui, sans-serif;
  font-weight: 600;
  letter-spacing: 0.005em;   /* Oswald is condensed — let it breathe, don't tighten */
  color: var(--gm-ink);
  margin: 0 0 .5em 0;
}

h1 { font-size: 2.5rem; line-height: 1.08; font-weight: 600; letter-spacing: 0.01em; }
h2 { font-size: 1.65rem; line-height: 1.2; }
h3 { font-size: 1.2rem; }
h4 { font-size: 1.02rem; font-weight: 500; }

/* tall condensed all-caps treatment echoing the Industria Inline wordmark */
.brand-display {
  font-family: "Oswald", sans-serif;
  text-transform: uppercase;
  letter-spacing: .06em;
  font-weight: 600;
}

p { margin: 0 0 1em 0; color: var(--gm-ink-soft); }
a { color: var(--gm-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
small { color: var(--gm-muted); }
hr { border: none; border-top: 1px solid var(--gm-line); margin: 16px 0; }

/* ---------- App Shell (sidebar + topbar + main) ---------- */

.app-shell {
  display: grid;
  grid-template-columns: 84px 1fr;
  min-height: 100vh;
  background: var(--gm-cream);
}

.sidebar {
  background: var(--gm-paper);
  border-right: 1px solid var(--gm-line);
  padding: 24px 0 32px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.sidebar-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--gm-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 32px;
  overflow: hidden;
}
.sidebar-mark img { width: 100%; height: 100%; object-fit: cover; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  align-items: center;
  flex: 1;
}

.sidebar-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gm-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all .15s ease;
  position: relative;
  text-decoration: none;
}
.sidebar-link:hover { background: var(--gm-cream-deep); color: var(--gm-ink); text-decoration: none; }
.sidebar-link.active {
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
}
.sidebar-link.active::before {
  content: "";
  position: absolute;
  left: -12px; top: 12px;
  width: 4px; height: 20px;
  background: var(--gm-primary);
  border-radius: 0 4px 4px 0;
}
.sidebar-link svg { width: 22px; height: 22px; stroke-width: 1.6; }

.sidebar-foot { margin-top: auto; }

@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.app-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* contain stray horizontal overflow (e.g. edge hover-tooltips) without creating a
     scroll container — keeps the sticky topbar working and removes the side gap */
  overflow-x: clip;
}

/* ---------- Topbar ---------- */

.topbar {
  background: var(--gm-paper);
  border-bottom: 1px solid var(--gm-line);
  padding: 0 32px;
  height: 72px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: sticky;
  top: 0;
  z-index: 18;
}
/* signature brand gradient (echoes the logo's coral→orange→teal→lime Ψ) */
.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: var(--gm-gradient);
}

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--gm-ink);
}
.topbar-brand img {
  height: 44px;
  width: auto;
  border-radius: 8px;
}
.topbar-brand .brand-text {
  font-family: "Oswald", "PT Sans Narrow", sans-serif;
  font-weight: 700;
  font-size: 1.62rem;
  letter-spacing: 0;
  line-height: 1;
  text-transform: none;
}

.topbar-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--gm-cream);
  color: var(--gm-ink);
  border: 1px solid var(--gm-line);
  border-radius: 999px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .9rem;
  font-weight: 500;
  text-decoration: none;
  transition: all .15s ease;
}
.topbar-pill:hover { background: var(--gm-cream-deep); border-color: #cdd6dd; text-decoration: none; }
.topbar-pill.active { background: var(--gm-primary-l); color: var(--gm-primary-d); border-color: #9de0da; }

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}

.iconbtn {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gm-ink-soft);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background .15s ease;
  position: relative;
  text-decoration: none;
}
.iconbtn:hover { background: var(--gm-cream-deep); text-decoration: none; }
.iconbtn svg { width: 20px; height: 20px; stroke-width: 1.6; }
.iconbtn .dot {
  position: absolute;
  top: 9px; right: 10px;
  width: 8px; height: 8px;
  background: var(--gm-accent);
  border: 2px solid var(--gm-paper);
  border-radius: 50%;
}
.iconbtn .badge-num {
  position: absolute;
  top: 4px; right: 4px;
  background: var(--gm-accent);
  color: white;
  font-size: .65rem;
  font-weight: 600;
  border-radius: 999px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 0 2px var(--gm-paper);
  animation: gm-pop .35s ease-out;
}
@keyframes gm-pop {
  0%   { transform: scale(.4); opacity: 0; }
  60%  { transform: scale(1.15); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

.topbar-divider {
  width: 1px;
  height: 24px;
  background: var(--gm-line);
  margin: 0 8px;
}

.avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--gm-primary);
  color: white;
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 600;
  font-size: .85rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  flex-shrink: 0;
  border: 2px solid var(--gm-paper);
  box-shadow: var(--gm-shadow-sm);
}
.avatar-lg { width: 88px; height: 88px; font-size: 1.5rem; border-width: 3px; }
.avatar-sm { width: 28px; height: 28px; font-size: .7rem; }

@media (max-width: 800px) {
  .topbar { padding: 0 20px; height: 60px; }
  .topbar-pill { display: none; }
}

/* ---------- Page content area ---------- */

main {
  flex: 1;
  padding: 36px 40px 80px;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
}

@media (max-width: 800px) {
  main { padding: 24px 20px 60px; }
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

/* ---------- Profile header ---------- */

.profile-head {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-bottom: 28px;
}

.profile-head .avatar-lg {
  background: linear-gradient(135deg, var(--gm-primary) 0%, var(--gm-primary-2) 100%);
}

.profile-head h1 {
  margin: 0 0 6px 0;
  font-size: 2rem;
}

.profile-head .profile-meta {
  color: var(--gm-muted);
  font-size: .92rem;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: center;
}
.profile-head .profile-meta .dot { width: 3px; height: 3px; background: var(--gm-muted); border-radius: 50%; display: inline-block; }

/* ---------- Stat cards (3-up) ---------- */

.stat-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-bottom: 40px;
}
@media (max-width: 900px) { .stat-cards { grid-template-columns: 1fr; } }

.stat-card {
  border-radius: var(--gm-radius);
  padding: 22px 24px;
  display: flex;
  align-items: center;
  gap: 22px;
  color: white;
  position: relative;
  overflow: hidden;
  min-height: 110px;
  box-shadow: var(--gm-shadow);
}
.stat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 10%, rgba(255,255,255,.18) 0%, transparent 50%);
  pointer-events: none;
}
.stat-card .stat-num {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 700;
  font-size: 3rem;
  line-height: 1;
  letter-spacing: -0.02em;
  flex-shrink: 0;
  width: 64px;
  text-align: left;
}
.stat-card .stat-body { position: relative; z-index: 1; }
.stat-card h3 { color: white; margin: 0 0 4px 0; font-size: 1.1rem; font-weight: 600; }
.stat-card p { color: rgba(255,255,255,.85); margin: 0; font-size: .85rem; line-height: 1.45; }

/* solid teal stat cards (matching the GrayMatters logo) with glow shadow */
.stat-card {
  background: var(--gm-primary);
  box-shadow:
    0 12px 28px -10px rgba(10,125,119,.45),
    0 4px 12px -4px rgba(10,125,119,.22),
    0 0 0 1px rgba(255,255,255,.06) inset;
  transition: box-shadow .2s ease, transform .12s ease;
}
.stat-card:hover {
  box-shadow:
    0 16px 36px -10px rgba(10,125,119,.55),
    0 6px 16px -4px rgba(10,125,119,.28),
    0 0 0 1px rgba(255,255,255,.08) inset;
  transform: translateY(-2px);
}
.stat-card .stat-num { color: rgba(255,255,255,.95); }

/* ---------- Sections + subtle dividers ---------- */

.section {
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--gm-line-soft);
}
.section.first { padding-top: 0; margin-top: 0; border-top: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 16px;
}
.section-head h2 {
  margin: 0;
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-head .sub {
  display: block;
  margin-top: 4px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-weight: 400;
  font-size: .85rem;
  color: var(--gm-muted);
  letter-spacing: 0;
  text-transform: none;
}
.section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gm-cream-deep);
  color: var(--gm-muted);
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .78rem;
  font-weight: 500;
  min-width: 26px;
  height: 26px;
  padding: 0 8px;
  border-radius: 999px;
}
.section-link {
  font-size: .88rem;
  color: var(--gm-primary);
  font-weight: 500;
}

.divider {
  height: 1px;
  background: var(--gm-line-soft);
  border: 0;
  margin: 32px 0;
}

/* ---------- Wide sidebar (admin) ---------- */

.app-shell.shell-wide { grid-template-columns: 244px 1fr; }
@media (max-width: 800px) { .app-shell.shell-wide { grid-template-columns: 1fr; } }

.sidebar.sb-wide {
  width: 244px;
  padding: 0 0 28px 0;
  align-items: stretch;
}
.sidebar.sb-wide .sb-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 22px;
  border-bottom: 1px solid var(--gm-line-soft);
  text-decoration: none;
  color: var(--gm-ink);
  margin-bottom: 14px;
}
.sidebar.sb-wide .sb-brand img {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}
.sidebar.sb-wide .sb-brand .brand-text {
  font-family: "Oswald", "PT Sans Narrow", sans-serif;
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1;
  letter-spacing: 0;
  color: var(--gm-ink);
}
.sidebar.sb-wide .sidebar-nav {
  align-items: stretch;
  padding: 0 14px;
  gap: 4px;
}
.sidebar.sb-wide .sidebar-link {
  width: 100%;
  height: 42px;
  border-radius: 10px;
  justify-content: flex-start;
  padding: 0 14px;
  gap: 14px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .92rem;
  color: var(--gm-ink-soft);
}
.sidebar.sb-wide .sidebar-link svg { width: 19px; height: 19px; }
.sidebar.sb-wide .sidebar-link.active::before { display: none; }
.sidebar.sb-wide .sidebar-link.active {
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  font-weight: 500;
}
.sidebar.sb-wide .sidebar-foot {
  margin-top: auto;
  padding: 8px 16px 0;
  border-top: 1px solid var(--gm-line-soft);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar.sb-wide .sidebar-foot a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  font-size: .76rem;
  color: var(--gm-muted);
  border-radius: 8px;
  text-decoration: none;
}
.sidebar.sb-wide .sidebar-foot a:hover { background: var(--gm-cream-deep); color: var(--gm-ink); }
.sidebar.sb-wide .sidebar-foot a svg { width: 14px; height: 14px; stroke-width: 1.6; flex-shrink: 0; }

/* simplified topbar on admin (sidebar carries the brand) */
.app-shell.shell-wide .topbar-brand { display: none; }
.app-shell.shell-wide .topbar { padding-left: 28px; padding-right: 28px; }

.topbar-page-title {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--gm-ink);
}

/* logout text */
.logout-text {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 10px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gm-ink-soft);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: all .15s ease;
}
.logout-text:hover {
  background: var(--gm-cream-deep);
  color: var(--gm-ink);
  text-decoration: none;
}

/* ---------- Two-column dashboard (main + right rail) ---------- */

.dash-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 36px;
  align-items: start;
}
@media (max-width: 1080px) { .dash-grid { grid-template-columns: 1fr; } }

.dash-rail { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 92px; }

.rail-card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
}
.rail-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--gm-line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.rail-head h4 { margin: 0; font-size: .95rem; }
.rail-body { padding: 6px 0; }
.rail-empty { padding: 18px; color: var(--gm-muted); font-size: .88rem; text-align: center; }
.rail-item {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 12px;
  padding: 12px 18px;
  align-items: flex-start;
  border-bottom: 1px solid var(--gm-line-soft);
}
.rail-item:last-child { border-bottom: 0; }
.rail-item .rail-mark {
  width: 36px; height: 36px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gm-primary-l); color: var(--gm-primary-d);
  flex-shrink: 0;
}
.rail-item .rail-mark.terra  { background: var(--gm-accent-l); color: var(--gm-accent-d); }
.rail-item .rail-mark.amber  { background: #fdead4; color: var(--gm-warn); }
.rail-item .rail-mark.sage   { background: #eef4dd; color: var(--gm-success); }
.rail-item h5 { margin: 0 0 2px 0; font-size: .92rem; font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif; font-weight: 500; }
.rail-item .rail-meta { font-size: .78rem; color: var(--gm-muted); }
.rail-item p { margin: 4px 0 0 0; font-size: .85rem; color: var(--gm-ink-soft); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: var(--gm-radius-sm);
  border: 1px solid transparent;
  font-family: "Oswald", "DM Sans", system-ui, sans-serif;
  font-size: .95rem;
  font-weight: 500;
  letter-spacing: .03em;
  cursor: pointer;
  transition: transform .05s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--gm-primary); outline-offset: 2px; }

.btn-primary  { background: var(--gm-primary); color: white; }
.btn-primary:hover  { background: var(--gm-primary-d); text-decoration: none; }

.btn-accent   { background: var(--gm-accent); color: white; }
.btn-accent:hover   { background: var(--gm-accent-d); text-decoration: none; }

.btn-outline  { background: var(--gm-paper); color: var(--gm-ink); border-color: var(--gm-line); }
.btn-outline:hover  { background: var(--gm-cream-deep); text-decoration: none; }

.btn-ghost    { background: transparent; color: var(--gm-ink-soft); }
.btn-ghost:hover    { background: var(--gm-cream-deep); }

.btn-danger   { background: var(--gm-paper); color: var(--gm-danger); border-color: var(--gm-line); }
.btn-danger:hover   { background: #fde6ea; }

.btn-success  { background: var(--gm-success); color: white; }
.btn-success:hover  { background: #5b7626; text-decoration: none; }

.btn-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--gm-primary);
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
}
.btn-link:hover { text-decoration: underline; }
.btn-link svg { width: 14px; height: 14px; }

.btn-sm { padding: 6px 12px; font-size: .85rem; }
.btn-lg { padding: 13px 22px; font-size: .95rem; }
.btn-block { width: 100%; }

/* ---------- Forms ---------- */

.form-row { display: flex; gap: 16px; }
.form-row > .field { flex: 1; }

.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: .85rem;
  font-weight: 500;
  color: var(--gm-ink);
  margin-bottom: 6px;
}
.field .hint { display: block; font-size: .78rem; color: var(--gm-muted); margin-top: 4px; }

.field input:not([type=checkbox]):not([type=radio]):not([type=submit]):not([type=button]),
.field select,
.field textarea {
  width: 100%;
  padding: 11px 13px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .95rem;
  color: var(--gm-ink);
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--gm-primary);
  box-shadow: 0 0 0 3px rgba(10,125,119,.12);
}
.field textarea { resize: vertical; min-height: 90px; }

.checkbox {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 14px;
  background: var(--gm-cream);
  border-radius: var(--gm-radius-sm);
  border: 1px solid var(--gm-line);
}
.checkbox input[type=checkbox] {
  width: 16px; height: 16px; margin-top: 3px; flex-shrink: 0;
  accent-color: var(--gm-primary);
}
.checkbox label { font-size: .88rem; color: var(--gm-ink-soft); margin: 0; }

/* ---------- Cards ---------- */

.card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 24px;
  box-shadow: var(--gm-shadow-sm);
}
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card-tight { padding: 16px; }

/* ---------- Single-column auth (login / signup) ---------- */

.auth-single {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gm-cream);
  padding: 40px 24px;
  position: relative;
}
/* signature brand gradient bar at the top of auth screens */
.auth-single::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gm-gradient);
  z-index: 5;
}
.auth-single .auth-card { max-width: 460px; width: 100%; }

/* generic small centered logo — used on login, consent, onboarding, pending */
.auth-logo {
  display: flex;
  justify-content: center;
  margin-bottom: 28px;
}
.auth-logo img {
  width: auto;
  height: 130px;
  border-radius: 0;
  background: transparent;
  mix-blend-mode: multiply;
}
.auth-logo.sm img { height: 96px; }

/* ---------- Auth shell (legacy two-column, kept for unused flows) ---------- */

.auth-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 380px 1fr;
  background: var(--gm-cream);
}

.auth-aside {
  background: linear-gradient(135deg, var(--gm-primary) 0%, var(--gm-primary-d) 100%);
  color: white;
  padding: 48px 36px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-aside h1 { font-size: 1.7rem !important; }
.auth-aside::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 20% 80%, rgba(201,123,90,.18) 0%, transparent 45%),
                    radial-gradient(circle at 80% 20%, rgba(255,255,255,.08) 0%, transparent 35%);
  pointer-events: none;
}
.auth-aside > * { position: relative; z-index: 1; }
.auth-aside h1 { color: white; font-size: 2.4rem; line-height: 1.15; margin-bottom: 16px; }
.auth-aside p  { color: rgba(255,255,255,.85); max-width: 38ch; }
.auth-aside .auth-meta { font-size: .8rem; color: rgba(255,255,255,.6); letter-spacing: .04em; text-transform: uppercase; }

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.auth-card { width: 100%; max-width: 440px; }
.auth-card .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 32px;
  justify-content: center;
  text-decoration: none;
  color: var(--gm-ink);
}
.auth-card .brand img {
  height: 130px;
  width: auto;
  border-radius: 0;
  background: transparent;
  mix-blend-mode: multiply;
}
.auth-card .brand-text { display: none; }

.auth-card h2 { text-align: center; margin-bottom: 4px; font-size: 1.7rem; }
.auth-card .auth-sub { text-align: center; color: var(--gm-muted); margin-bottom: 32px; font-size: .92rem; }

.auth-divider {
  text-align: center;
  margin: 22px 0 12px 0;
  color: var(--gm-muted);
  font-size: .88rem;
}

@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-aside { padding: 40px 32px; min-height: auto; }
  .auth-aside h1 { font-size: 1.6rem; }
}

/* ---------- Full-photo hero ---------- */

.hero-full {
  margin-bottom: 28px;
  border-radius: var(--gm-radius-lg);
  overflow: hidden;
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  box-shadow: var(--gm-shadow-sm);
}
.hero-full img {
  display: block;
  width: 100%;
  height: auto;
}

.welcome-block {
  margin-bottom: 36px;
}
.welcome-block h2 {
  font-size: 2.1rem;
  margin: 0 0 16px 0;
  letter-spacing: -0.02em;
}

/* ---------- Tooltip system ---------- */

[data-tip] { position: relative; }
[data-tip]::after {
  content: attr(data-tip);
  position: absolute;
  z-index: 90;
  background: #eef1f4;          /* warm off-white between white and beige */
  color: var(--gm-ink);
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .82rem;
  font-weight: 500;
  letter-spacing: 0;
  padding: 7px 12px;
  border: 1px solid #d5dde3;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .14s ease, transform .14s ease;
  box-shadow: 0 6px 18px rgba(60,45,20,.12);
  /* default position: below, centered */
  top: calc(100% + 8px);
  left: 50%;
  transform: translate(-50%, -4px);
}
[data-tip]:hover::after,
[data-tip]:focus-visible::after {
  opacity: 1;
  transform: translate(-50%, 0);
}
[data-tip][data-tip-pos="right"]::after {
  top: 50%;
  left: calc(100% + 12px);
  transform: translate(-4px, -50%);
}
[data-tip][data-tip-pos="right"]:hover::after,
[data-tip][data-tip-pos="right"]:focus-visible::after {
  transform: translate(0, -50%);
}
[data-tip][data-tip-pos="left"]::after {
  top: 50%;
  right: calc(100% + 12px);
  left: auto;
  transform: translate(4px, -50%);
}
[data-tip][data-tip-pos="left"]:hover::after,
[data-tip][data-tip-pos="left"]:focus-visible::after {
  transform: translate(0, -50%);
}
[data-tip][data-tip-pos="top"]::after {
  top: auto;
  bottom: calc(100% + 8px);
  transform: translate(-50%, 4px);
}
[data-tip][data-tip-pos="top"]:hover::after,
[data-tip][data-tip-pos="top"]:focus-visible::after {
  transform: translate(-50%, 0);
}

/* ---------- Hero (legacy two-column, retained for unused flows) ---------- */

.hero {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  box-shadow: var(--gm-shadow);
}
.hero-content { padding: 40px 44px; }
.hero-content h2 { font-size: 1.7rem; margin-bottom: 8px; }
.hero-content p  { font-size: 1rem; max-width: 50ch; }
.hero-image {
  height: 100%;
  min-height: 240px;
  background-size: cover;
  background-position: center;
  background-image: url("../../Assets/GRAYMATTERS-ACADEMY-4-scaled.png");
  background-color: var(--gm-cream-deep);
}

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-content { padding: 28px 24px; }
  .hero-image { min-height: 200px; order: -1; }
}

/* ---------- Recently Viewed / horizontal course rows ---------- */

.row-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 36px;
}

.row-card {
  display: grid;
  grid-template-columns: 160px 1fr auto;
  gap: 24px;
  align-items: center;
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 16px;
  box-shadow: var(--gm-shadow-sm);
  transition: border-color .15s ease, transform .12s ease;
}
.row-card:hover { border-color: #cdd6dd; transform: translateY(-1px); }

.row-card .row-img {
  width: 160px;
  height: 130px;
  border-radius: var(--gm-radius-sm);
  background-size: cover;
  background-position: center;
  background-color: var(--gm-cream-deep);
}

.row-card .row-body { min-width: 0; }
.row-card h3 {
  font-size: 1.1rem;
  margin: 8px 0 6px 0;
  line-height: 1.3;
}
.row-card p {
  font-size: .9rem;
  color: var(--gm-muted);
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.row-card .row-side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: space-between;
  height: 100%;
  gap: 12px;
  min-width: 130px;
}

.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.tag-teal    { background: var(--gm-primary-l);  color: var(--gm-primary-d); }
.tag-terra   { background: var(--gm-accent-l);    color: var(--gm-accent-d); }
.tag-sage    { background: var(--gm-lime-l);      color: var(--gm-lime-d); }
.tag-amber   { background: var(--gm-coral-l);     color: var(--gm-coral-d); }
.tag-violet  { background: var(--gm-slate-l);     color: var(--gm-slate-d); }

.peer-stack {
  display: inline-flex;
  align-items: center;
}
.peer-stack .avatar { width: 26px; height: 26px; font-size: .65rem; margin-right: -8px; border: 2px solid var(--gm-paper); }
.peer-stack .more {
  background: var(--gm-cream-deep);
  color: var(--gm-ink-soft);
  font-size: .72rem;
  font-weight: 500;
  border-radius: 999px;
  padding: 0 8px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  margin-left: -2px;
  border: 2px solid var(--gm-paper);
}

@media (max-width: 700px) {
  .row-card { grid-template-columns: 100px 1fr; gap: 14px; }
  .row-card .row-img { width: 100px; height: 100px; }
  .row-card .row-side { display: none; }
}

/* ---------- News tiles (compact 2-up under recently viewed) ---------- */

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}
@media (max-width: 800px) { .news-grid { grid-template-columns: 1fr; } }

.news-card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--gm-shadow-sm);
}
.news-card .news-image { height: 160px; background-size: cover; background-position: center; background-color: var(--gm-cream-deep); }
.news-card .news-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; }
.news-card .news-meta { font-size: .76rem; color: var(--gm-muted); margin-bottom: 6px; letter-spacing: .03em; text-transform: uppercase; }
.news-card h3 { font-size: 1.05rem; margin-bottom: 6px; line-height: 1.3; }

/* clickable news cards */
.news-clickable {
  cursor: pointer;
  transition: transform .14s ease, box-shadow .15s ease, border-color .15s ease;
  outline: none;
}
.news-clickable:hover {
  transform: translateY(-2px);
  border-color: #cdd6dd;
  box-shadow: var(--gm-shadow);
}
.news-clickable:focus-visible {
  border-color: var(--gm-primary);
  box-shadow: 0 0 0 3px rgba(10,125,119,.15);
}
.news-clickable .btn-link { margin-top: auto; padding-top: 10px; }

/* ---------- Canvas-style course cards (with colored banner) ---------- */

.canvas-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .canvas-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .canvas-grid { grid-template-columns: 1fr; } }

.canvas-card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--gm-shadow-sm);
  transition: transform .12s ease, box-shadow .15s ease, border-color .15s ease;
  position: relative;
}
.canvas-card:hover { transform: translateY(-2px); border-color: #cdd6dd; box-shadow: var(--gm-shadow); }
.canvas-card a.cover-link { position: absolute; inset: 0; z-index: 1; }

.canvas-banner {
  height: 110px;
  position: relative;
  background-size: cover;
  background-position: center;
}
.canvas-banner.solid-teal     { background: linear-gradient(135deg, #0a7d77 0%, #06504a 100%); }
.canvas-banner.solid-teal-2   { background: linear-gradient(135deg, #12a69d 0%, #0a7d77 100%); }
.canvas-banner.solid-terra    { background: linear-gradient(135deg, #f1803a 0%, #cf5f1e 100%); }
.canvas-banner.solid-sage     { background: linear-gradient(135deg, #a2b542 0%, #6f8f2f 100%); }
.canvas-banner.solid-amber    { background: linear-gradient(135deg, #f06278 0%, #d8455e 100%); }
.canvas-banner.solid-violet   { background: linear-gradient(135deg, #7a8bab 0%, #5d7192 100%); }
.canvas-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,.18) 0%, transparent 55%);
}
.canvas-banner .banner-tag {
  position: absolute;
  top: 14px; left: 14px;
  background: rgba(255,255,255,.92);
  color: var(--gm-ink);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 5px;
  z-index: 1;
  backdrop-filter: blur(4px);
}
.canvas-banner .lock-veil {
  position: absolute; inset: 0;
  background: rgba(31,71,84,.45);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
  z-index: 1;
}

.canvas-body {
  padding: 16px 18px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.canvas-body h3 { font-size: 1.02rem; margin: 0; line-height: 1.3; }
.canvas-body .canvas-sub { font-size: .82rem; color: var(--gm-muted); }
.canvas-body .canvas-desc {
  font-size: .85rem;
  color: var(--gm-ink-soft);
  margin: 6px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.canvas-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--gm-line-soft);
  background: var(--gm-paper);
  position: relative;
  z-index: 2;
}
.canvas-foot .foot-actions { display: inline-flex; gap: 2px; }
.canvas-foot .foot-act {
  width: 32px; height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--gm-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: all .15s ease;
  text-decoration: none;
}
.canvas-foot .foot-act:hover { background: var(--gm-cream-deep); color: var(--gm-ink); }
.canvas-foot .foot-act svg { width: 16px; height: 16px; stroke-width: 1.7; }
.canvas-foot .foot-price { font-family: "Oswald", "DM Sans", sans-serif; font-weight: 600; font-size: .95rem; color: var(--gm-ink); }

/* ---------- Course catalog grid (legacy + simple cards) ---------- */

.course-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
@media (max-width: 1024px) { .course-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px)  { .course-grid { grid-template-columns: 1fr; } }

.course-card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--gm-shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
  position: relative;
}
.course-card:hover { transform: translateY(-2px); border-color: #cdd6dd; box-shadow: var(--gm-shadow); }
.course-card .course-image {
  height: 150px;
  background-size: cover;
  background-position: center;
  background-color: var(--gm-cream-deep);
  position: relative;
}
.course-card .course-image .lock-veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(31,71,84,.12), rgba(31,71,84,.55));
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.4rem;
}
.course-card .course-body { padding: 18px 20px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.course-card h3 { font-size: 1.05rem; margin: 0; line-height: 1.3; }
.course-card p { font-size: .88rem; color: var(--gm-muted); margin: 0; }
.course-card .course-foot {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; border-top: 1px solid var(--gm-line); background: var(--gm-cream);
}

.price { font-family: "Oswald", "DM Sans", sans-serif; font-weight: 600; color: var(--gm-ink); font-size: 1rem; }

.cpd-tag {
  display: inline-block;
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  align-self: flex-start;
}

/* ---------- Status badges ---------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  letter-spacing: .02em;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-pending  { background: #fdead4; color: var(--gm-warn); }
.badge-verified { background: #eef4dd; color: var(--gm-success); }
.badge-rejected { background: #fbe0e5; color: var(--gm-danger); }
.badge-expired  { background: #eceff2; color: var(--gm-ink-soft); }

/* ---------- Banner ---------- */

.banner {
  background: #fdead4;
  border: 1px solid #f3b06a;
  color: #8a4712;
  padding: 14px 18px;
  border-radius: var(--gm-radius);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 24px;
}
.banner-info    { background: var(--gm-primary-l); border-color: #9de0da; color: var(--gm-primary-d); }
.banner-success { background: #eef4dd; border-color: #cdd98f; color: #46601f; }
.banner-danger  { background: #fbe0e5; border-color: #f3a9b5; color: var(--gm-danger); }
.banner .banner-icon { font-size: 1.1rem; line-height: 1.2; flex-shrink: 0; }

/* ---------- Tabs ---------- */

.tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--gm-line);
  margin-bottom: 24px;
  overflow-x: auto;
}
.tab {
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  background: none;
  border: 0;
  padding: 12px 18px;
  font-size: .92rem;
  color: var(--gm-ink-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tab:hover { color: var(--gm-ink); }
.tab.active { color: var(--gm-primary-d); border-bottom-color: var(--gm-primary); font-weight: 500; }

/* ---------- Tables ---------- */

.table-wrap {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  /* scroll wide tables sideways instead of clipping columns on small screens */
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.table-wrap table.gm-table th,
.table-wrap table.gm-table td { white-space: nowrap; }

table.gm-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.gm-table th, table.gm-table td {
  text-align: left;
  padding: 12px 16px;
  border-bottom: 1px solid var(--gm-line-soft);
}
table.gm-table th {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 500;
  background: var(--gm-cream);
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gm-muted);
}
table.gm-table tbody tr:last-child td { border-bottom: 0; }
table.gm-table tbody tr:hover { background: var(--gm-cream); }

/* Pin the first column (Name / Course) so it stays visible while the rest scrolls sideways */
.table-wrap table.gm-table th:first-child,
.table-wrap table.gm-table td:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--gm-paper);
  box-shadow: inset -1px 0 0 var(--gm-line);
}
.table-wrap table.gm-table th:first-child { background: var(--gm-cream); z-index: 2; }
.table-wrap table.gm-table tbody tr:hover td:first-child { background: var(--gm-cream); }
@media (max-width: 720px) {
  .table-wrap table.gm-table th:first-child,
  .table-wrap table.gm-table td:first-child {
    max-width: 40vw;
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: inset -1px 0 0 var(--gm-line), 4px 0 6px -4px rgba(20, 40, 60, .18);
  }
}

/* ---------- Stat tiles (small admin variant) ---------- */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
@media (max-width: 800px) { .stat-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 18px;
}
.stat .stat-label { font-size: .78rem; color: var(--gm-muted); letter-spacing: .04em; text-transform: uppercase; margin-bottom: 8px; }
.stat .stat-value { font-family: "Oswald", "DM Sans", sans-serif; font-size: 1.7rem; font-weight: 600; color: var(--gm-ink); }
.stat .stat-foot  { font-size: .8rem; color: var(--gm-muted); margin-top: 6px; }

/* ---------- Two-column admin ---------- */

.admin-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
}
@media (max-width: 900px) { .admin-grid { grid-template-columns: 1fr; } }

.admin-side {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 14px;
  height: fit-content;
}
.admin-side a {
  display: block;
  padding: 10px 12px;
  border-radius: var(--gm-radius-sm);
  font-size: .92rem;
  color: var(--gm-ink-soft);
  text-decoration: none;
}
.admin-side a:hover { background: var(--gm-cream-deep); color: var(--gm-ink); text-decoration: none; }
.admin-side a.active { background: var(--gm-primary-l); color: var(--gm-primary-d); font-weight: 500; }

/* ---------- File upload ---------- */

.uploader {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 600px) { .uploader { grid-template-columns: 1fr; } }

.upload-tile {
  border: 2px dashed var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 24px;
  text-align: center;
  background: var(--gm-cream);
  position: relative;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}
.upload-tile:hover { border-color: var(--gm-primary); background: var(--gm-primary-l); }
.upload-tile.has-file { border-style: solid; border-color: var(--gm-success); background: #f6f9ec; }
.upload-tile .upload-label { font-weight: 500; margin-bottom: 4px; }
.upload-tile .upload-hint { font-size: .8rem; color: var(--gm-muted); }
.upload-tile input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.preview-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.preview-pair .preview-tile {
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 12px;
  background: var(--gm-cream);
  text-align: center;
}
.preview-pair .preview-tile .label { font-size: .78rem; color: var(--gm-muted); margin-bottom: 8px; letter-spacing: .04em; text-transform: uppercase; }
.preview-pair .preview-tile img {
  max-width: 100%; height: 200px; object-fit: cover;
  border-radius: var(--gm-radius-sm);
  background: var(--gm-paper);
}

/* ---------- Footer (auth-shell only) ---------- */

.site-foot {
  background: var(--gm-paper);
  border-top: 1px solid var(--gm-line);
  padding: 22px 0;
  font-size: .85rem;
  color: var(--gm-muted);
}
.site-foot .container { padding: 0 32px; }
.site-foot .foot-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Misc ---------- */

.muted { color: var(--gm-muted); }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.mt-2 { margin-top: 16px; } .mb-2 { margin-bottom: 16px; }
.mt-3 { margin-top: 24px; } .mb-3 { margin-bottom: 24px; }
.mt-4 { margin-top: 32px; } .mb-4 { margin-bottom: 32px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.grow { flex: 1; }
.hidden { display: none !important; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(38,48,63,.45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 80;
  padding: 24px;
}
.modal-backdrop.open {
  display: flex;
  animation: gm-modal-fade .18s ease-out;
}
.modal {
  background: var(--gm-paper);
  border-radius: var(--gm-radius-lg);
  max-width: 540px;
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  padding: 28px;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  animation: gm-modal-pop .24s cubic-bezier(.2, .8, .25, 1);
}
@keyframes gm-modal-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes gm-modal-pop {
  from { opacity: 0; transform: scale(.96) translateY(10px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal h3 { margin-top: 0; }
.modal .modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- Course Builder (admin) ---------- */

.builder-shell {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: start;
}
@media (max-width: 900px) { .builder-shell { grid-template-columns: 1fr; } }

.builder-toc {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 8px;
  position: sticky;
  top: 92px;
}
.builder-toc h4 {
  font-size: .76rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gm-muted);
  padding: 10px 12px 8px;
  margin: 0;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-weight: 500;
}
.builder-toc a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--gm-ink-soft);
  text-decoration: none;
}
.builder-toc a:hover { background: var(--gm-cream-deep); color: var(--gm-ink); text-decoration: none; }
.builder-toc a .toc-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--gm-cream-deep);
  color: var(--gm-muted);
  font-size: .72rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.section-block {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.section-block-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--gm-line-soft);
  background: var(--gm-cream);
}
.section-block-head .section-kind {
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 5px;
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  flex-shrink: 0;
}
.section-block-head h4 { margin: 0; flex: 1; font-size: 1rem; }
.section-block-head .section-actions { display: flex; gap: 4px; }
.section-block-body { padding: 18px; }

.add-section-bar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  padding: 24px;
  background: var(--gm-cream);
  border: 2px dashed var(--gm-line);
  border-radius: var(--gm-radius);
  margin: 22px 0;
}
.add-section-bar .lbl {
  grid-column: 1 / -1;
  font-family: "Oswald", "DM Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--gm-ink);
  margin: 0 0 4px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}
.add-section-bar .lbl::before {
  content: "+";
  width: 32px; height: 32px;
  background: var(--gm-primary);
  color: white;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  line-height: 1;
}
.add-section-bar button {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  color: var(--gm-ink);
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .98rem;
  font-weight: 500;
  padding: 16px 18px;
  border-radius: var(--gm-radius);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: transform .12s ease, background .15s ease, border-color .15s ease, box-shadow .15s ease;
  box-shadow: var(--gm-shadow-sm);
}
.add-section-bar button:hover {
  background: var(--gm-primary);
  color: white;
  border-color: var(--gm-primary);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -10px rgba(10,125,119,.5);
}
.add-section-bar button .icn {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .15s ease;
}
.add-section-bar button:hover .icn {
  background: rgba(255,255,255,.18);
  color: white;
}
.add-section-bar button .icn svg { width: 22px; height: 22px; stroke-width: 1.7; }
.add-section-bar button .bd { display: flex; flex-direction: column; gap: 2px; }
.add-section-bar button .bd strong {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: -0.005em;
}
.add-section-bar button .bd small {
  font-size: .78rem;
  color: var(--gm-muted);
  font-weight: 400;
}
.add-section-bar button:hover .bd small { color: rgba(255,255,255,.82); }

/* bigger section blocks for the builder */
.section-block { margin-bottom: 18px; box-shadow: var(--gm-shadow-sm); }
.section-block-head { padding: 18px 22px; }
.section-block-head .section-kind { font-size: .76rem; padding: 4px 10px; }
.section-block-head h4 { font-size: 1.12rem; }
.section-block-head .section-actions .btn { padding: 8px 12px; font-size: .9rem; }
.section-block-body { padding: 22px; }

.qa-row {
  background: var(--gm-cream);
  border: 1px solid var(--gm-line-soft);
  border-radius: var(--gm-radius-sm);
  padding: 16px;
  margin-bottom: 12px;
}
.qa-row .qa-prompt {
  font-weight: 600;
  margin-bottom: 10px;
  font-size: .95rem;
  color: var(--gm-ink);
}

/* ---------- "Preview details" link on course cards ---------- */

.preview-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: .9rem;
  font-weight: 500;
  color: var(--gm-primary);
  cursor: pointer;
  background: transparent;
  border: 0;
  padding: 0;
  text-decoration: none;
}
.preview-link .label {
  position: relative;
  display: inline-block;
}
.preview-link .label::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--gm-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
}
.preview-link:hover .label::after,
.canvas-card:hover .preview-link .label::after,
.canvas-card:focus-visible .preview-link .label::after { transform: scaleX(1); }
.preview-link svg {
  width: 14px;
  height: 14px;
  transition: transform .2s ease;
}
.canvas-card:hover .preview-link svg,
.preview-link:hover svg { transform: translateX(3px); }

/* ---------- Materials row (small inline arrow + hover underline) ---------- */

.mat-row {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--gm-ink);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
  padding: 12px 16px;
  background: var(--gm-paper);
  transition: border-color .15s ease, background .15s ease;
}
.mat-row:hover {
  border-color: #cdd6dd;
  background: var(--gm-cream);
  text-decoration: none;
}
.mat-row .mat-type {
  font-size: .7rem;
  font-weight: 600;
  color: var(--gm-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
  flex-shrink: 0;
  width: 44px;
}
.mat-row .mat-name {
  flex: 1;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .95rem;
}
.mat-row .mat-name .label {
  position: relative;
  display: inline-block;
}
.mat-row .mat-name .label::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1.5px;
  background: var(--gm-primary);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .25s ease;
}
.mat-row:hover .mat-name .label::after { transform: scaleX(1); }
.mat-row .mat-arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  color: var(--gm-muted);
  flex-shrink: 0;
  transition: transform .2s ease, color .15s ease;
}
.mat-row .mat-arrow svg { width: 14px; height: 14px; stroke-width: 2; }
.mat-row:hover .mat-arrow {
  color: var(--gm-primary);
  transform: translateX(3px);
}

/* ---------- Section progress + lock states ---------- */

.section-progress {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 14px 18px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--gm-shadow-sm);
}
.section-progress .pcount {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-weight: 600;
  font-size: .92rem;
  color: var(--gm-ink);
  white-space: nowrap;
}
.section-progress .pbar {
  flex: 1;
  height: 8px;
  background: var(--gm-line-soft);
  border-radius: 999px;
  overflow: hidden;
}
.section-progress .pbar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gm-primary) 0%, var(--gm-primary-2) 100%);
  border-radius: 999px;
  transition: width .35s ease;
}
.section-progress .pmeta {
  font-size: .82rem;
  color: var(--gm-muted);
}

.section-item.locked,
.section-item.locked-row {
  opacity: .6;
  cursor: not-allowed;
}
.section-item.locked .summary-locked {
  list-style: none;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}
.section-item.locked .si-mark {
  background: var(--gm-cream-deep);
  color: var(--gm-muted);
}
.section-item.completed summary .si-mark {
  background: #eef4dd;
  color: var(--gm-success);
}
.section-item.completed summary .si-title::after {
  content: " · Completed";
  color: var(--gm-success);
  font-weight: 500;
  font-size: .82rem;
}
.section-item.locked .si-meta {
  color: var(--gm-muted);
  font-size: .8rem;
  font-style: italic;
}
.section-item.locked .si-mark svg { width: 16px; height: 16px; }

.complete-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--gm-cream);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
}
.complete-bar .lbl {
  font-size: .88rem;
  color: var(--gm-ink-soft);
}

/* ---------- Course content (client view) ---------- */

.section-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.section-item {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
}
.section-item summary {
  list-style: none;
  cursor: pointer;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  user-select: none;
}
.section-item summary::-webkit-details-marker { display: none; }
.section-item summary .si-mark {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.section-item summary .si-mark.terra  { background: var(--gm-accent-l); color: var(--gm-accent-d); }
.section-item summary .si-mark.amber  { background: #fdead4; color: var(--gm-warn); }
.section-item summary .si-mark.sage   { background: #eef4dd; color: var(--gm-success); }
.section-item summary .si-mark svg { width: 18px; height: 18px; stroke-width: 1.6; }
.section-item summary .si-title { font-weight: 500; flex: 1; }
.section-item summary .si-meta { font-size: .8rem; color: var(--gm-muted); }
.section-item summary .si-chev {
  color: var(--gm-muted);
  transition: transform .15s ease;
}
.section-item[open] summary .si-chev { transform: rotate(90deg); }
.section-item[open] summary { border-bottom: 1px solid var(--gm-line-soft); }
.section-body {
  padding: 18px 24px 22px;
}

/* ---------- Certificate ---------- */

.cert-canvas {
  /* every design token below can be overridden inline by the admin's template */
  --cert-bg: #fbfcfd;
  --cert-frame: var(--gm-primary);
  --cert-accent: var(--gm-accent-d);
  --cert-heading: var(--gm-ink);
  --cert-name: var(--gm-primary-d);
  --cert-text: var(--gm-ink-soft);
  --cert-heading-font: "Oswald", "DM Sans", sans-serif;
  background-color: var(--cert-bg);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  /* size to content so signatures/long titles never overflow the frame,
     while keeping a landscape-certificate minimum */
  padding: 46px 60px 40px;
  min-height: 460px;
  position: relative;
  text-align: center;
  box-shadow: var(--gm-shadow);
}
/* background photo on its own layer so the admin can set its opacity */
.cert-canvas .cert-bg-layer {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--cert-bg-image, none);
  background-size: cover;
  background-position: center;
  opacity: var(--cert-bg-opacity, 1);
  pointer-events: none;
  z-index: 0;
}
.cert-canvas::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 18px;
  border: 2px solid var(--cert-frame);
  border-radius: 8px;
  pointer-events: none;
}
.cert-canvas::after {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 24px;
  border: 1px solid var(--cert-accent);
  border-radius: 5px;
  pointer-events: none;
}
.cert-canvas.cert-border-solid::after { display: none; }
.cert-canvas.cert-border-none::before,
.cert-canvas.cert-border-none::after { display: none; }
/* all logos share the first line, centred; they shrink rather than wrap */
.cert-canvas .cert-logos {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  gap: 22px;
  margin: 0 auto 18px;
  max-width: 100%;
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-logo {
  height: 64px;
  width: auto;
  max-width: 100%;
  min-width: 0;
  flex: 0 1 auto;
  object-fit: contain;
  border-radius: 8px;
  mix-blend-mode: multiply;
}
.cert-canvas .cert-eyebrow {
  font-family: "Bookman Old Style", "URW Bookman L", Georgia, serif;
  font-size: var(--cert-eyebrow-size, 13px);
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--cert-accent);
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-title {
  font-family: var(--cert-heading-font);
  font-size: var(--cert-title-size, 35px);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cert-heading);
  margin: 6px 0 18px 0;
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-presented { font-size: .92rem; color: var(--cert-text); margin-bottom: 8px; position: relative; z-index: 2; }
.cert-canvas .cert-name {
  font-family: var(--cert-heading-font);
  font-size: 2.4rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--cert-name);
  margin: 0 0 16px 0;
  border-bottom: 2px solid var(--cert-frame);
  padding-bottom: 12px;
  display: inline-block;
  min-width: 60%;
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-msg {
  font-size: 1rem;
  color: var(--cert-text);
  max-width: 640px;
  margin: 0 auto 6px;
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-course {
  font-family: var(--cert-heading-font);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--cert-heading);
  margin: 8px auto 24px;
  position: relative;
  z-index: 2;
}
.cert-canvas .cert-foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-top: 28px;
  position: relative;
  z-index: 2;
  gap: 24px;
}
/* any number of signatories: wrap onto more rows, centred */
.cert-canvas .cert-sigs {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 28px;
}
.cert-canvas .cert-sig {
  text-align: center;
  flex: 1 1 170px;
  max-width: 250px;
}
.cert-canvas .cert-sig .sig-line {
  border-top: 1px solid var(--gm-ink);
  margin-bottom: 6px;
  font-family: "Oswald", "DM Sans", sans-serif;
  font-style: italic;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--gm-primary-d);
  padding-top: 6px;
  min-height: 30px;
}
.cert-canvas .cert-sig .sig-line img { height: 36px; vertical-align: middle; }
.cert-canvas .cert-sig .sig-name { font-weight: 600; font-size: .92rem; }
.cert-canvas .cert-sig .sig-title { font-size: .78rem; color: var(--gm-muted); }
.cert-canvas .cert-meta {
  font-size: .72rem;
  color: var(--gm-muted);
  letter-spacing: .04em;
  text-transform: uppercase;
}

@media print {
  body * { visibility: hidden; }
  #cert-print, #cert-print * { visibility: visible; }
  #cert-print { position: absolute; inset: 0; padding: 24px; margin: 0; }
  .cert-canvas { box-shadow: none; border: none; min-height: auto; }
}

/* ---------- Calendar ---------- */

.cal-shell {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 28px;
  align-items: start;
}
@media (max-width: 1000px) { .cal-shell { grid-template-columns: 1fr; } }

.cal-card {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  overflow: hidden;
}
.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--gm-line-soft);
}
.cal-head h2 { margin: 0; font-size: 1.2rem; }
.cal-nav { display: flex; gap: 6px; }
.cal-nav button {
  width: 34px; height: 34px;
  background: var(--gm-cream);
  border: 1px solid var(--gm-line);
  border-radius: 8px;
  cursor: pointer;
  color: var(--gm-ink-soft);
  font-size: 1.1rem;
}
.cal-nav button:hover { background: var(--gm-cream-deep); color: var(--gm-ink); }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-dow {
  background: var(--gm-cream);
  font-size: .72rem;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--gm-muted);
  padding: 12px 0;
  text-align: center;
  border-bottom: 1px solid var(--gm-line-soft);
}
.cal-day {
  min-height: 96px;
  padding: 8px 10px;
  border-right: 1px solid var(--gm-line-soft);
  border-bottom: 1px solid var(--gm-line-soft);
  font-size: .85rem;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cal-day:nth-child(7n) { border-right: 0; }
.cal-day .cal-num { font-weight: 500; color: var(--gm-ink); }
.cal-day.cal-out .cal-num { color: var(--gm-line); }
.cal-day.cal-today .cal-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px; height: 26px;
  background: var(--gm-primary);
  color: white;
  border-radius: 50%;
  font-size: .8rem;
}

.cal-event {
  display: block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: .72rem;
  line-height: 1.3;
  font-weight: 500;
  border-left: 3px solid currentColor;
  background: var(--gm-primary-l);
  color: var(--gm-primary-d);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-event.terra { background: var(--gm-accent-l);    color: var(--gm-accent-d); }
.cal-event.sage  { background: #eef4dd;              color: var(--gm-success); }
.cal-event.amber { background: #fdead4;              color: var(--gm-warn); }

.cal-list { display: flex; flex-direction: column; gap: 12px; }
.cal-list-item {
  background: var(--gm-paper);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.cal-list-item .cal-date {
  flex-shrink: 0;
  width: 56px;
  text-align: center;
  background: var(--gm-cream);
  border: 1px solid var(--gm-line);
  border-radius: 10px;
  padding: 6px 0;
}
.cal-list-item .cal-date .m {
  font-size: .68rem;
  font-weight: 600;
  color: var(--gm-accent-d);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.cal-list-item .cal-date .d {
  font-family: "Oswald", "DM Sans", sans-serif;
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--gm-ink);
  line-height: 1;
  margin-top: 2px;
}
.cal-list-item h5 { margin: 0 0 4px 0; font-size: .95rem; }
.cal-list-item .meta { font-size: .82rem; color: var(--gm-muted); }

/* ---------- Add-to-cart animation ---------- */

.fly-chip {
  position: fixed;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  z-index: 200;
  pointer-events: none;
  box-shadow: 0 10px 28px rgba(38,48,63,.3), 0 0 0 4px rgba(255,255,255,.85);
  transition:
    transform .7s cubic-bezier(.55, -0.2, .85, .85),
    opacity .7s ease,
    width .7s ease,
    height .7s ease;
}
.fly-chip.fly { width: 18px; height: 18px; opacity: .35; }

.btn.flash-success {
  background: var(--gm-success) !important;
  color: white !important;
  border-color: var(--gm-success) !important;
  transition: background .15s ease, color .15s ease;
}

.iconbtn.cart-thump {
  animation: cart-thump .55s ease;
  background: var(--gm-accent-l);
  color: var(--gm-accent-d);
}
@keyframes cart-thump {
  0%   { transform: scale(1); }
  35%  { transform: scale(1.22); }
  60%  { transform: scale(.92); }
  100% { transform: scale(1); }
}

.iconbtn .badge-num.bump { animation: badge-bump .45s ease; }
@keyframes badge-bump {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.4); }
  100% { transform: scale(1); }
}

/* ---------- Cart preview (modal helper) ---------- */

.cart-preview-row {
  display: flex; gap: 12px; padding: 12px;
  background: var(--gm-cream); border-radius: var(--gm-radius-sm);
  margin-bottom: 18px;
  border: 1px solid var(--gm-line-soft);
}
.cart-preview-row .img {
  width: 80px; height: 60px; border-radius: 8px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}
.cart-preview-list {
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
  overflow: hidden;
  margin-bottom: 4px;
}
.cart-preview-item {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid var(--gm-line-soft);
  font-size: .9rem;
}
.cart-preview-item:last-child { border-bottom: 0; }
.cart-preview-total {
  display: flex; justify-content: space-between;
  padding: 12px 14px;
  font-weight: 600;
  border-top: 2px solid var(--gm-line);
}

/* ---------- Privacy text block ---------- */

.privacy-block {
  background: var(--gm-cream);
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius);
  padding: 20px 22px;
  font-size: .92rem;
  color: var(--gm-ink-soft);
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.6;
  margin-bottom: 16px;
}
.privacy-block strong { color: var(--gm-ink); }

/* ---------- badges / awards ---------- */
.awards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.award-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--gm-line);
  border-radius: var(--gm-radius-sm);
  background: var(--gm-paper);
  transition: transform .15s ease, box-shadow .15s ease;
}
.award-chip.award-earned { box-shadow: var(--gm-shadow-sm); }
.award-chip.award-earned:hover { transform: translateY(-2px); box-shadow: var(--gm-shadow); }
.award-chip.award-locked { opacity: .55; filter: grayscale(.5); }
.award-medal {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: var(--gm-cream-deep);
  color: var(--gm-primary-d);
}
.award-medal svg { width: 20px; height: 20px; }
.award-teal   { background: var(--gm-primary-l); color: var(--gm-primary-d); }
.award-sage   { background: var(--gm-lime-l);    color: var(--gm-lime-d); }
.award-amber  { background: var(--gm-coral-l);   color: var(--gm-coral-d); }
.award-terra  { background: var(--gm-accent-l);  color: var(--gm-accent-d); }
.award-violet { background: var(--gm-slate-l);   color: var(--gm-slate-d); }
.award-title { font-family: "Oswald", "DM Sans", sans-serif; font-weight: 600; font-size: .92rem; }
.award-desc { font-size: .78rem; color: var(--gm-muted); }

/* mini badge row (dashboard) */
.award-mini {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 1.1rem;
  background: var(--gm-cream-deep);
  border: 1px solid var(--gm-line);
}
.award-mini.locked { opacity: .4; }

/* ---------- print (certificate) ---------- */
@media print {
  .sidebar, .topbar, .no-print, .btn { display: none !important; }
  .app-shell, .app-main { display: block !important; margin: 0 !important; }
  body { background: #fff !important; }
  .cert-canvas { box-shadow: none !important; margin: 0 auto !important; }
}

/* ---------- star rating (feedback forms) ---------- */
.gm-rating { display: inline-flex; flex-direction: column; gap: 4px; }
.gm-stars { display: flex; gap: 6px; }
.gm-star { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.gm-star input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.gm-star svg { width: 32px; height: 32px; fill: none; stroke: #cdd6dd; stroke-width: 1.6; stroke-linejoin: round; transition: fill .12s ease, stroke .12s ease, transform .12s ease; }
.gm-star.on svg { fill: var(--gm-accent); stroke: var(--gm-accent-d); }
.gm-star:hover svg { transform: scale(1.08); }
.gm-star input:focus-visible + svg { outline: 2px solid var(--gm-primary); outline-offset: 2px; border-radius: 4px; }
.gm-star .n { font-family: "Oswald", sans-serif; font-size: .75rem; color: var(--gm-muted); }
.gm-rating-caps { display: flex; justify-content: space-between; font-size: .72rem; color: var(--gm-muted); letter-spacing: .03em; text-transform: uppercase; }
@media (prefers-reduced-motion: reduce) { .gm-star svg { transition: none; } .gm-star:hover svg { transform: none; } }
.rating-preview { margin-top: 10px; padding: 12px 14px; border: 1px dashed var(--gm-line); border-radius: var(--gm-radius-sm); background: var(--gm-cream); }
.rating-preview .lbl { font-size: .75rem; color: var(--gm-muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }

/* ---------- account settings: two independent card stacks (no row-height gaps) ---------- */
.account-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.account-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.account-col > .card { margin: 0; }
@media (max-width: 900px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---------- Badge Journey roadmap (badges.html) ---------- */
.rm-body { background: #fbfcfd; }
.rm-body #root { max-width: none; padding: 0; margin: 0; }
.rm-top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 16px;
  padding: 12px clamp(16px, 4vw, 32px);
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gm-line);
}
.rm-top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--gm-gradient); }
.rm-back { flex-shrink: 0; gap: 6px; }
.rm-top-brand { display: flex; align-items: center; gap: 10px; font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.25rem; color: var(--gm-ink); min-width: 0; }
.rm-top-brand img { width: 34px; height: 34px; border-radius: 8px; object-fit: cover; }
.rm-top-level { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.rm-chip { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1rem; letter-spacing: .03em; padding: 6px 14px; border-radius: 999px; background: var(--gm-primary-l); color: var(--gm-primary-d); white-space: nowrap; }
.rm-bar { width: 180px; height: 10px; border-radius: 999px; background: var(--gm-line-soft); overflow: hidden; }
.rm-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #0cb5ac, #a2b542); }

.rm-intro { max-width: 820px; margin: 0 auto; padding: 56px 20px 36px; text-align: center; }
.rm-eyebrow { font-family: "Oswald", sans-serif; text-transform: uppercase; letter-spacing: .12em; font-size: .9rem; color: var(--gm-primary); margin: 0 0 6px; }
.rm-intro h1 { margin: 0 0 12px; font-size: clamp(2rem, 6vw, 3.2rem); }
.rm-lead { color: var(--gm-ink-soft); margin: 0 auto 26px; max-width: 580px; font-size: 1.12rem; }
.rm-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.rm-stats > div { background: var(--gm-paper); border: 1px solid var(--gm-line); border-radius: var(--gm-radius-sm); padding: 18px 10px; display: flex; flex-direction: column; gap: 4px; }
.rm-stats strong { font-family: "Oswald", sans-serif; font-size: 2.2rem; line-height: 1.1; color: var(--gm-ink); }
.rm-stats span { font-size: .9rem; color: var(--gm-muted); }
.rm-next { margin: 0 0 18px; color: var(--gm-ink-soft); font-size: 1.1rem; }
.rm-medals { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }
.rm-medal-mini { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 1.7rem; background: var(--tone-l); box-shadow: inset 0 0 0 2px var(--tone); }
.rm-medal-mini.locked { background: var(--gm-line-soft); box-shadow: inset 0 0 0 2px var(--gm-line); color: var(--gm-muted); }
.rm-medal-mini svg { width: 20px; height: 20px; }
.rm-scroll-hint { margin: 26px 0 0; font-size: .9rem; color: var(--gm-muted); font-family: "Oswald", sans-serif; letter-spacing: .06em; text-transform: uppercase; }

.rm-world { position: relative; overflow-x: clip; border-top: 1px solid var(--gm-line-soft); }
.rm-map { position: relative; max-width: 960px; margin: 0 auto; padding: 0 16px; box-sizing: border-box; }
.rm-map > * { box-sizing: border-box; }
.rm-road { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; }
.rm-road path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rm-road-edge { stroke: rgba(38,48,63,.10); stroke-width: 44; }
.rm-road-base { stroke: #fff; stroke-width: 36; }
.rm-road-dots { stroke: #cfd8df; stroke-width: 6; stroke-dasharray: 0.1 20; }
.rm-road-done { stroke: url(#rmDone); stroke-width: 30; }
.rm-road-done-dots { stroke: rgba(255,255,255,.9); stroke-width: 6; stroke-dasharray: 0.1 20; }

.rm-zone { position: absolute; left: 12px; transform: translateY(-50%); font-family: "Oswald", sans-serif; font-size: .85rem; letter-spacing: .1em; text-transform: uppercase; color: var(--tone); opacity: .85; white-space: nowrap; pointer-events: none; }
.rm-summit { position: absolute; left: 50%; transform: translateX(-50%); font-family: "Oswald", sans-serif; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; font-size: 1.05rem; color: var(--gm-slate-d); background: var(--gm-paper); border: 1px solid var(--gm-line); border-radius: 999px; padding: 8px 20px; box-shadow: var(--gm-shadow); white-space: nowrap; }

.rm-node { position: absolute; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; text-decoration: none; z-index: 2; }
.rm-start { width: 84px; height: 84px; background: var(--gm-paper); box-shadow: 0 0 0 4px var(--gm-primary-l), var(--gm-shadow); }
.rm-flag { font-size: 1.9rem; line-height: 1; margin-top: -12px; }
.rm-start-txt { position: absolute; bottom: 10px; font-family: "Oswald", sans-serif; font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gm-primary-d); }
.rm-level { width: 68px; height: 68px; font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.55rem; }
.rm-level.is-done { background: linear-gradient(160deg, #19c3b9, #0a7d77); color: #fff; box-shadow: 0 6px 0 #06504a, 0 8px 14px rgba(6,80,74,.25); }
.rm-level.is-locked { background: #eef1f4; color: #a3adb9; box-shadow: 0 6px 0 #d6dde4; }
.rm-level.is-next { background: #fff; color: var(--gm-accent-d); box-shadow: 0 0 0 4px var(--gm-accent), 0 4px 0 4px var(--gm-accent-d), 0 10px 18px rgba(207,95,30,.3); animation: rm-pulse 1.8s ease-in-out infinite; }
.rm-level.is-next:hover { transform: translate(-50%, -50%) scale(1.08); animation: none; }
.rm-tick { position: absolute; right: -4px; top: -4px; width: 24px; height: 24px; border-radius: 50%; background: var(--gm-lime); color: #fff; font-size: .85rem; display: grid; place-items: center; box-shadow: 0 0 0 2px #fff; }
.rm-next-tag { position: absolute; top: calc(100% + 12px); font-size: .82rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gm-accent-d); background: #fff; padding: 3px 10px; border-radius: 999px; box-shadow: var(--gm-shadow); white-space: nowrap; }

.rm-badge { width: 112px; height: 112px; }
.rm-medal { position: relative; width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone-l) 55%); box-shadow: 0 0 0 5px var(--tone), 0 6px 0 5px rgba(38,48,63,.18), 0 14px 24px rgba(38,48,63,.18); }
.rm-emoji { font-size: 3rem; line-height: 1; }
.rm-badge.is-locked .rm-medal { background: #f1f3f6; box-shadow: 0 0 0 5px #d6dde4, 0 6px 0 5px #c4ccd5; }
.rm-badge.is-locked .rm-emoji { filter: grayscale(1); opacity: .35; }
.rm-badge.is-next .rm-medal { box-shadow: 0 0 0 5px var(--gm-accent), 0 6px 0 5px var(--gm-accent-d), 0 14px 24px rgba(207,95,30,.3); animation: rm-pulse 1.8s ease-in-out infinite; }
.rm-lock { position: absolute; right: 0; bottom: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--gm-slate); color: #fff; display: grid; place-items: center; box-shadow: 0 0 0 3px #fff; }
.rm-lock svg { width: 18px; height: 18px; }
.rm-lvl { position: absolute; top: calc(100% + 14px); font-family: "Oswald", sans-serif; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gm-ink-soft); background: rgba(255,255,255,.9); padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.rm-badge.is-earned::after { content: ""; position: absolute; inset: -14px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tone) 28%, transparent) 0%, transparent 70%); z-index: -1; }

.rm-label { position: absolute; transform: translateY(-50%); z-index: 3; background: var(--gm-paper); border: 1px solid var(--gm-line); border-left: 4px solid var(--tone); border-radius: var(--gm-radius); padding: 14px 18px; box-shadow: var(--gm-shadow-lg); display: flex; flex-direction: column; gap: 3px; }
.rm-label.on-left { border-left: 1px solid var(--gm-line); border-right: 4px solid var(--tone); text-align: right; }
.rm-label-eyebrow { font-family: "Oswald", sans-serif; font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gm-muted); }
.rm-label strong { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.35rem; color: var(--gm-ink); line-height: 1.2; }
.rm-label-desc { font-size: .95rem; color: var(--gm-ink-soft); }
.rm-status { margin-top: 6px; font-family: "Oswald", sans-serif; font-size: .9rem; letter-spacing: .04em; color: var(--gm-accent-d); }
.rm-status.ok { color: var(--gm-success); }

.rm-pin { position: absolute; transform: translate(-50%, calc(-50% - 14px)); z-index: 5; display: flex; flex-direction: column; align-items: center; animation: rm-bob 1.6s ease-in-out infinite; pointer-events: none; }
.rm-pin .avatar { width: 58px; height: 58px; font-size: 1.45rem; box-shadow: 0 0 0 3px #fff, 0 6px 14px rgba(38,48,63,.25); }
.rm-pin-tag { order: -1; margin-bottom: 6px; font-family: "Oswald", sans-serif; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; background: var(--gm-ink); color: #fff; padding: 4px 11px; border-radius: 999px; white-space: nowrap; }

.rm-fab { position: fixed; right: 24px; bottom: 24px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 7px 18px 7px 7px; font-size: 1.05rem; border: 0; border-radius: 999px; background: var(--gm-ink); color: #fff; font-family: "Oswald", sans-serif; letter-spacing: .05em; cursor: pointer; box-shadow: var(--gm-shadow-lg); }
.rm-fab .avatar { width: 40px; height: 40px; font-size: 1.05rem; }
.rm-fab:hover { background: var(--gm-primary-d); }
.rm-fab:focus-visible, .rm-level.is-next:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: 3px; }

@keyframes rm-pulse { 0%, 100% { filter: none; } 50% { filter: drop-shadow(0 0 10px rgba(241,128,58,.55)); } }
@keyframes rm-bob { 0%, 100% { margin-top: 0; } 50% { margin-top: -6px; } }
@media (prefers-reduced-motion: reduce) { .rm-level.is-next, .rm-badge.is-next .rm-medal, .rm-pin { animation: none; } }

@media (max-width: 640px) {
  .rm-top { gap: 10px; }
  .rm-top-brand span, .rm-bar { display: none; }
  .rm-top-brand img { width: 30px; height: 30px; }
  .rm-intro { padding: 40px 16px 28px; }
  .rm-stats { gap: 10px; }
  .rm-stats > div { padding: 14px 6px; }
  .rm-stats strong { font-size: 1.6rem; }
  .rm-stats span { font-size: .8rem; }
  .rm-medal-mini { width: 48px; height: 48px; font-size: 1.4rem; }
  .rm-road-edge { stroke-width: 34; }
  .rm-road-base { stroke-width: 28; }
  .rm-road-done { stroke-width: 23; }
  .rm-road-dots, .rm-road-done-dots { stroke-width: 5; stroke-dasharray: 0.1 16; }
  .rm-start { width: 68px; height: 68px; }
  .rm-flag { font-size: 1.5rem; margin-top: -10px; }
  .rm-start-txt { font-size: .68rem; bottom: 8px; }
  .rm-badge { width: 84px; height: 84px; }
  .rm-emoji { font-size: 2.3rem; }
  .rm-lock { width: 28px; height: 28px; }
  .rm-lock svg { width: 15px; height: 15px; }
  .rm-level { width: 52px; height: 52px; font-size: 1.2rem; }
  .rm-tick { width: 20px; height: 20px; font-size: .72rem; }
  .rm-label { padding: 10px 12px; }
  .rm-label strong { font-size: 1.1rem; }
  .rm-label-desc { display: none; }
  .rm-status { font-size: .8rem; }
  .rm-pin .avatar { width: 48px; height: 48px; font-size: 1.2rem; }
  .rm-pin-tag { font-size: .75rem; }
  .rm-zone { display: none; }
}

/* My Library: clickable badges stat card */
a.stat-card { text-decoration: none; transition: transform .15s ease, box-shadow .15s ease; }
a.stat-card:hover { transform: translateY(-2px); box-shadow: var(--gm-shadow-lg); }
a.stat-card:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: 3px; }
.stat-card .stat-cta { display: inline-block; margin-top: 6px; font-family: "Oswald", sans-serif; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: #fff; opacity: .95; }

/* ---------- current badge: homepage chip + sidebar Badge Roadmap link ---------- */
.badge-chip {
  display: inline-flex; align-items: center; gap: 12px; margin-top: 12px;
  padding: 8px 16px 8px 8px; border-radius: 999px; text-decoration: none;
  background: var(--tone-l); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  color: var(--gm-ink); transition: transform .15s ease, box-shadow .15s ease;
  max-width: 100%;
}
.badge-chip:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--gm-shadow); }
.badge-chip:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: 3px; }
.badge-chip-medal {
  width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.3rem; background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone-l) 70%);
  box-shadow: 0 0 0 3px var(--tone);
}
.badge-chip-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.badge-chip-text strong { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1rem; }
.badge-chip-text span { font-size: .8rem; color: var(--gm-ink-soft); }
.badge-chip-cta { font-family: "Oswald", sans-serif; font-size: .78rem; letter-spacing: .05em; text-transform: uppercase; color: var(--gm-primary-d); white-space: nowrap; padding-left: 4px; }
.badge-chip.no-badge { background: var(--gm-cream-deep); border-color: var(--gm-line); }
.badge-chip.no-badge .badge-chip-medal { box-shadow: 0 0 0 3px var(--gm-line); background: #fff; }
@media (max-width: 520px) { .badge-chip-cta { display: none; } }

.sidebar-badge { margin-top: 10px; }
.sidebar-badge::after { content: ""; position: absolute; top: -8px; left: 10px; right: 10px; height: 1px; background: var(--gm-line); }
.sidebar-badge-medal {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-size: 1.1rem;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone-l) 70%);
  box-shadow: 0 0 0 2px var(--tone);
  transition: transform .15s ease;
}
.sidebar-badge:hover .sidebar-badge-medal { transform: scale(1.08); }
.sidebar-badge.no-badge .sidebar-badge-medal { background: #fff; box-shadow: 0 0 0 2px var(--gm-line); }

/* Top-bar badge chip — shown only where the sidebar (and its badge item) is hidden */
.topbar-badge {
  display: none; align-items: center; gap: 6px; flex-shrink: 0;
  padding: 3px 10px 3px 3px; border-radius: 999px; text-decoration: none;
  background: var(--tone-l); border: 1px solid color-mix(in srgb, var(--tone) 35%, transparent);
  color: var(--gm-ink); margin-right: 6px;
}
.topbar-badge:hover { text-decoration: none; box-shadow: var(--gm-shadow); }
.topbar-badge:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: 2px; }
.topbar-badge-medal {
  width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone-l) 70%); box-shadow: 0 0 0 2px var(--tone);
}
.topbar-badge-name { font-family: "Oswald", sans-serif; font-weight: 600; font-size: .82rem; white-space: nowrap; }
.topbar-badge.no-badge { background: var(--gm-cream-deep); border-color: var(--gm-line); }
.topbar-badge.no-badge .topbar-badge-medal { background: #fff; box-shadow: 0 0 0 2px var(--gm-line); }
@media (max-width: 800px) {
  .topbar-badge { display: inline-flex; }
}
@media (max-width: 640px) {
  /* make room on phones: logo image stays, wordmark text hides */
  .topbar { gap: 10px; padding: 0 12px; }
  .topbar-brand .brand-text { display: none; }
  .topbar-brand img { height: 38px; }
  .topbar-actions { gap: 2px; }
  .topbar-actions .iconbtn { width: 36px; height: 36px; }
  .topbar-actions .logout-text { padding: 6px 8px; font-size: .85rem; }
}
@media (max-width: 400px) {
  .topbar-badge { padding: 3px; }
  .topbar-badge-name { display: none; }
}

/* ---------- mobile menu (drawer) — ≤800px, where the sidebar is hidden ---------- */
.topbar-menu { display: none; flex-shrink: 0; }
.topbar-menu svg { width: 22px; height: 22px; stroke-width: 1.8; }
.mobile-menu, .mm-backdrop { display: none; }
@media (max-width: 800px) {
  .topbar-menu { display: flex; margin-right: -6px; }
  .mm-backdrop { display: block; position: fixed; inset: 0; z-index: 60; background: rgba(38,48,63,.4); opacity: 0; transition: opacity .2s ease; }
  .mm-backdrop.open { opacity: 1; }
  .mobile-menu {
    display: flex; flex-direction: column; position: fixed; top: 0; bottom: 0; left: 0; z-index: 61;
    width: min(320px, 86vw); background: var(--gm-paper); box-shadow: var(--gm-shadow-lg);
    transform: translateX(-100%); transition: transform .22s ease; overflow-y: auto; overscroll-behavior: contain;
  }
  .mobile-menu.open { transform: none; }
  .mobile-menu[hidden], .mm-backdrop[hidden] { display: none; }
  html.mm-lock, html.mm-lock body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) { .mobile-menu, .mm-backdrop { transition: none; } }
.mm-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--gm-line); position: relative; }
.mm-head::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--gm-gradient); }
.mm-brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--gm-ink); font-family: "Oswald", sans-serif; font-weight: 700; font-size: 1.15rem; }
.mm-brand img { height: 36px; width: auto; border-radius: 8px; }
.mm-brand:hover { text-decoration: none; }
.mm-user { display: flex; align-items: center; gap: 12px; padding: 18px 16px 10px; min-width: 0; }
.mm-user > div { display: flex; flex-direction: column; min-width: 0; }
.mm-user strong { font-family: "Oswald", sans-serif; font-weight: 600; font-size: 1.05rem; }
.mm-user span { font-size: .8rem; color: var(--gm-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mm-links { list-style: none; margin: 0; padding: 6px 10px; display: flex; flex-direction: column; gap: 2px; }
.mm-link {
  display: flex; align-items: center; gap: 14px; min-height: 46px; padding: 0 12px; border-radius: 10px;
  color: var(--gm-ink-soft); text-decoration: none; font-size: .98rem;
}
.mm-link svg { width: 20px; height: 20px; stroke-width: 1.6; flex-shrink: 0; }
.mm-link:hover { background: var(--gm-cream-deep); color: var(--gm-ink); text-decoration: none; }
.mm-link.active { background: var(--gm-primary-l); color: var(--gm-primary-d); font-weight: 500; }
.mm-link:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: -3px; }
.mm-badge { margin-top: 8px; padding: 10px 12px; position: relative; }
.mm-badge::before { content: ""; position: absolute; top: -5px; left: 12px; right: 12px; height: 1px; background: var(--gm-line); }
.mm-badge-medal {
  width: 36px; height: 36px; flex-shrink: 0; margin-left: -8px; margin-right: -6px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem;
  background: radial-gradient(circle at 35% 30%, #fff 0%, var(--tone-l) 70%); box-shadow: 0 0 0 2px var(--tone);
}
.mm-badge.no-badge .mm-badge-medal { background: #fff; box-shadow: 0 0 0 2px var(--gm-line); }
.mm-badge-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.mm-badge-text small { font-size: .78rem; color: var(--gm-muted); }
.mm-foot { margin-top: auto; padding: 10px; border-top: 1px solid var(--gm-line); display: flex; flex-direction: column; gap: 2px; }
@media (max-width: 640px) {
  /* the menu has My Library, so its top-bar shortcut makes way for the menu button */
  .topbar-actions .topbar-library { display: none; }
  .topbar { gap: 8px; }
}

/* ---------- certificate editor: ranges, logo + signatory lists ---------- */
.ct-range label { display: flex; justify-content: space-between; align-items: baseline; }
.ct-range output { font-family: "Oswald", sans-serif; font-size: .82rem; color: var(--gm-primary-d); font-variant-numeric: tabular-nums; }
.ct-range input[type=range] { width: 100%; accent-color: var(--gm-primary); }
.ct-range input[type=range]:disabled { opacity: .45; }
.ct-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.ct-item { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border: 1px solid var(--gm-line); border-radius: var(--gm-radius-sm); background: var(--gm-cream); min-width: 0; }
.ct-thumb { width: 44px; height: 32px; object-fit: contain; background: #fff; border-radius: 6px; border: 1px solid var(--gm-line-soft); flex-shrink: 0; }
.ct-item-name { flex: 1; min-width: 0; font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ct-item-actions { display: flex; gap: 2px; flex-shrink: 0; }
.ct-item-actions .btn { padding-left: 8px; padding-right: 8px; }
.ct-upload { position: relative; overflow: hidden; cursor: pointer; }
.ct-upload input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.ct-upload:focus-within { outline: 3px solid var(--gm-primary); outline-offset: 2px; }
.ct-sig-card { border: 1px solid var(--gm-line); border-radius: var(--gm-radius-sm); padding: 12px; background: var(--gm-cream); }
.ct-sig-num { font-family: "Oswald", sans-serif; font-weight: 600; font-size: .9rem; }

/* password field with show/hide toggle; live match hint */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 64px; }
.pw-toggle { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); font-size: .82rem; }
.hint.hint-ok { color: var(--gm-success); }
.hint.hint-bad { color: var(--gm-danger); }

/* email viewer (admin outbox, verify page demo copy) */
.email-meta { display: grid; gap: 4px; font-size: .85rem; padding: 10px 12px; background: var(--gm-cream); border: 1px solid var(--gm-line); border-radius: var(--gm-radius-sm); margin-bottom: 12px; }
.email-meta span { display: inline-block; min-width: 44px; color: var(--gm-muted); font-family: "Oswald", sans-serif; text-transform: uppercase; font-size: .72rem; letter-spacing: .05em; margin-right: 8px; }
.email-body { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .92rem; line-height: 1.6; padding: 14px; border: 1px solid var(--gm-line); border-radius: var(--gm-radius-sm); background: var(--gm-paper); max-height: 50vh; overflow-y: auto; }
/* simple on/off switch */
.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-family: "Oswald", sans-serif; font-size: .85rem; }
.switch input { appearance: none; -webkit-appearance: none; width: 40px; height: 22px; border-radius: 999px; background: var(--gm-line); position: relative; cursor: pointer; transition: background .15s ease; margin: 0; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: var(--gm-shadow-sm); transition: transform .15s ease; }
.switch input:checked { background: var(--gm-primary); }
.switch input:checked::after { transform: translateX(18px); }
.switch input:focus-visible { outline: 3px solid var(--gm-primary); outline-offset: 2px; }

/* ---------- verify email ---------- */
.code-input { font-family: "Oswald", sans-serif; font-size: 1.6rem; letter-spacing: .5em; text-align: center; padding-left: .5em; font-variant-numeric: tabular-nums; }
.verify-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 14px; font-size: .88rem; }
.verify-actions .btn-link:disabled { color: var(--gm-muted); cursor: default; text-decoration: none; }
.verify-done { text-align: center; }
.verify-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; margin: 0 auto 14px; font-size: 1.8rem; }
.verify-icon.ok { background: var(--gm-lime-l); color: var(--gm-success); box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--gm-lime); }
.demo-inbox { margin-top: 22px; padding: 12px 14px; border: 1px dashed var(--gm-line); border-radius: var(--gm-radius-sm); background: var(--gm-cream); }
.demo-inbox summary { cursor: pointer; font-family: "Oswald", sans-serif; font-size: .85rem; letter-spacing: .04em; text-transform: uppercase; color: var(--gm-ink-soft); }
.demo-inbox .email-body { max-height: 260px; font-size: .85rem; }

/* long free-text cells may wrap inside otherwise single-line admin tables */
.table-wrap table.gm-table td.td-wrap { white-space: normal; min-width: 240px; }

/* course pages (API) */
@media (max-width: 800px) {
  .course-grid { grid-template-columns: 1fr !important; gap: 20px !important; }
  .course-grid aside .card { position: static !important; }
}
.att-table td { vertical-align: middle; }
.att-table input[type=number] { padding: 6px 8px; }
