/* =========================================================
   ITHCC design system — ported from ITHCC.WebsiteMain main.css
   Cleaned: no page-scale hack, no marquee/shake, mobile nav added.
   ========================================================= */

:root {
  /* Corporate healthcare / payer-oriented palette */
  --primary: #1f3b70;        /* deep desaturated blue */
  --accent: #1b9aaa;         /* teal */
  --accent-soft: #46b5d1;    /* softer teal/blue */
  --light-bg: #f3f6fc;       /* light blue-ish background */
  --text-main: #1f2933;
  --text-muted: #6b7280;
  --border-radius: 14px;
  --shadow-soft: 0 18px 45px rgba(12, 35, 75, 0.16);
  --max-width: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #ffffff;
  color: var(--text-main);
  line-height: 1.6;
}

a {
  color: inherit;
  text-decoration: none;
}

.page {
  min-height: 100vh;
  background: radial-gradient(circle at top left, #e0ecff 0, #f4f7fd 40%, #ffffff 85%);
  color: var(--text-main);
  padding: 20px;
}

.shell {
  max-width: var(--max-width);
  margin: 0 auto;
}

/* Header / Nav */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 4px 10px;
  gap: 10px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  flex-direction: column;      /* stack logo and text vertically (original) */
  align-items: flex-start;
  gap: 6px;
}

.brand-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.brand-logo img {
  display: block;
  height: 60px;
  width: auto;
}

.brand-text-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
}

.brand-text-sub {
  font-size: 12px;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  gap: 16px;
  align-items: center;
  font-size: 14px;
  color: var(--text-muted);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  opacity: 0.9;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  opacity: 1;
  color: var(--primary);
}

.nav-cta {
  padding: 5px 10px;
  border-radius: 25px;
  border: 1px solid rgba(27, 154, 170, 0.4);
  background: #ffffff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 10px 30px rgba(27, 154, 170, 0.25);
  cursor: pointer;
}

