:root {
  --blue: #1e3a8a;
  --blue-deep: #0f1f52;
  --yellow: #facc15;
  --paper: #fffdf7;
  --paper-soft: #f6f2e8;
  --ink: #111827;
  --muted: #5b6475;
  --green: #0f9d58;
  --red: #d94841;
  --line: rgba(17, 24, 39, 0.12);
  --shadow: 10px 10px 0 rgba(17, 24, 39, 0.92);
  --max: 1240px;
  --space-card: 18px;
  --space-card-lg: 22px;
  --space-stack: 12px;
  --space-stack-lg: 16px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  font-family: "Inter", sans-serif;
  background: linear-gradient(180deg, #fbfaf5 0%, #f4f1e8 100%);
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(rgba(17, 24, 39, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 24, 39, 0.03) 1px, transparent 1px);
  background-size: 26px 26px;
  opacity: 0.4;
}
.noise,
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
}
.noise {
  opacity: 0.08;
  background-image:
    radial-gradient(circle at 20% 20%, rgba(17, 24, 39, 0.45) 0.8px, transparent 1px),
    radial-gradient(circle at 80% 40%, rgba(17, 24, 39, 0.3) 0.8px, transparent 1px),
    radial-gradient(circle at 60% 80%, rgba(17, 24, 39, 0.22) 0.8px, transparent 1px);
  background-size: 18px 18px, 22px 22px, 26px 26px;
}
.ambient {
  filter: blur(34px);
  opacity: 0.42;
  animation: drift 16s ease-in-out infinite alternate;
}
.ambient-one {
  background: radial-gradient(circle at 20% 20%, rgba(250, 204, 21, 0.42), transparent 28%);
}
.ambient-two {
  background: radial-gradient(circle at 78% 18%, rgba(30, 58, 138, 0.22), transparent 26%);
  animation-duration: 20s;
}
@keyframes drift {
  from { transform: translate3d(-2%, -1%, 0) scale(1); }
  to { transform: translate3d(2%, 2%, 0) scale(1.08); }
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

.site-header, .page {
  width: min(calc(100% - 28px), var(--max));
  margin: 0 auto;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 0 14px;
  background: linear-gradient(180deg, rgba(247, 246, 241, 0.98), rgba(247, 246, 241, 0.88), transparent);
}
.brand { display: inline-flex; align-items: center; gap: 14px; }
.brand-badge {
  display: grid; place-items: center; width: 48px; height: 48px;
  border: 2px solid var(--ink); border-radius: 14px;
  font-family: "Poppins", sans-serif; font-size: 1.2rem; font-weight: 800;
  background: var(--yellow); box-shadow: 6px 6px 0 var(--ink);
}
.brand-text { display: flex; flex-direction: column; gap: 2px; }
.brand-text strong, .site-nav a, .header-button, .primary-link, .secondary-link, .save-button, .action-button,
h1, h2, h3, .metric-value, .card-title, .feed-title, .status-pill {
  font-family: "Poppins", sans-serif;
}
.brand-text strong { font-size: 1.02rem; }
.brand-text span:last-child, .site-nav a, .session-pill { color: var(--muted); font-size: 0.92rem; }
.site-nav, .header-actions, .hero-cta-row, .footer-links, .entry-actions, .item-meta, .results-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
}
.results-meta {
  margin: 4px 0 12px;
  display: block;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}
.results-meta span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 11px;
  border: 1px solid rgba(30, 58, 138, 0.28);
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.22);
  font-family: "Poppins", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: none;
  color: var(--blue-deep);
}
.site-nav { gap: 20px; }
.site-nav a { position: relative; padding-bottom: 3px; }
.site-nav a::after {
  content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 2px;
  background: var(--yellow); transform: scaleX(0); transform-origin: left; transition: transform 180ms ease;
}
.site-nav a:hover::after { transform: scaleX(1); }
.header-actions { align-items: center; justify-content: flex-end; }

