/* ============================================================
   CardioGenetics Web — Master Stylesheet
   iOS-native aesthetic in the browser
   ============================================================ */

/* ---------- CSS Custom Properties ---------- */
:root {
  --scd-primary: #8b4049;
  --scd-light: #a9606a;
  --ascvd-primary: #2d6a9f;
  --ascvd-light: #4a8abf;
  --ep-primary: #3949ab;
  --ep-light: #5c6bc0;
  --diag-primary: #3a7d7e;
  --diag-light: #5a9e9f;
  --trials-primary: #3d7a5f;
  --trials-light: #5a9a7a;

  --risk-low: #1e8449;
  --risk-int: #ca6f1e;
  --risk-high: #922b21;

  --text-dark: #2c3e50;
  --text-sec: #666;
  --bg: #f5f5f7;
  --card-bg: #fff;

  --tab-height: 60px;
  --topbar-height: 52px;
  --max-content: 640px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, select, textarea { font: inherit; }

/* ---------- Keyframe Animations ---------- */
@keyframes splashIn {
  0%   { transform: scale(0.3); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  80%  { transform: scale(0.96); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes popIn {
  from { transform: scale(0.8); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

@keyframes highlightFlash {
  0%, 100% { border-color: transparent; }
  50%      { border-color: var(--ascvd-primary); }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

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

/* ---------- 1. Splash Screen ---------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  transition: opacity 0.5s ease;
}

#splash.fade-out {
  opacity: 0;
  pointer-events: none;
}

#splash .splash-logo-img {
  width: 120px;
  height: 120px;
  border-radius: 24px;
  object-fit: cover;
  animation: splashIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

#splash .splash-tagline {
  margin-top: 18px;
  font-size: 16px;
  color: var(--text-sec);
  letter-spacing: 0.3px;
  opacity: 0;
  animation: fadeIn 0.6s 0.6s ease forwards;
}

#splash .splash-title {
  margin-top: 10px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  opacity: 0;
  animation: fadeIn 0.5s 0.4s ease forwards;
}

/* ---------- 2. App Shell ---------- */

/* -- Top Bar -- */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.12);
}

.top-bar .bar-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
  text-align: center;
}

.top-bar .back-btn {
  position: absolute;
  left: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 17px;
  color: var(--ascvd-primary);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
}

.top-bar .back-btn svg,
.top-bar .back-btn .back-icon {
  width: 20px;
  height: 20px;
}

.top-bar .bar-action {
  position: absolute;
  right: 12px;
  font-size: 15px;
  color: var(--ascvd-primary);
  padding: 8px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* -- Content Area -- */
.content-area {
  padding-top: calc(var(--topbar-height) + 8px);
  padding-bottom: calc(var(--tab-height) + 24px);
  padding-left: 16px;
  padding-right: 16px;
  max-width: var(--max-content);
  margin: 0 auto;
  min-height: 100vh;
}

/* -- Tab Bar -- */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--tab-height);
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-top: 0.5px solid rgba(0, 0, 0, 0.12);
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-bar .tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: #999;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2px;
  transition: color 0.2s ease;
  min-width: 44px;
  min-height: 44px;
  padding: 4px 0;
}

.tab-bar .tab-item svg,
.tab-bar .tab-item .tab-icon {
  width: 24px;
  height: 24px;
  margin-bottom: 1px;
  transition: transform 0.2s ease;
}

.tab-bar .tab-item.active {
  color: var(--scd-primary);
}

.tab-bar .tab-item.active svg,
.tab-bar .tab-item.active .tab-icon {
  transform: scale(1.08);
}

.tab-bar .tab-item span {
  line-height: 1;
}

/* ---------- 3. Tab Banner ---------- */
.tab-banner {
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  color: #fff;
  animation: slideUp 0.4s ease;
}

.tab-banner.scd   { background: linear-gradient(135deg, var(--scd-primary), var(--scd-light)); }
.tab-banner.ascvd { background: linear-gradient(135deg, var(--ascvd-primary), var(--ascvd-light)); }
.tab-banner.ep    { background: linear-gradient(135deg, var(--ep-primary), var(--ep-light)); }
.tab-banner.diag  { background: linear-gradient(135deg, var(--diag-primary), var(--diag-light)); }
.tab-banner.trials { background: linear-gradient(135deg, var(--trials-primary), var(--trials-light)); }

.tab-banner .banner-icon {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  opacity: 0.95;
}

.tab-banner .banner-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.tab-banner .banner-title {
  font-size: 20px;
  font-weight: 700;
  line-height: 1.2;
}

.tab-banner .banner-subtitle {
  font-size: 13px;
  opacity: 0.85;
  font-weight: 400;
  line-height: 1.3;
}

/* ---------- 4. Cards ---------- */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
  animation: slideUp 0.35s ease;
}

.card + .card {
  animation-delay: 0.05s;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.card-subtitle {
  font-size: 13px;
  color: var(--text-sec);
  margin-bottom: 8px;
}

/* ---------- 5. Section Headers ---------- */
.section-header {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-sec);
  margin: 24px 0 10px;
  padding-left: 4px;
}

.section-header:first-child {
  margin-top: 8px;
}

/* ---------- 6. Slider Rows ---------- */
.slider-row {
  margin-bottom: 18px;
}

.slider-row .slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}

.slider-row .slider-label .label-text {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
}

.slider-row .slider-label .label-value {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  min-width: 48px;
  text-align: right;
}

.slider-row .slider-label .label-unit {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-sec);
  margin-left: 3px;
}

/* Range slider styling */
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  outline: none;
  background: linear-gradient(
    to right,
    var(--track-color, var(--scd-primary)) var(--pct, 50%),
    #ddd var(--pct, 50%)
  );
  transition: background 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.22), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
}