/* Shake animation (original) */
@keyframes shake {
  0% { transform: translateX(0); }
  20% { transform: translateX(-3px); }
  40% { transform: translateX(3px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

.shake-once {
  animation: shake 0.45s ease-in-out;
}

.nav-cta .dot {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: #22c55e;
}

/* Auth links: fixed to the top-right corner of the page, separate from
   the menu. Hidden unless this browser signed in before. */

.page {
  position: relative;
}

.auth-links {
  position: absolute;
  top: 6px;
  right: 18px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  padding: 3px 10px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(31, 59, 112, 0.12);
  border-radius: 999px;
}

.auth-links a {
  color: var(--primary);
  font-weight: 600;
}

.auth-links form {
  display: inline;
}

.auth-links .auth-logout {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
}

.auth-links .auth-logout:hover {
  color: var(--primary);
}

/* Mobile nav toggle */

.nav-toggle {
  display: none;
  background: #ffffff;
  border: 1px solid rgba(31, 59, 112, 0.2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 18px;
  line-height: 1;
  color: var(--primary);
  cursor: pointer;
}

/* Topic banner – auto-scrolling (from original site) */

.topic-banner {
  /* +3px top: hovered pills lift 1px and their top border was clipping
     against the element above */
  margin: 9px 0 12px;
  padding: 11px 12px 8px;
  border-radius: 999px;
  background: rgba(31, 59, 112, 0.05);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.topic-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.topic-marquee {
  overflow: hidden;
  flex: 1;
}

.topic-track {
  display: inline-flex;
  gap: 8px;
  white-space: nowrap;
  animation: scrollTopics 45s linear infinite;
}

.topic-pill {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  /* admin-styled (Site Content page); fallbacks = original design */
  background: var(--pill-bg, #ffffff);
  border: 1px solid var(--pill-bd, rgba(31, 59, 112, 0.16));
  color: var(--pill-fg, var(--primary));
  transition: background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.topic-pill:hover {
  background: #e8faf9;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

@keyframes scrollTopics {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@media (max-width: 640px) {
  .topic-banner {
    border-radius: 12px;
    padding: 8px;
  }
}

/* Hero */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 18px 0 8px;
}

.hero--single {
  grid-template-columns: minmax(0, 1fr);
}

.hero-kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 10px;
}

.hero-title {
  font-size: 34px;
  line-height: 1.2;
  color: var(--primary);
  margin-bottom: 12px;
}

.hero-title .highlight {
  color: var(--accent-soft);
}

.hero-subtitle {
  font-size: 16px;
  color: var(--text-muted);
  max-width: 580px;
  margin-bottom: 18px;
}

.hero-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.hero-pill {
  font-size: 11px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(27, 154, 170, 0.08);
  color: var(--primary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 6px;
}

.btn-primary {
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 11px 22px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-soft));
  color: #ffffff;
  box-shadow: 0 14px 35px rgba(27, 154, 170, 0.45);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.btn-secondary {
  border-radius: 999px;
  border: 1px solid rgba(31, 59, 112, 0.18);
  padding: 10px 20px;
  font-size: 13px;
  color: var(--primary);
  background: rgba(255, 255, 255, 0.96);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.btn-secondary:hover {
  border-color: rgba(31, 59, 112, 0.4);
}

.hero-meta {
  margin-top: 14px;
  font-size: 12px;
  color: var(--text-muted);
}

.hero-meta strong {
  color: var(--primary);
}

/* AI assistant callout — invites visitors to the chat capsule (text or voice) */
.assistant-callout {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 26px auto 0;
  max-width: var(--max-width);
  padding: 14px 18px;
  background: linear-gradient(135deg, #f2f9fa, #eaf4fb);
  border: 1px solid #d7e8ee;
  border-radius: var(--border-radius);
}

.assistant-callout-mic {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(140deg, #059669, #34d399);
  color: #ffffff;
  font-size: 19px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 3px 10px rgba(5, 150, 105, 0.35);
  animation: assistant-callout-pulse 2.2s infinite;
}

@keyframes assistant-callout-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.assistant-callout-text {
  margin: 0;
  font-size: 14px;
  color: var(--text-main);
}

.assistant-callout-text strong {
  color: var(--primary);
}

.assistant-callout-text a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.assistant-callout-text a:hover {
  text-decoration: underline;
}

/* Hero card */

.hero-card {
  background: #ffffff;
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  padding: 18px 18px 16px;
  border: 1px solid rgba(31, 59, 112, 0.06);
}

.hero-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 10px;
}

.hero-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.hero-card-chip {
  font-size: 11px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(27, 154, 170, 0.11);
  color: var(--accent);
  font-weight: 600;
  white-space: nowrap;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 14px;
}

.hero-stat {
  padding: 10px 8px;
  border-radius: 10px;
  background: var(--light-bg);
  text-align: left;
}

.hero-stat-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.hero-stat-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}

.hero-card-footer {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.hero-card-footer .dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #22c55e;
  margin-right: 4px;
}

/* Trust strip */

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  align-items: center;
  padding: 12px 4px;
  font-size: 12px;
  color: var(--text-muted);
  border-top: 1px solid rgba(31, 59, 112, 0.08);
  border-bottom: 1px solid rgba(31, 59, 112, 0.08);
  margin: 10px 0 6px;
}

.trust-strip strong {
  color: var(--primary);
}

/* Sections */

.section {
  margin-top: 32px;
  margin-bottom: 24px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--primary);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 560px;
}

.section-link {
  font-size: 13px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

/* Service grid & cards */

.service-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.service-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.service-card {
  /* G restyle: soft border + hover lift + teal->navy left stripe
     (owner-approved card treatment; content untouched) */
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(12, 35, 75, 0.07);
  padding: 16px 16px 14px 20px;   /* extra left room for the stripe */
  border: 1px solid #e6ebf2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  justify-content: flex-start;    /* text packs to the TOP of the card */
  position: relative;
  overflow: hidden;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.service-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, #1b9aaa, #14284c);
}

a.service-card:hover {   /* links only — main-page cards are static (no link yet) */
  box-shadow: 0 10px 24px rgba(12, 35, 75, 0.14);
  transform: translateY(-2px);
}

.service-card--contact {
  max-width: 560px;
}

.service-tag {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--accent-soft);
  font-weight: 600;
}

.service-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--primary);
}

.service-body {
  font-size: 13px;
  color: var(--text-muted);
  flex: 0 0 auto;   /* text packs to the top */
}

.service-list {
  margin-top: 6px;
  padding-left: 16px;
  font-size: 12px;
  color: var(--text-muted);
}

.service-list li {
  margin-bottom: 3px;
}

.service-footer {
  margin-top: auto;   /* the ONLY bottom-pinned element in a card */
  padding-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-muted);
  gap: 10px;
  flex-wrap: wrap;
}

.service-footer a {
  font-size: 11px;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Matches the original site: no height/position, so the bar is not visible.
   (The positioned 3px version exists in old main.css only as a comment.) */
.service-accent-bar {
  background: linear-gradient(90deg, #004b8d, #1b9aaa, #46b5d1);
}

/* Executive CTA link (ported from index.html inline styles) */

.ithcc-link-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 14px;
  border-radius: 10px;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid rgba(31, 59, 112, 0.25);
  color: var(--primary);
  background: rgba(27, 154, 170, 0.08);
  transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease, border-color 0.12s ease;
  cursor: pointer;
}

.ithcc-link-cta:hover {
  transform: translateY(-1px);
  border-color: rgba(27, 154, 170, 0.55);
  background: rgba(27, 154, 170, 0.14);
  box-shadow: 0 10px 24px rgba(12, 35, 75, 0.12);
}

.ithcc-link-cta:active {
  transform: translateY(0);
  box-shadow: none;
}

.ithcc-link-cta:focus-visible {
  outline: 3px solid rgba(27, 154, 170, 0.35);
  outline-offset: 3px;
}

/* How we work strip */

.strip {
  margin-top: 28px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f3b70, #284986);
  color: #f3f5fb;
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 16px 45px rgba(10, 27, 62, 0.6);
}

.strip-main {
  max-width: 520px;
}

.strip-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 4px;
}

.strip-text {
  font-size: 13px;
  opacity: 0.94;
}

.strip-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11px;
}

.strip-badge {
  padding: 4px 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  opacity: 0.95;
}

/* Prose blocks (service detail / case study / legal pages) */

.prose {
  max-width: 760px;
  font-size: 14px;
  color: var(--text-main);
}

.prose h2 {
  font-size: 18px;
  color: var(--primary);
  margin: 22px 0 8px;
}

.prose h3 {
  font-size: 15px;
  color: var(--primary);
  margin: 18px 0 6px;
}

.prose p {
  margin: 8px 0;
}

.prose ul,
.prose ol {
  margin: 8px 0 8px 20px;
}

.prose li {
  margin-bottom: 4px;
}

/* ROI cards (case studies — ported from index.html inline styles) */

.roi-metrics {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 20px;
}

.roi-card {
  background: #f8fafc;
  border-left: 4px solid #0b5bd3;
  padding: 18px;
  border-radius: 8px;
  flex: 1 1 220px;
  min-width: 220px;
}

.roi-highlight {
  font-size: 22px;
  font-weight: 700;
  color: #0b5bd3;
  margin-bottom: 8px;
}

.roi-text {
  font-size: 14px;
  color: #334155;
  line-height: 1.5;
}

.roi-footer {
  margin-top: 18px;
  font-weight: 500;
  color: #0f172a;
}

/* =========================
   Modal (ported from source index.html inline styles)
   ========================= */

#simpleModal.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 12px;
}

#simpleModal.modal-overlay.active {
  display: flex;
}