.session-pill, .status-pill {
  display: inline-flex; align-items: center; padding: 9px 12px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(255, 255, 255, 0.72);
}
#sessionBadge {
  display: none;
}
#sessionBadge.profile-pill:not(.hidden) {
  display: inline-flex;
}
.profile-pill {
  gap: 8px;
  cursor: pointer;
  color: var(--ink);
}
.profile-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  position: relative;
  overflow: hidden;
}
.profile-head,
.profile-body {
  position: absolute;
  display: block;
  background: var(--ink);
}
.profile-head {
  top: 4px;
  width: 7px;
  height: 7px;
  border-radius: 999px;
}
.profile-body {
  bottom: 2px;
  width: 13px;
  height: 8px;
  border-radius: 8px 8px 4px 4px;
}
.profile-label {
  font-family: "Poppins", sans-serif;
  font-size: 0.9rem;
}
.status-pill.open { background: rgba(15, 157, 88, 0.1); color: var(--green); }
.status-pill.closed { background: rgba(217, 72, 65, 0.1); color: var(--red); }

.header-button, .primary-link, .secondary-link, .save-button, .action-button, .modal-tab, .modal-close {
  display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
  border: 2px solid var(--ink); transition: transform 160ms ease, box-shadow 160ms ease;
}
.header-button, .primary-link, .secondary-link, .save-button, .action-button { min-height: 46px; padding: 0 16px; }
.header-button.is-working::after,
.action-button.is-working::after,
.save-button.is-working::after,
.primary-link.is-working::after,
.secondary-link.is-working::after {
  content: "";
  width: 14px;
  height: 14px;
  margin-left: 8px;
  border: 2px solid rgba(17, 24, 39, 0.35);
  border-top-color: var(--ink);
  border-radius: 999px;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.global-loader {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 3px;
  background: transparent;
  z-index: 100;
  pointer-events: none;
}
.global-loader-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #facc15, #1e3a8a);
  transition: width 260ms ease, opacity 220ms ease;
  opacity: 0;
}
.global-loader.active .global-loader-bar {
  opacity: 1;
}
.global-blocker {
  position: fixed;
  inset: 0;
  background: rgba(255, 253, 247, 0.36);
  backdrop-filter: blur(1.5px);
  display: none;
  z-index: 90;
}
.global-blocker.active {
  display: block;
}
.interactive-press {
  position: relative;
  overflow: hidden;
}
.press-ripple {
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: rgba(30, 58, 138, 0.22);
  transform: translate(-50%, -50%) scale(0);
  animation: press-ripple 520ms ease-out forwards;
  pointer-events: none;
}
@keyframes press-ripple {
  to {
    transform: translate(-50%, -50%) scale(16);
    opacity: 0;
  }
}
.primary, .primary-link, .save-button.primary, .form-button { background: var(--yellow); box-shadow: 5px 5px 0 var(--ink); }
.ghost, .secondary-link, .save-button.secondary, .action-button, .modal-tab, .modal-close { background: #fff; }

.page { padding-bottom: 60px; }
.hero, .workspace-grid, .metric-grid, .hub-grid, .updates-grid, .admin-grid, .management-grid, .two-column, .roadmap-grid, .overview-split {
  display: grid; gap: 18px;
}
.hero { grid-template-columns: minmax(0, 1.2fr) 360px; padding: 28px 0 34px; }
.hero-main, .sticky-note, .scorecard, .metric-card, .schools-panel, .side-card, .content-block, .admin-card, .page-footer, .modal-card, .content-hero, .overview-list-card {
  border: 2px solid var(--ink); background: var(--paper);
}
.hero-main, .content-hero {
  position: relative; padding: 34px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(255, 250, 226, 0.98));
  box-shadow: 12px 12px 0 rgba(17, 24, 39, 0.96); overflow: hidden;
}
.auth-page-shell {
  width: min(100%, 560px);
  margin-left: auto;
  margin-right: auto;
}
.hero-main::before, .content-hero::before {
  content: ""; position: absolute; top: -72px; right: -72px; width: 220px; height: 220px;
  border-radius: 50%; border: 22px solid rgba(30, 58, 138, 0.08);
}
.hero-rail { display: grid; gap: 18px; align-content: start; }
.sticky-note, .scorecard, .side-card, .admin-card, .schools-panel, .content-block, .page-footer, .overview-list-card { padding: var(--space-card-lg); }
.sticky-note {
  background: #fff8c6; box-shadow: 10px 10px 0 rgba(217, 72, 65, 0.18); transform: rotate(-1.2deg); position: relative;
}
.sticky-note::before {
  content: ""; position: absolute; top: 14px; right: 18px; width: 58px; height: 16px; background: rgba(255, 255, 255, 0.55); transform: rotate(8deg);
}
.scorecard { background: var(--blue-deep); color: #fff; box-shadow: 10px 10px 0 rgba(17, 24, 39, 0.22); }
.scorecard ul { display: grid; gap: 14px; margin: 12px 0 0; padding: 0; list-style: none; }
.scorecard li { display: flex; justify-content: space-between; gap: 14px; padding-top: 14px; border-top: 1px solid rgba(255, 255, 255, 0.16); }
.scorecard li span, .scorecard .note-label { color: rgba(255, 255, 255, 0.74); }

.kicker, .section-tag, .note-label, .feed-tag {
  margin: 0 0 12px; font-size: 0.82rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue);
}
h1, h2, h3 { margin: 0; line-height: 1.02; letter-spacing: -0.02em; }
h1 { max-width: 14ch; font-size: clamp(2.3rem, 5.2vw, 4.2rem); }
h1 span { display: block; color: var(--blue); }
.home-page h1 {
  max-width: 14ch;
  font-size: clamp(2.3rem, 5.2vw, 4.2rem);
  line-height: 1.02;
}
.hero-copy, .section-copy, .helper-text, .entry-content, .metric-label, .item-meta, .empty-state, .side-card p, .page-footer p, .admin-empty, .banner-placeholder p, .details-list {
  color: var(--muted); line-height: 1.7;
}
.profile-grid .entry-content {
  overflow-wrap: anywhere;
  word-break: break-word;
}
.hero-copy { max-width: 66ch; margin: 18px 0 0; font-size: 0.98rem; }
.home-page .hero-copy {
  max-width: 66ch;
  font-size: 0.98rem;
}