input[type="range"]::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18), 0 0 0 0.5px rgba(0, 0, 0, 0.04);
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease;
}

input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 3px;
  background: transparent;
}

/* ---------- 7. Toggle Rows ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.toggle-row:last-child {
  border-bottom: none;
}

.toggle-row.indented {
  padding-left: 20px;
}

.toggle-row .toggle-label {
  font-size: 15px;
  color: var(--text-dark);
  flex: 1;
  padding-right: 12px;
  line-height: 1.35;
}

.toggle-row .toggle-sublabel {
  font-size: 12px;
  color: var(--text-sec);
  margin-top: 2px;
}

/* iOS-style toggle switch */
.toggle-switch {
  position: relative;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-switch .toggle-track {
  position: absolute;
  inset: 0;
  background: #e0e0e0;
  border-radius: 14px;
  transition: background 0.25s ease;
  cursor: pointer;
}

.toggle-switch input:checked + .toggle-track {
  background: var(--toggle-color, var(--scd-primary));
}

.toggle-switch .toggle-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.toggle-switch input:checked + .toggle-track::after {
  transform: translateX(20px);
}

/* ---------- 8. Select / Picker ---------- */
.select-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.select-row:last-child {
  border-bottom: none;
}

.select-row .select-label {
  font-size: 15px;
  color: var(--text-dark);
  font-weight: 500;
}

.picker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.picker select,
.select-row select {
  -webkit-appearance: none;
  appearance: none;
  background: var(--bg);
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  padding: 8px 32px 8px 12px;
  font-size: 15px;
  color: var(--text-dark);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23666' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  min-height: 44px;
  transition: border-color 0.2s ease;
}

.picker select:focus,
.select-row select:focus {
  outline: none;
  border-color: var(--ascvd-primary);
}

/* ---------- 9. Numeric Input ---------- */
.num-input {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.num-input input[type="number"] {
  width: 80px;
  padding: 8px 10px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 15px;
  text-align: center;
  color: var(--text-dark);
  background: var(--bg);
  min-height: 44px;
  transition: border-color 0.2s ease;
}

.num-input input[type="number"]:focus {
  outline: none;
  border-color: var(--ascvd-primary);
}

.num-input .unit {
  font-size: 13px;
  color: var(--text-sec);
  white-space: nowrap;
}

/* ---------- 10. Risk Metric Cell ---------- */
.risk-metric-cell {
  border-left: 4px solid var(--metric-color, var(--scd-primary));
  border-radius: 10px;
  background: var(--card-bg);
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  animation: slideUp 0.3s ease;
}

.risk-metric-cell .metric-info {
  flex: 1;
}

.risk-metric-cell .metric-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.risk-metric-cell .metric-category {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
}

.risk-metric-cell .metric-category.low  { background: var(--risk-low); }
.risk-metric-cell .metric-category.int  { background: var(--risk-int); }
.risk-metric-cell .metric-category.high { background: var(--risk-high); }

.risk-metric-cell .metric-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  line-height: 1;
}

.risk-metric-cell .metric-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-sec);
}

.risk-metric-cell.compact {
  padding: 10px 14px;
}

.risk-metric-cell.compact .metric-value {
  font-size: 22px;
}

.risk-metric-cell.compact .metric-title {
  font-size: 13px;
}

/* ---------- 11. Guideline Cards ---------- */
.guideline-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 16px;
  animation: slideUp 0.35s ease;
}

.guideline-card .guideline-header {
  padding: 14px 18px;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.guideline-card .guideline-ref {
  padding: 10px 18px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.4;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.guideline-card .guideline-ref a {
  color: var(--ascvd-primary);
  text-decoration: underline;
}

.guideline-card .synthesis-box {
  margin: 14px 18px;
  padding: 14px;
  background: #f0f7f0;
  border-radius: 10px;
  border-left: 3px solid var(--risk-low);
}

.guideline-card .synthesis-box .synthesis-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.guideline-card .synthesis-box .synthesis-text {
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.5;
}

.guideline-card .synthesis-context {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: 8px;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.45;
}

.rec-class-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.rec-class-badge.class-i   { background: var(--risk-low); }
.rec-class-badge.class-iia { background: #2e86c1; }
.rec-class-badge.class-iib { background: var(--risk-int); }
.rec-class-badge.class-iii { background: var(--risk-high); }

.guideline-card .guideline-details {
  padding: 0 18px;
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.35s ease, padding 0.35s ease;
}

.guideline-card .guideline-details.open {
  max-height: 2000px;
  padding: 12px 18px 18px;
}

.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.45;
}

.guideline-item:last-child {
  border-bottom: none;
}

.guideline-item.highlighted {
  background: rgba(46, 134, 193, 0.06);
  margin: 0 -10px;
  padding: 10px;
  border-radius: 8px;
  border-bottom: none;
}

.guideline-toggle {
  padding: 12px 18px;
  font-size: 14px;
  color: var(--ascvd-primary);
  font-weight: 500;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  border-top: 0.5px solid rgba(0, 0, 0, 0.06);
}

.guideline-toggle .chevron {
  transition: transform 0.25s ease;
  font-size: 12px;
}

.guideline-toggle .chevron.open {
  transform: rotate(180deg);
}

/* ---------- 12. Nav Buttons ---------- */
.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 16px 18px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: slideUp 0.3s ease;
  text-decoration: none;
}

.nav-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.nav-button:active {
  transform: scale(0.98);
}

.nav-button .nav-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: var(--nav-accent, var(--scd-primary));
  color: #fff;
}

.nav-button .nav-content {
  flex: 1;
  min-width: 0;
}

.nav-button .nav-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.25;
}

.nav-button .nav-subtitle {
  font-size: 13px;
  color: var(--text-sec);
  margin-top: 2px;
  line-height: 1.3;
}