#simpleModal .modal-box {
  width: min(900px, 96vw);
  max-height: calc(100dvh - 24px);
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.55);
  display: flex;
  flex-direction: column;
}

#simpleModal .modal-header {
  background: #1f2937;
  color: #fff;
  padding: 14px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  gap: 12px;
}

#simpleModal .modal-header span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#simpleModal .modal-close {
  border: none;
  background: none;
  color: #fff;
  font-size: 22px;
  cursor: pointer;
  line-height: 1;
  padding: 0 6px;
}

/* IMPORTANT: scrolling happens here */
#simpleModal .modal-body,
#simpleModal #modalContent {
  padding: 22px;
  color: #334155;
  font-size: 15px;
  line-height: 1.6;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
}

/* Mobile: make modal feel natural on small screens */
@media (max-width: 520px) {
  #simpleModal.modal-overlay {
    align-items: flex-start;
    padding-top: 12px;
  }

  #simpleModal .modal-box {
    width: calc(100vw - 24px);
  }

  #simpleModal .modal-body,
  #simpleModal #modalContent {
    padding: 16px;
    font-size: 14px;
  }
}

/* Case study typography (inside modal) */

#simpleModal #modalContent h3 {
  margin: 18px 0 8px 0;
  color: #0f172a;
  font-size: 16px;
}