.hero-search, .filter-bar, .stack-form { display: grid; gap: 10px; }
.blog-filter-bar {
  grid-template-columns: minmax(0, 1.3fr) minmax(220px, 0.7fr);
  margin-bottom: 12px;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.editor-shell {
  border: 2px solid var(--ink);
  background: #fff;
}
.editor-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 10px;
  border-bottom: 2px solid var(--ink);
  background: rgba(250, 204, 21, 0.12);
}
.editor-toolbar .action-button {
  min-height: 36px;
  padding: 0 10px;
}
.rich-editor {
  min-height: 220px;
  padding: 14px 16px;
  line-height: 1.7;
  color: var(--ink);
  outline: none;
}
.rich-editor h2,
.rich-editor h3 {
  margin: 12px 0 8px;
  font-family: "Poppins", sans-serif;
}
.rich-editor p {
  margin: 0 0 10px;
}
.checklist-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}
.checklist-item {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: #fff;
}
.checklist-item input {
  margin-top: 2px;
}
#costEstimatorResult {
  margin-top: 4px;
}
.estimate-breakdown {
  margin-top: 10px;
  display: grid;
  gap: 8px;
}
.estimate-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
}
.estimate-row.total {
  border: 2px solid var(--ink);
  background: rgba(250, 204, 21, 0.16);
}
.estimate-label {
  color: var(--muted);
  line-height: 1.45;
}
.estimate-value {
  font-family: "Poppins", sans-serif;
  color: var(--blue-deep);
  white-space: nowrap;
}
.cost-breakdown-list {
  list-style: disc;
  padding-left: 28px;
}
.cost-breakdown-list li {
  margin-bottom: 6px;
}
.hero-search { grid-template-columns: 1fr auto; max-width: 720px; margin-top: 22px; padding: 10px; border: 2px solid var(--ink); background: #fff; }
.hero-search input { border: 0; }
.hero-search input, .filter-bar input, .filter-bar select, .stack-form input, .stack-form select, .stack-form textarea {
  min-width: 0; padding: 14px 16px; border: 2px solid var(--ink); background: #fff;
}

.homepage-banner { margin-top: 12px; }
.banner-frame, .entry-image {
  width: 100%; border: 2px solid var(--ink); background: #fff;
}
.banner-frame {
  min-height: 240px;
  overflow: hidden;
  aspect-ratio: 16 / 6;
}
.home-banner-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
}
.entry-image {
  min-height: 190px; object-fit: cover; display: block; margin-bottom: 16px;
}
.image-gallery {
  position: relative;
  margin-bottom: 16px;
}
.image-gallery-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: thin;
  border: 2px solid var(--ink);
  background: #fff;
}
.gallery-image {
  margin-bottom: 0;
  scroll-snap-align: start;
}
.gallery-count {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.92);
  font-family: "Poppins", sans-serif;
  font-size: 0.85rem;
}
.gallery-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 34px;
  height: 34px;
  border: 2px solid var(--ink);
  background: rgba(255, 253, 247, 0.92);
  color: var(--ink);
  font-family: "Poppins", sans-serif;
  font-size: 1.25rem;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 2;
}
.gallery-nav.prev { left: 10px; }
.gallery-nav.next { right: 10px; }
.gallery-nav:hover {
  background: #fff;
}
.entry-image.placeholder, .banner-placeholder {
  display: grid; place-items: center; text-align: center; padding: 26px;
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(30, 58, 138, 0.08));
}
.banner-placeholder strong, .entry-image.placeholder span {
  display: block; font-family: "Poppins", sans-serif; font-size: 1.4rem; margin: 10px 0;
}