.nav-button .nav-chevron {
  color: #c7c7cc;
  font-size: 18px;
  flex-shrink: 0;
}

/* ---------- 13. Sub-Nav ---------- */
.sub-nav {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
  margin-bottom: 8px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.sub-nav::-webkit-scrollbar {
  display: none;
}

.sub-nav .sub-nav-pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-sec);
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.2s ease;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.sub-nav .sub-nav-pill.active {
  background: var(--scd-primary);
  color: #fff;
  border-color: transparent;
}

.sub-nav .sub-nav-pill:not(.active):hover {
  background: rgba(0, 0, 0, 0.03);
}

/* ---------- 14. Reference Box ---------- */
.ref-box {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.ref-box .ref-box-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ref-box .ref-item {
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.ref-box .ref-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.ref-box .ref-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.35;
  margin-bottom: 4px;
}

.ref-box .ref-citation {
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.4;
  margin-bottom: 4px;
}

.ref-box .ref-link {
  font-size: 13px;
  color: var(--ascvd-primary);
  text-decoration: underline;
  word-break: break-all;
}

/* ---------- 15. Lay Summary ---------- */
.lay-summary-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  margin-bottom: 16px;
  position: relative;
}

.lay-summary-card .lay-summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.lay-summary-card .lay-summary-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
}

.lay-summary-card .lay-summary-icon {
  font-size: 20px;
}

.lay-summary-card .lay-summary-text {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.6;
}

/* ---------- 16. Equation Card ---------- */
.equation-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
}

.equation-card .equation-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.equation-box {
  background: var(--bg);
  border-radius: 10px;
  padding: 16px;
  font-family: 'SF Mono', SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  color: var(--text-dark);
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ---------- 17. Floating Dock ---------- */
.floating-dock {
  position: fixed;
  bottom: calc(var(--tab-height) + 8px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--max-content) - 32px);
  z-index: 90;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: slideUp 0.3s ease;
}

.floating-dock .dock-label {
  font-size: 14px;
  color: var(--text-sec);
  font-weight: 500;
}

.floating-dock .dock-value {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
}

.floating-dock .dock-unit {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-sec);
  margin-left: 3px;
}

.floating-dock .dock-category {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 8px;
  color: #fff;
}

/* ---------- 18. Disclaimer Bar ---------- */
.disclaimer-bar {
  background: rgba(0, 0, 0, 0.03);
  border-radius: 10px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.45;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.disclaimer-bar .disclaimer-icon {
  flex-shrink: 0;
  font-size: 14px;
  margin-top: 1px;
}

/* ---------- 19. Step List ---------- */
.step-list {
  padding: 0;
  list-style: none;
  counter-reset: step-counter;
}

.step-list .step-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  counter-increment: step-counter;
}

.step-list .step-item:last-child {
  border-bottom: none;
}

.step-list .step-number {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--scd-primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  flex-shrink: 0;
}

.step-list .step-content {
  flex: 1;
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.45;
  padding-top: 4px;
}

/* ---------- 20. Accordion ---------- */
.accordion {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 16px;
}

.accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  transition: background 0.15s ease;
  min-height: 44px;
}

.accordion-header:hover {
  background: rgba(0, 0, 0, 0.02);
}

.accordion-header .accordion-chevron {
  font-size: 14px;
  color: #c7c7cc;
  transition: transform 0.3s ease;
}

.accordion-header.open .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-body.open {
  max-height: 2000px;
}

.accordion-body-inner {
  padding: 0 20px 18px;
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.55;
}

/* ---------- 21. Info Card ---------- */
.info-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  margin-bottom: 16px;
}

.info-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
}

.info-header .info-icon {
  font-size: 22px;
  flex-shrink: 0;
}

.info-header .info-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.info-body {
  padding: 16px 20px;
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.55;
}

/* ---------- 22. Divider ---------- */
.divider {
  height: 0.5px;
  background: rgba(0, 0, 0, 0.1);
  margin: 16px 0;
  border: none;
}

/* ---------- 23. Home Page ---------- */
.hero-header {
  text-align: center;
  padding: 24px 0 20px;
  animation: fadeIn 0.5s ease;
}

.hero-header .hero-logo-img {
  width: 80px;
  height: 80px;
  margin: 0 auto 12px;
  border-radius: 20px;
  object-fit: cover;
  display: block;
  box-shadow: none;
  pointer-events: none;
  user-select: none;
  will-change: transform, opacity;
  transition: none; /* JS handles smooth interpolation */
}

/* Top-bar mini logo (hidden by default, revealed on scroll) */
.top-bar .top-bar-logo {
  position: absolute;
  left: 14px;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  object-fit: cover;
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.top-bar.logo-visible .top-bar-logo {
  opacity: 1;
  transform: scale(1);
}

.hero-header .hero-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.hero-header .hero-subtitle,
.hero-header .hero-tagline {
  font-size: 14px;
  color: var(--text-sec);
}

/* App Store Banner */
.app-store-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 16px;
  text-decoration: none;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  animation: slideUp 0.4s ease;
}
.app-store-banner:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.25);
}
.app-store-banner:active {
  transform: scale(0.98);
}
.asb-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.asb-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.asb-text {
  min-width: 0;
}
.asb-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 3px;
}
.asb-sub {
  font-size: 11px;
  opacity: 0.75;
  line-height: 1.3;
}
.asb-badge {
  flex-shrink: 0;
}
.asb-badge svg {
  display: block;
}

@media (max-width: 420px) {
  .app-store-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .asb-badge {
    align-self: center;
  }
}

/* Search bar */
.search-bar {
  position: relative;
  margin-bottom: 20px;
}

.search-bar input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  border: none;
  border-radius: 12px;
  background: var(--card-bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 16px;
  color: var(--text-dark);
  min-height: 44px;
  transition: box-shadow 0.2s ease;
}

