:root {
  --nsc5-green-950: #052e22;
  --nsc5-green-900: #064e3b;
  --nsc5-green-800: #075f46;
  --nsc5-green-700: #087451;
  --nsc5-green-100: #dff7ed;
  --nsc5-green-50: #f0fbf6;
  --nsc5-ink: #122019;
  --nsc5-text: #25362e;
  --nsc5-muted: #5b6b63;
  --nsc5-border: #d9e3dd;
  --nsc5-soft: #f4f7f5;
  --nsc5-surface: #ffffff;
  --nsc5-warn: #8a4b08;
  --nsc5-warn-bg: #fff7e6;
  --nsc5-danger: #9f1d27;
  --nsc5-shadow: 0 16px 45px rgba(15, 36, 26, .08);
  --nsc5-radius: 18px;
  --nsc5-topbar: 72px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --nsc5-green-950: #d8f7e8;
    --nsc5-green-900: #3dd79b;
    --nsc5-green-800: #4ee3aa;
    --nsc5-green-700: #6cebbb;
    --nsc5-green-100: #173d31;
    --nsc5-green-50: #122c24;
    --nsc5-ink: #f2faf6;
    --nsc5-text: #d5e2dc;
    --nsc5-muted: #aebeb6;
    --nsc5-border: #31453b;
    --nsc5-soft: #142019;
    --nsc5-surface: #0d1712;
    --nsc5-warn: #ffd08a;
    --nsc5-warn-bg: #3b2a11;
    --nsc5-danger: #ff9ba4;
    --nsc5-shadow: 0 18px 50px rgba(0, 0, 0, .28);
  }
}

html[data-theme="dark"], body.dark-mode, body.nsc-dark-mode {
  --nsc5-green-950: #d8f7e8;
  --nsc5-green-900: #3dd79b;
  --nsc5-green-800: #4ee3aa;
  --nsc5-green-700: #6cebbb;
  --nsc5-green-100: #173d31;
  --nsc5-green-50: #122c24;
  --nsc5-ink: #f2faf6;
  --nsc5-text: #d5e2dc;
  --nsc5-muted: #aebeb6;
  --nsc5-border: #31453b;
  --nsc5-soft: #142019;
  --nsc5-surface: #0d1712;
  --nsc5-warn: #ffd08a;
  --nsc5-warn-bg: #3b2a11;
  --nsc5-danger: #ff9ba4;
}

.nsc5-document {
  margin: 0;
  background: var(--nsc5-soft);
  color: var(--nsc5-text);
}

.nsc5-app,
.nsc5-app * {
  box-sizing: border-box;
}

.nsc5-app {
  min-height: 100vh;
  background: var(--nsc5-soft);
  color: var(--nsc5-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}


.nsc5-app .screen-reader-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.nsc5-app a {
  color: var(--nsc5-green-800);
  text-decoration-thickness: .3px;
  text-underline-offset: .18em;
}

.nsc5-app a:hover {
  color: var(--nsc5-green-950);
}

.nsc5-app :focus-visible {
  outline: 3px solid #f1b600;
  outline-offset: 3px;
}

.nsc5-skip {
  position: fixed;
  z-index: 99999;
  top: 10px;
  left: 10px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 10px;
  background: #fff;
  color: #111 !important;
  font-weight: 800;
}

.nsc5-skip:focus { transform: translateY(0); }

.nsc5-topbar {
  position: sticky;
  z-index: 1000;
  top: 0;
  min-height: var(--nsc5-topbar);
  border-bottom: 1px solid var(--nsc5-border);
  background: color-mix(in srgb, var(--nsc5-surface) 94%, transparent);
  backdrop-filter: blur(14px);
}

.admin-bar .nsc5-topbar { top: 32px; }

.nsc5-topbar-inner {
  display: grid;
  grid-template-columns: minmax(210px, 280px) minmax(280px, 680px) auto;
  gap: 28px;
  align-items: center;
  width: min(1500px, calc(100% - 40px));
  min-height: var(--nsc5-topbar);
  margin: 0 auto;
}

.nsc5-brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--nsc5-ink) !important;
  text-decoration: none !important;
}

.nsc5-brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 13px;
  background: #064e3b;
  color: #fff;
  font-size: 20px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.16);
}

.nsc5-brand strong,
.nsc5-brand small { display: block; }
.nsc5-brand strong { font-size: 15px; line-height: 1.15; }
.nsc5-brand small { margin-top: 2px; color: var(--nsc5-muted); font-size: 12px; }

.nsc5-global-search {
  position: relative;
  display: flex;
  align-items: center;
}

.nsc5-global-search svg {
  position: absolute;
  left: 15px;
  width: 19px;
  fill: none;
  stroke: var(--nsc5-muted);
  stroke-width: 2;
  pointer-events: none;
}

.nsc5-global-search input {
  width: 100%;
  min-height: 44px;
  padding: 9px 15px 9px 44px;
  border: 1px solid var(--nsc5-border);
  border-radius: 14px;
  background: var(--nsc5-soft);
  color: var(--nsc5-ink);
  font: inherit;
}

.nsc5-global-search input::placeholder,
.nsc5-form input::placeholder,
.nsc5-form textarea::placeholder,
.nsc5-course-search input::placeholder { color: color-mix(in srgb, var(--nsc5-muted) 92%, transparent); opacity: 1; }

.nsc5-top-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.nsc5-icon-button,
.nsc5-avatar {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--nsc5-border);
  border-radius: 50%;
  background: var(--nsc5-surface);
  color: var(--nsc5-ink) !important;
  text-decoration: none !important;
}