.metric-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.metric-card { padding: 20px; }
.metric-value { display: block; margin-top: 8px; font-size: 2rem; }
.overview-split { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 18px; }
.overview-list-card {
  background: #fff8c6;
  box-shadow: 10px 10px 0 rgba(217, 72, 65, 0.16);
  position: relative;
  transform: rotate(-0.8deg);
}
.overview-list-card::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 18px;
  width: 56px;
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(7deg);
}
.overview-list-card:nth-child(2n) {
  transform: rotate(0.8deg);
  box-shadow: 10px 10px 0 rgba(30, 58, 138, 0.15);
}
.overview-mini-list { display: grid; gap: 12px; }
.overview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}
.overview-row:first-child { border-top: 0; padding-top: 0; }
.overview-row:hover {
  transform: translate(-2px, -2px);
  background: rgba(250, 204, 21, 0.1);
}
.overview-copy h4 {
  margin: 0;
  font-family: "Poppins", sans-serif;
  font-size: 1.02rem;
  line-height: 1.15;
}
.overview-copy p {
  margin: 6px 0 0;
  color: var(--muted);
}
.overview-meta {
  display: grid;
  justify-items: end;
  gap: 8px;
  text-align: right;
}
.overview-meta strong {
  font-family: "Poppins", sans-serif;
  font-size: 0.92rem;
}

