:root {
  --primary: #0b3d5c;
  --secondary: #d8a84c;
  --bg: #f7f7f3;
  --panel: #ffffff;
  --text: #1e2a39;
  --muted: #5e6977;
  --border: #e6e4de;
  --shadow: 0 20px 50px rgba(11, 61, 92, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

img {
  display: block;
  max-width: 100%;
}

button,
input,
textarea {
  font: inherit;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 72px;
}

.brand {
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--primary);
  font-size: 1.2rem;
}

nav {
  display: flex;
  gap: 18px;
  align-items: center;
  font-weight: 500;
  color: var(--text);
}

.nav-button,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.8rem 1.3rem;
  font-weight: 700;
  transition: 0.2s ease;
}

.primary-btn {
  background: var(--primary);
  color: white;
  border: none;
}

.secondary-btn {
  background: white;
  color: var(--primary);
  border: 1px solid var(--border);
}

.nav-button {
  background: var(--primary);
  color: white;
  border: 1px solid var(--primary);
  padding: 0.58rem 1rem;
  font-size: 0.88rem;
}

.login-icon {
  display: block;
  transform: translateX(1px);
  font-size: 1.05rem;
  font-weight: 700;
}

.login-button {
  gap: 7px;
  padding: 0.58rem 1rem;
  border-radius: 8px;
  font-size: 0.88rem;
}

.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;
}

.nav-button:hover,
.nav-button:focus-visible {
  background: #164f70;
  color: white;
  box-shadow: 0 5px 14px rgba(11, 61, 92, 0.2);
}

.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.nav-button:focus-visible {
  outline: 3px solid rgba(216, 168, 76, 0.45);
  outline-offset: 2px;
}

.primary-btn:hover,
.secondary-btn:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

.hero {
  padding: 72px 0 52px;
  background: linear-gradient(180deg, #f8f5ee 0%, #f7f7f3 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--secondary);
  margin-bottom: 12px;
}

.hero-copy h1 {
  font-size: clamp(2.3rem, 5vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -0.05em;
  margin: 0 0 18px;
  color: var(--primary);
}

.hero-copy p {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 28px;
  max-width: 620px;
}

.cta-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 24px;
  color: var(--primary);
  font-size: 0.92rem;
  font-weight: 600;
}

.hero-meta span {
  background: rgba(11, 61, 92, 0.06);
  padding: 0.65rem 0.9rem;
  border-radius: 999px;
}

.hero-visual img {
  width: 100%;
  min-height: 420px;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.section {
  padding: 76px 0;
}

.muted {
  background: #eef3f5;
}

.split-layout,
.mission-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 36px;
  align-items: start;
}

.about-visual {
  display: grid;
  gap: 18px;
}

.about-visual > img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

h2 {
  font-size: clamp(2rem, 3vw, 2.7rem);
  line-height: 1.1;
  margin: 0 0 18px;
  color: var(--primary);
}

p {
  color: var(--muted);
}

.value-box,
.info-card,
.project-card,
.testimonial-card,
.auth-card,
.admin-panel,
.stat-card,
.mini-card {
  background: var(--panel);
  border-radius: 22px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.value-box {
  padding: 28px 26px;
}

.value-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 18px;
}

.value-box li {
  display: grid;
  gap: 5px;
}

.heading-row {
  margin-bottom: 28px;
}

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

.stat-card {
  padding: 28px 22px;
  text-align: center;
}

.stat-card strong {
  display: block;
  color: var(--primary);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1;
  margin-bottom: 8px;
}

.stat-card span {
  color: var(--muted);
  font-weight: 600;
}

.info-row {
  display: grid;
  gap: 18px;
}

.mission-photo img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.mission-card-row {
  display: grid;
  gap: 14px;
}

.mini-card {
  padding: 22px 20px;
}

.mini-card h3 {
  margin: 0 0 8px;
  color: var(--primary);
}

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

.info-card,
.project-card,
.testimonial-card {
  padding: 24px 20px;
}

.info-card,
.project-card {
  overflow: hidden;
  padding: 0 0 24px;
}

.info-card img,
.project-card img {
  width: 100%;
  height: 170px;
  object-fit: cover;
  object-position: center 30%;
  margin-bottom: 20px;
}

/* Per-photo focal tweaks: the two 800x600 programme photos frame
   differently from the square ones, so anchor each on its subjects. */
.info-card img[src*="programme-hr-training"] { object-position: center 45%; }
.info-card img[src*="programme-aj-client"] { object-position: center 20%; }

.info-card h3,
.info-card p,
.project-card h3,
.project-card p {
  margin-left: 20px;
  margin-right: 20px;
}

.info-card h3,
.project-card h3 {
  margin-top: 0;
  margin-bottom: 12px;
  color: var(--primary);
}

.testimonial-card p {
  font-size: 1.02rem;
}

.testimonial-card img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 50%;
  margin-bottom: 16px;
}

.testimonial-card strong,
.testimonial-card span {
  display: block;
}

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

.gallery-grid img {
  width: 100%;
  height: 230px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.gallery-grid img:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(11, 61, 92, 0.14);
}

.cta-banner {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr auto;
  gap: 18px;
  align-items: center;
  background: linear-gradient(135deg, var(--primary), #1d5a7d);
  border-radius: 28px;
  color: white;
  padding: 30px 28px;
  box-shadow: var(--shadow);
}

.cta-banner h2 {
  color: white;
  margin-bottom: 0;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.cta-banner-meta {
  display: grid;
  gap: 8px;
}

.flash-box {
  max-width: 1180px;
  margin: 18px auto 0;
  padding: 0 20px;
}

.flash-box > div {
  background: rgba(11, 61, 92, 0.08);
  color: var(--primary);
  border: 1px solid rgba(11, 61, 92, 0.12);
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 600;
}

.auth-wrap {
  padding: 80px 20px;
}

.auth-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px;
}

.auth-card h2 {
  margin-bottom: 22px;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

.admin-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.admin-layout {
  background: #f1f4f2;
  padding: 42px 0 90px;
}

.admin-sidebar {
  position: sticky;
  top: 96px;
  display: flex;
  flex-direction: column;
  /* Fit the viewport: shrink to the space under the sticky header and scroll
     internally, so every nav link + "Log out" stays reachable on short screens. */
  min-height: min(480px, calc(100vh - 120px));
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px 14px;
  background: #102d3b;
  border-radius: 14px;
  color: white;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.35) transparent;
}
.admin-sidebar::-webkit-scrollbar { width: 8px; }
.admin-sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.28);
  border-radius: 8px;
}
.admin-sidebar::-webkit-scrollbar-track { background: transparent; }

.admin-content {
  min-width: 0;
}

.admin-sidebar-brand {
  display: grid;
  gap: 6px;
  padding: 8px 10px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.16);
}

.admin-sidebar-brand strong {
  line-height: 1.3;
}

.admin-kicker {
  display: block;
  color: #b7792d;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-nav {
  display: grid;
  gap: 3px;
  margin-top: 18px;
}

.admin-nav a,
.admin-logout {
  padding: 10px;
  border-radius: 7px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.admin-nav a:hover,
.admin-logout:hover {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}

.admin-logout {
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  padding-top: 18px;
}

.admin-page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  margin-bottom: 24px;
}

.admin-page-heading h1 {
  margin: 4px 0 6px;
  color: var(--primary);
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.1;
}

