/* ── HOME ZONES ─────────────────────────────────────────────────────────────── */
.home-zone { margin-bottom: var(--section-gap, 32px); }

/* ── HOME WELCOME ────────────────────────────────────────────────────────────── */
.home-welcome {
  display: flex; align-items: baseline; gap: 10px;
  margin-bottom: 20px;
}
.home-welcome-title {
  font-size: 20px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.02em;
}
.home-welcome-sub {
  font-size: 13px; color: var(--text-muted); font-weight: 500;
}

/* ── HOME PRIMARY HUB — Clinical Presentations ───────────────────────────────── */
.home-primary-hub {
  margin-bottom: 10px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #EAF3FF 0%, #D6E8FF 100%);
  border: 1.5px solid rgba(15, 94, 168, 0.28);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.home-primary-hub-link {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 18px 16px;
  text-decoration: none; color: inherit;
  transition: background var(--transition);
}
.home-primary-hub-link:hover { background: rgba(15, 94, 168, 0.06); }
.home-primary-hub-icon { font-size: 32px; line-height: 1; flex-shrink: 0; }
.home-primary-hub-body { flex: 1; }
.home-primary-hub-title {
  font-size: 19px; font-weight: 800; color: var(--primary);
  letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 3px;
}
.home-primary-hub-sub { font-size: 12.5px; color: var(--text-secondary); }
.home-primary-hub-arrow {
  font-size: 14px; font-weight: 600; color: var(--primary);
  white-space: nowrap; flex-shrink: 0;
}
.home-primary-hub-features {
  display: flex;
  border-top: 1px solid rgba(15, 94, 168, 0.15);
}
.home-primary-feature {
  flex: 1;
  display: flex; align-items: center; gap: 7px;
  padding: 11px 16px;
  text-decoration: none; color: var(--primary);
  font-size: 13px; font-weight: 600;
  transition: background var(--transition);
  border-right: 1px solid rgba(15, 94, 168, 0.12);
}
.home-primary-feature:last-child { border-right: none; }
.home-primary-feature:hover { background: rgba(15, 94, 168, 0.08); }
.home-primary-feature-icon { font-size: 16px; flex-shrink: 0; }
.home-primary-feature-label { flex: 1; }
.home-primary-feature-count {
  font-size: 11px; font-weight: 600; color: var(--text-muted);
  background: rgba(255,255,255,0.7); padding: 1px 7px;
  border-radius: 10px; border: 1px solid rgba(15,94,168,0.15);
}

/* ── HOME SECONDARY GRID — Conditions / Reasoning / Meds ────────────────────── */
.home-secondary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}
.home-sec-tile {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 14px;
  border-radius: var(--radius);
  text-decoration: none; color: inherit;
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition), border-color var(--transition);
  min-height: 64px;
}
.home-sec-tile:hover { box-shadow: var(--shadow-md); }
.home-sec-tile--conditions { border-color: rgba(14, 116, 144, 0.22); }
.home-sec-tile--conditions:hover { border-color: rgba(14, 116, 144, 0.45); }
.home-sec-tile--reasoning { border-color: rgba(107, 33, 168, 0.22); }
.home-sec-tile--reasoning:hover { border-color: rgba(107, 33, 168, 0.45); }
.home-sec-tile--meds { border-color: rgba(22, 101, 52, 0.22); }
.home-sec-tile--meds:hover { border-color: rgba(22, 101, 52, 0.45); }
.home-sec-tile-icon { font-size: 22px; flex-shrink: 0; }
.home-sec-tile-body { flex: 1; min-width: 0; }
.home-sec-tile-title { font-size: 13px; font-weight: 700; color: var(--text); line-height: 1.2; }
.home-sec-tile-sub { font-size: 11px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-sec-tile-count {
  font-size: 12px; font-weight: 600; color: var(--text-muted);
  background: var(--bg); padding: 2px 7px;
  border-radius: 10px; border: 1px solid var(--border);
  flex-shrink: 0;
}

/* Legacy home-action-tile kept for any remaining references */
.home-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 28px; }
.home-action-tile {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 12px; padding: 18px 16px 16px; border-radius: var(--radius-lg);
  text-decoration: none; color: inherit; background: var(--surface);
  border: 1.5px solid var(--border); box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
  min-height: 110px;
}
.home-action-tile:hover { box-shadow: var(--shadow-md); }
.home-action-tile--primary {
  grid-column: span 2; min-height: 90px;
  background: linear-gradient(135deg, #EAF3FF 0%, #D6E8FF 100%);
  border-color: rgba(15, 94, 168, 0.30);
}
.home-action-tile-icon { font-size: 26px; line-height: 1; display: block; }
.home-action-tile-body { flex: 1; }
.home-action-tile-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.home-action-tile--primary .home-action-tile-title { font-size: 17px; color: var(--primary); }
.home-action-tile-desc { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.home-action-tile-arrow { font-size: 14px; color: var(--text-muted); align-self: flex-end; }

/* ── HOME REGION CHIP GRID ───────────────────────────────────────────────────── */
.home-region-section { margin-bottom: 24px; }
.home-region-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 10px;
}
.home-region-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.home-region-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 13px;
  border-radius: 20px;
  font-size: 13px; font-weight: 600;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: filter var(--transition), transform var(--transition), box-shadow var(--transition);
  line-height: 1;
}
.home-region-chip:hover { filter: brightness(0.94); }
.home-region-chip--lumbar     { background: var(--col-lumbar-bg);     color: var(--col-lumbar);     border-color: color-mix(in srgb, var(--col-lumbar) 25%, transparent); }
.home-region-chip--cervical   { background: var(--col-cervical-bg);   color: var(--col-cervical);   border-color: color-mix(in srgb, var(--col-cervical) 25%, transparent); }
.home-region-chip--shoulder   { background: var(--col-shoulder-bg);   color: var(--col-shoulder);   border-color: color-mix(in srgb, var(--col-shoulder) 25%, transparent); }
.home-region-chip--hip        { background: var(--col-hip-bg);        color: var(--col-hip);        border-color: color-mix(in srgb, var(--col-hip) 25%, transparent); }
.home-region-chip--knee       { background: var(--col-knee-bg);       color: var(--col-knee);       border-color: color-mix(in srgb, var(--col-knee) 25%, transparent); }
.home-region-chip--lower-limb { background: var(--col-lower-limb-bg); color: var(--col-lower-limb); border-color: color-mix(in srgb, var(--col-lower-limb) 25%, transparent); }
.home-region-chip--upper-limb { background: var(--col-upper-limb-bg); color: var(--col-upper-limb); border-color: color-mix(in srgb, var(--col-upper-limb) 25%, transparent); }
.home-region-chip--multi      { background: var(--col-multi-bg);      color: var(--col-multi);      border-color: color-mix(in srgb, var(--col-multi) 25%, transparent); }