.hub-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.hub-card, .entry-card, .feed-item, .saved-item, .admin-item {
  border: 2px solid var(--ink); background: #fff; padding: var(--space-card);
}
.ad-slot-card {
  display: block;
  border: 2px dashed var(--ink);
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.16), rgba(30, 58, 138, 0.08));
  padding: var(--space-card);
  color: inherit;
  text-decoration: none;
}
.ad-slot-card h3 {
  font-family: "Poppins", sans-serif;
  font-size: 1.1rem;
}
.entry-card, .feed-item, .detail-card, .update-item {
  position: relative;
}
.interactive-card {
  transition: transform 220ms ease, box-shadow 220ms ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.interactive-card:hover {
  box-shadow: 10px 10px 0 rgba(17, 24, 39, 0.14);
}
.featured-post {
  background: #fff8c6;
  box-shadow: 10px 10px 0 rgba(217, 72, 65, 0.18);
  transform: rotate(-0.7deg);
  position: relative;
}
.featured-post::before {
  content: "";
  position: absolute;
  top: 12px;
  right: 18px;
  width: 56px;
  height: 14px;
  background: rgba(255, 255, 255, 0.55);
  transform: rotate(8deg);
}
.hub-card { min-height: 170px; display: flex; flex-direction: column; gap: var(--space-stack); }
.hub-card strong { font-family: "Poppins", sans-serif; font-size: 1.25rem; line-height: 1.2; }

.workspace-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; margin-top: 34px; }
.side-stack { display: grid; gap: 18px; }
.section-intro { margin-bottom: var(--space-stack-lg); }
.section-intro.compact { margin-bottom: 10px; }
.section-intro h2 { max-width: 100%; font-size: clamp(1.55rem, 2.6vw, 2.35rem); line-height: 1.1; }
.home-page .section-intro h2 {
  max-width: 100%;
  font-size: clamp(1.55rem, 2.6vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: left;
}
.filter-bar { grid-template-columns: 1.2fr repeat(3, minmax(0, 0.7fr)); margin-bottom: 14px; }
.card-list, .feed-list, .admin-list { display: grid; gap: var(--space-stack); }
.two-column, .updates-grid, .admin-grid, .management-grid, .roadmap-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.entry-header { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-title { font-size: 1.35rem; }
.feed-title { font-size: 1.25rem; }
.blog-card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}
.blog-card-link .feed-item {
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.blog-card-link:hover .feed-item {
  transform: translate(-2px, -2px);
  box-shadow: 9px 9px 0 rgba(17, 24, 39, 0.14);
  border-color: rgba(30, 58, 138, 0.42);
}
.blog-card-link .entry-actions {
  margin-top: 10px;
}
.blog-card-link .secondary-link {
  pointer-events: none;
}
.entry-actions { margin-top: var(--space-stack); }
.saved-item + .saved-item, .admin-item + .admin-item { margin-top: var(--space-stack); }
.details-list { margin-top: 10px; }
.feed-topline {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-start;
}
.updated-stamp {
  position: absolute;
  right: 14px;
  bottom: 12px;
  font-size: 0.68rem;
  padding: 4px 8px;
  opacity: 0.78;
  letter-spacing: 0.04em;
}
.publish-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.94rem;
}
.updated-stamp {
  background: rgba(250, 204, 21, 0.22);
  color: var(--blue-deep);
}
.updated-inline {
  color: var(--blue);
  font-weight: 700;
}
.update-item .entry-header {
  align-items: flex-start;
}
.admin-item {
  display: grid;
  gap: var(--space-stack);
}
.user-metric-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}
.user-filter-bar {
  grid-template-columns: 1.3fr 0.7fr 0.8fr;
}
.admin-item-header,
.admin-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}
.file-picker {
  display: grid;
  gap: 8px;
  padding: 14px 16px;
  border: 2px dashed var(--ink);
  background: rgba(255, 255, 255, 0.88);
}
.file-picker span {
  font-family: "Poppins", sans-serif;
}
.image-preview-shell {
  border: 2px solid var(--ink);
  background: #fff;
  padding: 12px;
}
.image-preview-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}
.preview-thumb {
  position: relative;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 8px;
}
.image-preview {
  display: block;
  width: 100%;
  max-height: 220px;
  object-fit: cover;
}
.preview-remove {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 30px;
  height: 30px;
  border: 2px solid var(--ink);
  background: #fff7c6;
  font-family: "Poppins", sans-serif;
  cursor: pointer;
}
.editing-focus {
  animation: editPulse 1.6s ease;
}
@keyframes editPulse {
  0% { transform: translateY(0); box-shadow: 0 0 0 rgba(250, 204, 21, 0); }
  20% { transform: translateY(-4px); box-shadow: 0 0 0 6px rgba(250, 204, 21, 0.18); }
  100% { transform: translateY(0); box-shadow: 0 0 0 rgba(250, 204, 21, 0); }
}