.nsc5-icon-button svg {
  width: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
}

.nsc5-avatar {
  border-color: #075f46;
  background: #075f46;
  color: #fff !important;
  font-weight: 850;
}

.nsc5-login {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 18px;
  border-radius: 12px;
  background: #064e3b;
  color: #fff !important;
  font-weight: 800;
  text-decoration: none !important;
}

.nsc5-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 790px) minmax(250px, 310px);
  gap: 30px;
  align-items: start;
  width: min(1500px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

.nsc5-sidebar,
.nsc5-context {
  position: sticky;
  top: calc(var(--nsc5-topbar) + 28px);
}

.admin-bar .nsc5-sidebar,
.admin-bar .nsc5-context { top: calc(var(--nsc5-topbar) + 60px); }

.nsc5-nav-list { display: grid; gap: 4px; }

.nsc5-nav-item {
  display: flex;
  min-height: 46px;
  align-items: center;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 12px;
  color: var(--nsc5-text) !important;
  font-size: 14px;
  font-weight: 720;
  text-decoration: none !important;
}

.nsc5-nav-item svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.nsc5-nav-item:hover { background: var(--nsc5-green-50); }
.nsc5-nav-item.is-active { background: var(--nsc5-green-100); color: var(--nsc5-green-950) !important; }

.nsc5-sidebar-note {
  margin-top: 28px;
  padding: 18px;
  border: 1px solid var(--nsc5-border);
  border-radius: 16px;
  background: var(--nsc5-surface);
}
.nsc5-sidebar-note strong { color: var(--nsc5-ink); font-size: 14px; }
.nsc5-sidebar-note p { margin: 7px 0 0; color: var(--nsc5-muted); font-size: 13px; line-height: 1.55; }
.nsc5-back-link { display: inline-block; margin: 17px 12px 0; color: var(--nsc5-muted) !important; font-size: 12px; }

.nsc5-main { min-width: 0; }

.nsc5-hero,
.nsc5-course-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: clamp(24px, 5vw, 48px);
  border: 1px solid var(--nsc5-border);
  border-radius: 24px;
  background: var(--nsc5-surface);
  box-shadow: var(--nsc5-shadow);
}

.nsc5-hero h1,
.nsc5-page-head h1,
.nsc5-course-hero h1,
.nsc5-thread-detail h1,
.nsc5-login-gate h1 {
  margin: 8px 0 12px;
  color: var(--nsc5-ink);
  font-size: clamp(31px, 4.5vw, 52px);
  line-height: 1.04;
  letter-spacing: -.035em;
}

.nsc5-course-hero h1 { font-size: clamp(29px, 4vw, 45px); }
.nsc5-thread-detail h1 { font-size: clamp(28px, 4vw, 44px); }

.nsc5-hero p,
.nsc5-page-head p,
.nsc5-course-hero p,
.nsc5-login-gate p {
  max-width: 660px;
  margin: 0;
  color: var(--nsc5-muted);
  font-size: 17px;
}

.nsc5-eyebrow {
  display: inline-block;
  color: var(--nsc5-green-800);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .12em;
  line-height: 1.2;
  text-transform: uppercase;
}

.nsc5-primary {
  display: inline-flex;
  min-height: 46px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  padding: 10px 19px;
  border: 1px solid #064e3b;
  border-radius: 13px;
  background: #064e3b;
  color: #fff !important;
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none !important;
  cursor: pointer;
}

.nsc5-primary:hover { background: #043d2e; color: #fff !important; }
.nsc5-primary[disabled] { cursor: wait; opacity: .68; }

.nsc5-attention,
.nsc5-section { margin-top: 34px; }

.nsc5-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}

.nsc5-section-head h2,
.nsc5-context-card h2 {
  margin: 4px 0 0;
  color: var(--nsc5-ink);
  font-size: 22px;
  line-height: 1.2;
  letter-spacing: -.015em;
}

.nsc5-section-head > a { font-size: 13px; font-weight: 750; }

.nsc5-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.nsc5-stat-card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--nsc5-border);
  border-radius: 16px;
  background: var(--nsc5-surface);
}
.nsc5-stat-card > strong { color: var(--nsc5-ink); font-size: 30px; line-height: 1; }
.nsc5-stat-card p { min-height: 48px; margin: 9px 0 12px; color: var(--nsc5-muted); font-size: 13px; line-height: 1.45; }
.nsc5-stat-card a { font-size: 12px; font-weight: 800; }