#simpleModal #modalContent ul {
  margin: 8px 0 0 18px;
  padding: 0;
}

.cta {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid #e2e8f0;
  color: #0f172a;
}

.cta a {
  color: #0b5bd3;
  text-decoration: underline;
}

/* Back link */

.back-link {
  margin: 2px 0 6px;
}

.back-link a {
  display: inline-block;
  padding: 4px 10px;
  background: #ffffff;
  border-radius: 8px;
  border: 1px solid rgba(31, 59, 112, 0.2);
  color: var(--primary);
  font-size: 13px;
  font-weight: 500;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
  transition: all 0.2s ease;
}

.back-link a:hover {
  background: #f2f7ff;
  border-color: rgba(31, 59, 112, 0.35);
}

/* Forms (contact) */

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  max-width: 680px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-field--full {
  grid-column: 1 / -1;
}

.form-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.form-field input,
.form-field select,
.form-field textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 2px solid rgba(27, 154, 170, 0.4);
  border-color: var(--accent);
}

.form-error {
  color: #b91c1c;
  font-size: 12px;
}

.form-success {
  background: #ecfdf5;
  border: 1px solid #10b981;
  border-radius: 10px;
  padding: 14px 16px;
  color: #065f46;
  font-size: 14px;
  max-width: 680px;
}

/* Footer */

.site-footer {
  border-top: 1px solid rgba(31, 59, 112, 0.08);
  padding: 14px 2px 8px;
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--accent);
  font-size: 11px;
}