.roadmap-step {
  border: 2px solid var(--ink); background: #fffdf8; padding: var(--space-card);
}
.detail-card {
  border: 2px solid var(--ink);
  background: #fff;
  padding: var(--space-card-lg);
}
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}
.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.detail-panel {
  border: 2px solid var(--ink);
  background: var(--paper-soft);
  padding: var(--space-card);
}
.detail-panel h3 {
  margin-bottom: 10px;
  font-size: 1.1rem;
}
.blog-article .card-title {
  font-size: clamp(1.8rem, 3vw, 2.5rem);
  line-height: 1.08;
  margin-bottom: 8px;
}
.blog-article-body {
  margin-top: 14px;
  font-size: 1rem;
  line-height: 1.8;
  color: var(--ink);
}
.blog-article-body p {
  margin: 0 0 14px;
}
.related-blog-panel {
  margin-top: 16px;
}
.related-blog-list {
  display: grid;
  gap: 10px;
}
.related-blog-item {
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}
.related-blog-item strong {
  display: block;
  font-family: "Poppins", sans-serif;
  margin-bottom: 4px;
}
.related-blog-item p {
  margin: 0;
  color: var(--muted);
}
.roadmap-step .step-number {
  display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px;
  border: 2px solid var(--ink); background: var(--yellow); font-family: "Poppins", sans-serif; margin-bottom: 12px;
}

.page-footer { display: grid; grid-template-columns: 1fr 320px; gap: 18px; margin-top: 30px; }
.footer-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-content: start; }
.footer-links a { color: var(--blue); font-family: "Poppins", sans-serif; }
.legal-page .content-hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  max-width: 24ch;
  letter-spacing: -0.02em;
}
.legal-page .hero-copy {
  font-size: 0.98rem;
  max-width: 72ch;
}
.legal-page .section-tag {
  font-size: 0.72rem;
}