.search-bar input:focus {
  outline: none;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.1), 0 0 0 2px rgba(45, 106, 159, 0.2);
}

.search-bar input::placeholder {
  color: #aaa;
}

.search-bar .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
  font-size: 16px;
  pointer-events: none;
}

/* Search results dropdown */
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  z-index: 50;
  max-height: 320px;
  overflow-y: auto;
  display: block;
}

.search-results.hidden {
  display: none !important;
}

.search-results.active {
  display: block;
  animation: fadeIn 0.15s ease;
}

.search-results .search-result-item {
  padding: 12px 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  transition: background 0.15s ease;
  min-height: 44px;
}

.search-results .search-result-item:last-child {
  border-bottom: none;
}

.search-results .search-result-item:hover {
  background: rgba(0, 0, 0, 0.03);
}

.search-results .search-result-item.highlight-flash {
  animation: highlightFlash 0.8s ease 2;
  border: 2px solid transparent;
}

.search-results .result-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  color: #fff;
}

.search-results .result-text {
  flex: 1;
}

.search-results .result-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
}

.search-results .result-module {
  font-size: 12px;
  color: var(--text-sec);
}

/* Module grid */
.module-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 20px;
}

.module-tile {
  border-radius: 16px;
  padding: 20px 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--tile-dark, #666), var(--tile-light, #888));
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  animation: popIn 0.3s ease;
  min-height: 120px;
  text-decoration: none;
  position: relative;
  overflow: hidden;
  border: none;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
}

.module-tile::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -20%;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
}

.module-tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.15);
}

.module-tile:active {
  transform: scale(0.97);
}

.module-tile.scd   { background: linear-gradient(135deg, var(--scd-primary), var(--scd-light)); }
.module-tile.ascvd { background: linear-gradient(135deg, var(--ascvd-primary), var(--ascvd-light)); }
.module-tile.ep    { background: linear-gradient(135deg, var(--ep-primary), var(--ep-light)); }
.module-tile.diag  { background: linear-gradient(135deg, var(--diag-primary), var(--diag-light)); }
.module-tile.trials { background: linear-gradient(135deg, var(--trials-primary), var(--trials-light)); }

.module-tile .tile-icon {
  display: none;
}

.module-tile .tile-title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.2;
}

.module-tile .tile-subtitle,
.module-tile .tile-sub {
  font-size: 12px;
  opacity: 0.8;
  line-height: 1.3;
}

/* Quick pills */
.quick-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 16px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.quick-pills::-webkit-scrollbar {
  display: none;
}

.quick-pills .quick-pill,
.quick-pills .pill {
  flex-shrink: 0;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  background: var(--card-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  min-height: 36px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.quick-pills .quick-pill:hover,
.quick-pills .pill:hover {
  background: rgba(0, 0, 0, 0.03);
  border-color: rgba(0,0,0,0.15);
}

.quick-pills .quick-pill .pill-icon {
  font-size: 14px;
}

/* Audience cards */
.audience-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
}

.audience-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  animation: slideUp 0.35s ease;
}

.audience-card .audience-icon {
  font-size: 28px;
  flex-shrink: 0;
  margin-top: 2px;
}

.audience-card .audience-content {
  flex: 1;
}

.audience-card .audience-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.audience-card .audience-desc {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.45;
}

/* Faculty card */
.faculty-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
  animation: slideUp 0.35s ease;
}

.faculty-card .faculty-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.faculty-card .faculty-photo {
  width: 82px;
  height: 116px;
  border-radius: 16px;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.faculty-card .faculty-info {
  flex: 1;
}

.faculty-card .faculty-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 4px;
  line-height: 1.3;
}

.faculty-card .faculty-role {
  font-size: 12px;
  color: var(--text-sec);
  margin-bottom: 2px;
}

.faculty-card .faculty-dept {
  font-size: 12px;
  color: #555;
  line-height: 1.35;
  margin-bottom: 10px;
}

.faculty-card .faculty-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--ascvd-primary);
  text-decoration: none;
  padding: 6px 12px;
  background: rgba(45, 106, 159, 0.1);
  border: 1px solid rgba(45, 106, 159, 0.18);
  border-radius: 20px;
  transition: background 0.2s;
}

.faculty-card .faculty-link:hover {
  background: rgba(45, 106, 159, 0.18);
}

.faculty-card .faculty-bio {
  font-size: 12px;
  color: #44515c;
  line-height: 1.55;
  margin: 0;
}

/* Audience card */
.audience-rows { display: flex; flex-direction: column; gap: 12px; }
.audience-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.audience-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
}
.audience-row-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 2px;
}
.audience-row-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.45;
}

/* Card titles */
.card-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 10px;
}
.card-body-text {
  font-size: 14px;
  color: #444;
  line-height: 1.6;
  margin: 0 0 10px;
}
.card-body-text:last-child { margin-bottom: 0; }

/* ---------- 24. Diagnosis Page ---------- */
.criteria-group {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.criteria-group .criteria-group-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.criteria-checkbox {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  min-height: 44px;
}

.criteria-checkbox:last-child {
  border-bottom: none;
}

.criteria-checkbox input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #d0d0d0;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.criteria-checkbox input[type="checkbox"]:checked {
  background: var(--diag-primary);
  border-color: var(--diag-primary);
}

.criteria-checkbox input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.criteria-checkbox .criteria-text {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.4;
  flex: 1;
}

