/* ═══════════════════════════════════════════════════
   DxAssist — Modern Contemporary Theme
   Clean · Precise · Product-grade
   ═══════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Geist:wght@300;400;500;600;700&family=Geist+Mono:wght@400;500&display=swap');
/* Fallback stack if Geist isn't available via Google Fonts yet */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;1,9..40,400&family=DM+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Neutrals — precise greyscale */
  --parchment:     #ffffff;
  --parchment2:    #f7f7f8;
  --parchment3:    #efeff1;
  --ink:           #0d0d0f;
  --ink2:          #3a3a40;
  --ink3:          #72727d;
  --ink4:          #a8a8b2;
  /* Accent — a single clean indigo-blue */
  --brass:         #1680b4;
  --brass2:        #1993cf;
  --brass3:        #c7d1fd;
  /* Destructive */
  --crimson:       #e5373a;
  --crimson2:      #f05e61;
  /* Success teal */
  --teal:          #0a7a6a;
  --teal2:         #14a896;
  /* Surfaces */
  --surface:       #ffffff;
  --border:        #e4e4e8;
  --border2:       #d0d0d8;
  --shadow:        rgba(13,13,15,0.06);
  --shadow2:       rgba(13,13,15,0.03);
  --radius:        4px;
  /* Fonts */
  --font-display:  'DM Sans', system-ui, sans-serif;
  --font-body:     'DM Sans', system-ui, sans-serif;
  --font-special:  'DM Sans', system-ui, sans-serif;
  --font-type:     'DM Mono', 'Courier New', monospace;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background-color: var(--parchment2);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding-bottom: 48px; /* clearance for fixed footer */
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.25;
  color: var(--ink);
  letter-spacing: -0.025em;
}
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.125rem; }
p  { font-size: 1rem; line-height: 1.7; color: var(--ink2); font-weight: 400; }

a { color: var(--brass); text-decoration: none; transition: color 0.12s; }
a:hover { color: var(--brass2); }

/* ── Divider (replaces ornament) ── */
.ornament {
  text-align: center;
  color: var(--ink4);
  font-family: var(--font-type);
  font-size: 0.7rem;
  letter-spacing: 0.25em;
  margin: 0.5rem 0;
}

.ornament-line {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 1.25rem 0;
  color: var(--ink4);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ornament-line::before,
.ornament-line::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Header ── */
.site-header {
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 200;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.site-logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  gap: 1px;
}

.logo-title {
  font-family: var(--font-display);
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  letter-spacing: -0.03em;
}

.logo-tagline {
  font-family: var(--font-type);
  font-size: 0.6rem;
  color: var(--ink4);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

/* ── Navigation ── */
.site-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--brass);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  transition: color 0.12s, background 0.12s;
}

.site-nav a:hover { color: var(--brass2); background: var(--parchment3); }
.site-nav a.active { color: var(--brass); background: var(--parchment3); }

.nav-credits {
  font-family: var(--font-body);
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--brass) !important;
  background: rgba(79,110,247,0.08) !important;
  border: 1px solid rgba(79,110,247,0.2) !important;
  border-radius: 4px !important;
  margin-left: 6px;
  padding: 6px 14px !important;
  transition: background 0.12s, border-color 0.12s !important;
}

.nav-credits:hover {
  background: rgba(79,110,247,0.14) !important;
  border-color: var(--brass) !important;
  color: var(--brass) !important;
}

/* ── Main layout ── */
.page-wrap {
  flex: 1;
  max-width: 1280px;
  width: 100%;
  margin: 0 auto;
  padding: 2rem;
}

.page-wrap.narrow {
  max-width: 640px;
}

/* ── Page title block ── */
.page-title-block {
  text-align: center;
  margin-bottom: 2.5rem;
}