.dashboard-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}
.dashboard-sidebar {
  position: sticky;
  top: 98px;
  align-self: start;
  border: 2px solid var(--ink);
  background: #fff;
  padding: 16px;
  display: grid;
  gap: 12px;
}
.dashboard-sidebar h3 {
  font-size: 1rem;
}
.dashboard-side-nav {
  display: grid;
  gap: 8px;
}
.dashboard-side-nav a {
  font-family: "Poppins", sans-serif;
  color: var(--blue);
  border: 1px solid var(--line);
  background: rgba(30, 58, 138, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
}
.dashboard-side-nav a:hover {
  background: rgba(250, 204, 21, 0.2);
}
.dashboard-main {
  display: grid;
  gap: 18px;
}

.modal {
  position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 20px; background: rgba(17, 24, 39, 0.42);
}
.modal-card { position: relative; width: min(100%, 520px); padding: 24px; background: #fffdf8; box-shadow: var(--shadow); }
#profileModal .modal-card {
  width: min(100%, 860px);
}
#profileModal .profile-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
#profileModal .detail-panel {
  min-height: 100%;
}
.modal-tabs { display: flex; gap: 12px; margin-bottom: 18px; }
.modal-tab { min-height: 42px; padding: 0 14px; }
.modal-tab.active { background: var(--yellow); }
.modal-close { position: absolute; top: 14px; right: 14px; width: 36px; height: 36px; }
.toast-rack {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  pointer-events: none;
}
.toast-message {
  min-width: min(320px, calc(100vw - 36px));
  padding: 14px 16px;
  border: 2px solid var(--ink);
  background: #fffdf8;
  box-shadow: 8px 8px 0 var(--ink);
  font-family: "Poppins", sans-serif;
  transform: translateY(18px) scale(0.98);
  opacity: 0;
  transition: transform 220ms ease, opacity 220ms ease;
}
.toast-message.success {
  background: #fff7c6;
}
.toast-message.error {
  background: #ffe0d8;
}
.toast-message.is-visible {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.header-button.is-working,
.action-button.is-working {
  opacity: 0.88;
  transform: scale(0.99);
}
.header-button:disabled,
.action-button:disabled {
  cursor: wait;
}

.hidden { display: none !important; }
.empty-state, .admin-empty {
  padding: 16px; border: 2px dashed var(--ink); background: rgba(255, 255, 255, 0.66);
}
.helper-text { margin: 0; }
.auth-helper-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-top: -2px;
}
.text-link-button {
  appearance: none;
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-link-button:hover {
  color: #102766;
}
.auth-message {
  margin: 4px 0 0;
  padding: 12px 14px;
  border: 2px solid var(--ink);
  background: #fff;
  font-family: "Poppins", sans-serif;
  font-size: 0.95rem;
}
.auth-message.error {
  background: #ffe0d8;
}
.auth-message.success {
  background: #fff7c6;
}

[data-reveal] { opacity: 0; transform: translateY(28px); transition: opacity 600ms ease, transform 600ms ease; }
[data-reveal].is-visible { opacity: 1; transform: translateY(0); }

.header-button:hover, .primary-link:hover, .secondary-link:hover, .save-button:hover, .action-button:hover, .modal-tab:hover, .modal-close:hover {
  transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

@media (max-width: 1180px) {
  .hero, .workspace-grid, .page-footer {
    grid-template-columns: 1fr;
  }
  .dashboard-shell {
    grid-template-columns: 1fr;
  }
  .dashboard-sidebar {
    position: static;
  }
  .dashboard-side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .metric-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hub-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .two-column, .updates-grid, .admin-grid, .management-grid, .roadmap-grid, .overview-split {
    grid-template-columns: 1fr;
  }
  .hero-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .site-header {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .site-nav { width: 100%; }
  .header-actions {
    width: auto;
    margin-left: auto;
    justify-content: flex-end;
  }
  .entry-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .entry-actions {
    width: 100%;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
  .profile-grid,
  .user-metric-grid,
  .user-filter-bar {
    grid-template-columns: 1fr;
  }
  .filter-bar, .footer-links { grid-template-columns: 1fr; }
  .blog-filter-bar { grid-template-columns: 1fr; }
  .hero-search { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .site-header, .page { width: min(calc(100% - 18px), var(--max)); }
  .site-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
  .site-nav {
    grid-column: 1 / -1;
    order: 3;
    gap: 12px;
  }
  .site-nav a {
    font-size: 0.86rem;
  }
  .header-actions {
    grid-column: 2;
    margin-left: 0;
    justify-content: flex-end;
    gap: 8px;
  }
  .header-actions .header-button {
    min-height: 38px;
    padding: 0 12px;
    font-size: 0.84rem;
  }
  .header-actions .session-pill {
    max-width: 46vw;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .profile-pill {
    padding: 7px;
  }
  .profile-label {
    display: none;
  }
  .brand-text span:last-child { display: none; }
  .hero-main, .content-hero, .sticky-note, .scorecard, .metric-card, .schools-panel, .side-card, .content-block, .admin-card, .page-footer, .modal-card {
    padding: 20px;
  }
  .content-hero {
    padding: 16px;
  }
  .content-hero h1 {
    max-width: 100%;
    font-size: clamp(1.9rem, 9.2vw, 2.5rem);
    line-height: 1.04;
    letter-spacing: -0.015em;
    word-break: break-word;
  }
  .content-hero p {
    font-size: 0.95rem;
    line-height: 1.45;
  }
  .featured-post {
    transform: none;
  }
  .dashboard-side-nav {
    grid-template-columns: 1fr;
  }
  .hero-rail { grid-template-columns: 1fr; }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .hub-grid { grid-template-columns: 1fr; }
  .hero-search {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .hero-search button {
    width: 100%;
  }
  .filter-bar {
    grid-template-columns: 1fr;
  }
  .entry-image {
    min-height: 150px;
  }
  .gallery-nav {
    width: 30px;
    height: 30px;
    font-size: 1.05rem;
  }
  .overview-mini-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .overview-row {
    grid-template-columns: 1fr;
    align-items: start;
    padding: 14px;
    border: 2px solid var(--ink);
    background: #fff;
  }
  .overview-row:first-child {
    padding-top: 14px;
  }
  .overview-list-card,
  .overview-list-card:nth-child(2n) {
    transform: none;
  }
  .overview-meta {
    justify-items: start;
    text-align: left;
  }
  .detail-card {
    padding: 20px;
  }
  .admin-item-header,
  .admin-badges {
    justify-content: flex-start;
  }
  h1 {
    max-width: 100%;
    font-size: clamp(1.95rem, 9.4vw, 2.7rem);
    line-height: 1.04;
  }
  .toast-rack {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }
  .toast-message {
    min-width: 0;
    width: 100%;
  }
  .auth-helper-row {
    flex-direction: column;
    align-items: flex-start;
  }
  #profileModal .modal-card {
    width: min(100%, 520px);
  }
  #profileModal .profile-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 420px) {
  .overview-mini-list, .hub-grid {
    grid-template-columns: 1fr;
  }
}