.criteria-checkbox .criteria-points {
  font-size: 13px;
  font-weight: 600;
  color: var(--diag-primary);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Diagnosis result */
.dx-result {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  animation: popIn 0.3s ease;
}

.dx-result .dx-classification {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.dx-result .dx-score {
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 8px;
}

.dx-result .dx-label {
  font-size: 14px;
  color: var(--text-sec);
}

.dx-result .dx-badge {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-top: 10px;
}

/* Gene table */
.gene-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin-bottom: 16px;
}

.gene-table th {
  background: var(--bg);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
}

.gene-table td {
  padding: 10px 12px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  color: var(--text-dark);
  vertical-align: top;
}

.gene-table tr:last-child td {
  border-bottom: none;
}

.gene-table tr:hover td {
  background: rgba(0, 0, 0, 0.02);
}

/* ---------- 25. Trials Page ---------- */
.trial-card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px;
  margin-bottom: 16px;
  animation: slideUp 0.35s ease;
}

.trial-card .trial-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.3;
  margin-bottom: 10px;
}

.trial-status-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 8px;
  margin-bottom: 12px;
}

.trial-status-badge.recruiting {
  background: #e8f5e9;
  color: var(--risk-low);
}

.trial-status-badge.not-recruiting {
  background: #fff3e0;
  color: var(--risk-int);
}

.trial-status-badge.completed {
  background: #e3f2fd;
  color: var(--ascvd-primary);
}

.trial-detail {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  font-size: 14px;
  color: var(--text-dark);
}

.trial-detail .detail-label {
  font-weight: 500;
  color: var(--text-sec);
  white-space: nowrap;
  min-width: 80px;
}

.trial-detail .detail-value {
  flex: 1;
  line-height: 1.4;
}

.trial-detail a {
  color: var(--ascvd-primary);
  text-decoration: underline;
}

.site-map {
  width: 100%;
  height: 200px;
  border-radius: 10px;
  background: var(--bg);
  margin-top: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-sec);
  font-size: 13px;
}

/* ---------- 26. Charts ---------- */
.chart-container {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 16px;
  margin-bottom: 16px;
}

.chart-container .chart-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 12px;
}

.chart-container canvas {
  width: 100% !important;
  height: auto !important;
  max-height: 280px;
}

/* ---------- 27. Copy Button ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--text-sec);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
}

.copy-btn:hover {
  background: #e8e8ea;
  color: var(--text-dark);
}

.copy-btn.copied {
  background: var(--risk-low);
  color: #fff;
}

.copy-btn.copied::after {
  content: '\2713';
  position: absolute;
  font-size: 16px;
  font-weight: 700;
  animation: popIn 0.25s ease;
}

/* ---------- 28. Checkbox Row ---------- */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  cursor: pointer;
  min-height: 44px;
}

.checkbox-row:last-child {
  border-bottom: none;
}

.checkbox-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border: 2px solid #d0d0d0;
  border-radius: 6px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  position: relative;
  transition: all 0.2s ease;
}

.checkbox-row input[type="checkbox"]:checked {
  background: var(--scd-primary);
  border-color: var(--scd-primary);
}

.checkbox-row input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 6px;
  height: 10px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
}

.checkbox-row .checkbox-label {
  font-size: 15px;
  color: var(--text-dark);
  line-height: 1.4;
  flex: 1;
}

/* ---------- Additional Component Styles ---------- */

/* Disabled tile */
.module-tile.disabled {
  opacity: 0.5;
  cursor: default;
  pointer-events: none;
}