.page-title-block h1 {
  font-size: 2rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.page-title-block .subtitle {
  font-family: var(--font-body);
  font-size: 0.9rem;
  color: var(--ink3);
  font-weight: 400;
  letter-spacing: 0;
}

/* ── Card / Panel ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 1px 3px var(--shadow), 0 4px 16px var(--shadow2);
  position: relative;
  overflow: hidden;
}

/* No decorative pseudo-element — clean top edge */
.card::before { display: none; }

.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.card-header h2, .card-header h3 {
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 600;
}

.card-header .card-desc {
  font-size: 0.85rem;
  color: var(--ink3);
  margin-top: 3px;
  font-weight: 400;
}

.card-body { padding: 1.5rem; }

/* ── Corner ornaments — removed for clean aesthetic ── */
.card-corner::before,
.card-corner::after { display: none; }

/* ── Mode toggle — pill segmented control ── */
.mode-toggle {
  display: flex;
  background: var(--parchment3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 3px;
  gap: 2px;
  margin-bottom: 1.5rem;
}

.mode-btn {
  flex: 1;
  padding: 8px 14px;
  border: none;
  border-radius: 4px;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink3);
  cursor: pointer;
  transition: all 0.15s;
  letter-spacing: -0.01em;
}

.mode-btn.active {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px var(--shadow), 0 1px 2px rgba(0,0,0,0.04);
}

/* ── Form elements ── */
.form-group {
  margin-bottom: 1.25rem;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  display: block;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: -0.005em;
  text-transform: none;
  margin-bottom: 6px;
}

.field-hint {
  font-size: 0.78rem;
  color: var(--ink4);
  margin-top: 5px;
  line-height: 1.5;
}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
select,
textarea {
  width: 100%;
  padding: 9px 13px;
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.925rem;
  color: var(--ink);
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
  -webkit-appearance: none;
}

input::placeholder, textarea::placeholder { color: var(--ink4); }

input:focus, select:focus, textarea:focus {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2372727d' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

textarea {
  min-height: 140px;
  resize: vertical;
  line-height: 1.65;
}

textarea.freeform { min-height: 220px; }

/* ── Symptom tags ── */
.tag-input-wrap {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: 4px;
  padding: 8px;
  min-height: 90px;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-content: flex-start;
  cursor: text;
  transition: border-color 0.12s, box-shadow 0.12s;
}

.tag-input-wrap:focus-within {
  border-color: var(--brass);
  box-shadow: 0 0 0 3px rgba(79,110,247,0.12);
}

.sym-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(79,110,247,0.08);
  border: 1px solid rgba(79,110,247,0.2);
  color: var(--brass);
  border-radius: 4px;
  padding: 3px 8px 3px 10px;
  font-size: 0.825rem;
  font-weight: 500;
  animation: tagIn 0.12s ease;
}

@keyframes tagIn { from { opacity:0; transform:scale(0.9); } to { opacity:1; transform:scale(1); } }

.sym-tag-remove {
  cursor: pointer;
  color: var(--ink4);
  font-size: 0.9rem;
  line-height: 1;
  transition: color 0.1s;
}
.sym-tag-remove:hover { color: var(--crimson); }

#symptom-input {
  border: none;
  background: transparent;
  outline: none;
  font-family: var(--font-body);
  font-size: 0.925rem;
  color: var(--ink);
  min-width: 160px;
  flex: 1;
  padding: 3px 4px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.12s;
  letter-spacing: -0.01em;
  text-decoration: none;
  border: none;
}

.btn-primary {
  background: var(--brass);
  color: #fff;
  box-shadow: 0 1px 2px rgba(79,110,247,0.25), 0 3px 8px rgba(79,110,247,0.18);
}

.btn-primary:hover {
  background: var(--brass2);
  box-shadow: 0 2px 4px rgba(79,110,247,0.3), 0 6px 16px rgba(79,110,247,0.2);
  transform: translateY(-1px);
  color: #fff;
  text-decoration: none;
}

.btn-primary:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(79,110,247,0.2); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink2);
  border: 1px solid var(--border2);
  box-shadow: 0 1px 2px var(--shadow);
}

.btn-secondary:hover {
  background: var(--parchment2);
  border-color: var(--border2);
  color: var(--ink);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px var(--shadow);
  text-decoration: none;
}

.btn-danger {
  background: var(--crimson);
  color: #fff;
  box-shadow: 0 1px 2px rgba(229,55,58,0.2);
}

.btn-danger:hover {
  background: var(--crimson2);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(229,55,58,0.25);
  text-decoration: none;
  color: #fff;
}

.btn:disabled, .btn[disabled] {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.btn-full { width: 100%; }

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
  border-radius: 4px;
}

/* ── Spinner ── */
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Alerts ── */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid;
}