/* ── START HERE CARD (legacy — kept for back-compat if referenced) ────────────── */
.start-here-card {
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--primary-bg); border: 1.5px solid rgba(15,94,168,0.28);
  border-radius: var(--radius-lg); padding: 20px 24px;
  text-decoration: none; color: inherit;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), transform var(--transition);
}
.start-here-card:hover { box-shadow: var(--shadow-md), var(--glow-primary); }
.start-here-body     { flex: 1; min-width: 0; }
.start-here-title    { font-size: 18px; font-weight: 700; color: var(--primary); margin-bottom: 4px; }
.start-here-subtitle { font-size: 13px; color: #1F4E79; line-height: 1.6; margin-bottom: 14px; }
.start-here-btn {
  display: inline-block; background: var(--primary); color: #fff;
  padding: 9px 20px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
}
.start-here-count {
  flex-shrink: 0; font-size: 12px; font-weight: 600; color: var(--primary);
  background: var(--surface); border: 1px solid #b3d0f0; border-radius: 20px; padding: 4px 12px;
}

/* ── HOMEPAGE TIER-1 PRIORITY STRIP ─────────────────────────────────────────── */
.cond-group-priority {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: 6px; margin-bottom: 10px;
}
.cond-priority-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.05em; color: var(--tier1-color); flex-shrink: 0;
}
.cond-priority-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; padding: 2px 9px;
  background: var(--tier1-bg); color: var(--tier1-color);
  border: 1px solid rgba(183, 28, 28, 0.18); border-radius: 12px;
  text-decoration: none;
  transition: background var(--transition), box-shadow var(--transition);
}
.cond-priority-chip::before { content: '⚠\fe0e'; font-size: 10px; }
.cond-priority-chip:hover { background: #fdd9d9; box-shadow: var(--shadow-sm); }

/* ── HOME FOOTER LINK ────────────────────────────────────────────────────────── */
.home-footer-link { font-size: 12px; color: var(--text-muted); margin-top: 20px; }
.home-footer-link a { color: var(--text-muted); text-decoration: none; }
.home-footer-link a:hover { text-decoration: underline; color: var(--text-secondary); }

/* ── BOTTOM NAV (hidden on desktop) ─────────────────────────────────────────── */
#bottom-nav {
  display: none;
}