.nsc5-thread-list { display: grid; gap: 13px; }
.nsc5-thread-card {
  padding: 22px 24px;
  border: 1px solid var(--nsc5-border);
  border-radius: 18px;
  background: var(--nsc5-surface);
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.nsc5-thread-card:hover { border-color: color-mix(in srgb, var(--nsc5-green-800) 48%, var(--nsc5-border)); box-shadow: 0 12px 32px rgba(15, 36, 26, .06); transform: translateY(-1px); }
.nsc5-thread-card-top,
.nsc5-thread-card-foot,
.nsc5-thread-meta {
  display: flex;
  align-items: center;
  gap: 9px;
}
.nsc5-thread-card-top { justify-content: space-between; }
.nsc5-thread-card h3 { margin: 11px 0 7px; color: var(--nsc5-ink); font-size: 20px; line-height: 1.28; }
.nsc5-thread-card h3 a { color: inherit !important; text-decoration: none !important; }
.nsc5-thread-card p { margin: 0; color: var(--nsc5-muted); font-size: 14px; }
.nsc5-thread-card-foot { flex-wrap: wrap; margin-top: 16px; color: var(--nsc5-muted); font-size: 12px; }
.nsc5-thread-card-foot span + span::before { content: "·"; margin-right: 9px; }
.nsc5-reason { color: var(--nsc5-muted); font-size: 11px; font-weight: 700; text-align: right; }

.nsc5-type-badge,
.nsc5-course-code {
  display: inline-flex;
  min-height: 25px;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--nsc5-green-100);
  color: var(--nsc5-green-950) !important;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .04em;
  text-decoration: none !important;
  text-transform: uppercase;
}
.nsc5-type-badge.is-announcement { background: var(--nsc5-warn-bg); color: var(--nsc5-warn) !important; }
.nsc5-type-badge.is-resource { background: #eaf0ff; color: #23408d !important; }
@media (prefers-color-scheme: dark) { .nsc5-type-badge.is-resource { background: #1d2d54; color: #c9d7ff !important; } }

.nsc5-caught-up {
  display: flex;
  gap: 13px;
  align-items: flex-start;
  margin-top: 20px;
  padding: 18px 20px;
  border: 1px dashed var(--nsc5-border);
  border-radius: 16px;
  color: var(--nsc5-muted);
}
.nsc5-caught-up > span { display: grid; width: 28px; height: 28px; place-items: center; border-radius: 50%; background: var(--nsc5-green-100); color: var(--nsc5-green-950); font-weight: 900; }
.nsc5-caught-up strong { color: var(--nsc5-ink); }
.nsc5-caught-up p { margin: 2px 0 0; font-size: 13px; }

.nsc5-context { display: grid; gap: 13px; }
.nsc5-context-card {
  padding: 19px;
  border: 1px solid var(--nsc5-border);
  border-radius: 17px;
  background: var(--nsc5-surface);
}
.nsc5-context-card h2 { font-size: 18px; }
.nsc5-context-card p { margin: 9px 0 12px; color: var(--nsc5-muted); font-size: 13px; line-height: 1.55; }
.nsc5-context-card a { font-size: 12px; font-weight: 800; }
.nsc5-context-muted { background: transparent; border-style: dashed; }
.nsc5-context-muted strong { color: var(--nsc5-ink); }

.nsc5-page-head { margin-bottom: 26px; padding: 18px 0 8px; }
.nsc5-page-head h1 { font-size: clamp(30px, 4vw, 45px); }

.nsc5-intent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.nsc5-intent-card {
  display: block;
  min-height: 130px;
  padding: 19px;
  border: 1px solid var(--nsc5-border);
  border-radius: 17px;
  background: var(--nsc5-surface);
  color: var(--nsc5-text) !important;
  text-decoration: none !important;
}
.nsc5-intent-card strong { display: block; color: var(--nsc5-ink); font-size: 16px; }
.nsc5-intent-card span { display: block; margin-top: 8px; color: var(--nsc5-muted); font-size: 13px; line-height: 1.5; }
.nsc5-intent-card.is-active { border-color: var(--nsc5-green-800); background: var(--nsc5-green-50); box-shadow: inset 0 0 0 1px var(--nsc5-green-800); }

.nsc5-form-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--nsc5-border);
  border-radius: 22px;
  background: var(--nsc5-surface);
}
.nsc5-form { display: grid; gap: 18px; }
.nsc5-form label { display: grid; gap: 7px; color: var(--nsc5-ink); font-size: 13px; font-weight: 800; }
.nsc5-form label small { color: var(--nsc5-muted); font-weight: 500; }
.nsc5-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.nsc5-form input,
.nsc5-form textarea,
.nsc5-form select,
.nsc5-course-search input {
  width: 100%;
  min-height: 45px;
  padding: 10px 12px;
  border: 1px solid var(--nsc5-border);
  border-radius: 11px;
  background: var(--nsc5-soft);
  color: var(--nsc5-ink);
  font: inherit;
  font-size: 14px;
}
.nsc5-form textarea { min-height: 100px; resize: vertical; }
.nsc5-form input:focus,
.nsc5-form textarea:focus,
.nsc5-form select:focus,
.nsc5-course-search input:focus,
.nsc5-global-search input:focus { border-color: var(--nsc5-green-800); }

.nsc5-form-notice,
.nsc5-foundation-callout {
  padding: 15px 17px;
  border: 1px solid color-mix(in srgb, var(--nsc5-warn) 35%, var(--nsc5-border));
  border-radius: 13px;
  background: var(--nsc5-warn-bg);
  color: var(--nsc5-warn);
  font-size: 13px;
}
.nsc5-form-status { min-height: 1px; color: var(--nsc5-muted); font-size: 13px; }
.nsc5-form-status.is-error { color: var(--nsc5-danger); font-weight: 700; }
.nsc5-form-status.is-success { color: var(--nsc5-green-800); font-weight: 800; }

.nsc5-duplicates {
  padding: 15px;
  border: 1px solid var(--nsc5-border);
  border-radius: 13px;
  background: var(--nsc5-green-50);
}
.nsc5-duplicates strong { display: block; color: var(--nsc5-ink); }
.nsc5-duplicates ul { margin: 9px 0 0; padding-left: 18px; }
.nsc5-duplicates li + li { margin-top: 7px; }

.nsc5-course-search { display: flex; gap: 10px; margin-bottom: 20px; }
.nsc5-course-search button {
  min-width: 100px;
  border: 1px solid var(--nsc5-border);
  border-radius: 11px;
  background: var(--nsc5-surface);
  color: var(--nsc5-ink);
  font-weight: 800;
  cursor: pointer;
}
.nsc5-course-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.nsc5-course-card {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid var(--nsc5-border);
  border-radius: 18px;
  background: var(--nsc5-surface);
}
.nsc5-course-card h2 { margin: 12px 0 7px; color: var(--nsc5-ink); font-size: 20px; line-height: 1.25; }
.nsc5-course-card h2 a { color: inherit !important; text-decoration: none !important; }
.nsc5-course-card p { margin: 0; color: var(--nsc5-muted); font-size: 13px; }
.nsc5-course-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 24px; color: var(--nsc5-muted); font-size: 11px; }
.nsc5-follow-button {
  min-height: 35px;
  padding: 6px 12px;
  border: 1px solid var(--nsc5-green-800);
  border-radius: 10px;
  background: transparent;
  color: var(--nsc5-green-800);
  font-weight: 850;
  cursor: pointer;
}
.nsc5-follow-button.is-following { background: var(--nsc5-green-100); color: var(--nsc5-green-950); }