.admin-page-heading p,
.admin-card-heading p {
  margin: 0;
  color: var(--muted);
}

.admin-card {
  scroll-margin-top: 100px;
  margin-bottom: 18px;
  padding: 24px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 10px 26px rgba(11, 61, 92, 0.05);
}

.admin-card-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 20px;
  margin-bottom: 22px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.admin-card-heading h2 {
  margin: 3px 0 0;
  font-size: 1.35rem;
}

.admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}

.admin-form-grid .form-group {
  margin-bottom: 18px;
}

.admin-form-grid .full-width {
  grid-column: 1 / -1;
}

.form-group small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.leadership-editor {
  margin-bottom: 22px;
}

.leadership-editor-row {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px 18px 4px;
  margin: 0 0 16px;
  background: var(--surface-soft, transparent);
}

.leadership-editor-row legend {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: 0 6px;
}

.leadership-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.leadership-row-label {
  color: inherit;
}

.lead-photo-inputs {
  display: flex;
  gap: 10px;
  align-items: center;
}

.lead-photo-inputs input[type="text"] {
  flex: 1;
  min-width: 0;
}

.lead-photo-preview {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface, #fff);
  overflow: hidden;
}

.lead-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.leadership-editor-row .file-picker {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.82rem;
}

.leadership-editor-row .file-picker input[type="file"] {
  display: block;
  margin-top: 6px;
  font-size: 0.82rem;
}

.media-preview-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 22px;
}

.media-preview-grid figure {
  margin: 0;
}

.media-preview-grid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.media-preview-grid figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.photo-slot-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.photo-slot {
  overflow: hidden;
  background: #fbfcfb;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.photo-slot-preview {
  display: grid;
  place-items: center;
  min-height: 150px;
  background: #e8eeeb;
  color: var(--muted);
  font-size: 0.8rem;
}

.photo-slot-preview img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.photo-slot-details {
  display: grid;
  gap: 9px;
  padding: 14px;
}

.photo-slot-label {
  display: block;
  min-height: 1.3em;
  margin: 0;
  color: var(--primary);
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.3;
}

.photo-title-field {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 0.75rem;
}

.photo-title-field input {
  padding: 0.58rem 0.65rem;
  border-radius: 7px;
  font-size: 0.8rem;
}

.photo-slot-details form {
  display: grid;
  gap: 8px;
}

.file-picker {
  display: block;
  overflow: hidden;
  padding: 9px 10px;
  border: 1px dashed #b8c8c0;
  border-radius: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  cursor: pointer;
}

.file-picker input {
  display: block;
  width: 100%;
  margin-top: 5px;
  padding: 0;
  border: 0;
  font-size: 0.72rem;
}

.photo-action {
  width: 100%;
  padding: 0.62rem 0.8rem;
  border-radius: 7px;
  font-size: 0.78rem;
}

.photo-delete {
  width: 100%;
  padding: 5px;
  border: 0;
  background: transparent;
  color: #a0473b;
  font-size: 0.78rem;
  cursor: pointer;
}

.photo-delete:hover {
  text-decoration: underline;
}

.creation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.creation-panel {
  padding: 18px;
  background: #f4f7f5;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.creation-panel h3 {
  margin: 5px 0 18px;
  color: var(--primary);
}

.custom-content-list {
  display: grid;
  gap: 8px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.content-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 7px;
}

.content-row div {
  display: grid;
  gap: 3px;
}

.content-row span {
  color: var(--muted);
  font-size: 0.78rem;
}

.custom-section-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 38px;
  align-items: center;
}

.custom-section-grid img,
.custom-page-image {
  width: 100%;
  max-height: 380px;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--border);
}