/* Search result items (used by home search) */
.search-result-text { flex: 1; min-width: 0; }
.search-result-title { font-size: 14px; font-weight: 600; color: var(--text-dark); }
.search-result-subtitle { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.search-result-badge {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  padding: 3px 8px;
  border-radius: 10px;
}

/* Version footer */
.version-footer {
  text-align: center;
  padding: 24px 0 16px;
  color: var(--text-sec);
  font-size: 12px;
  line-height: 1.6;
}
.version-footer p { margin: 0; }

/* Search container */
.search-container {
  position: relative;
  margin-bottom: 20px;
}

/* Nav button */
.nav-button {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px;
  background: var(--card-bg);
  border: none;
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  cursor: pointer;
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  margin-bottom: 10px;
}
.nav-button:hover { transform: translateY(-1px); box-shadow: 0 4px 16px rgba(0,0,0,0.1); }
.nav-button:active { transform: scale(0.98); }
.nav-btn-icon { display: none; }
.nav-btn-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.nav-btn-text { flex: 1; min-width: 0; }
.nav-btn-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.nav-btn-sub { font-size: 12px; color: var(--text-sec); margin-top: 2px; }
.nav-btn-arrow { color: var(--text-sec); font-size: 14px; flex-shrink: 0; }

/* Sub-navigation */
.sub-nav {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.sub-nav::-webkit-scrollbar { display: none; }
.sub-nav-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
}
.sub-nav-btn:hover { border-color: var(--sn-color, #888); color: var(--sn-color, #888); }
.sub-nav-btn.active {
  background: var(--sn-color, #888);
  color: #fff;
  border-color: var(--sn-color, #888);
}

/* Tab banner */
.tab-banner {
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  color: #fff;
}
.banner-icon { display: none; }
.banner-text { flex: 1; }
.banner-title { font-size: 19px; font-weight: 700; line-height: 1.2; }
.banner-subtitle { font-size: 12px; opacity: 0.85; margin-top: 4px; line-height: 1.4; }

/* Section header */
.section-header {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  color: var(--text-sec);
  text-transform: uppercase;
  margin-bottom: 10px;
  margin-top: 8px;
}

/* Card */
.card {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 16px;
}

/* Slider row */
.slider-row {
  margin-bottom: 16px;
}
.slider-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-dark);
  margin-bottom: 8px;
}
.slider-value { font-weight: 700; font-size: 15px; }

/* Range slider */
.range-slider,
input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(to right, var(--track-color, var(--scd-primary)) var(--pct, 50%), #ddd var(--pct, 50%));
  outline: none;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
  border: 2px solid var(--track-color, var(--scd-primary));
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
  cursor: pointer;
  border: 2px solid var(--track-color, var(--scd-primary));
}

/* Toggle switch */
.toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}
.toggle-row.indented { padding-left: 20px; }
.toggle-label-text { font-size: 14px; color: var(--text-dark); flex: 1; padding-right: 12px; }
.toggle-switch {
  position: relative;
  width: 48px; height: 28px;
  flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: #ccc;
  border-radius: 28px;
  cursor: pointer;
  transition: background 0.25s ease;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 3px; left: 3px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.25s ease;
}
.toggle-switch input:checked + .toggle-slider {
  background: var(--toggle-color, #34c759);
}
.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(20px);
}

/* Select/picker */
.select-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}
.select-label { font-size: 14px; color: var(--text-dark); }
.picker {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 13px;
  background: var(--card-bg);
  color: var(--text-dark);
  cursor: pointer;
}

/* Numeric input */
.num-input-wrap { display: flex; align-items: baseline; gap: 4px; }
.num-input {
  width: 72px;
  padding: 4px 8px;
  border: 1px solid rgba(0,0,0,0.12);
  border-radius: 8px;
  font-size: 15px;
  font-weight: 700;
  text-align: right;
  background: var(--card-bg);
}
.num-unit { font-size: 12px; color: var(--text-sec); }

/* Risk metric cell */
.risk-metric-cell {
  padding: 14px 16px;
  border-radius: 12px;
  border-left: 4px solid;
  margin-bottom: 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}
.risk-metric-cell.compact { padding: 10px 14px; margin-bottom: 8px; }
.risk-title { font-size: 13px; font-weight: 600; color: var(--text-dark); }
.risk-category { font-size: 13px; font-weight: 800; letter-spacing: 0.5px; }
.risk-percent { font-size: 15px; font-weight: 700; }

/* Guideline card */
.guideline-card {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  margin-bottom: 16px;
  background: var(--card-bg);
}
.guideline-header {
  padding: 12px 16px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}
.guideline-ref {
  padding: 8px 16px;
  font-size: 11px;
  color: var(--text-sec);
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}
.synthesis-box {
  padding: 14px 16px;
  margin: 12px;
  border-radius: 10px;
}
.synthesis-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--text-sec);
  margin-bottom: 6px;
}
.synthesis-rec {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.rec-class-badge {
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.rec-text { font-size: 14px; font-weight: 600; line-height: 1.4; }
.synthesis-context {
  margin-top: 10px;
  padding: 10px 12px;
  background: rgba(0,0,0,0.03);
  border-radius: 8px;
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.5;
}
.synthesis-context-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  margin-bottom: 4px;
  color: var(--text-sec);
}
.guideline-details { padding: 0 16px 12px; }
.guideline-expand-btn {
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  list-style: none;
}
.guideline-expand-btn::-webkit-details-marker { display: none; }
.expand-icon {
  transition: transform 0.2s ease;
  font-size: 10px;
}
details[open] > .guideline-expand-btn .expand-icon { transform: rotate(90deg); }
.guideline-items { padding-top: 8px; }
.guideline-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  font-size: 13px;
  line-height: 1.5;
}
.guideline-item:last-child { border-bottom: none; }
.guideline-item-badge {
  padding: 2px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  white-space: nowrap;
  margin-top: 2px;
}
.guideline-item-text { flex: 1; color: var(--text-dark); }
.guideline-item.highlighted {
  padding: 10px;
  border-radius: 8px;
  margin: -2px 0;
}
.guideline-footnote {
  font-size: 11px;
  color: var(--text-sec);
  margin-top: 8px;
  padding-top: 8px;
  border-top: 0.5px solid rgba(0,0,0,0.06);
}

/* Info card */
.info-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.info-icon { display: none; }
.info-title { font-size: 15px; font-weight: 700; }
.info-body { font-size: 13px; color: var(--text-sec); line-height: 1.6; }
.info-body p { margin: 0 0 8px; }
.info-body ul { margin: 4px 0 8px; padding-left: 20px; }
.info-body li { margin-bottom: 4px; }

/* Equation card */
.eq-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.eq-icon { display: none; }
.eq-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.eq-desc { font-size: 12px; color: var(--text-sec); margin-bottom: 12px; }
.eq-box {
  background: rgba(0,0,0,0.03);
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
  font-family: 'SF Mono', 'Menlo', 'Consolas', monospace;
  font-size: 12px;
  line-height: 1.6;
  overflow-x: auto;
}
.eq-main { font-weight: 700; margin-bottom: 8px; color: var(--text-dark); }
.eq-divider { height: 1px; background: rgba(0,0,0,0.08); margin: 8px 0; }
.eq-terms { font-size: 11px; color: var(--text-sec); }
.eq-vars { font-size: 12px; }
.eq-vars-title { font-weight: 700; color: var(--text-dark); margin-bottom: 6px; }
.eq-vars-text { color: var(--text-sec); margin-bottom: 3px; font-size: 12px; }

/* Reference box */
.ref-box {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 16px;
}
.ref-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ref-icon { display: none; }
.ref-title { font-size: 15px; font-weight: 700; color: var(--text-dark); }
.ref-item { padding: 8px 0; }
.ref-item-title { font-size: 13px; font-weight: 600; color: var(--text-dark); margin-bottom: 2px; }
.ref-item-citation { font-size: 12px; color: var(--text-sec); line-height: 1.5; }
.ref-links { margin-top: 4px; }
.ref-links a {
  font-size: 12px;
  color: #2d6a9f;
  text-decoration: none;
  font-weight: 600;
  margin-right: 12px;
}
.ref-links a:hover { text-decoration: underline; }
.ref-divider { height: 1px; background: rgba(0,0,0,0.06); margin: 8px 0; }
.ref-notes { font-size: 12px; color: var(--text-sec); }