/* Responsive */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-card {
    margin-top: 6px;
  }

  .service-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .service-grid--two {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .hero-title {
    font-size: 26px;
  }

  .service-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* Collapse nav behind toggle */
  .nav-toggle {
    display: inline-flex;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 4px;
    padding: 8px 0 4px;
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-links a:not(.nav-cta) {
    padding: 10px 8px;
    border-radius: 8px;
  }

  .nav-links a:not(.nav-cta):hover {
    background: rgba(31, 59, 112, 0.05);
  }

  .nav-cta {
    justify-content: center;
  }
}

/* Accessibility: respect reduced-motion preferences */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ============================================================
   Admin theme (internal areas only): dark & light, toggle in the
   top-right auth pill. Public site is unaffected.
   ============================================================ */

:root {
  /* Light (default): blue-sky, not washed out; black-ish text */
  --adm-bg: #cfe0f5;
  --adm-bg2: #bcd2ee;
  --adm-card: #ffffff;
  --adm-text: #0c1b34;
  --adm-muted: #44618c;
  --adm-border: rgba(31, 59, 112, 0.20);
  --adm-primary: #1f3b70;
  --adm-input-bg: #ffffff;
  --adm-header: #1f3b70;
  --adm-header-fg: #ffffff;
}

html[data-admin-theme="dark"] {
  --adm-bg: #0d1c36;
  --adm-bg2: #091530;
  --adm-card: #16294a;
  --adm-text: #eaf1fb;
  --adm-muted: #a4b7d6;
  --adm-border: rgba(255, 255, 255, 0.16);
  --adm-primary: #8fb6ee;
  --adm-input-bg: #0f2244;
  --adm-header: #0b1830;
  --adm-header-fg: #eaf1fb;
}

/* Page + text */
body.internal .page {
  background: linear-gradient(180deg, var(--adm-bg) 0, var(--adm-bg2) 100%);
  color: var(--adm-text);
}

body.internal .hero-title,
body.internal .section-title,
body.internal .service-title,
body.internal .hero-card-title,
body.internal .hero-kicker {
  color: var(--adm-primary);
}

body.internal .hero-subtitle,
body.internal .section-subtitle,
body.internal .service-body,
body.internal .hero-meta,
body.internal .service-tag {
  color: var(--adm-muted);
}

/* Cards / panels */
body.internal .service-card,
body.internal .hero-card,
body.internal .edit-card,
body.internal .cn-modal-box,
body.internal .rules-table,
body.internal .timer-card {
  background: var(--adm-card);
  border-color: var(--adm-border);
  color: var(--adm-text);
}

body.internal .rules-table td { color: var(--adm-text); border-color: var(--adm-border); }
body.internal .rules-table th,
body.internal .cn-modal-header { background: var(--adm-header); color: var(--adm-header-fg); }

/* Forms */
body.internal .form-field label,
body.internal .config-label { color: var(--adm-primary); }

body.internal .form-field input,
body.internal .form-field select,
body.internal .form-field textarea,
body.internal .config-textarea,
body.internal .timer-row input {
  background: var(--adm-input-bg);
  color: var(--adm-text);
  border-color: var(--adm-border);
}

/* Buttons / links */
body.internal .btn-secondary,
body.internal .back-link a {
  background: var(--adm-card);
  color: var(--adm-primary);
  border-color: var(--adm-border);
}

body.internal .section-link,
body.internal .service-footer a { color: var(--adm-primary); }

/* Footer */
body.internal .site-footer {
  color: var(--adm-muted);
  border-color: var(--adm-border);
}
body.internal .site-footer a { color: var(--adm-primary); }

/* Theme toggle button in the auth pill */
.auth-links .theme-toggle {
  border: 1px solid rgba(31, 59, 112, 0.25);
  background: #ffffff;
  color: #1f3b70;
  border-radius: 999px;
  width: 26px;
  height: 26px;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}
html[data-admin-theme="dark"] .auth-links .theme-toggle {
  background: #16294a;
  color: #8fb6ee;
  border-color: rgba(255, 255, 255, 0.25);
}

/* Auth pill itself adapts in dark */
html[data-admin-theme="dark"] body.internal .auth-links {
  background: rgba(22, 41, 74, 0.9);
  border-color: rgba(255, 255, 255, 0.18);
}
html[data-admin-theme="dark"] body.internal .auth-links a { color: #eaf1fb; }
html[data-admin-theme="dark"] body.internal .auth-links .auth-logout { color: #a4b7d6; }

/* =========================================================
   Scrollbars — styled as part of the page (all vertical/
   horizontal scroll areas: page, textareas, panels, grids).
   Light + dark admin theme variants.
   ========================================================= */
* {
  scrollbar-width: thin;                                   /* Firefox */
  scrollbar-color: rgba(31, 59, 112, 0.45) rgba(31, 59, 112, 0.08);
}
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: rgba(31, 59, 112, 0.06); border-radius: 8px; }
*::-webkit-scrollbar-thumb {
  background: rgba(31, 59, 112, 0.35);
  border-radius: 8px;
  border: 2px solid transparent;
  background-clip: padding-box;
}
*::-webkit-scrollbar-thumb:hover { background-color: rgba(31, 59, 112, 0.6); background-clip: padding-box; }
*::-webkit-scrollbar-corner { background: transparent; }

/* Dark admin theme: light thumbs on the dark surface */
html[data-admin-theme="dark"] * {
  scrollbar-color: rgba(143, 182, 238, 0.4) rgba(255, 255, 255, 0.06);
}
html[data-admin-theme="dark"] *::-webkit-scrollbar-track { background: rgba(255, 255, 255, 0.05); }
html[data-admin-theme="dark"] *::-webkit-scrollbar-thumb {
  background: rgba(143, 182, 238, 0.35);
  border: 2px solid transparent;
  background-clip: padding-box;
}
html[data-admin-theme="dark"] *::-webkit-scrollbar-thumb:hover { background-color: rgba(143, 182, 238, 0.6); background-clip: padding-box; }

/* Linked topic pills (topics editor V2) — anchors look like the spans */
a.topic-pill { text-decoration: none; cursor: pointer; }
a.topic-pill:hover { background: #1b9aaa; color: #ffffff; border-color: #1b9aaa; }