.admin-user-list,
.admin-user-add {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.admin-user-list h3,
.admin-user-add h3 {
  margin: 0 0 14px;
  color: var(--primary);
  font-size: 1rem;
}

.custom-page-inner {
  max-width: 860px;
}

.custom-page-inner h1,
.empty-page h1 {
  margin: 0 0 22px;
  color: var(--primary);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.custom-page-content {
  white-space: pre-line;
  color: var(--muted);
  font-size: 1.08rem;
}

.custom-page-image {
  margin-bottom: 34px;
}

.admin-save-bar {
  position: sticky;
  bottom: 16px;
  z-index: 3;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(11, 61, 92, 0.12);
  backdrop-filter: blur(12px);
}

.admin-save-bar span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

  .admin-sidebar {
    position: static;
    min-height: auto;
    max-height: none;
    overflow: visible;
  }

  .admin-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .admin-logout {
    margin-top: 12px;
  }
}

@media (max-width: 620px) {
  .admin-layout {
    padding-top: 24px;
  }

  .admin-page-heading,
  .admin-card-heading,
  .admin-save-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-form-grid,
  .media-preview-grid,
  .photo-slot-grid,
  .creation-grid,
  .custom-section-grid {
    grid-template-columns: 1fr;
  }

  .media-preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-save-bar .primary-btn {
    width: 100%;
  }
}

.form-group label {
  font-weight: 600;
  color: var(--primary);
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.8rem 0.9rem;
  background: white;
  color: var(--text);
}

textarea {
  min-height: 110px;
  resize: vertical;
}

.wide {
  width: 100%;
  border: none;
  cursor: pointer;
}

.admin-layout {
  padding: 56px 0;
}

.admin-grid {
  display: grid;
}

.admin-panel {
  padding: 26px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.site-footer {
  background: #0d1b2a;
  color: white;
  padding: 46px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 0.8fr;
  gap: 28px;
}

.site-footer h3,
.site-footer h4 {
  margin: 0 0 12px;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

@media (max-width: 900px) {
  .hero-grid,
  .split-layout,
  .mission-grid,
  .cta-banner,
  .footer-grid,
  .stats-grid,
  .card-grid {
    grid-template-columns: 1fr;
  }

  nav {
    gap: 10px;
    font-size: 0.88rem;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
}

@media (max-width: 560px) {
  .nav-wrap {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px 0;
  }

  .nav-button,
  .primary-btn,
  .secondary-btn {
    width: 100%;
  }

  .cta-row {
    flex-direction: column;
  }
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.site-footer h3,
.site-footer h4 {
  margin-top: 0;
  margin-bottom: 14px;
}

.site-footer p,
.site-footer li,
.site-footer a {
  color: rgba(255, 255, 255, 0.8);
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.flash-box {
  max-width: 1180px;
  margin: 20px auto 0;
  background: #eaf7ee;
  border: 1px solid #bddbc5;
  color: #1e5b39;
  padding: 14px 18px;
  border-radius: 12px;
}

.auth-wrap {
  padding: 120px 0;
}

.auth-card {
  max-width: 500px;
  margin: 0 auto;
  padding: 26px 22px;
}

.auth-card h2 {
  margin-bottom: 18px;
}

form {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  font-weight: 600;
  color: var(--primary);
}

input,
textarea,
button {
  font: inherit;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: white;
  color: var(--text);
  padding: 0.85rem 0.9rem;
}

textarea {
  resize: vertical;
}

.wide {
  width: 100%;
  border: none;
  cursor: pointer;
}

.admin-layout {
  padding-top: 60px;
}

.admin-grid {
  display: grid;
  grid-template-columns: 1fr;
}

.admin-panel {
  padding: 28px 24px;
}

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 22px;
}

.form-group {
  display: grid;
  gap: 8px;
  margin-bottom: 18px;
}

@media (max-width: 820px) {
  nav {
    gap: 10px;
    font-size: 0.9rem;
  }

  .hero-grid,
  .split-layout,
  .card-grid,
  .gallery-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .nav-wrap {
    flex-direction: column;
    justify-content: center;
    padding: 14px 0;
  }
}

.register-link {
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 700;
}

.auth-card p {
  margin-top: -8px;
  margin-bottom: 22px;
}

.auth-switch {
  margin: 18px 0 0 !important;
  text-align: center;
  font-size: 0.9rem;
}

.auth-switch a {
  color: var(--primary);
  font-weight: 700;
}

.account-wrap {
  min-height: 55vh;
}

.account-panel {
  max-width: 760px;
  padding: 36px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.account-panel h1 {
  margin: 4px 0 8px;
  color: var(--primary);
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.account-details {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 28px 0;
}

.account-details div {
  display: grid;
  gap: 5px;
  padding: 16px;
  background: #f2f6f3;
  border-radius: 8px;
}

.account-details span {
  color: var(--muted);
  font-size: 0.78rem;
}

.account-details strong {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.member-pages {
  margin: 30px 0;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.member-pages-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 18px;
  margin-bottom: 16px;
}

.member-pages-heading h2 {
  margin: 3px 0 0;
  font-size: 1.45rem;
}

.member-page-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.member-page-link {
  display: grid;
  gap: 4px;
  padding: 14px;
  background: #f2f6f3;
  border: 1px solid transparent;
  border-radius: 8px;
}

.member-page-link:hover {
  border-color: var(--secondary);
  background: white;
}

.member-page-link strong {
  color: var(--primary);
}

.member-page-link span {
  color: var(--muted);
  font-size: 0.82rem;
}

.remember-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.remember-row input[type="checkbox"] {
  width: auto;
  accent-color: var(--primary);
}

@media (max-width: 560px) {
  .account-details,
  .member-page-list {
    grid-template-columns: 1fr;
  }

  .member-pages-heading {
    align-items: stretch;
    flex-direction: column;
  }
}

/* ============ Responsive: auto-fit all screen sizes ============ */

/* Fluid type + media safety */
html { -webkit-text-size-adjust: 100%; }
img, video, iframe { max-width: 100%; height: auto; }
img { overflow-wrap: anywhere; }

/* (Hamburger toggle removed — nav links are always visible at all sizes) */

/* --- Large tablets / small laptops (<=1024px) --- */
@media (max-width: 1024px) {
  .container { padding: 0 18px; }
  .hero { padding: 56px 0 44px; }
  .section { padding: 60px 0; }
  .hero-grid { gap: 28px; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .media-preview-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .cta-banner { grid-template-columns: 1fr 1fr; row-gap: 14px; }
  .cta-banner .primary-btn { grid-column: 1 / -1; justify-self: start; }
  .admin-shell { grid-template-columns: 200px minmax(0, 1fr); gap: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Mobile nav toggle (hamburger) — hidden on large screens, shown only ≤768px */
.nav-toggle { display: none !important; }

/* --- Tablets / large phones (<=768px): hamburger menu + single columns --- */
@media (max-width: 768px) {
  .nav-wrap { gap: 8px; flex-wrap: wrap; justify-content: center; }
  .brand { width: 100%; text-align: center; }
  .nav-toggle {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 8px;
    font-size: 20px;
    line-height: 1;
    padding: 8px 14px;
    cursor: pointer;
    color: #222;
  }
  #main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
    gap: 4px 14px;
    padding: 8px 0 4px;
  }
  #main-nav.open { display: flex; }
  #main-nav a { padding: 8px 6px; }
  #main-nav a.nav-button { text-align: center; }

  .hero { padding: 44px 0 36px; }
  .hero-grid,
  .split-layout,
  .mission-grid,
  .info-row { grid-template-columns: 1fr; }
  .hero-visual img { min-height: 0; height: clamp(220px, 55vw, 340px); }
  .about-visual > img { height: clamp(180px, 45vw, 260px); }
  .mission-photo img { height: clamp(170px, 45vw, 250px); }

  .card-grid,
  .stats-grid,
  .gallery-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .gallery-grid img { height: clamp(150px, 38vw, 220px); }
  .info-card img, .project-card img { height: clamp(130px, 32vw, 180px); }

  .cta-banner { grid-template-columns: 1fr; text-align: left; padding: 26px 22px; }
  .cta-banner .primary-btn { justify-self: stretch; }

  .admin-layout { padding: 28px 0 60px; }
  .admin-shell { grid-template-columns: 1fr; }
  .admin-sidebar { position: static; min-height: 0; max-height: none; overflow: visible; }
  .admin-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .admin-logout { margin-top: 12px; }
  .admin-page-heading { flex-direction: column; align-items: stretch; }
  .admin-card { padding: 20px 16px; }
  .admin-card-heading { flex-direction: column; }
  .admin-form-grid { grid-template-columns: 1fr; }

  .auth-wrap { padding: 56px 16px; }
  .auth-card { padding: 24px 18px; }
  .account-panel { padding: 26px 18px; }
  .account-details { grid-template-columns: 1fr 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 22px; }
  .site-footer { padding: 36px 0; }
}

/* --- Phones (<=480px): everything stacks, tap targets stay usable --- */
@media (max-width: 480px) {
  body { font-size: 0.98rem; }
  .container { padding: 0 14px; }
  .brand { font-size: 1.02rem; }
  .hero { padding: 36px 0 30px; }
  .section { padding: 48px 0; }
  .card-grid,
  .stats-grid,
  .gallery-grid,
  .account-details,
  .member-page-list,
  .admin-nav { grid-template-columns: 1fr; }
  .hero-meta span { width: 100%; text-align: center; }
  .cta-row { flex-direction: column; align-items: stretch; }
  .cta-row .primary-btn, .cta-row .secondary-btn { width: 100%; }
  .nav-button, .primary-btn, .secondary-btn { min-height: 44px; }
  input, textarea, select { font-size: 16px; } /* stops iOS auto-zoom on focus */
  .stat-card { padding: 22px 16px; }
  .testimonial-card img { width: 56px; height: 56px; }
}

/* --- Very small phones (<=360px) --- */
@media (max-width: 360px) {
  .hero-copy h1 { font-size: clamp(1.8rem, 9vw, 2.3rem); }
  h2 { font-size: clamp(1.5rem, 7vw, 2rem); }
  .auth-card, .account-panel, .admin-card { border-radius: 12px; }
}

/* --- Large desktops (>=1400px): cap line length, use extra space --- */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
  .hero-grid { gap: 56px; }
  .card-grid { gap: 26px; }
}

/* ===== Organisational profile page ===== */
.fact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 26px; }
.fact-item { background: #fff; border: 1px solid #e5e0d5; border-top: 3px solid #a8823c; border-radius: 2px; padding: 16px 18px; }
.fact-item span { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: #777; margin-bottom: 6px; }
.fact-item strong { font-size: 0.98rem; line-height: 1.4; }
.reg-card { background: #fff; border: 1px solid #e5e0d5; border-top: 4px solid #16324f; border-radius: 2px; padding: 26px; max-width: 720px; margin-top: 26px; }
.reg-table { width: 100%; border-collapse: collapse; }
.reg-table th, .reg-table td { text-align: left; padding: 12px 14px; border-bottom: 1px solid #eee9de; vertical-align: top; }
.reg-table tr:last-child th, .reg-table tr:last-child td { border-bottom: none; }
.reg-table th { width: 38%; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; color: #6b5d3f; font-weight: 600; }
.reg-table td { font-size: 1rem; }
.reg-number { font-size: 1.25rem; color: #16324f; letter-spacing: 0.04em; }
@media (max-width: 480px) { .reg-table th, .reg-table td { display: block; width: 100%; padding: 6px 0; } .reg-table tr { border-bottom: 1px solid #eee9de; padding: 8px 0; display: block; } }

/* ===== Partnerships & Leadership pages (incorporated from paytack.co.ke/ila) ===== */
.section-alt { background: #f6f4ef; }
.lead { max-width: 760px; font-size: 1.06rem; line-height: 1.65; color: #444; }
.note { margin-top: 18px; font-size: 0.92rem; color: #777; font-style: italic; }
.check-list { list-style: none; padding: 0; margin: 10px 0 0; }
.check-list li { position: relative; padding: 6px 0 6px 26px; line-height: 1.5; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 6px; color: #1c7c54; font-weight: 700; }
.pill { display: inline-block; background: #efe9dc; color: #6b5d3f; border-radius: 999px; padding: 4px 12px; font-size: 0.8rem; font-weight: 600; margin-bottom: 10px; }
.tag-grid { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 10px; }
.tag-item { background: #fff; border: 1px solid #e5e0d5; border-radius: 10px; padding: 12px 16px; font-weight: 500; font-size: 0.95rem; }
.partner-card { display: grid; grid-template-columns: 220px 1fr; gap: 28px; background: #fff; border: 1px solid #e5e0d5; border-radius: 14px; padding: 26px; margin-top: 26px; align-items: start; }
.partner-card-media img { width: 100%; max-height: 160px; object-fit: contain; border-radius: 10px; }
.partner-card-body h3 { margin: 6px 0 10px; }
.partner-card-body h4 { margin: 16px 0 0; font-size: 1rem; }
.duo-media { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 26px; }
.duo-media figure { margin: 0; background: #fff; border: 1px solid #e5e0d5; border-radius: 14px; overflow: hidden; }
.duo-media img { width: 100%; height: 320px; object-fit: cover; display: block; }
.duo-media figcaption { padding: 10px 14px; font-size: 0.85rem; color: #777; }
.team-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 32px; margin-top: 30px; }
.team-card { background: #fff; border: 1px solid #e5e0d5; border-radius: 14px; overflow: hidden; text-align: center; padding-bottom: 22px; }
.team-card img { width: 200px; height: 257px; object-fit: cover; display: block; margin: 24px auto 24px; border: 1px solid #cfc8b8; border-radius: 2px; background: #fff; box-shadow: 0 1px 3px rgba(22,50,79,0.12); }
.team-card h3 { margin: 0 14px 12px; font-size: 1.05rem; }
.team-role { margin: 0 14px 10px; font-weight: 600; color: #1c7c54; font-size: 0.9rem; line-height: 1.45; }
.team-cred { margin: 0 14px 20px; color: #666; font-size: 0.88rem; line-height: 1.45; }
.team-mail { display: block; margin: 0 14px; padding: 14px 0 4px; border-top: 1px solid #eee7d8; font-size: 0.85rem; color: #2456a6; word-break: break-all; }
.org-chain { list-style: none; margin: 26px 0 0; padding: 0; max-width: 640px; }
.org-chain li { background: #fff; border: 1px solid #e5e0d5; border-left: 5px solid #1c7c54; border-radius: 10px; padding: 14px 18px; margin-bottom: 12px; }
.org-chain li strong { display: block; font-size: 1.02rem; }
.org-chain li span { color: #666; font-size: 0.9rem; }
@media (max-width: 768px) {
  .partner-card { grid-template-columns: 1fr; }
  .partner-card-media img { max-height: 120px; }
  .duo-media { grid-template-columns: 1fr; }
  .duo-media img { height: auto; }
  .tag-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .tag-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   CLASSIC THEME OVERRIDE (2026-09-15)
   Serif headings, rectangular elements, formal navy/antique-gold palette.
   Appended last so these rules win over the modern styles above.
   ===================================================================== */
:root {
  --primary: #16324f;        /* deep institutional navy */
  --secondary: #a8823c;      /* antique gold */
  --bg: #faf8f3;             /* warm cream */
  --panel: #ffffff;
  --text: #24303f;
  --muted: #5d6470;
  --border: #dcd5c6;
  --shadow: 0 1px 2px rgba(22, 50, 79, 0.06), 0 10px 24px rgba(22, 50, 79, 0.07);
  --serif: Georgia, 'Times New Roman', 'Palatino Linotype', serif;
}

/* --- Typography: serif headings, calmer rhythm --- */
body { line-height: 1.65; }
h1, h2, h3, h4, h5, h6,
.brand,
.cta-banner h2,
.auth-card h2 {
  font-family: var(--serif);
  letter-spacing: 0 !important;
  font-weight: 700;
}
h2 { font-size: 1.9rem; }
.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
  border-left: 3px solid var(--secondary);
  padding-left: 12px;
}
.eyebrow {
  color: var(--secondary);
  letter-spacing: 0.22em;
  font-weight: 700;
}
.lead { color: var(--muted); }

/* --- Rectangular classic components --- */
.nav-button, .primary-btn, .secondary-btn,
.login-button, .hero-meta span,
.info-card, .project-card, .testimonial-card, .mini-card, .stat-card,
.partner-card, .team-card, .org-chain li, .tag-item, .duo-media figure,
.pill, .auth-card, .admin-card, .account-panel, .custom-page-image,
.cta-banner, input, textarea, select, .remember-row input {
  border-radius: 2px;
}
.hero-visual img { border-radius: 2px; box-shadow: var(--shadow); }

/* --- Buttons: squared, uppercase, no floating hover --- */
.nav-button, .primary-btn, .secondary-btn {
  border-radius: 2px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.8rem 1.4rem;
}
.login-button {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  border-radius: 2px;
}
.primary-btn:hover, .secondary-btn:hover, .nav-button:hover {
  transform: none;
}
.primary-btn { border: 1px solid var(--primary); }
.primary-btn:hover { background: #0f2338; }
.secondary-btn { border: 1px solid var(--primary); background: transparent; }
.secondary-btn:hover { background: rgba(22, 50, 79, 0.06); }
.nav-button:hover { background: #0f2338; box-shadow: none; }
.primary-btn:focus-visible, .secondary-btn:focus-visible, .nav-button:focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

/* --- Header: solid, formal, double-rule under nav --- */
.topbar {
  background: #ffffff;
  backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 #fff, 0 3px 0 var(--primary);
}
nav { font-weight: 500; }
nav a { letter-spacing: 0.02em; }
nav a:hover { color: var(--secondary); }

/* --- Hero: calmer, paper-like --- */
.hero {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 84px 0 60px;
}
.hero-meta span {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 2px;
  text-transform: uppercase;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

/* --- Sections & cards: crisp borders, quiet shadows --- */
.section { padding: 72px 0; }
.muted, .section-alt { background: #f3f0e8; }
.info-card, .project-card, .testimonial-card, .mini-card, .stat-card,
.partner-card, .team-card, .tag-item, .org-chain li, .duo-media figure,
.auth-card, .admin-card, .account-panel, .cta-banner {
  border: 1px solid var(--border);
  box-shadow: none;
}
.info-card img, .project-card img, .testimonial-card img, .team-card img,
.duo-media img, .duo-media figure { border-radius: 0; }
.info-card { border-top: 3px solid var(--secondary); }
.org-chain li { border-left: 4px solid var(--secondary); }
.team-card { padding-bottom: 20px; }
.team-role { color: var(--secondary); }
.stat-card { background: #fff; border: 1px solid var(--border); }

/* --- CTA banner: solid navy, classic --- */
.cta-banner {
  background: var(--primary);
  color: #f3efe6;
  border: none;
  border-top: 4px solid var(--secondary);
}
.cta-banner h2 { color: #fff; }
.cta-banner p { color: #cfd8e2; }

/* --- Footer: navy with gold rule --- */
.site-footer {
  background: #10263d;
  border-top: 4px solid var(--secondary);
}
.site-footer a:hover { color: var(--secondary); }

/* --- Forms --- */
input, textarea, select { border: 1px solid var(--border); background: #fff; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); }

/* --- Pills/badges: square-ish, muted --- */
.pill { border: 1px solid var(--border); background: #f3efe4; color: #7a6432; }

@media (max-width: 768px) {
  .hero { padding: 56px 0 44px; }
  .section { padding: 56px 0; }
}
/* ===== Paytack.co.ke/ila incorporation: new sections ===== */
.hero-sub { font-size: 1.15rem; font-weight: 600; color: #16324f; margin-top: -6px; }
.text-link { display: inline-block; margin-top: 10px; color: #16324f; font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.text-link:hover { color: #a8823c; }
.justice-quote { margin: 26px 0 0; padding: 18px 24px; border-left: 4px solid #a8823c; background: #fff; font-family: Georgia, 'Times New Roman', serif; font-size: 1.08rem; font-style: italic; color: #2b2b2b; max-width: 820px; }
.flagship-copy { max-width: 560px; }
.flagship-media { margin: 0; background: #fff; border: 1px solid #e0d9c8; padding: 10px; }
.flagship-media img { width: 100%; height: 340px; object-fit: cover; display: block; }
.flagship-media figcaption { padding: 10px 6px 4px; font-size: 0.85rem; color: #6b6b6b; }
.caption-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; margin-top: 24px; }
.caption-card { margin: 0; background: #fff; border: 1px solid #e0d9c8; overflow: hidden; display: flex; flex-direction: column; }
.caption-card img { width: 100%; height: 250px; object-fit: cover; object-position: center 30%; display: block; }
.caption-card figcaption { padding: 10px 12px; font-size: 0.86rem; color: #555; border-top: 1px solid #eee7d8; min-height: 64px; display: flex; align-items: center; }
.partner-strip-row { display: grid; grid-template-columns: 130px 130px 1fr; gap: 24px; align-items: center; margin-top: 24px; background: #fff; border: 1px solid #e0d9c8; padding: 22px 26px; }
.partner-strip-row img { max-height: 72px; width: auto; object-fit: contain; justify-self: center; }
.footer-motto { font-family: Georgia, 'Times New Roman', serif; font-style: italic; color: #cfa85e; margin: 6px 0 10px; }
/* ===== Call button (contact section): phones/small screens only ===== */
.call-btn { display: none; }
@media (max-width: 768px) {
  .call-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 12px 22px;
    background: #1c7c54;
    color: #fff;
    font-weight: 700;
    text-decoration: none;
    border-radius: 6px;
  }
  .call-btn:hover { background: #155e40; color: #fff; }
}
.footer-reg { font-size: 0.8rem; color: #8fa3b8; margin-top: 8px; letter-spacing: 0.04em; }
@media (max-width: 768px) {
  .partner-strip-row { grid-template-columns: 1fr 1fr; }
  .partner-strip-row div { grid-column: 1 / -1; }
  .flagship-media img { height: auto; }
}
/* ===== Site database manager (/admin/database) ===== */
.db-table-wrap { overflow-x: auto; }
.db-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.db-table th, .db-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid #eee7d8; vertical-align: middle; }
.db-table thead th { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: #8a7a55; border-bottom: 2px solid #e0d9c8; }
.db-key { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.86rem; background: #faf8f3; border: 1px solid #e0d9c8; padding: 2px 7px; }
.db-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #6b5d3f; background: #efe9dc; border-radius: 999px; padding: 2px 9px; margin-left: 6px; }
.db-actions { white-space: nowrap; }
.db-actions form { display: inline; margin-left: 8px; }
.db-small { font-size: 0.82rem; padding: 6px 12px; }
.db-editor { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; line-height: 1.55; width: 100%; border: 1px solid #cfc6ae; background: #fffdf8; }
.db-transfer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; }
.db-transfer-grid h3 { margin: 0 0 6px; }
.db-danger { border: 1px solid #d8a7a0; }
@media (max-width: 768px) {
  .db-transfer-grid { grid-template-columns: 1fr; }
}

/* =====================================================================
   ILA DIGITAL THEME (2026-09-24)
   Design language adopted from paytack.co.ke/ila: navy + signal-blue +
   antique-gold, Manrope display / Inter body, crisp bordered cards with
   quiet shadows, gold rules, navy utility bar and footer.
   Appended last so these rules win over the themes above.
   ===================================================================== */
:root {
  /* Raw palette (paytack.co.ke/ila tokens) */
  --navy: #0f2f5a;
  --navy-deep: #0a2140;
  --navy-ink: #172033;
  --blue: #144b92;
  --blue-hover: #103c75;
  --gold: #af862c;
  --gold-hover: #785b1d;
  --gold-soft: #d9b768;
  --light-blue: #eaf2fa;
  --soft: #f7f9fc;
  --cream: #f7f1e3;
  --line: #d9e1ea;
  --display: 'Manrope', 'Inter', sans-serif;

  /* Token remap — every component rule above follows these */
  --primary: #0f2f5a;
  --secondary: #af862c;
  --bg: #ffffff;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5d6778;
  --border: #d9e1ea;
  --shadow: 0 1px 2px rgba(15, 47, 90, 0.05), 0 12px 28px rgba(15, 47, 90, 0.07);
}

/* --- Typography: Manrope display, Inter body --- */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
}
h1, h2, h3, h4, h5, h6,
.brand,
.cta-banner h2,
.auth-card h2,
.admin-page-heading h1,
.account-panel h1 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.015em;
  color: var(--navy);
}
h2 { font-size: clamp(1.65rem, 2.6vw, 2.15rem); line-height: 1.2; }
h3 { font-size: 1.15rem; }
.eyebrow {
  color: var(--gold);
  letter-spacing: 0.14em;
  font-weight: 800;
}
.lead { color: var(--muted); max-width: 780px; }
.note { color: var(--muted); }
.text-link { color: var(--blue); }
.text-link:hover { color: var(--blue-hover); }
.footer-motto { font-family: var(--display); font-style: italic; color: var(--gold-soft); }
.check-list li::before { color: var(--blue); }
.team-role { color: var(--blue); }
.team-mail { color: var(--blue); }
.hero-sub { color: var(--navy); }

/* --- Utility bar: navy contact strip (target shows it on wide screens) --- */
.utility-bar { display: none; background: var(--navy); color: #fff; }
.utility-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 40px;
  font-size: 0.8125rem;
  line-height: 1.35;
  white-space: nowrap;
}
/* Left cluster stays on one line; the address absorbs the slack. */
.utility-contact {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: nowrap;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
}
.utility-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: rgba(255, 255, 255, 0.78);
}
a.utility-item:hover { color: #fff; }
.utility-item svg { color: var(--gold-soft); flex: none; }
/* Text nodes clip instead of spilling; address is the only shrinker. */
.utility-item > span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Email and phone must never compress or wrap. */
.utility-item:not(.utility-item-address) { flex: 0 0 auto; }
.utility-item-address { display: none; flex: 1 1 auto; min-width: 0; }

/* --- Address marquee: the full address scrolls instead of truncating --- */
.utility-item .utility-marquee {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: clip; /* beats .utility-item > span; text scrolls, never ellipsis */
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 20px, #000 calc(100% - 20px), transparent 100%);
}
.utility-marquee__track {
  display: flex;
  width: max-content;
  animation: utility-marquee-scroll 34s linear infinite;
  will-change: transform;
}
/* Equal padding on both copies keeps the -50% loop seamless. */
.utility-marquee__text { padding-right: 3rem; white-space: nowrap; }
@keyframes utility-marquee-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}
/* WCAG 2.2.2: let visitors pause the motion by hovering or focusing. */
.utility-item-address:hover .utility-marquee__track,
.utility-item-address:focus-within .utility-marquee__track { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) {
  .utility-marquee__track { animation: none; }
}
/* Socials stay rigid and hard-aligned to the right edge. */
.utility-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
  margin-left: auto;
}
.utility-links a { color: rgba(255, 255, 255, 0.78); font-weight: 600; font-size: 0.8125rem; }
.utility-links a:hover { color: var(--gold-soft); }
@media (min-width: 768px) { .utility-bar { display: block; } }
@media (min-width: 1360px) { .utility-item-address { display: inline-flex; } }

/* --- Header: white, quiet shadow, blue hover --- */
.topbar {
  background: #ffffff;
  backdrop-filter: none;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 3px rgba(15, 47, 90, 0.06);
}
.nav-wrap { min-height: 74px; }
.brand {
  font-size: 1.15rem;
  color: var(--navy);
  border-left: 3px solid var(--gold);
  padding-left: 12px;
  line-height: 1.2;
}
nav { font-weight: 600; font-size: 0.9375rem; }
nav a { letter-spacing: 0; color: var(--text); }
nav a:hover { color: var(--blue); }

/* --- Buttons: rectangular, blue primary / outline secondary --- */
.nav-button,
.primary-btn,
.secondary-btn {
  border-radius: 8px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.72rem 1.4rem;
}
.primary-btn { background: var(--blue); border: 1px solid var(--blue); color: #fff; }
.primary-btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); transform: none; }
.secondary-btn { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.secondary-btn:hover { background: var(--light-blue); transform: none; }
.nav-button { background: var(--blue); border: 1px solid var(--blue); }
.nav-button:hover,
.nav-button:focus-visible { background: var(--blue-hover); border-color: var(--blue-hover); box-shadow: none; }
.login-button { border-radius: 8px; text-transform: none; letter-spacing: 0; }
.primary-btn:focus-visible,
.secondary-btn:focus-visible,
.nav-button:focus-visible { outline: 3px solid rgba(175, 134, 44, 0.45); outline-offset: 2px; }
.register-link,
.auth-switch a { color: var(--blue); }

/* --- Hero: soft blue wash, breadcrumb support --- */
.hero {
  background: linear-gradient(180deg, var(--light-blue) 0%, #ffffff 100%);
  border-bottom: 1px solid var(--line);
  padding: 64px 0 56px;
}
.page-hero {
  background: var(--soft);
  border-bottom: 1px solid var(--line);
  padding: 44px 0 48px;
}
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}
.breadcrumb a { color: var(--blue); font-weight: 600; }
.breadcrumb a:hover { color: var(--blue-hover); }
.breadcrumb .crumb-sep { color: #b9c7d6; }
.breadcrumb [aria-current='page'] { color: var(--navy); font-weight: 600; }
.page-hero h1 {
  font-family: var(--display);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-size: clamp(2rem, 4vw, 2.9rem);
  line-height: 1.12;
  color: var(--navy);
  margin: 0 0 14px;
}
.page-hero .lead { font-size: 1.0625rem; }
.hero-meta span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  padding: 6px 14px;
}
.heading-row { margin-bottom: 18px; }

/* --- Badges / pills --- */
.badge,
.pill {
  display: inline-block;
  border: 1px solid #e6d7ac;
  border-radius: 999px;
  background: var(--cream);
  color: var(--gold-hover);
  padding: 4px 12px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 10px;
}

/* --- Sections: white / soft alternates --- */
.section { padding: 68px 0; }
.muted,
.section-alt { background: var(--soft); }
.section-alt { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* --- Cards: crisp borders, small radius, quiet shadow --- */
.info-card, .project-card, .testimonial-card, .mini-card, .stat-card,
.partner-card, .team-card, .tag-item, .org-chain li, .duo-media figure,
.auth-card, .admin-card, .account-panel, .caption-card, .flagship-media,
.partner-strip-row, .fact-item, .reg-card, .admin-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 1px 2px rgba(15, 47, 90, 0.04);
}
.info-card,
.project-card { border-top: 3px solid var(--gold); }
.info-card img,
.project-card img,
.duo-media img,
.duo-media figure { border-radius: 12px 12px 0 0; }
.duo-media figure { overflow: hidden; }
.stat-card strong { color: var(--navy); font-family: var(--display); }
.team-card img { border: 1px solid var(--line); border-radius: 8px; }
.org-chain li { border-left: 4px solid var(--gold); }
.fact-item { border-top: 3px solid var(--gold); }
.reg-card { border-top: 4px solid var(--navy); }
.reg-number { color: var(--navy); }

/* --- Partner cards: media panel + labelled sections (target style) --- */
.partner-card { padding: 26px; align-items: start; }
.partner-card-media {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  display: grid;
  place-items: center;
}
.partner-card-media img { border-radius: 6px; }
.partner-card-body h3 { font-size: 1.35rem; margin: 8px 0 10px; }
.partner-card-body h3 .name-muted { color: var(--muted); font-weight: 600; }
.partner-card-body h4 {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-family: var(--display);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--navy);
}
.quote-line {
  margin: 14px 0 0;
  padding-left: 16px;
  border-left: 3px solid var(--gold);
  font-family: var(--display);
  font-size: 1.0625rem;
  font-weight: 600;
  font-style: italic;
  line-height: 1.5;
  color: var(--navy);
}
.partner-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 26px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}
.partner-meta li { display: inline-flex; align-items: center; gap: 8px; }
.partner-meta svg { color: var(--gold); flex: none; }
.justice-quote { font-family: var(--display); border-left: 4px solid var(--gold); border-radius: 0; }

/* --- CTA banner: solid navy with gold rule --- */
.cta-banner {
  background: var(--navy);
  border: none;
  border-top: 4px solid var(--gold);
  border-radius: 12px;
  box-shadow: none;
  color: #fff;
}
.cta-banner .eyebrow { color: var(--gold-soft); }
.cta-banner h2 { color: #fff; }

/* --- Footer: navy with gold rule --- */
.site-footer {
  background: var(--navy);
  border-top: 4px solid var(--gold);
  color: #fff;
  padding: 54px 0 0;
}
.footer-grid { grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 34px; }
.site-footer h3,
.site-footer h4 {
  font-family: var(--display);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 14px;
}
.site-footer h3 { font-size: 0.95rem; text-transform: none; letter-spacing: 0; }
.site-footer p,
.site-footer li,
.site-footer a { color: rgba(255, 255, 255, 0.78); }
.site-footer a:hover { color: var(--gold-soft); }
.footer-bottom {
  margin-top: 40px;
  padding: 18px 0 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.footer-bottom .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}
.footer-bottom p { margin: 0; font-size: 0.82rem; color: rgba(255, 255, 255, 0.62); }
.footer-reg { color: rgba(255, 255, 255, 0.55); letter-spacing: 0.02em; }

/* --- Forms stay legible on the new palette --- */
label, .form-group label { color: var(--navy); }
input, textarea, select { border-radius: 8px; border-color: var(--line); }
input:focus, textarea:focus, select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(20, 75, 146, 0.15);
  outline-offset: 0;
}
.flash-box > div {
  background: var(--light-blue);
  border: 1px solid #bcd3ea;
  border-radius: 10px;
  color: var(--blue-hover);
}

/* --- Responsive: footer columns + page hero --- */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .page-hero { padding: 34px 0 38px; }
  .hero { padding: 44px 0 40px; }
  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-footer { padding-top: 42px; }
  .partner-card { padding: 20px 18px; }
}

/* =====================================================================
   CONTACT FORM + INBOX (2026-09-24)
   ===================================================================== */
.contact-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 34px; align-items: start; }
.contact-card {
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--gold);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 1px 2px rgba(15, 47, 90, 0.04);
}
.contact-intro { margin: 0 0 22px; font-style: normal; }
.contact-form { display: grid; gap: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.contact-submit { margin-top: 6px; }
.contact-submit .primary-btn { width: 100%; cursor: pointer; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.contact-aside {
  display: grid;
  gap: 20px;
  padding: 26px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.contact-aside h2 { margin: 0; font-size: 1.15rem; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.contact-list li { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 12px; font-size: 0.9375rem; }
.contact-list svg { color: var(--gold); margin-top: 3px; }
.contact-list strong { display: block; font-family: var(--display); font-size: 0.72rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--navy); margin-bottom: 2px; }
.block-btn { display: block; width: 100%; text-align: center; }
.contact-note { padding-top: 16px; border-top: 1px solid var(--line); }
.contact-note h3 { margin: 0 0 6px; font-size: 0.95rem; }
.contact-note p { margin: 0; font-size: 0.9rem; color: var(--muted); }

/* Admin inbox */
.admin-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mail-status { margin: 0; padding: 12px 14px; border-radius: 8px; font-size: 0.92rem; }
.mail-status-on { background: #eef6f0; border: 1px solid #c3ddca; color: #1e5b39; }
.mail-status-off { background: var(--cream); border: 1px solid #e6d7ac; color: var(--gold-hover); }
.mail-status code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; background: rgba(15, 47, 90, 0.06); padding: 1px 5px; border-radius: 4px; }
.message-card { padding: 22px 24px; }
.message-unread { border-left: 4px solid var(--blue); }
.message-head { display: flex; justify-content: space-between; align-items: start; gap: 20px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.message-head h2 { margin: 0 0 6px; font-size: 1.1rem; }
.message-meta { margin: 0 0 3px; font-size: 0.85rem; color: var(--muted); word-break: break-word; }
.message-meta a { color: var(--blue); }
.message-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.message-actions form { display: block; }
.message-actions .secondary-btn { cursor: pointer; padding: 7px 14px; font-size: 0.82rem; }
.message-body {
  margin: 0;
  padding: 14px 16px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-family: inherit;
  font-size: 0.95rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.message-foot { margin: 12px 0 0; }

@media (max-width: 1024px) {
  .contact-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .contact-card, .contact-aside { padding: 22px 18px; }
  .field-row { grid-template-columns: 1fr; }
  .message-head { flex-direction: column; }
  .message-actions { flex-wrap: wrap; }
}

/* --- Corner radii + display tracking follow-through --- */
.hero-copy h1 { letter-spacing: -0.025em; }
.hero-visual img { border-radius: 14px; box-shadow: var(--shadow); }
.about-visual > img,
.mission-photo img,
.gallery-grid img,
.custom-page-image { border-radius: 12px; }
.value-box { border-radius: 12px; padding: 26px 24px; }
.value-box li strong { color: var(--navy); }
.flagship-media,
.caption-card { border-radius: 12px; overflow: hidden; }
.flagship-media img,
.caption-card img { border-radius: 12px 12px 0 0; }
.tag-item { padding: 12px 16px; }
.tag-item:hover { border-color: var(--gold); }
.stats-section { padding-bottom: 0; }
.stat-card { border-top: 3px solid var(--gold); }
.mission-card-row .mini-card { border-left: 3px solid var(--gold); }
.admin-layout { background: var(--soft); }
.admin-sidebar { background: var(--navy); border-radius: 12px; }
.admin-kicker { color: var(--gold-soft); }
.admin-card { border-radius: 12px; }

/* --- Header logo (appended: overrides earlier text-brand rules) --- */
.brand {
  display: inline-flex;
  align-items: center;
  border-left: 0 !important;
  padding-left: 0 !important;
  font-size: inherit !important;
  line-height: 1;
}
.brand img {
  height: 48px;
  width: auto;
  display: block;
}
@media (max-width: 768px) {
  .brand img { height: 38px; }
}
@media (max-width: 768px) {
  .brand { justify-content: center; }
}

/* =====================================================================
   DARK MODE (2026-09-24) — activated by <html data-theme="dark">
   Strategy: remap the design tokens, then pin the surfaces that are
   painted solid navy (footer/utility/CTA/sidebar) and the hardcoded
   white cards/inputs so nothing goes invisible.
   ===================================================================== */
html[data-theme='dark'] {
  color-scheme: dark;
  --bg: #0e1626;
  --panel: #162033;
  --text: #e9eef6;
  --muted: #9da9bd;
  --border: #2a3752;
  --line: #2a3752;
  --soft: #111a2c;
  --cream: #2c2717;
  --light-blue: #13233a;
  --primary: #7db2f2;   /* text/accent roles only — see button pins below */
  --blue: #7db2f2;
  --blue-hover: #a6ccf7;
  --navy: #9cc3f4;      /* text roles; solid-navy roles re-pinned below */
  --gold: #d3a94f;
  --gold-soft: #e7cc8b;
  --gold-hover: #e7cc8b;
  --secondary: #d3a94f;
  --navy-deep: #0a1f3d;
  --navy-ink: #dfe7f2;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 12px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] body { background: var(--bg); color: var(--text); }

/* Solid navy surfaces must stay dark (they carry white text) */
html[data-theme='dark'] .utility-bar,
html[data-theme='dark'] .cta-banner,
html[data-theme='dark'] .site-footer,
html[data-theme='dark'] .admin-sidebar { background: #0a1f3d; }

/* Sticky header + mobile hamburger */
html[data-theme='dark'] .topbar {
  background: rgba(14, 22, 38, 0.96);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
html[data-theme='dark'] .nav-toggle {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}

/* Hero washes: light-blue -> white becomes deep -> page bg */
html[data-theme='dark'] .hero {
  background: linear-gradient(180deg, #13233a 0%, var(--bg) 100%);
  border-bottom-color: var(--line);
}
html[data-theme='dark'] .hero-meta span {
  background: var(--panel);
  border-color: var(--line);
  color: var(--muted);
}
html[data-theme='dark'] .page-hero,
html[data-theme='dark'] .section-alt,
html[data-theme='dark'] .muted { background: var(--soft); border-color: var(--line); }

/* White cards -> panel (theme group + older one-off rules) */
html[data-theme='dark'] .info-card, html[data-theme='dark'] .project-card,
html[data-theme='dark'] .testimonial-card, html[data-theme='dark'] .mini-card,
html[data-theme='dark'] .stat-card, html[data-theme='dark'] .partner-card,
html[data-theme='dark'] .team-card, html[data-theme='dark'] .tag-item,
html[data-theme='dark'] .org-chain li, html[data-theme='dark'] .duo-media figure,
html[data-theme='dark'] .auth-card, html[data-theme='dark'] .admin-card,
html[data-theme='dark'] .account-panel, html[data-theme='dark'] .caption-card,
html[data-theme='dark'] .flagship-media, html[data-theme='dark'] .partner-strip-row,
html[data-theme='dark'] .fact-item, html[data-theme='dark'] .reg-card,
html[data-theme='dark'] .admin-panel, html[data-theme='dark'] .contact-card,
html[data-theme='dark'] .contact-aside, html[data-theme='dark'] .content-row,
html[data-theme='dark'] .creation-panel, html[data-theme='dark'] .photo-slot,
html[data-theme='dark'] .photo-slot-preview, html[data-theme='dark'] .account-details div,
html[data-theme='dark'] .member-page-link, html[data-theme='dark'] .member-page-link:hover,
html[data-theme='dark'] .justice-quote, html[data-theme='dark'] .db-key,
html[data-theme='dark'] .db-editor {
  background: var(--panel);
  border-color: var(--line);
  color: var(--text);
}
html[data-theme='dark'] .db-badge,
html[data-theme='dark'] .pill,
html[data-theme='dark'] .badge {
  background: var(--cream);
  border-color: #4a4026;
  color: var(--gold-soft);
}
html[data-theme='dark'] .team-card img { background: var(--panel); border-color: var(--line); }
html[data-theme='dark'] .admin-layout { background: var(--bg); }

/* The border-color pin above flattened accent edges — restore them */
html[data-theme='dark'] .info-card, html[data-theme='dark'] .project-card,
html[data-theme='dark'] .fact-item, html[data-theme='dark'] .stat-card {
  border-top-color: var(--gold);
}
html[data-theme='dark'] .reg-card { border-top-color: var(--blue); }
html[data-theme='dark'] .org-chain li,
html[data-theme='dark'] .mission-card-row .mini-card { border-left-color: var(--gold); }
html[data-theme='dark'] .message-unread { border-left-color: var(--blue); }
html[data-theme='dark'] .tag-item:hover { border-color: var(--gold); }

/* Logo JPEG has a baked white background — round it into a plate */
html[data-theme='dark'] .brand img { border-radius: 8px; }

/* Forms: white fields -> panel */
html[data-theme='dark'] input, html[data-theme='dark'] textarea,
html[data-theme='dark'] select {
  background: var(--panel);
  color: var(--text);
  border-color: var(--line);
}
html[data-theme='dark'] input::placeholder,
html[data-theme='dark'] textarea::placeholder { color: var(--muted); opacity: 1; }
html[data-theme='dark'] input:focus, html[data-theme='dark'] textarea:focus,
html[data-theme='dark'] select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(125, 178, 242, 0.25);
}
html[data-theme='dark'] label, html[data-theme='dark'] .form-group label { color: var(--navy); }

/* Solid-blue buttons keep white text (light blue would break contrast) */
html[data-theme='dark'] .primary-btn,
html[data-theme='dark'] .nav-button {
  background: #2f6ed0;
  border-color: #2f6ed0;
  color: #fff;
}
html[data-theme='dark'] .primary-btn:hover,
html[data-theme='dark'] .primary-btn:focus-visible,
html[data-theme='dark'] .nav-button:hover,
html[data-theme='dark'] .nav-button:focus-visible {
  background: #265cb0;
  border-color: #265cb0;
  color: #fff;
}
html[data-theme='dark'] .secondary-btn {
  background: transparent;
  color: var(--blue);
  border-color: var(--blue);
}
html[data-theme='dark'] .secondary-btn:hover { background: var(--light-blue); color: var(--blue-hover); }

/* Flash + mail notices: soft tints -> dark tints */
html[data-theme='dark'] .flash-box { background: transparent; border: none; color: var(--text); }
html[data-theme='dark'] .flash-box > div {
  background: #12351f;
  border: 1px solid #2c5e3f;
  color: #9fd9b4;
}
html[data-theme='dark'] .mail-status-on { background: #12351f; border-color: #2c5e3f; color: #9fd9b4; }
html[data-theme='dark'] .mail-status-off { background: var(--cream); border-color: #4a4026; color: var(--gold-soft); }
html[data-theme='dark'] .mail-status code { background: rgba(255, 255, 255, 0.09); color: var(--text); }

/* Tables (registration + database browser) */
html[data-theme='dark'] .reg-table th, html[data-theme='dark'] .reg-table td,
html[data-theme='dark'] .db-table th, html[data-theme='dark'] .db-table td {
  border-bottom-color: var(--line);
  color: var(--text);
}
html[data-theme='dark'] .reg-table th,
html[data-theme='dark'] .db-table thead th { color: var(--gold-soft); }
html[data-theme='dark'] .db-table thead th { border-bottom-color: var(--border); }
html[data-theme='dark'] .reg-table tr { border-bottom-color: var(--line); }

/* Toggle button (fluid footprint; icon scales independently) */
.theme-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  inline-size: clamp(2.125rem, 3.5vw, 2.75rem);
  block-size: clamp(2.125rem, 3.5vw, 2.75rem);
  padding: 0;
  border-radius: clamp(0.5rem, 1.5vw, 0.75rem);
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: clamp(0.95rem, 2.2vw, 1.15rem);
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
#themeIcon {
  display: block;
  max-inline-size: 100%;
  max-block-size: 100%;
  font-size: inherit;
  line-height: 1;
}
.theme-toggle:hover, .theme-toggle:focus-visible {
  background: var(--light-blue);
  border-color: var(--blue);
  outline: none;
}
html[data-theme='dark'] .theme-toggle { background: var(--panel); border-color: var(--line); }
html[data-theme='dark'] .theme-toggle:hover,
html[data-theme='dark'] .theme-toggle:focus-visible { background: var(--light-blue); border-color: var(--blue); }

/* Keep both header controls together and fluid on compact screens. */
@media (max-width: 768px) {
  .nav-wrap {
    display: grid;
    grid-template-columns: auto auto;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
  }
  .brand { grid-column: 1 / -1; grid-row: 1; }
  .nav-toggle { grid-column: 1; grid-row: 2; margin: 0; }
  .theme-toggle { grid-column: 2; grid-row: 2; }
  #main-nav { grid-column: 1 / -1; grid-row: 3; }
}