/* Lay summary */
.lay-summary-card { position: relative; }
.lay-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.lay-icon { display: none; }
.lay-title { font-size: 15px; font-weight: 700; flex: 1; }
.lay-text { font-size: 13px; color: var(--text-sec); line-height: 1.7; margin: 0; }
.copy-btn {
  background: rgba(0,0,0,0.04);
  border: none;
  border-radius: 8px;
  padding: 6px;
  cursor: pointer;
  color: var(--text-sec);
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
}
.copy-btn:hover { background: rgba(0,0,0,0.08); }
.copy-btn.copied { color: #1e8449; }

/* Floating dock */
.floating-dock {
  position: fixed;
  bottom: calc(var(--tab-height, 60px) + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: calc(var(--max-content, 640px) - 32px);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: 14px;
  padding: 12px 16px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  z-index: 40;
  animation: slideUp 0.3s ease;
}

/* Disclaimer */
.disclaimer-bar {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 16px;
  background: rgba(0,0,0,0.03);
  border-radius: 12px;
  font-size: 11px;
  color: var(--text-sec);
  line-height: 1.5;
  margin-bottom: 16px;
}
.disc-icon { display: none; }

/* Step list */
.step-list { margin-bottom: 12px; }
.step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
}
.step-item:last-child { border-bottom: none; }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-text { font-size: 13px; color: var(--text-dark); line-height: 1.5; flex: 1; }

/* Accordion */
.accordion {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  margin-bottom: 10px;
  overflow: hidden;
}
.accordion-title {
  padding: 14px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.accordion-title::-webkit-details-marker { display: none; }
.accordion-title::after {
  content: '\25B6';
  font-size: 10px;
  color: var(--text-sec);
  transition: transform 0.2s ease;
}
details[open] > .accordion-title::after { transform: rotate(90deg); }
.accordion-content {
  padding: 0 16px 14px;
  font-size: 13px;
  color: var(--text-sec);
  line-height: 1.6;
}

/* Divider */
.divider {
  height: 1px;
  background: rgba(0,0,0,0.06);
  margin: 16px 0;
}

/* Checkbox row (diagnosis criteria) */
.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  cursor: pointer;
  font-size: 13px;
  color: var(--text-dark);
  line-height: 1.5;
}
.checkbox-row:last-child { border-bottom: none; }
.checkbox-row input[type="checkbox"] {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 2px solid rgba(0,0,0,0.2);
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
  accent-color: var(--scd-primary);
}
.cb-box { display: none; }
.cb-label { flex: 1; }
.cb-severity {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  margin-right: 4px;
}
.cb-severity.major { background: #c0392b; }
.cb-severity.minor { background: #ca6f1e; }

/* Diagnosis result */
.dx-result {
  padding: 16px;
  border-radius: 12px;
  border-left: 4px solid;
  margin-bottom: 16px;
}

/* Gene table */
.gene-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  margin-bottom: 16px;
}
.gene-table th {
  background: rgba(0,0,0,0.04);
  padding: 8px 10px;
  text-align: left;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-sec);
  border-bottom: 1px solid rgba(0,0,0,0.1);
}
.gene-table td {
  padding: 8px 10px;
  border-bottom: 0.5px solid rgba(0,0,0,0.06);
  color: var(--text-dark);
  line-height: 1.4;
}
.gene-table tr:hover td { background: rgba(0,0,0,0.02); }

/* Trial card */
.trial-card {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.06);
  padding: 16px;
  margin-bottom: 12px;
}
.trial-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 10px;
}
.trial-title { font-size: 14px; font-weight: 700; color: var(--text-dark); flex: 1; }
.trial-status-badge {
  flex-shrink: 0;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
}
.trial-status-badge.recruiting { background: #1e8449; }
.trial-status-badge.not-recruiting { background: #ca6f1e; }
.trial-status-badge.na { background: #888; }
.trial-details { font-size: 12px; color: var(--text-sec); line-height: 1.6; }
.trial-detail { margin-bottom: 4px; }
.td-label { font-weight: 600; color: var(--text-dark); }
.trial-detail a { color: #2d6a9f; text-decoration: none; font-weight: 600; }
.trial-detail a:hover { text-decoration: underline; }

/* Trial filter buttons */
.trial-filters {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 14px;
  scrollbar-width: none;
}
.trial-filters::-webkit-scrollbar { display: none; }
.trial-filter-btn {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  background: var(--card-bg);
  color: var(--text-dark);
  border: 1px solid rgba(0,0,0,0.08);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.trial-filter-btn:hover { border-color: #3d7a5f; }
.trial-filter-btn.active { background: #3d7a5f; color: #fff; border-color: #3d7a5f; }

/* Chart container */
.chart-container {
  background: var(--card-bg);
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
  padding: 16px;
  margin-bottom: 16px;
  overflow: hidden;
}
.chart-container canvas {
  display: block;
  margin: 0 auto;
}

/* Quick access section */
.quick-access-section { margin-bottom: 20px; }

/* Page content padding */
.page-content {
  padding: 0;
  animation: fadeIn 0.25s ease;
}
.page-scroll { padding: 0; }

/* ---------- Utility Classes ---------- */
.text-center { text-align: center; }
.text-sec    { color: var(--text-sec); }
.text-sm     { font-size: 13px; }
.text-xs     { font-size: 12px; }
.mt-0        { margin-top: 0; }
.mt-8        { margin-top: 8px; }
.mt-16       { margin-top: 16px; }
.mt-24       { margin-top: 24px; }
.mb-0        { margin-bottom: 0; }
.mb-8        { margin-bottom: 8px; }
.mb-16       { margin-bottom: 16px; }
.mb-24       { margin-bottom: 24px; }
.p-0         { padding: 0; }
.fw-600      { font-weight: 600; }
.fw-700      { font-weight: 700; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.gap-8       { gap: 8px; }
.gap-12      { gap: 12px; }
.hidden      { display: none !important; }
.vis-hidden  { visibility: hidden; }

/* Color helpers */
.bg-low  { background: var(--risk-low); }
.bg-int  { background: var(--risk-int); }
.bg-high { background: var(--risk-high); }
.c-low   { color: var(--risk-low); }
.c-int   { color: var(--risk-int); }
.c-high  { color: var(--risk-high); }

/* ---------- Responsive ---------- */
@media (min-width: 768px) {
  body {
    font-size: 16px;
  }

  .hero-header .hero-title {
    font-size: 30px;
  }

  .tab-banner .banner-title {
    font-size: 22px;
  }

  .card {
    padding: 24px;
  }

  .module-tile {
    min-height: 140px;
    padding: 24px 20px;
  }

  .module-tile .tile-title {
    font-size: 18px;
  }

  .risk-metric-cell .metric-value {
    font-size: 32px;
  }

  .floating-dock .dock-value {
    font-size: 26px;
  }

  .content-area {
    padding-left: 20px;
    padding-right: 20px;
  }
}

/* Larger screens: center with max-width */
@media (min-width: 1024px) {
  .tab-bar {
    max-width: var(--max-content);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 16px 16px 0 0;
    border-left: 0.5px solid rgba(0, 0, 0, 0.08);
    border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  }

  .top-bar {
    max-width: var(--max-content);
    left: 50%;
    transform: translateX(-50%);
    border-radius: 0 0 16px 16px;
    border-left: 0.5px solid rgba(0, 0, 0, 0.08);
    border-right: 0.5px solid rgba(0, 0, 0, 0.08);
  }
}

/* Safe area support for notched devices */
@supports (padding: env(safe-area-inset-bottom)) {
  .tab-bar {
    padding-bottom: env(safe-area-inset-bottom);
    height: calc(var(--tab-height) + env(safe-area-inset-bottom));
  }

  .content-area {
    padding-bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 24px);
  }

  .floating-dock {
    bottom: calc(var(--tab-height) + env(safe-area-inset-bottom) + 8px);
  }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1c1c1e;
    --card-bg: #2c2c2e;
    --text-dark: #f2f2f7;
    --text-sec: #98989d;
  }

  .top-bar {
    background: rgba(28, 28, 30, 0.92);
    border-bottom-color: rgba(255, 255, 255, 0.08);
  }

  .tab-bar {
    background: rgba(28, 28, 30, 0.94);
    border-top-color: rgba(255, 255, 255, 0.08);
  }

  #splash {
    background: #1c1c1e;
  }

  .search-bar input {
    background: var(--card-bg);
    color: var(--text-dark);
  }

  .search-results {
    background: #3a3a3c;
  }

  input[type="range"] {
    background: linear-gradient(
      to right,
      var(--track-color, var(--scd-primary)) var(--pct, 50%),
      #48484a var(--pct, 50%)
    );
  }

  .toggle-switch .toggle-track {
    background: #48484a;
  }

  .picker select,
  .select-row select {
    background: #3a3a3c;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
  }

  .num-input input[type="number"] {
    background: #3a3a3c;
    border-color: rgba(255, 255, 255, 0.1);
    color: var(--text-dark);
  }

  .gene-table th {
    background: #3a3a3c;
  }

  .copy-btn {
    background: #3a3a3c;
  }

  .copy-btn:hover {
    background: #48484a;
  }

  .equation-box {
    background: #3a3a3c;
  }

  .disclaimer-bar {
    background: rgba(255, 255, 255, 0.04);
  }

  .floating-dock {
    background: rgba(44, 44, 46, 0.88);
  }

  .criteria-checkbox input[type="checkbox"],
  .checkbox-row input[type="checkbox"] {
    border-color: #48484a;
  }

  .guideline-card .synthesis-box {
    background: rgba(30, 132, 73, 0.1);
  }

  .quick-pills .quick-pill {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .sub-nav .sub-nav-pill {
    background: var(--card-bg);
    border-color: rgba(255, 255, 255, 0.08);
  }

  .search-results .search-result-item:hover {
    background: rgba(255, 255, 255, 0.05);
  }

  .accordion-header:hover {
    background: rgba(255, 255, 255, 0.04);
  }

  .card,
  .nav-button,
  .ref-box,
  .lay-summary-card,
  .equation-card,
  .accordion,
  .info-card,
  .criteria-group,
  .dx-result,
  .trial-card,
  .chart-container,
  .faculty-card,
  .audience-card {
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  }

  .nav-button:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  }

  .divider {
    background: rgba(255, 255, 255, 0.08);
  }

  .guideline-card .guideline-ref {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .guideline-item {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .guideline-item.highlighted {
    background: rgba(46, 134, 193, 0.1);
  }

  .guideline-toggle {
    border-top-color: rgba(255, 255, 255, 0.06);
  }

  .synthesis-context {
    background: rgba(255, 255, 255, 0.04);
  }

  .toggle-row,
  .select-row,
  .criteria-checkbox,
  .checkbox-row,
  .step-list .step-item,
  .ref-box .ref-item,
  .info-header {
    border-bottom-color: rgba(255, 255, 255, 0.06);
  }

  .tab-bar .tab-item {
    color: #636366;
  }

  .site-map {
    background: #3a3a3c;
  }
}

/* Print styles */
@media print {
  .top-bar,
  .tab-bar,
  .floating-dock,
  .sub-nav,
  #splash {
    display: none !important;
  }

  .content-area {
    padding: 0;
    max-width: 100%;
  }

  .card,
  .nav-button,
  .criteria-group,
  .trial-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  body {
    background: #fff;
    color: #000;
    font-size: 12pt;
  }
}