.alert-error  { background: #fff5f5; border-color: #fecaca; color: #c0373a; }
.alert-success{ background: #f0fdf6; border-color: #a7f3d0; color: #0a7a4a; }
.alert-info   { background: #eff6ff; border-color: #bfdbfe; color: #1d6ee4; }
.alert-warn   { background: #fffbeb; border-color: #fde68a; color: #92660a; }

/* ── Results panel ── */
.results-wrap {
  background: var(--parchment2);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  font-size: 0.925rem;
  line-height: 1.75;
  color: var(--ink2);
  min-height: 100px;
  white-space: pre-wrap;
  word-break: break-word;
}

.results-meta {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}

.badge {
  font-family: var(--font-type);
  font-size: 0.68rem;
  padding: 3px 9px;
  border-radius: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.badge-mode   { background: rgba(79,110,247,0.08);  color: var(--brass);   border: 1px solid rgba(79,110,247,0.18); }
.badge-time   { background: var(--parchment3);       color: var(--ink3);    border: 1px solid var(--border); }
.badge-credits{ background: var(--ink);              color: #fff;           border: 1px solid var(--ink); }

/* ── History table ── */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.data-table th {
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink3);
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  background: var(--parchment2);
  white-space: nowrap;
}

.data-table td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--ink2);
  vertical-align: top;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--parchment2); color: var(--ink); }

.data-table .truncate {
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ── Credit packages ── */
.credit-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.credit-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1.5rem;
  text-align: center;
  position: relative;
  box-shadow: 0 1px 3px var(--shadow);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
  cursor: pointer;
  overflow: hidden;
}

.credit-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
  border-color: var(--border2);
}

.credit-card.featured {
  border-color: var(--brass);
  box-shadow: 0 2px 8px rgba(79,110,247,0.12);
}

.credit-card.featured:hover {
  box-shadow: 0 10px 28px rgba(79,110,247,0.18);
  transform: translateY(-3px);
}

.credit-card .ribbon {
  position: absolute;
  top: 28px; right: -26px;
  background: var(--brass);
  color: #fff;
  font-family: var(--font-type);
  font-size: 0.58rem;
  letter-spacing: 0.08em;
  padding: 4px 32px;
  text-transform: uppercase;
  transform: rotate(45deg);
  font-weight: 500;
}

.credit-card .credits-num {
  font-family: var(--font-display);
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-bottom: 4px;
  letter-spacing: -0.04em;
}

.credit-card .credits-label {
  font-size: 0.8rem;
  color: var(--ink3);
  font-weight: 400;
  margin-bottom: 1.25rem;
}

.credit-card .price {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--brass);
  letter-spacing: -0.03em;
  margin-bottom: 0.75rem;
}

.credit-card .per-credit {
  font-family: var(--font-type);
  font-size: 0.68rem;
  color: var(--ink4);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

/* ── Auth forms ── */
.auth-wrap {
  min-height: calc(100vh - 172px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  background: var(--parchment2);
}

.auth-card {
  width: 100%;
  max-width: 440px;
}

.auth-header {
  text-align: center;
  margin-bottom: 2rem;
}

.auth-header h1 {
  font-size: 1.75rem;
  letter-spacing: -0.03em;
  margin-bottom: 0.4rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.85rem;
  color: var(--ink3);
}

/* ── Admin ── */
.admin-table input[type=number],
.admin-table input[type=text] {
  padding: 6px 10px;
  font-size: 0.875rem;
}

/* ── Loading skeleton ── */
.skel {
  background: linear-gradient(90deg, var(--parchment3) 25%, var(--border) 50%, var(--parchment3) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 4px;
  height: 14px;
  margin-bottom: 10px;
}

@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ── Footer ── */
.site-footer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  text-align: center;
  padding: 0.75rem 2rem;
  border-top: 1px solid var(--border);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 0.8rem;
  color: var(--ink4);
  line-height: 1.6;
}

.site-footer a { color: var(--ink3); }
.site-footer a:hover { color: var(--ink); }

/* ── Responsive ── */
@media (max-width: 900px) {
  .page-wrap { padding: 1rem; }
  .credit-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .header-inner { padding: 0 1rem; }
  .site-nav a { padding: 6px 8px; font-size: 0.82rem; }
}

/* Mobile menu — hidden by default */
.mobile-menu-btn { display: none; }
.mobile-nav { display: none; }

@media (max-width: 640px) {
  .site-nav { display: none; }

  /* Hamburger button */
  .mobile-menu-btn {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 36px;
    height: 36px;
    padding: 6px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 4px;
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-menu-btn span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ink2);
    border-radius: 4px;
    transition: transform 0.2s, opacity 0.2s;
    transform-origin: center;
  }

  /* Animate to X when open */
  .mobile-menu-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
  .mobile-menu-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Mobile nav drawer */
  .mobile-nav {
    flex-direction: column;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 0.5rem 0;
  }

  .mobile-nav.open { display: flex; }

  .mobile-nav a {
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--ink2);
    text-decoration: none;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.12s, color 0.12s;
  }

  .mobile-nav a:last-child { border-bottom: none; }
  .mobile-nav a:hover { background: var(--parchment2); color: var(--ink); }
  .mobile-nav a.active { color: var(--brass); background: var(--parchment2); }
  .mobile-nav .nav-credits {
    color: var(--brass) !important;
    background: rgba(79,110,247,0.06) !important;
    margin: 0.5rem 1rem !important;
    border-radius: 4px !important;
    border: 1px solid rgba(79,110,247,0.2) !important;
    text-align: center;
  }
}