/* ── HOME — ILLNESS SCRIPTS TILE ─────────────────────────────────────────── */
.home-action-tile--scripts {
  grid-column: span 2;
  background: linear-gradient(135deg, #fffbeb 0%, #f0fdfa 50%, #eef2ff 100%);
  border-color: rgba(217, 119, 6, 0.25);
  min-height: 72px;
}
.home-action-tile--scripts:hover { border-color: rgba(13, 148, 136, 0.45); }
.home-action-tile--scripts .home-action-tile-title { color: #0d9488; }

/* ── HOME REGION CHIP — base structure (desktop: chips, unchanged) ──────── */
/* Inner spans are inline by default; desc is hidden on desktop             */
.home-region-chip-icon { pointer-events: none; line-height: 1; }
.home-region-chip-text { pointer-events: none; display: inline-flex; align-items: center; gap: 5px; }
.home-region-chip-name { pointer-events: none; }
.home-region-chip-desc { display: none; } /* visible only on mobile below */

/* ── HOME: welcome line ─────────────────────────────────────────────────── */
@media (max-width: 767px) {
  .home-welcome { margin-bottom: 14px; }
  .home-welcome-title { font-size: 17px; }
  .home-welcome-sub { font-size: 11.5px; }
}

/* ── HOME: primary hub mobile ───────────────────────────────────────────── */
@media (max-width: 767px) {
  .home-primary-hub { margin-bottom: 8px; }
  .home-primary-hub-link { padding: 16px 14px 12px; gap: 10px; }
  .home-primary-hub-icon { font-size: 26px; }
  .home-primary-hub-title { font-size: 16px; }
  .home-primary-hub-sub { font-size: 11px; color: var(--text-muted); }
  .home-primary-hub-arrow { font-size: 12px; }
  .home-primary-feature { padding: 9px 12px; font-size: 12px; gap: 5px; }
  .home-primary-feature-icon { font-size: 14px; }
  .home-primary-feature-count { font-size: 10px; }
}

/* ── HOME: secondary grid mobile — 3-col stays but compact ─────────────── */
@media (max-width: 767px) {
  .home-secondary-grid { gap: 6px; margin-bottom: 18px; }
  .home-sec-tile { padding: 10px 10px; gap: 7px; min-height: 54px; }
  .home-sec-tile-icon { font-size: 18px; }
  .home-sec-tile-title { font-size: 11.5px; }
  .home-sec-tile-sub { display: none; } /* too cramped at 3-col mobile */
  .home-sec-tile-count { display: none; }
}

/* ── HOME: Hero primary card ─────────────────────────────────────────────── */
.home-hero-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, #EAF3FF 0%, #D6E8FF 100%);
  border: 1.5px solid rgba(15, 94, 168, 0.28);
  box-shadow: var(--shadow-md);
  text-decoration: none;
  color: inherit;
  margin-bottom: 24px;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.home-hero-card:hover {
  box-shadow: var(--shadow-lg), var(--glow-primary);
  border-color: rgba(15, 94, 168, 0.45);
}
.home-hero-body {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  min-width: 0;
}
.home-hero-icon { font-size: 30px; line-height: 1; flex-shrink: 0; }
.home-hero-text { flex: 1; min-width: 0; }
.home-hero-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 3px;
}
.home-hero-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--primary);
  opacity: 0.8;
  margin-bottom: 3px;
}
.home-hero-sub {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}
.home-hero-count {
  font-size: 20px;
  font-weight: 800;
  color: var(--primary);
  white-space: nowrap;
  flex-shrink: 0;
}
.home-hero-arrow { font-weight: 400; opacity: 0.6; }