.nsc5-course-hero { align-items: center; }
.nsc5-tabs { display: flex; gap: 6px; overflow-x: auto; margin: 18px 0 0; padding: 6px; border: 1px solid var(--nsc5-border); border-radius: 13px; background: var(--nsc5-surface); scrollbar-width: thin; }
.nsc5-tabs a { flex: 0 0 auto; padding: 7px 11px; border-radius: 9px; color: var(--nsc5-muted) !important; font-size: 12px; font-weight: 800; text-decoration: none !important; }
.nsc5-tabs a.is-active { background: var(--nsc5-green-100); color: var(--nsc5-green-950) !important; }
.nsc5-foundation-callout { margin-top: 24px; }
.nsc5-foundation-callout p { margin: 5px 0 0; }

.nsc5-thread-detail {
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--nsc5-border);
  border-radius: 22px;
  background: var(--nsc5-surface);
}
.nsc5-thread-detail .nsc5-byline { margin: 0; color: var(--nsc5-muted); font-size: 13px; }
.nsc5-thread-body { margin-top: 28px; color: var(--nsc5-text); font-size: 16px; }
.nsc5-thread-body p:last-child { margin-bottom: 0; }
.nsc5-answers { margin-top: 28px; }
.nsc5-answer { padding: 22px; border: 1px solid var(--nsc5-border); border-radius: 17px; background: var(--nsc5-surface); }
.nsc5-answer + .nsc5-answer { margin-top: 12px; }
.nsc5-answer-head { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--nsc5-border); color: var(--nsc5-muted); font-size: 12px; }
.nsc5-answer-head strong { color: var(--nsc5-ink); }
.nsc5-answer-form { margin-top: 18px; padding: 22px; border: 1px solid var(--nsc5-border); border-radius: 17px; background: var(--nsc5-surface); }
.nsc5-login-inline { margin-top: 16px; padding: 17px; border: 1px dashed var(--nsc5-border); border-radius: 13px; text-align: center; }

.nsc5-empty,
.nsc5-placeholder,
.nsc5-login-gate {
  padding: clamp(30px, 6vw, 60px);
  border: 1px dashed var(--nsc5-border);
  border-radius: 20px;
  background: var(--nsc5-surface);
  text-align: center;
}
.nsc5-empty strong,
.nsc5-placeholder strong { display: block; color: var(--nsc5-ink); font-size: 18px; }
.nsc5-empty p,
.nsc5-placeholder p { max-width: 550px; margin: 8px auto 14px; color: var(--nsc5-muted); }
.nsc5-placeholder > span { display: grid; width: 52px; height: 52px; place-items: center; margin: 0 auto 15px; border-radius: 16px; background: var(--nsc5-green-100); color: var(--nsc5-green-950); }
.nsc5-placeholder svg { width: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.nsc5-login-gate h1 { font-size: clamp(29px, 5vw, 43px); }
.nsc5-login-gate .nsc5-primary { margin-top: 22px; }
.nsc5-page-actions { margin: -8px 0 20px; }

.nsc5-mobile-nav { display: none; }

@media (max-width: 1220px) {
  .nsc5-layout { grid-template-columns: 210px minmax(0, 1fr); }
  .nsc5-context { display: none; }
  .nsc5-topbar-inner { grid-template-columns: 210px minmax(240px, 1fr) auto; }
}

@media (max-width: 782px) {
  :root { --nsc5-topbar: 64px; }
  .admin-bar .nsc5-topbar { top: 46px; }
  .nsc5-topbar-inner {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    width: calc(100% - 24px);
  }
  .nsc5-brand-mark { width: 38px; height: 38px; border-radius: 11px; }
  .nsc5-brand strong { font-size: 14px; }
  .nsc5-brand small { display: none; }
  .nsc5-global-search { display: none; }
  .nsc5-layout { display: block; width: min(100% - 24px, 760px); padding: 18px 0 100px; }
  .nsc5-sidebar { display: none; }
  .nsc5-mobile-nav {
    position: fixed;
    z-index: 1000;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--nsc5-border);
    background: color-mix(in srgb, var(--nsc5-surface) 96%, transparent);
    backdrop-filter: blur(16px);
  }
  .nsc5-mobile-nav .nsc5-nav-list { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; }
  .nsc5-mobile-nav .nsc5-nav-item { min-height: 56px; flex-direction: column; justify-content: center; gap: 2px; padding: 5px 2px; font-size: 10px; }
  .nsc5-mobile-nav .nsc5-nav-item svg { width: 20px; height: 20px; }
  .nsc5-hero,
  .nsc5-course-hero { align-items: flex-start; flex-direction: column; padding: 26px 22px; border-radius: 20px; }
  .nsc5-hero h1,
  .nsc5-page-head h1,
  .nsc5-course-hero h1,
  .nsc5-thread-detail h1 { font-size: clamp(29px, 10vw, 42px); }
  .nsc5-hero p,
  .nsc5-page-head p,
  .nsc5-course-hero p { font-size: 15px; }
  .nsc5-primary { width: 100%; }
  .nsc5-stat-grid,
  .nsc5-intent-grid,
  .nsc5-course-grid,
  .nsc5-field-grid { grid-template-columns: 1fr; }
  .nsc5-stat-card p { min-height: 0; }
  .nsc5-thread-card { padding: 19px; }
  .nsc5-thread-card-top { align-items: flex-start; }
  .nsc5-reason { max-width: 42%; }
  .nsc5-thread-card h3 { font-size: 18px; }
  .nsc5-course-search { flex-direction: column; }
  .nsc5-course-search button { min-height: 44px; }
  .nsc5-course-card { min-height: 190px; }
  .nsc5-course-card-foot { align-items: flex-end; }
  .nsc5-section-head { align-items: flex-start; flex-direction: column; gap: 6px; }
  .nsc5-form-card { padding: 21px 18px; }
  .nsc5-thread-detail { padding: 24px 20px; }
}