/* Restore desktop nav */
@media (min-width: 641px) {
  .site-nav { display: flex; }
}


    /* ── Scroll fade-in ── */
    .terms-section {
      opacity: 0;
      transform: translateY(12px);
      animation: fadeUp 0.4s ease forwards;
    }
    .terms-section:nth-child(1)  { animation-delay: 0.05s; }
    .terms-section:nth-child(2)  { animation-delay: 0.10s; }
    .terms-section:nth-child(3)  { animation-delay: 0.15s; }
    .terms-section:nth-child(4)  { animation-delay: 0.20s; }
    .terms-section:nth-child(5)  { animation-delay: 0.25s; }
    .terms-section:nth-child(6)  { animation-delay: 0.30s; }
    .terms-section:nth-child(7)  { animation-delay: 0.35s; }
    .terms-section:nth-child(8)  { animation-delay: 0.40s; }
    .terms-section:nth-child(9)  { animation-delay: 0.45s; }
    .terms-section:nth-child(10) { animation-delay: 0.50s; }
    .terms-section:nth-child(11) { animation-delay: 0.55s; }

    @keyframes fadeUp {
      to { opacity: 1; transform: translateY(0); }
    }

   /* ── Sticky sidebar TOC ── */
    .toc-sidebar {
      position: sticky;
      top: 88px;
    }
    .toc-label {
      font-family: var(--font-type);
      font-size: 0.68rem;
      font-weight: 500;
      color: var(--ink4);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      margin-bottom: 12px;
      padding-left: 12px;
    }
    .toc-list { list-style: none; }
    .toc-list li { border-left: 2px solid var(--border); }
    .toc-list li.active { border-left-color: var(--brass); }
    .toc-list a {
      display: block;
      padding: 6px 12px;
      font-size: 0.8rem;
      color: var(--ink3);
      text-decoration: none;
      line-height: 1.45;
      transition: color 0.12s;
    }
    .toc-list li.active a { color: var(--brass); font-weight: 600; }
    .toc-list a:hover { color: var(--ink); }

    /* ── ICO badge in sidebar ── */
    .ico-badge {
      margin-top: 2rem;
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1rem;
      text-align: center;
    }
    .ico-badge .ico-logo {
      width: 44px;
      height: 44px;
      background: #003087;
      border-radius: 4px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin: 0 auto 0.6rem;
      font-family: var(--font-type);
      font-size: 0.72rem;
      font-weight: 700;
      color: #fff;
      letter-spacing: 0.05em;
    }
    .ico-badge p {
      font-size: 0.72rem;
      color: var(--ink3);
      line-height: 1.5;
      margin: 0;
    }
    .ico-badge a {
      font-size: 0.7rem;
      color: var(--brass);
      text-decoration: none;
    }
    .ico-badge a:hover { text-decoration: underline; }

    /* ── Main content ── */
    .privacy-content { min-width: 0; }

    .page-heading {
      margin-bottom: 2.5rem;
      padding-bottom: 2rem;
      border-bottom: 1px solid var(--border);
    }
    .page-heading .eyebrow {
      font-family: var(--font-type);
      font-size: 0.7rem;
      font-weight: 500;
      color: var(--brass);
      letter-spacing: 0.12em;
      text-transform: uppercase;
      margin-bottom: 10px;
    }
    .page-heading h1 {
      font-size: 2rem;
      font-weight: 700;
      letter-spacing: -0.03em;
      color: var(--ink);
      margin-bottom: 0.75rem;
    }
    .page-heading .meta {
      font-size: 0.85rem;
      color: var(--ink3);
      display: flex;
      gap: 1.5rem;
      flex-wrap: wrap;
    }

    /* ── ICO registration banner ── */
    .ico-banner {
      background: #eef2ff;
      border: 1.5px solid #c7d1fd;
      border-radius: 4px;
      padding: 1.5rem 1.75rem;
      margin-bottom: 2rem;
      display: flex;
      gap: 1.25rem;
      align-items: center;
    }
    .ico-banner .ico-pill {
      background: #106189;
      color: #fff;
      font-family: var(--font-type);
      font-size: 0.7rem;
      font-weight: 700;
      letter-spacing: 0.08em;
      padding: 6px 12px;
      border-radius: 4px;
      white-space: nowrap;
      flex-shrink: 0;
    }
    .ico-banner-text h3 {
      font-size: 0.95rem;
      font-weight: 700;
      color: #106189;
      letter-spacing: -0.01em;
      margin-bottom: 4px;
    }
    .ico-banner-text p {
      font-size: 0.85rem;
      color: #1993cf;
      line-height: 1.55;
      margin: 0;
    }
    .ico-banner-text a { color: #1993cf; font-weight: 600; }

    /* ── Patient data warning banner ── */
    .patient-data-banner {
      background: #fff5f5;
      border: 2px solid #fca5a5;
      border-radius: 4px;
      padding: 1.5rem 1.75rem;
      margin-bottom: 2.5rem;
      display: flex;
      gap: 1rem;
      align-items: flex-start;
    }
    .patient-data-banner .icon { font-size: 1.5rem; flex-shrink: 0; margin-top: 1px; }
    .patient-data-banner h3 {
      font-size: 1rem;
      font-weight: 700;
      color: #b91c1c;
      letter-spacing: -0.01em;
      margin-bottom: 6px;
    }
    .patient-data-banner p {
      font-size: 0.875rem;
      color: #991b1b;
      line-height: 1.65;
      margin-bottom: 0.5rem;
    }
    .patient-data-banner p:last-child { margin-bottom: 0; }
    .patient-data-banner ul {
      padding-left: 1.1rem;
      margin: 0.5rem 0 0;
    }
    .patient-data-banner li {
      font-size: 0.85rem;
      color: #991b1b;
      line-height: 1.65;
      margin-bottom: 0.25rem;
    }

    /* ── Sections ── */
    .privacy-section {
      margin-bottom: 3rem;
      scroll-margin-top: 88px;
      opacity: 0;
      transform: translateY(12px);
      animation: fadeUp 0.4s ease forwards;
    }
    .privacy-section:nth-child(1)  { animation-delay: 0.05s; }
    .privacy-section:nth-child(2)  { animation-delay: 0.10s; }
    .privacy-section:nth-child(3)  { animation-delay: 0.15s; }
    .privacy-section:nth-child(4)  { animation-delay: 0.20s; }
    .privacy-section:nth-child(5)  { animation-delay: 0.25s; }
    .privacy-section:nth-child(6)  { animation-delay: 0.30s; }
    .privacy-section:nth-child(7)  { animation-delay: 0.35s; }
    .privacy-section:nth-child(8)  { animation-delay: 0.40s; }
    .privacy-section:nth-child(9)  { animation-delay: 0.45s; }
    .privacy-section:nth-child(10) { animation-delay: 0.50s; }
    .privacy-section:nth-child(11) { animation-delay: 0.55s; }
    .privacy-section:nth-child(12) { animation-delay: 0.60s; }

    @keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

    .section-number {
      font-family: var(--font-type);
      font-size: 0.68rem;
      color: var(--brass);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .privacy-section h2 {
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: -0.025em;
      color: var(--ink);
      margin-bottom: 1rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
    }
    .privacy-section h3 {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--ink);
      margin: 1.5rem 0 0.5rem;
      letter-spacing: -0.01em;
    }
    .privacy-section p {
      font-size: 0.9rem;
      line-height: 1.75;
      color: var(--ink2);
      margin-bottom: 1rem;
    }
    .privacy-section ul, .privacy-section ol {
      padding-left: 1.25rem;
      margin-bottom: 1rem;
    }
    .privacy-section li {
      font-size: 0.9rem;
      line-height: 1.7;
      color: var(--ink2);
      margin-bottom: 0.4rem;
    }
    .privacy-section li::marker { color: var(--brass); }

    /* Info box */
    .info-box {
      background: var(--surface);
      border: 1.5px solid var(--border2);
      border-left: 4px solid var(--brass);
      border-radius: 0 4px 4px 0;
      padding: 1.25rem 1.5rem;
      margin: 1.25rem 0;
    }
    .info-box h4 {
      font-size: 0.875rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 0.6rem;
    }
    .info-box p {
      font-size: 0.875rem;
      color: var(--ink2);
      margin-bottom: 0.6rem;
      line-height: 1.7;
    }
    .info-box p:last-child { margin-bottom: 0; }

    /* Callout */
    .callout {
      background: rgba(79,110,247,0.05);
      border: 1px solid rgba(79,110,247,0.15);
      border-radius: 4px;
      padding: 1rem 1.25rem;
      margin: 1.25rem 0;
    }
    .callout p { font-size: 0.875rem; color: var(--ink2); margin: 0; line-height: 1.65; }
    .callout strong { color: var(--brass); }

    /* Success callout */
    .callout-green {
      background: #f0fdf6;
      border: 1px solid #a7f3d0;
      border-radius: 4px;
      padding: 1rem 1.25rem;
      margin: 1.25rem 0;
    }
    .callout-green p { font-size: 0.875rem; color: #065f46; margin: 0; line-height: 1.65; }

    /* Data table */
    .data-purposes-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
      margin: 1.25rem 0;
      border-radius: 4px;
      overflow: hidden;
      border: 1px solid var(--border);
    }
    .data-purposes-table th {
      font-weight: 600;
      font-size: 0.75rem;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--ink3);
      padding: 10px 14px;
      text-align: left;
      background: var(--parchment2);
      border-bottom: 1px solid var(--border);
    }
    .data-purposes-table td {
      padding: 10px 14px;
      border-bottom: 1px solid var(--border);
      color: var(--ink2);
      vertical-align: top;
      line-height: 1.55;
    }
    .data-purposes-table tr:last-child td { border-bottom: none; }
    .data-purposes-table tr:hover td { background: var(--parchment2); }

    /* Rights grid */
    .rights-grid {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 0.75rem;
      margin: 1.25rem 0;
    }
    .right-card {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1rem;
    }
    .right-card .right-title {
      font-size: 0.825rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 4px;
      display: flex;
      align-items: center;
      gap: 6px;
    }
    .right-card .right-title .dot {
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--brass);
      flex-shrink: 0;
    }
    .right-card p {
      font-size: 0.8rem;
      color: var(--ink3);
      line-height: 1.55;
      margin: 0;
    }

    /* Contact block */
    .contact-block {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 1.5rem;
      margin-top: 1rem;
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 1.5rem;
    }
    .contact-item h4 {
      font-size: 0.8rem;
      font-weight: 700;
      color: var(--ink3);
      text-transform: uppercase;
      letter-spacing: 0.06em;
      margin-bottom: 6px;
      font-family: var(--font-type);
    }
    .contact-item p { font-size: 0.875rem; color: var(--ink2); margin: 0; line-height: 1.6; }
    .contact-item a { color: var(--brass); text-decoration: none; }
    .contact-item a:hover { text-decoration: underline; }
   /* ── Critical disclaimer banner ── */
    .disclaimer-banner {
      background: #fff5f5;
      border: 1.5px solid #fca5a5;
      border-radius: 4px;
      padding: 1.5rem 1.75rem;
      margin-bottom: 2.5rem;
      display: flex;
      gap: 1rem;
      align-items: flex-start;
    }
    .disclaimer-banner .icon {
      font-size: 1.4rem;
      flex-shrink: 0;
      margin-top: 1px;
    }
    .disclaimer-banner h3 {
      font-size: 0.95rem;
      font-weight: 700;
      color: #b91c1c;
      letter-spacing: -0.01em;
      margin-bottom: 6px;
    }
    .disclaimer-banner p {
      font-size: 0.875rem;
      color: #991b1b;
      line-height: 1.6;
    }

    /* Entertainment banner */
    .entertainment-banner {
      background: var(--amber-bg);
      border: 1.5px solid var(--amber-border);
      border-radius: 4px;
      padding: 1.25rem 1.5rem;
      margin-bottom: 2.5rem;
      display: flex;
      gap: 1rem;
      align-items: flex-start;
    }
    .entertainment-banner .icon { font-size: 1.3rem; flex-shrink: 0; margin-top: 1px; }
    .entertainment-banner h3 {
      font-size: 0.9rem;
      font-weight: 700;
      color: #92400e;
      margin-bottom: 4px;
    }
    .entertainment-banner p { font-size: 0.85rem; color: #78350f; line-height: 1.6; }

    /* ── Section ── */
    .terms-section {
      margin-bottom: 3rem;
      scroll-margin-top: 88px;
    }
    .section-number {
      font-family: var(--font-type);
      font-size: 0.68rem;
      color: var(--brass);
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin-bottom: 6px;
    }
    .terms-section h2 {
      font-size: 1.25rem;
      font-weight: 700;
      letter-spacing: -0.025em;
      color: var(--ink);
      margin-bottom: 1rem;
      padding-bottom: 0.75rem;
      border-bottom: 1px solid var(--border);
    }
    .terms-section h3 {
      font-size: 0.95rem;
      font-weight: 700;
      color: var(--ink);
      margin: 1.5rem 0 0.5rem;
      letter-spacing: -0.01em;
    }
    .terms-section p {
      font-size: 0.9rem;
      line-height: 1.75;
      color: var(--ink2);
      margin-bottom: 1rem;
    }
    .terms-section ul, .terms-section ol {
      padding-left: 1.25rem;
      margin-bottom: 1rem;
    }
    .terms-section li {
      font-size: 0.9rem;
      line-height: 1.7;
      color: var(--ink2);
      margin-bottom: 0.4rem;
    }
    .terms-section li::marker { color: var(--brass); }

    /* Liability box — specially styled */
    .liability-box {
      background: var(--surface);
      border: 1.5px solid var(--border2);
      border-left: 4px solid var(--brass);
      border-radius: 0 4px 4px 0;
      padding: 1.5rem;
      margin: 1.5rem 0;
    }
    .liability-box h4 {
      font-size: 0.875rem;
      font-weight: 700;
      color: var(--ink);
      margin-bottom: 0.75rem;
      letter-spacing: -0.01em;
    }
    .liability-box p {
      font-size: 0.875rem;
      line-height: 1.7;
      color: var(--ink2);
      margin-bottom: 0.75rem;
    }
    .liability-box p:last-child { margin-bottom: 0; }

    /* Highlight callout */
    .callout {
      background: rgba(79,110,247,0.05);
      border: 1px solid rgba(79,110,247,0.15);
      border-radius: 4px;
      padding: 1rem 1.25rem;
      margin: 1.25rem 0;
    }
    .callout p {
      font-size: 0.875rem;
      color: var(--ink2);
      margin: 0;
      line-height: 1.65;
    }
    .callout strong { color: var(--brass); }

    /* ── Acceptance footer ── */
    .acceptance-block {
      background: var(--surface);
      border: 1px solid var(--border);
      border-radius: 4px;
      padding: 2rem;
      margin-top: 3rem;
      text-align: center;
    }
    .acceptance-block h3 {
      font-size: 1.05rem;
      font-weight: 700;
      letter-spacing: -0.02em;
      color: var(--ink);
      margin-bottom: 0.6rem;
    }
    .acceptance-block p {
      font-size: 0.875rem;
      color: var(--ink3);
      max-width: 540px;
      margin: 0 auto 1.5rem;
      line-height: 1.65;
    }

.dx-report {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Header card */
.dx-header .dx-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.025em;
}

.dx-header .dx-summary {
  font-size: 0.9rem;
  color: var(--ink2);
  line-height: 1.7;
  margin: 0;
}

/* Red flags block */
.dx-red-flags {
  background: #fff5f5;
  border: 1.5px solid #fca5a5;
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.dx-red-flags__header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 700;
  color: #b91c1c;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dx-red-flags__icon { font-size: 1rem; }

.dx-red-flags__list {
  padding-left: 1.25rem;
  margin-bottom: 0.75rem;
}

.dx-red-flags__list li {
  font-size: 0.875rem;
  color: #991b1b;
  line-height: 1.65;
  margin-bottom: 0.35rem;
}

.dx-red-flags__list li::marker { color: #e5373a; }

.dx-red-flags__action {
  background: rgba(229,55,58,0.07);
  border-left: 3px solid #e5373a;
  border-radius: 0 4px 4px 0;
  padding: 0.65rem 1rem;
  font-size: 0.875rem;
  color: #7f1d1d;
  line-height: 1.6;
}

.dx-red-flags__action-label {
  font-weight: 700;
  margin-right: 0.4rem;
  color: #b91c1c;
}

/* Diagnosis cards grid */
.dx-diagnoses {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Individual diagnosis card */
.dx-card__header {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.dx-card__rank {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--parchment3);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-type);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink2);
  flex-shrink: 0;
}

.dx-card__title-wrap { flex: 1; }

.dx-card__name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

/* Likelihood badge */
.dx-likelihood {
  font-family: var(--font-type);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 4px;
  flex-shrink: 0;
}

.likelihood--high {
  background: #fff1f2;
  color: #be123c;
  border: 1px solid #fecdd3;
}

.likelihood--medium-high {
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.likelihood--medium {
  background: #fefce8;
  color: #a16207;
  border: 1px solid #fef08a;
}

.likelihood--low {
  background: var(--parchment2);
  color: var(--ink3);
  border: 1px solid var(--border);
}

/* Sections within a card */
.dx-card__body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.dx-section__label {
  font-family: var(--font-type);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.5rem;
}

.dx-list {
  padding-left: 1.25rem;
  margin: 0;
}

.dx-list li {
  font-size: 0.875rem;
  color: var(--ink2);
  line-height: 1.65;
  margin-bottom: 0.3rem;
}

.dx-list li::marker { color: var(--brass); }

.dx-list--investigations li::marker { color: var(--teal); }

/* Urgent action strip */
.dx-urgent-action {
  background: rgba(79,110,247,0.05);
  border: 1px solid rgba(79,110,247,0.15);
  border-radius: 4         ssspx;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  color: var(--ink2);
  line-height: 1.6;
}

.dx-urgent-action__label {
  font-family: var(--font-type);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--brass);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}
/* ── Mobile responsive additions ── */
@media (max-width: 640px) {

  /* Page wrap padding */
  .page-wrap { padding: 1rem; }

  /* Stack all inline grids to single column */
  .mobile-stack { grid-template-columns: 1fr !important; display: flex !important; flex-direction: column !important; }

  /* Data tables — reduce font */
  .data-table { font-size: 0.8rem; }
  .data-table th, .data-table td { padding: 8px 8px; }

  /* History table — hide less critical columns */
  .history-col-hide { display: none !important; }

  /* Quick links — stack vertically */
  .quick-links { flex-direction: column !important; align-items: stretch !important; }
  .quick-links a, .quick-links button { margin-left: 0 !important; text-align: center; }

  /* Form rows single column */
  .form-row { grid-template-columns: 1fr !important; }

  /* Auth cards full width */
  .auth-card { max-width: 100% !important; }

  /* Credit grid single column */
  .credit-grid { grid-template-columns: 1fr !important; }

  /* Modal overlay */
  #modal-overlay { padding: 0.5rem !important; }
  #modal-overlay > div { max-width: 100% !important; }

  /* Diagnosis cards */
  .dx-card__header { flex-wrap: wrap; gap: 0.5rem; }

  /* Print button hidden on mobile */
  #btn-print-modal, #btn-print-results { display: none !important; }

  /* Increase body bottom padding for multi-line footer on mobile */
  body { padding-bottom: 110px; }

  /* Footer smaller */
  .site-footer { font-size: 0.72rem; padding: 0.6rem 1rem; }

  /* Preference button full width */
  .btn-set-preference { width: 100%; margin-top: 0.5rem; }

  /* Stripe action buttons */
  .stripe-actions { flex-direction: column !important; }
  .stripe-actions a { width: 100%; text-align: center; box-sizing: border-box; }
}