/* ── HOME: Grouped sections ──────────────────────────────────────────────── */
.home-group { margin-bottom: 24px; }
.home-group-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}
.home-group-grid {
  display: grid;
  gap: 10px;
}
.home-group-grid--2 { grid-template-columns: 1fr 1fr; }
.home-group-grid--3 { grid-template-columns: 1fr 1fr 1fr; }

/* ── MORE PAGE (v2.34a) — single-column stack of secondary route cards ─────── */
.more-grid { display: flex; flex-direction: column; gap: 10px; }
.more-card { width: 100%; }

/* ── HOME: Tool card (secondary) ─────────────────────────────────────────── */
.home-tool-card {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
  min-height: 60px;
}
.home-tool-card:hover {
  box-shadow: var(--shadow-md);
  border-color: rgba(15, 94, 168, 0.3);
}
.home-tool-icon { font-size: 20px; line-height: 1; flex-shrink: 0; }
.home-tool-body { flex: 1; min-width: 0; }
.home-tool-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 2px;
}
.home-tool-sub {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.3;
}
.home-tool-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 7px;
  flex-shrink: 0;
  white-space: nowrap;
}

/* v2.51 — Flashcard tile accent */
.home-tool-card--cards { border-left: 3px solid #7c3aed; }
.home-tool-card--cards:hover { border-color: #7c3aed; }

/* ── v3.1 — HOME VISUAL TIERS (same tokens/language as presentation+condition pages) ──
   Reasoning (active study) = lifted + blue accent · Reference = flat/calm · More tools = quiet. */
.home-tool-card--reasoning {
  border-left: 4px solid var(--reasoning);
  box-shadow: var(--shadow-md);
}
.home-tool-card--reasoning .home-tool-icon { color: var(--reasoning); }
.home-tool-card--reasoning:hover { border-color: var(--reasoning); box-shadow: var(--shadow-lg); }

.home-tool-card--reference {
  background: var(--surface-sunken);
  box-shadow: none;
  border-color: var(--border);
}
/* v3.3 — reference reads quieter than the primary start/study cards */
.home-tool-card--reference .home-tool-title { color: var(--text-secondary); font-weight: 600; }
.home-tool-card--reference .home-tool-icon { opacity: 0.85; }

/* More tools row — quietest: smaller, lighter, recede behind the primary modes */
.home-more-tools { gap: 8px; }
.home-tool-card--quiet {
  padding: 10px 12px;
  min-height: 48px;
  background: var(--surface-sunken);
  box-shadow: none;
  border-width: 1px;
}
.home-tool-card--quiet .home-tool-icon { font-size: 16px; opacity: 0.8; }
.home-tool-card--quiet .home-tool-title { font-size: 12px; font-weight: 600; }
.home-tool-card--quiet .home-tool-sub { font-size: 10.5px; }
.home-tool-card--quiet:hover { border-color: rgba(15,94,168,0.25); box-shadow: var(--shadow-sm); }

/* Safety & Screening — full-width featured card at top of supporting tools */
.home-tool-card--safety-feature {
  border-left: 3px solid var(--col-neuro);
  background: var(--col-neuro-bg);
}
.home-tool-card--safety-feature .home-tool-title { color: var(--col-neuro); }
.home-tool-card--safety-feature:hover {
  border-color: var(--col-neuro);
  box-shadow: var(--shadow-sm);
}

/* Mobile: 2-col collapses to 1-col, 3-col collapses to 1-col */
@media (max-width: 767px) {
  .home-hero-card { padding: 16px 16px; margin-bottom: 14px; gap: 12px; }
  .home-hero-icon { font-size: 24px; }
  .home-hero-title { font-size: 16px; }
  .home-hero-count { font-size: 17px; }
  .home-group { margin-bottom: 14px; }
  .home-group-grid--2,
  .home-group-grid--3 { grid-template-columns: 1fr; gap: 8px; }
  .home-tool-card { padding: 11px 12px; min-height: 54px; }
}

/* ── HOME DESKTOP SCALE-UP (≥768px) ─────────────────────────────────────────
   Mobile-first means desktop was inheriting compact mobile sizes.
   These overrides restore generous desktop proportions.              ──────── */
@media (min-width: 768px) {
  /* Widen the home column to use more horizontal space */
  .home-page { max-width: 820px; padding-bottom: 80px; }

  /* Widen home column and increase vertical rhythm */
  .home-page { max-width: 820px; padding-bottom: 80px; }

  /* Hero card: taller, more impressive on desktop */
  .home-hero-card {
    padding: 28px 24px;
    margin-bottom: 28px;
    min-height: 120px;
  }
  .home-hero-icon  { font-size: 40px; }
  .home-hero-title { font-size: 22px; letter-spacing: -0.025em; }
  .home-hero-sub   { font-size: 14px; margin-top: 4px; }
  .home-hero-count { font-size: 28px; }
  .home-hero-eyebrow { font-size: 11px; margin-bottom: 4px; }

  /* Study group: full width, 3-col grid */
  .home-group--study { margin-bottom: 28px; }

  /* Study tiles: taller on desktop */
  .home-group--study .home-tool-card { padding: 18px 16px; min-height: 80px; }
  .home-group--study .home-tool-icon { font-size: 24px; }
  .home-group--study .home-tool-title { font-size: 14px; }
  .home-group--study .home-tool-sub  { font-size: 12px; display: block; }

  /* 2-column layout: region chips (left) + supporting tools (right) */
  .home-region-tools-wrap {
    display: grid;
    grid-template-columns: 3fr 2fr;
    column-gap: 28px;
    align-items: start;
    margin-bottom: 28px;
  }
  .home-region-tools-wrap > * { min-width: 0; }
  .home-group--region { margin-bottom: 0; }
  .home-group--tools  { margin-bottom: 0; }

  /* Region chips: bigger on desktop */
  .home-region-chip { padding: 9px 15px; font-size: 13.5px; }
  .home-group-label { margin-bottom: 12px; }

  /* Supporting tools: 1-col stack in the right column */
  .home-group--tools .home-more-tools { grid-template-columns: 1fr; gap: 8px; }
  .home-tool-card--quiet { padding: 13px 14px; min-height: 58px; }
}

/* ── HOME SCOPE STRIP — app totals at a glance ───────────────────────────── */
.home-scope-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 4px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.home-scope-item {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.home-scope-item strong {
  font-weight: 700;
  color: var(--text-secondary);
}
.home-scope-sep {
  color: var(--border);
  font-size: 13px;
  margin: 0 2px;
}
@media (max-width: 767px) {
  .home-scope-strip { margin-top: 12px; padding-top: 12px; }
  .home-scope-item  { font-size: 11px; }
}

/* ── MORE PAGE CARD ACCENTS ───────────────────────────────────────────────── */
.more-card {
  min-height: 72px;
  padding: 16px 16px;
  position: relative;
}
.more-card-arrow {
  font-size: 22px;
  color: var(--text-muted);
  flex-shrink: 0;
  line-height: 1;
  font-weight: 300;
  transition: transform var(--transition), color var(--transition);
}
.more-card:hover .more-card-arrow {
  transform: translateX(3px);
  color: var(--text-secondary);
}
.more-card .home-tool-sub {
  white-space: normal;
  line-height: 1.4;
  margin-top: 3px;
  max-width: 44ch;
}

/* Per-card accent left borders */
.more-card--pathways  { border-left: 3px solid var(--reasoning); }
.more-card--blueprints { border-left: 3px solid var(--col-cervical); }
.more-card--conditions { border-left: 3px solid var(--col-shoulder); }
.more-card--about     { border-left: 3px solid var(--border); }

/* Per-card hover border intensification */
.more-card--pathways:hover   { border-left-color: var(--reasoning); }
.more-card--blueprints:hover { border-left-color: var(--col-cervical); }
.more-card--conditions:hover { border-left-color: var(--col-shoulder); }

/* Desktop: 2-col more-grid */
@media (min-width: 768px) {
  .more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
  .more-card { min-height: 88px; }
}