@media (max-width: 420px) {
  .nsc5-top-actions { gap: 6px; }
  .nsc5-icon-button,
  .nsc5-avatar { width: 38px; height: 38px; }
  .nsc5-layout { width: calc(100% - 18px); }
  .nsc5-hero,
  .nsc5-course-hero { padding: 23px 18px; }
  .nsc5-thread-card { padding: 17px; }
  .nsc5-thread-card-top { display: block; }
  .nsc5-reason { display: block; max-width: none; margin-top: 8px; text-align: left; }
  .nsc5-thread-card-foot { gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .nsc5-app *, .nsc5-app *::before, .nsc5-app *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* Community 5.0.1 — guarded operational compatibility destinations. */
.nsc5-operational-tools { margin-top: 28px; }
.nsc5-tool-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.nsc5-tool-grid > a {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 18px;
  border: 1px solid var(--nsc5-border);
  border-radius: 15px;
  background: var(--nsc5-surface);
  color: var(--nsc5-ink);
  text-decoration-thickness: .3px;
  text-underline-offset: 3px;
}
.nsc5-tool-grid > a:hover { border-color: var(--nsc5-green-700); background: var(--nsc5-green-50); }
.nsc5-tool-grid > a strong { font-size: 16px; }
.nsc5-tool-grid > a span { color: var(--nsc5-muted); font-size: 13px; }

@media (max-width: 782px) {
  .nsc5-tool-grid { grid-template-columns: 1fr; }
  .nsc5-tool-grid > a { min-height: 82px; }
}

/* ========================================================================
 * Community 5.0.2 — accessibility colour system and theme isolation
 *
 * The NOUNUniversity theme owns the site-level colour preference through
 * html[data-theme="dark"]. Student Commons now follows that explicit state
 * instead of applying a second, independent prefers-color-scheme decision.
 * The scoped !important declarations below intentionally protect the
 * full-screen application from broad theme typography/form selectors.
 * ====================================================================== */

body.nsc5-document,
body.nsc5-document .nsc5-app {
  --nsc5-canvas: #f2f6f3;
  --nsc5-green-950: #084b37;
  --nsc5-green-900: #075c42;
  --nsc5-green-800: #086b4b;
  --nsc5-green-700: #0a7854;
  --nsc5-green-100: #d8f3e7;
  --nsc5-green-50: #edf9f4;
  --nsc5-ink: #10251b;
  --nsc5-text: #263a30;
  --nsc5-muted: #52665c;
  --nsc5-border: #bfcfc6;
  --nsc5-soft: #f2f6f3;
  --nsc5-surface: #ffffff;
  --nsc5-surface-2: #f8fbf9;
  --nsc5-input: #f8fbf9;
  --nsc5-link: #086b4b;
  --nsc5-link-hover: #064c37;
  --nsc5-button: #075c42;
  --nsc5-button-hover: #054632;
  --nsc5-warn: #7a4300;
  --nsc5-warn-bg: #fff5dc;
  --nsc5-danger: #9b1c28;
  --nsc5-danger-bg: #fff0f1;
  --nsc5-focus: #8a5b00;
  --nsc5-shadow: 0 16px 45px rgba(15, 36, 26, .10);
  color-scheme: light;
}

html[data-theme="dark"] body.nsc5-document,
html[data-theme="dark"] body.nsc5-document .nsc5-app,
body.nsc5-document.dark-mode,
body.nsc5-document.dark-mode .nsc5-app,
body.nsc5-document.nsc-dark-mode,
body.nsc5-document.nsc-dark-mode .nsc5-app {
  --nsc5-canvas: #07130e;
  --nsc5-green-950: #dcfff0;
  --nsc5-green-900: #b4f7d6;
  --nsc5-green-800: #72e6b5;
  --nsc5-green-700: #5bd3a0;
  --nsc5-green-100: #193d30;
  --nsc5-green-50: #112d23;
  --nsc5-ink: #f5fcf8;
  --nsc5-text: #dce9e2;
  --nsc5-muted: #aebfb6;
  --nsc5-border: #496157;
  --nsc5-soft: #07130e;
  --nsc5-surface: #0f1f18;
  --nsc5-surface-2: #142820;
  --nsc5-input: #12251d;
  --nsc5-link: #72e6b5;
  --nsc5-link-hover: #b4f7d6;
  --nsc5-button: #0b6b4a;
  --nsc5-button-hover: #0a6245;
  --nsc5-warn: #ffd28c;
  --nsc5-warn-bg: #3b2b12;
  --nsc5-danger: #ffadb5;
  --nsc5-danger-bg: #401b20;
  --nsc5-focus: #ffd166;
  --nsc5-shadow: 0 18px 50px rgba(0, 0, 0, .34);
  color-scheme: dark;
}

html body.nsc5-document {
  background: var(--nsc5-canvas) !important;
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-app {
  background: var(--nsc5-canvas) !important;
  color: var(--nsc5-text) !important;
}

/* Typography isolation: broad theme rules must not repaint application text. */
html body.nsc5-document .nsc5-app :where(h1, h2, h3, h4, h5, h6) {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-app :where(p, li, dd, dt) {
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-app :where(strong, b) {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-app a:not(.nsc5-primary):not(.nsc5-login):not(.nsc5-brand):not(.nsc5-icon-button):not(.nsc5-avatar):not(.nsc5-nav-item):not(.nsc5-intent-card):not(.nsc5-type-badge):not(.nsc5-course-code) {
  color: var(--nsc5-link) !important;
}

html body.nsc5-document .nsc5-app a:not(.nsc5-primary):not(.nsc5-login):not(.nsc5-brand):not(.nsc5-icon-button):not(.nsc5-avatar):not(.nsc5-nav-item):not(.nsc5-intent-card):not(.nsc5-type-badge):not(.nsc5-course-code):hover,
html body.nsc5-document .nsc5-app a:not(.nsc5-primary):not(.nsc5-login):not(.nsc5-brand):not(.nsc5-icon-button):not(.nsc5-avatar):not(.nsc5-nav-item):not(.nsc5-intent-card):not(.nsc5-type-badge):not(.nsc5-course-code):focus-visible {
  color: var(--nsc5-link-hover) !important;
}

html body.nsc5-document .nsc5-app :focus-visible {
  outline-color: var(--nsc5-focus) !important;
}

/* Primary application surfaces. */
html body.nsc5-document .nsc5-topbar,
html body.nsc5-document .nsc5-mobile-nav {
  background: var(--nsc5-surface) !important;
  border-color: var(--nsc5-border) !important;
}

html body.nsc5-document .nsc5-hero,
html body.nsc5-document .nsc5-course-hero,
html body.nsc5-document .nsc5-sidebar-note,
html body.nsc5-document .nsc5-stat-card,
html body.nsc5-document .nsc5-thread-card,
html body.nsc5-document .nsc5-context-card,
html body.nsc5-document .nsc5-intent-card,
html body.nsc5-document .nsc5-form-card,
html body.nsc5-document .nsc5-course-card,
html body.nsc5-document .nsc5-tabs,
html body.nsc5-document .nsc5-thread-detail,
html body.nsc5-document .nsc5-answer,
html body.nsc5-document .nsc5-answer-form,
html body.nsc5-document .nsc5-empty,
html body.nsc5-document .nsc5-placeholder,
html body.nsc5-document .nsc5-login-gate,
html body.nsc5-document .nsc5-tool-grid > a {
  background: var(--nsc5-surface) !important;
  border-color: var(--nsc5-border) !important;
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-context-muted,
html body.nsc5-document .nsc5-caught-up {
  background: transparent !important;
  border-color: var(--nsc5-border) !important;
}

/* Prominent headings and counters. */
html body.nsc5-document .nsc5-hero h1,
html body.nsc5-document .nsc5-page-head h1,
html body.nsc5-document .nsc5-course-hero h1,
html body.nsc5-document .nsc5-thread-detail h1,
html body.nsc5-document .nsc5-login-gate h1,
html body.nsc5-document .nsc5-section-head h2,
html body.nsc5-document .nsc5-context-card h2,
html body.nsc5-document .nsc5-thread-card h3,
html body.nsc5-document .nsc5-course-card h2,
html body.nsc5-document .nsc5-stat-card > strong,
html body.nsc5-document .nsc5-empty > strong,
html body.nsc5-document .nsc5-placeholder > strong,
html body.nsc5-document .nsc5-sidebar-note > strong,
html body.nsc5-document .nsc5-context-muted > strong,
html body.nsc5-document .nsc5-answer-head > strong {
  color: var(--nsc5-ink) !important;
}

/* Supporting text deliberately uses the tested muted colour, never opacity. */
html body.nsc5-document .nsc5-brand small,
html body.nsc5-document .nsc5-sidebar-note p,
html body.nsc5-document .nsc5-back-link,
html body.nsc5-document .nsc5-hero p,
html body.nsc5-document .nsc5-page-head p,
html body.nsc5-document .nsc5-course-hero p,
html body.nsc5-document .nsc5-login-gate p,
html body.nsc5-document .nsc5-stat-card p,
html body.nsc5-document .nsc5-thread-card p,
html body.nsc5-document .nsc5-thread-card-foot,
html body.nsc5-document .nsc5-reason,
html body.nsc5-document .nsc5-caught-up,
html body.nsc5-document .nsc5-caught-up p,
html body.nsc5-document .nsc5-context-card p,
html body.nsc5-document .nsc5-intent-card span,
html body.nsc5-document .nsc5-form label small,
html body.nsc5-document .nsc5-form-status,
html body.nsc5-document .nsc5-course-card p,
html body.nsc5-document .nsc5-course-card-foot,
html body.nsc5-document .nsc5-tabs a,
html body.nsc5-document .nsc5-thread-detail .nsc5-byline,
html body.nsc5-document .nsc5-answer-head,
html body.nsc5-document .nsc5-empty p,
html body.nsc5-document .nsc5-placeholder p,
html body.nsc5-document .nsc5-tool-grid > a span {
  color: var(--nsc5-muted) !important;
  opacity: 1 !important;
}

html body.nsc5-document .nsc5-thread-body,
html body.nsc5-document .nsc5-thread-body p,
html body.nsc5-document .nsc5-answer > div:not(.nsc5-answer-head),
html body.nsc5-document .nsc5-answer > div:not(.nsc5-answer-head) p {
  color: var(--nsc5-text) !important;
}

/* Brand, navigation and icon controls. */
html body.nsc5-document .nsc5-brand {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-brand strong {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-brand-mark,
html body.nsc5-document .nsc5-avatar {
  background: var(--nsc5-button) !important;
  border-color: var(--nsc5-button) !important;
  color: #ffffff !important;
}

html body.nsc5-document .nsc5-icon-button {
  background: var(--nsc5-surface-2) !important;
  border-color: var(--nsc5-border) !important;
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-icon-button:hover,
html body.nsc5-document .nsc5-icon-button:focus-visible {
  background: var(--nsc5-green-50) !important;
  border-color: var(--nsc5-green-700) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-nav-item {
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-nav-item:hover {
  background: var(--nsc5-green-50) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-nav-item.is-active {
  background: var(--nsc5-green-100) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-nav-item span {
  color: inherit !important;
}

/* Inputs and search remain readable in either explicit site theme. */
html body.nsc5-document .nsc5-global-search input,
html body.nsc5-document .nsc5-form input,
html body.nsc5-document .nsc5-form textarea,
html body.nsc5-document .nsc5-form select,
html body.nsc5-document .nsc5-course-search input,
html body.nsc5-document .nsc5-course-search button {
  background: var(--nsc5-input) !important;
  border-color: var(--nsc5-border) !important;
  color: var(--nsc5-ink) !important;
  -webkit-text-fill-color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-global-search svg {
  stroke: var(--nsc5-muted) !important;
}

html body.nsc5-document .nsc5-global-search input::placeholder,
html body.nsc5-document .nsc5-form input::placeholder,
html body.nsc5-document .nsc5-form textarea::placeholder,
html body.nsc5-document .nsc5-course-search input::placeholder {
  color: var(--nsc5-muted) !important;
  -webkit-text-fill-color: var(--nsc5-muted) !important;
  opacity: 1 !important;
}

html body.nsc5-document .nsc5-global-search input:focus,
html body.nsc5-document .nsc5-form input:focus,
html body.nsc5-document .nsc5-form textarea:focus,
html body.nsc5-document .nsc5-form select:focus,
html body.nsc5-document .nsc5-course-search input:focus,
html body.nsc5-document .nsc5-course-search button:hover {
  border-color: var(--nsc5-green-700) !important;
}

/* Filled actions use a deliberately darker green with white text. */
html body.nsc5-document .nsc5-primary,
html body.nsc5-document .nsc5-login,
html body.nsc5-document button.nsc5-primary,
html body.nsc5-document input.nsc5-primary {
  background: var(--nsc5-button) !important;
  border-color: var(--nsc5-button) !important;
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body.nsc5-document .nsc5-primary:hover,
html body.nsc5-document .nsc5-primary:focus-visible,
html body.nsc5-document .nsc5-login:hover,
html body.nsc5-document .nsc5-login:focus-visible {
  background: var(--nsc5-button-hover) !important;
  border-color: var(--nsc5-button-hover) !important;
  color: #ffffff !important;
}

/* Cards that act as links keep their own readable text hierarchy. */
html body.nsc5-document .nsc5-intent-card,
html body.nsc5-document .nsc5-tool-grid > a {
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-intent-card strong,
html body.nsc5-document .nsc5-tool-grid > a strong {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-intent-card.is-active,
html body.nsc5-document .nsc5-tool-grid > a:hover {
  background: var(--nsc5-green-50) !important;
  border-color: var(--nsc5-green-700) !important;
}

html body.nsc5-document .nsc5-thread-card h3 a,
html body.nsc5-document .nsc5-course-card h2 a {
  color: var(--nsc5-ink) !important;
}

html body.nsc5-document .nsc5-thread-card h3 a:hover,
html body.nsc5-document .nsc5-course-card h2 a:hover {
  color: var(--nsc5-link) !important;
}

/* Labels, tabs and secondary controls. */
html body.nsc5-document .nsc5-eyebrow {
  color: var(--nsc5-link) !important;
}

html body.nsc5-document .nsc5-type-badge,
html body.nsc5-document .nsc5-course-code,
html body.nsc5-document .nsc5-caught-up > span,
html body.nsc5-document .nsc5-placeholder > span {
  background: var(--nsc5-green-100) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-type-badge.is-announcement,
html body.nsc5-document .nsc5-form-notice,
html body.nsc5-document .nsc5-foundation-callout {
  background: var(--nsc5-warn-bg) !important;
  border-color: var(--nsc5-warn) !important;
  color: var(--nsc5-warn) !important;
}

html body.nsc5-document .nsc5-type-badge.is-announcement,
html body.nsc5-document .nsc5-form-notice strong,
html body.nsc5-document .nsc5-foundation-callout strong,
html body.nsc5-document .nsc5-foundation-callout p {
  color: var(--nsc5-warn) !important;
}

html:not([data-theme="dark"]) body.nsc5-document .nsc5-type-badge.is-resource {
  background: #eaf0ff !important;
  color: #23408d !important;
}

html[data-theme="dark"] body.nsc5-document .nsc5-type-badge.is-resource,
body.nsc5-document.dark-mode .nsc5-type-badge.is-resource,
body.nsc5-document.nsc-dark-mode .nsc5-type-badge.is-resource {
  background: #1d2d54 !important;
  color: #c9d7ff !important;
}

html body.nsc5-document .nsc5-tabs a {
  color: var(--nsc5-muted) !important;
}

html body.nsc5-document .nsc5-tabs a:hover {
  background: var(--nsc5-green-50) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-tabs a.is-active {
  background: var(--nsc5-green-100) !important;
  color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-follow-button {
  background: transparent !important;
  border-color: var(--nsc5-link) !important;
  color: var(--nsc5-link) !important;
  -webkit-text-fill-color: var(--nsc5-link) !important;
}

html body.nsc5-document .nsc5-follow-button:hover,
html body.nsc5-document .nsc5-follow-button.is-following {
  background: var(--nsc5-green-100) !important;
  border-color: var(--nsc5-green-700) !important;
  color: var(--nsc5-green-950) !important;
  -webkit-text-fill-color: var(--nsc5-green-950) !important;
}

html body.nsc5-document .nsc5-duplicates {
  background: var(--nsc5-green-50) !important;
  border-color: var(--nsc5-border) !important;
  color: var(--nsc5-text) !important;
}

html body.nsc5-document .nsc5-form-status.is-error {
  color: var(--nsc5-danger) !important;
}

html body.nsc5-document .nsc5-form-status.is-success {
  color: var(--nsc5-link) !important;
}

/* Do not use opacity to communicate disabled state so text stays legible. */
html body.nsc5-document .nsc5-primary[disabled],
html body.nsc5-document .nsc5-follow-button[disabled] {
  opacity: 1 !important;
  filter: saturate(.55);
  cursor: wait;
}

@media (max-width: 782px) {
  html body.nsc5-document .nsc5-mobile-nav {
    box-shadow: 0 -10px 30px rgba(10, 30, 20, .12);
  }
}

/* 5.0.2 component-boundary and browser-state refinements. */
body.nsc5-document,
body.nsc5-document .nsc5-app {
  --nsc5-border: #7b9185;
}

html[data-theme="dark"] body.nsc5-document,
html[data-theme="dark"] body.nsc5-document .nsc5-app,
body.nsc5-document.dark-mode,
body.nsc5-document.dark-mode .nsc5-app,
body.nsc5-document.nsc-dark-mode,
body.nsc5-document.nsc-dark-mode .nsc5-app {
  --nsc5-border: #587568;
}

html body.nsc5-document .nsc5-nav-item.is-active {
  box-shadow: inset 0 0 0 1px var(--nsc5-green-700) !important;
}

html body.nsc5-document .nsc5-app ::selection {
  background: var(--nsc5-green-100);
  color: var(--nsc5-green-950);
}

html body.nsc5-document .nsc5-app input[type="checkbox"],
html body.nsc5-document .nsc5-app input[type="radio"] {
  accent-color: var(--nsc5-button);
}

html body.nsc5-document .nsc5-app input:-webkit-autofill,
html body.nsc5-document .nsc5-app input:-webkit-autofill:hover,
html body.nsc5-document .nsc5-app input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--nsc5-ink) !important;
  box-shadow: 0 0 0 1000px var(--nsc5-input) inset !important;
  caret-color: var(--nsc5-ink) !important;
}

/* Compatibility with installations that place the dark-state class on html. */
html.dark-mode body.nsc5-document,
html.dark-mode body.nsc5-document .nsc5-app,
html.nsc-dark-mode body.nsc5-document,
html.nsc-dark-mode body.nsc5-document .nsc5-app {
  --nsc5-canvas: #07130e;
  --nsc5-green-950: #dcfff0;
  --nsc5-green-900: #b4f7d6;
  --nsc5-green-800: #72e6b5;
  --nsc5-green-700: #5bd3a0;
  --nsc5-green-100: #193d30;
  --nsc5-green-50: #112d23;
  --nsc5-ink: #f5fcf8;
  --nsc5-text: #dce9e2;
  --nsc5-muted: #aebfb6;
  --nsc5-border: #587568;
  --nsc5-soft: #07130e;
  --nsc5-surface: #0f1f18;
  --nsc5-surface-2: #142820;
  --nsc5-input: #12251d;
  --nsc5-link: #72e6b5;
  --nsc5-link-hover: #b4f7d6;
  --nsc5-button: #0b6b4a;
  --nsc5-button-hover: #0a6245;
  --nsc5-warn: #ffd28c;
  --nsc5-warn-bg: #3b2b12;
  --nsc5-danger: #ffadb5;
  --nsc5-danger-bg: #401b20;
  --nsc5-focus: #ffd166;
  --nsc5-shadow: 0 18px 50px rgba(0, 0, 0, .34);
  color-scheme: dark;
}
