/* ========================================================================== 
   ScrubHub UX layer
   A focused information hierarchy for onboarding, the Today dashboard,
   grouped navigation, mobile primary actions, and accessible touch targets.
   Loaded last so legacy feature styles remain intact underneath it.
   ========================================================================== */

:root {
  /* Final UI foundation. These semantic tokens intentionally win over the
     legacy teal layer and keep the product in one calm Nightshift Violet
     system without changing feature-specific clinical colors. */
  --bg: #f7f6fc;
  --surface: #ffffff;
  --surface-2: #f7f5fd;
  --ink: #211c36;
  --ink-soft: #625c78;
  --muted: #6d6781;
  --primary: #6b46e8;
  --primary-600: #5935cf;
  --primary-700: #4825a8;
  --primary-050: #f0ecff;
  --border: #e8e4f2;
  --border-strong: #d8d1e9;
  --overlay: rgba(20, 15, 40, .68);
  --radius-control: 12px;
  --radius-card: 18px;
  --radius-feature: 24px;
  --radius-pill: 999px;
  --shadow-sm: 0 1px 2px rgba(36, 25, 75, .045), 0 3px 10px rgba(36, 25, 75, .035);
  --shadow: 0 12px 32px rgba(36, 25, 75, .09);
  --shadow-lg: 0 28px 72px rgba(25, 17, 55, .22);
  --focus-ring: 0 0 0 3px rgba(107, 70, 232, .24);
  --card-radius: var(--radius-feature);
}

button, input, select, textarea { font-family: var(--font); }
.btn {
  min-height: 42px;
  border-radius: var(--radius-control);
  font-weight: 650;
}
.btn-sm { min-height: 38px; }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-600)); }
.btn-primary:hover:not(:disabled) { background: linear-gradient(135deg, var(--primary-600), var(--primary-700)); box-shadow: 0 9px 24px rgba(89,53,207,.25); }
.btn-secondary:hover:not(:disabled) { border-color: #c8bdf0; background: var(--primary-050); }
.btn:focus-visible, .tier-action:focus-visible { outline: none; box-shadow: var(--focus-ring); }
.btn:disabled, button[disabled], [aria-disabled="true"] { cursor: not-allowed; box-shadow: none !important; transform: none !important; }
.grad, .progress-bar { background-image: linear-gradient(120deg, var(--primary), var(--accent)); }
.hero-title .grad { animation: none; background-position: 0 0; }
.notes-badge { animation: none; }
.profile-chip:hover { transform: none; }
.welcome-brand-mark { filter: drop-shadow(0 10px 22px rgba(89,53,207,.2)); }
.btn-pro:hover { box-shadow: 0 7px 18px rgba(89,53,207,.22); }
.nadi-launcher:hover { box-shadow: 0 16px 40px rgba(89,53,207,.22); }
.nadi-overlay, .pro-overlay, .auth-overlay { background: var(--overlay); }
.auth-panel, .pro-panel, .nadi-panel { border: 1px solid rgba(255,255,255,.7); border-radius: var(--radius-feature); box-shadow: var(--shadow-lg); }
.auth-close, .pro-close, .nadi-close { background: var(--surface-2); color: var(--ink-soft); }
.auth-close:hover, .pro-close:hover, .nadi-close:hover { background: var(--primary-050); color: var(--primary-700); }
.auth-form input, .auth-form textarea, .auth-form select,
.input, .chat-input, .hb-input {
  border-radius: var(--radius-control);
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.auth-form input:focus, .auth-form textarea:focus, .auth-form select:focus,
.input:focus, .chat-input:focus, .hb-input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: var(--focus-ring);
}
#ss-form input[type="text"], #ss-form textarea { width: 100%; box-sizing: border-box; }
.auth-form label { display: grid; gap: 5px; }
.auth-form label.field-label { display: block; }
.auth-form label input, .auth-form label textarea { width: 100%; box-sizing: border-box; }
.auth-close, .pro-close { min-width: 44px; min-height: 44px; display: grid; place-items: center; border-radius: 12px; }
.tier-card.tier-featured { cursor: default; }
.tier-action { min-height: 40px; border: 0; cursor: pointer; font-family: var(--font); }
.tier-action:focus-visible { outline: 2px solid var(--primary-700); outline-offset: 2px; }
.test-preset-meta { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.test-preset-meta b { padding: 4px 7px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); font-size: 11px; font-weight: 700; }
.community-starters { display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; margin-top: 13px; }
.community-starters button { min-height: 38px; padding: 8px 11px; border: 1px solid var(--border-strong); border-radius: 999px; background: var(--surface); color: var(--primary-700); font-size: 10.5px; font-weight: 650; cursor: pointer; }
.community-starters button:hover { border-color: var(--primary); background: var(--primary-050); }
.focus-preview-count { margin: 0; padding: 9px 11px; border-radius: 11px; background: var(--surface-2); color: var(--primary-700); font-size: 11.5px; font-weight: 650; text-align: center; }
@media (min-width: 761px) { .wizard-card-wide #a-levels { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); } }
.side-brand, .quick-actions button, .mobile-link, .topic-search-results button,
.progress-details summary { -webkit-tap-highlight-color: transparent; }

/* ------------------------------------------------------------ app chrome */

.side-brand {
  width: 100%;
  border: 0;
  background: transparent;
  font-family: var(--font);
  text-align: left;
}
.side-brand:focus-visible { outline: 2px solid #c4b5fd; outline-offset: 2px; border-radius: 10px; }
.side-nav { min-height: 0; overflow-y: auto; scrollbar-width: thin; scrollbar-color: #3a3462 transparent; }
.side-nav-label {
  margin: 9px 12px 2px;
  color: #aaa3c8;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .13em;
  line-height: 1;
  text-transform: uppercase;
}
.side-nav-label:first-child { margin-top: 2px; }
.sidebar { background: linear-gradient(180deg, #18142d 0%, #141124 100%); border-right: 1px solid rgba(255,255,255,.035); }
.side-nav { scrollbar-width: none; }
.side-nav::-webkit-scrollbar { display: none; }
.side-link { min-height: 41px; padding-block: 9px; border-radius: var(--radius-control); }
.side-link:hover { transform: none; background: rgba(255,255,255,.06); }
.side-link.active { background: linear-gradient(135deg, #7650ee, #5c35d8); box-shadow: 0 8px 22px rgba(89,53,207,.32); }
.side-badge { background: #a52264; color: #fff; }
.side-meter { min-height: 0; }
.side-reset { min-height: 28px; }
.nadi-side-plan { margin-left: auto; padding: 3px 6px; border: 1px solid #3a3462; border-radius: 999px; color: #d4c9ff; font-size: 9.5px; font-weight: 700; white-space: nowrap; }
.side-legal { display: flex; justify-content: center; gap: 5px; color: #777092; font-size: 9.5px; }
.side-legal a { color: #9d96c0; text-decoration: none; }.side-legal a:hover { color: #fff; text-decoration: underline; }
.streak-zero { display: none; }

.mobile-nav { display: none; }

.topbar { min-height: 64px; background: rgba(247,246,252,.88); box-shadow: 0 1px 10px rgba(36,25,75,.035); }
#app { max-width: 1120px; }

/* Onboarding is a focused, distraction-free mode. */
body.onboarding-mode { grid-template-columns: minmax(0, 1fr); }
body.onboarding-mode > .sidebar,
body.onboarding-mode .topbar,
body.onboarding-mode .mobile-nav,
body.onboarding-mode .nadi-dock { display: none !important; }
body.onboarding-mode > .main-col { grid-column: 1; }
body.onboarding-mode #app { width: 100%; max-width: 1180px; padding-top: 24px; }

/* -------------------------------------------------------------- welcome */

.welcome-v2 { padding: 0 0 64px; }
.welcome-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 44px;
}
.welcome-lockup {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -.025em;
  text-decoration: none;
}
.welcome-lockup img { width: 42px; height: 42px; object-fit: contain; }
.welcome-lockup > span > span { color: var(--primary); }
.welcome-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(400px, .98fr);
  gap: clamp(42px, 7vw, 90px);
  align-items: center;
  min-height: 520px;
}
.welcome-hero-copy .eyebrow { max-width: 560px; }
.welcome-hero-copy .hero-title {
  max-width: 680px;
  margin: 12px 0 18px;
  font-size: clamp(44px, 5.4vw, 72px);
  line-height: .98;
  letter-spacing: -.045em;
}
.welcome-hero-copy .hero-lead { max-width: 660px; margin: 0; font-size: 17px; line-height: 1.7; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 28px; }
.welcome-actions .btn { min-height: 50px; }
.welcome-hero-copy .hero-note { margin: 13px 0 0; text-align: left; }

.welcome-preview {
  position: relative;
  overflow: hidden;
  padding: 19px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 28px;
  background: linear-gradient(145deg, #17142a 0%, #2a2152 65%, #48328c 130%);
  box-shadow: 0 30px 80px rgba(38,24,90,.26);
  color: #fff;
}
.welcome-preview::before {
  content: '';
  position: absolute;
  width: 240px;
  height: 240px;
  right: -90px;
  top: -110px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(244,114,182,.35), transparent 68%);
  pointer-events: none;
}
.welcome-preview-top { display: flex; align-items: center; gap: 8px; color: #ddd6fe; font-size: 12px; font-weight: 700; }
.welcome-preview-top small { margin-left: auto; color: #c4b5fd; }
.preview-example { padding: 3px 7px; border: 1px solid rgba(255,255,255,.16); border-radius: var(--radius-pill); background: rgba(255,255,255,.08); color: #fff; font-size: 9.5px; font-weight: 750; letter-spacing: .05em; text-transform: uppercase; }
.preview-dot { width: 8px; height: 8px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 5px rgba(74,222,128,.12); }
.preview-path { display: flex; flex-wrap: wrap; gap: 7px; margin: 18px 0 13px; }
.preview-path span { padding: 5px 9px; border: 1px solid rgba(255,255,255,.13); border-radius: 999px; background: rgba(255,255,255,.07); color: #ddd6fe; font-size: 10px; }
.preview-primary {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 13px;
  align-items: center;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 19px;
  background: rgba(255,255,255,.09);
}
.preview-number { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: #fff; color: var(--primary-700); font: 700 16px var(--display); }
.preview-primary div { display: grid; gap: 3px; }
.preview-primary small { color: #c4b5fd; font-size: 9px; font-weight: 800; letter-spacing: .11em; }
.preview-primary strong { font: 600 17px var(--display); }
.preview-primary p { margin: 0; color: #ddd6fe; font-size: 11px; line-height: 1.45; }
.preview-arrow { color: #c4b5fd; font-size: 21px; }
.preview-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; padding: 13px 5px; border-bottom: 1px solid rgba(255,255,255,.09); }
.preview-row > span { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: rgba(196,181,253,.12); color: #c4b5fd; }
.preview-row div { display: grid; gap: 2px; }.preview-row strong { font-size: 12px; }.preview-row small { color: #b9b4d4; font-size: 10px; }.preview-row b { color: #c4b5fd; font-size: 10px; }
.preview-safety { padding: 13px 5px 1px; color: #9d96c0; font-size: 9.5px; line-height: 1.45; }

.welcome-proof {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 56px 0 96px;
  padding: 20px 0;
  border-block: 1px solid var(--border);
}
.welcome-proof span { display: grid; gap: 3px; padding: 2px 24px; border-right: 1px solid var(--border); color: var(--ink-soft); font-size: 12px; }
.welcome-proof span:first-child { padding-left: 0; }.welcome-proof span:last-child { border: 0; }
.welcome-proof strong { color: var(--ink); font: 600 24px var(--display); }
.welcome-how { text-align: center; }
.welcome-how > h2 { max-width: 680px; margin: 7px auto 30px; font: 600 clamp(31px,4vw,46px)/1.08 var(--display); letter-spacing: -.025em; }
.welcome-v2 .steps { margin-top: 0; }
.welcome-v2 .step-card { padding: 24px 10px; border: 0; border-top: 1px solid var(--border); border-radius: 0; background: transparent; box-shadow: none; text-align: left; }
.welcome-v2 .step-card h3 { margin: 12px 0 7px; font: 600 18px var(--display); }
.welcome-feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 18px 0 96px; }
.welcome-feature-grid article { padding: 24px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface); box-shadow: var(--shadow-sm); }
.welcome-feature-grid article > span { display: grid; place-items: center; width: 43px; height: 43px; border-radius: 13px; background: var(--primary-050); color: var(--primary-700); }
.welcome-feature-grid h3 { margin: 16px 0 7px; font: 600 19px var(--display); }
.welcome-feature-grid p { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.welcome-v2 .welcome-pricing { scroll-margin-top: 24px; }
.welcome-price-card { align-content: start; border-radius: var(--radius-card); }
.welcome-price-card.featured { border-color: #b7a5f5; background: linear-gradient(145deg, #f4f0ff, #fff); box-shadow: 0 14px 32px rgba(89,53,207,.11); }
.welcome-price-card strong { display: flex; align-items: baseline; gap: 5px; }
.welcome-price-card strong small { color: var(--ink-soft); font: 600 12px var(--font); }
.price-feature-list { display: grid; gap: 9px; margin: 2px 0 8px; padding: 0; list-style: none; }
.price-feature-list li { position: relative; padding-left: 22px; color: var(--ink-soft); font-size: 13px; line-height: 1.45; }
.price-feature-list li::before { content: '✓'; position: absolute; left: 1px; color: var(--green); font-weight: 800; }
.price-disclosure { display: block; margin-top: 10px; color: var(--ink-soft); font-size: 12px; line-height: 1.45; }
.trust-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 42px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: 11.5px; }
.trust-footer nav, .dashboard-safety nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 11px; }
.trust-footer a, .dashboard-safety a { color: var(--primary-700); text-decoration: none; }.trust-footer a:hover, .dashboard-safety a:hover { text-decoration: underline; }

/* ------------------------------------------------------- Today dashboard */

.ux-dashboard { display: grid; gap: 20px; }
.ux-dashboard > * { min-width: 0; }
.ux-path-upgrade { margin: 0; padding: 17px 20px; border-color: #e9d7a7; border-radius: var(--radius-card); background: linear-gradient(120deg, #fffbf1, #fffdf8); box-shadow: none; }
.setup-kicker { display: block; margin-bottom: 3px; color: #8b6413; font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }

.today-card {
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-feature);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(36,25,75,.07);
}
.today-card-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
.today-card-head .eyebrow { margin-bottom: 2px; }
.today-card-head h1 { margin: 0; font: 600 29px/1.1 var(--display); letter-spacing: -.025em; }
.today-time { padding: 7px 11px; border-radius: 999px; background: var(--primary-050); color: var(--primary-700); font-size: 11px; font-weight: 700; white-space: nowrap; }
.today-grid { display: grid; grid-template-columns: minmax(0,1fr) 280px; gap: 14px; }
.today-grid .dash-hero { min-height: 174px; padding: 22px; box-shadow: none; }
.today-grid .dash-hero-title { font-size: 24px; }
.today-grid .dash-hero-sub { max-width: 540px; line-height: 1.55; }
.today-goals { display: grid; align-content: center; padding: 18px; border: 1px solid var(--border); border-radius: 20px; background: var(--surface-2); }
.today-goals-head { display: flex; justify-content: space-between; margin-bottom: 14px; font-size: 12px; font-weight: 700; }
.today-goals-head strong { color: var(--primary-700); }

.quick-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.quick-actions button {
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 10px;
  align-items: center;
  min-height: 82px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.quick-actions button:hover { transform: translateY(-1px); border-color: #cfc5fa; box-shadow: var(--shadow); }
.quick-actions button:focus-visible { outline: none; box-shadow: var(--focus-ring); border-color: var(--primary); }
.quick-actions button > span { grid-row: 1 / 3; display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-050); color: var(--primary-700); }
.quick-actions button:nth-child(2) > span { background: var(--green-050); color: #087b70; }
.quick-actions button:nth-child(4) > span { background: #fff0f7; color: #a52264; }
.quick-actions strong { font-size: 13.5px; }.quick-actions small { color: var(--ink-soft); font-size: 11px; line-height: 1.35; }

.path-context {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, #faf9ff, #fff);
}
.path-context h2 { margin: 2px 0 4px; font: 600 21px var(--display); }
.path-context-main > p:not(.eyebrow):not(.profile-goals) { margin: 0; color: var(--ink-soft); font-size: 12px; }
.path-context .profile-tags { margin-top: 10px; }
.path-context .ptag { padding: 5px 8px; font-size: 10px; }
.path-context .profile-goals { margin: 10px 0 0; color: var(--ink-soft); font-size: 11.5px; }

.ux-dashboard .weekly-plan { margin: 0; padding: 20px; border-radius: 22px; }
.ux-dashboard .weekly-plan-head { margin-bottom: 12px; }
.ux-dashboard .weekly-plan-head h2 { font: 600 22px var(--display); }
.ux-dashboard .plan-topic { min-height: 56px; }

.progress-snapshot { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; }
.progress-snapshot > div { display: grid; grid-template-columns: 34px 1fr; gap: 1px 10px; align-items: center; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.progress-snapshot > div > span { grid-row: 1/3; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 11px; background: var(--green-050); color: #087b70; }
.progress-snapshot strong { font-size: 13px; }.progress-snapshot small { color: var(--ink-soft); font-size: 11.5px; }

.ux-dashboard > .cat-block { margin: 12px 0 4px; }
.ux-dashboard > .cat-block .cat-name { margin-bottom: 12px; font: 600 22px var(--display); }
.ux-dashboard .ss-new { min-height: 190px; }

.library-shell { position: relative; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius-feature); background: var(--surface); box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 16px; }
.section-heading h2 { margin: 3px 0 3px; font: 600 25px var(--display); }
.section-heading p:not(.eyebrow) { margin: 0; color: var(--ink-soft); font-size: 12px; }
.topic-search-wrap { position: relative; z-index: 12; }
.topic-search-wrap > input {
  width: 100%;
  min-height: 52px;
  padding: 13px 48px 13px 46px;
  border: 1.5px solid var(--border-strong);
  border-radius: 16px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 15px;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.topic-search-wrap > input:focus { border-color: var(--primary); background: #fff; box-shadow: var(--focus-ring); }
.topic-search-icon { position: absolute; z-index: 2; left: 16px; top: 16px; color: var(--primary-700); pointer-events: none; }
.topic-search-clear { position: absolute; z-index: 2; right: 8px; top: 7px; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 11px; background: transparent; color: var(--ink-soft); cursor: pointer; }
.topic-search-clear:hover { background: var(--primary-050); color: var(--primary-700); }
.topic-search-results { position: absolute; left: 0; right: 0; top: calc(100% + 7px); overflow: hidden; border: 1px solid var(--border-strong); border-radius: 17px; background: #fff; box-shadow: 0 22px 52px rgba(38,24,90,.2); }
.topic-search-results button { display: grid; grid-template-columns: 34px 1fr auto; gap: 10px; align-items: center; width: 100%; min-height: 57px; padding: 9px 13px; border: 0; border-bottom: 1px solid var(--border); background: #fff; color: var(--ink); text-align: left; cursor: pointer; }
.topic-search-results button:last-child { border: 0; }
.topic-search-results button:hover, .topic-search-results button.active { background: var(--primary-050); }
.topic-search-results button > span:first-child { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); color: var(--primary-700); }
.topic-search-results button > span:nth-child(2) { display: grid; gap: 2px; }
.topic-search-results strong { font-size: 12.5px; }.topic-search-results small { color: var(--ink-soft); font-size: 10px; }.topic-search-results b { color: var(--primary-700); font-size: 10.5px; }
.topic-search-empty { display: grid; gap: 3px; padding: 17px; }.topic-search-empty strong { font-size: 12.5px; }.topic-search-empty span { color: var(--ink-soft); font-size: 11px; }
.path-preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin: 24px 0 12px; }
.path-preview-head h3 { margin: 0; font: 600 18px var(--display); }.path-preview-head span { color: var(--ink-soft); font-size: 10.5px; }
.path-preview-grid { grid-template-columns: repeat(3,1fr); }
.topic-heading { min-width: 0; }
.topic-subject { display: block; margin-bottom: 3px; color: var(--primary-700); font-size: 10px; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.ux-topic-card { min-height: 198px; }
.full-library { margin-top: 28px; }
.full-library .subject-block:first-child { margin-top: 0; }

.together-row { display: grid; grid-template-columns: minmax(0,1.25fr) minmax(300px,.75fr); gap: 14px; min-width: 0; }
.together-card, .invite-card { min-width: 0; min-height: 190px; padding: 20px; border: 1px solid var(--border); border-radius: var(--radius-feature); background: var(--surface); overflow: hidden; }
.together-card { display: flex; gap: 15px; align-items: flex-start; background: linear-gradient(140deg, #1d1936, #342763); color: #fff; }
.together-icon { display: grid; place-items: center; flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; background: rgba(255,255,255,.11); color: #c4b5fd; }
.together-card .eyebrow { color: #c4b5fd; }.together-card h2 { margin: 3px 0 7px; font: 600 23px var(--display); }.together-card p:not(.eyebrow) { margin: 0 0 15px; color: #ddd6fe; font-size: 12px; line-height: 1.55; }
.together-card .btn-primary { background: #fff; color: var(--primary-700); }
.invite-card { display: grid; align-content: center; }
.invite-share-row { display: flex; gap: 8px; min-width: 0; }
.invite-link-field { flex: 1; min-width: 0; min-height: 40px; padding: 8px 10px; border: 1.5px solid var(--border-strong); border-radius: var(--radius-control); background: var(--surface-2); color: var(--ink); font-size: 12px; }

.progress-details { overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--surface); }
.progress-details > summary { display: grid; grid-template-columns: 38px 1fr auto; gap: 11px; align-items: center; min-height: 72px; padding: 13px 18px; cursor: pointer; list-style: none; }
.progress-details > summary::-webkit-details-marker { display: none; }
.progress-details > summary > span:first-child { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--primary-050); color: var(--primary-700); }
.progress-details > summary > span:nth-child(2) { display: grid; gap: 2px; }.progress-details summary strong { font-size: 13px; }.progress-details summary small { color: var(--ink-soft); font-size: 10.5px; }.progress-details summary b { color: var(--primary-700); font-size: 11px; }
.progress-details[open] > summary { border-bottom: 1px solid var(--border); }
.progress-details .mastery-map { margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.dashboard-safety { display: grid; justify-items: center; gap: 7px; max-width: 780px; margin: 4px auto 0; color: var(--muted); font-size: 11.5px; line-height: 1.55; text-align: center; }
.dashboard-safety p { margin: 0; }

body.side-open .nadi-dock,
body:has(.auth-overlay) .nadi-dock,
body:has(.pro-overlay) .nadi-dock { display: none !important; }
body[data-view]:not([data-view="study"]) .nadi-dock { display: none !important; }
body[data-view="study"] .nadi-launcher { padding: 7px; }
body[data-view="study"] .nadi-launcher-label { display: none; }
.nadi-ai-badge { display: inline-flex; margin-left: 6px; padding: 3px 7px; border-radius: 999px; background: var(--primary-050); color: var(--primary-700); font: 700 9px var(--font); vertical-align: middle; }
.nadi-consent { display: grid; justify-items: center; max-width: 620px; margin: auto; padding: 34px; text-align: center; }
.nadi-consent-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; background: var(--primary-050); color: var(--primary-700); }
.nadi-consent h2 { margin: 15px 0 7px; font: 600 24px var(--display); }
.nadi-consent ul { display: grid; gap: 6px; max-width: 510px; margin: 12px 0; padding-left: 20px; color: var(--ink-soft); font-size: 12.5px; line-height: 1.5; text-align: left; }
.nadi-consent > p { max-width: 520px; margin: 5px 0 18px; color: var(--ink-soft); font-size: 11.5px; line-height: 1.55; }
.nadi-consent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ----------------------------------------------- shared feature surfaces */

.rail-card:hover, .stat-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.topic-card:hover, .test-preset:hover, .grp-card:hover, .grp-action-card:hover { transform: translateY(-1px); }
.groups-space { max-width: 1040px; }
.community-layout { grid-template-columns: minmax(0,1fr) 250px; gap: 24px; }
.community-compose, .community-side, .study-panel, .test-custom, .health-form,
.mech-card, .vl-settings, .notes-shell { border-radius: var(--radius-card); }
.community-hero h2 { font-size: clamp(1.25rem,2.2vw,1.6rem); }
.community-post-actions button, .grp-report { min-width: 40px; min-height: 40px; padding: 8px; border-radius: 10px; }
.grp-report { opacity: .72; }
.grp-report:hover, .grp-report:focus-visible { opacity: 1; }
.hub-tabs { border-radius: 16px; }
.hub-tab { min-height: 40px; border-radius: 12px; }
.hub-tab.active { box-shadow: 0 5px 14px rgba(89,53,207,.2); }
.focus-timer { border-radius: var(--radius-feature); box-shadow: 0 16px 36px rgba(36,25,75,.14); }
.room-controls { border-radius: 16px; }

.chat-log { padding-inline: clamp(24px,6vw,72px); }
.msg { width: 100%; }
.msg-assistant .msg-body { width: 100%; max-width: 720px; margin-inline: auto; }
body[data-view="study"] .nadi-notes-btn { display: none; }

.review-status {
  gap: 5px;
  min-height: 24px;
  padding: 4px 9px;
  border: 1px solid transparent;
  font-size: 10.5px;
  font-weight: 750;
}
.review-status::before { content: '•'; font-size: 13px; line-height: 1; }
.review-status.draft { border-color: #d8d1e9; background: #f2f0f7; color: #5f5874; }
.review-status.sourced { border-color: #bfd9f1; background: #edf7ff; color: #235f91; }
.review-status.nursing-review-pending,
.review-status.pharmacist-review-pending,
.review-status.clinician-review-pending { border-color: #e8c777; background: #fff7df; color: #704b00; }
.review-status.changes-requested { border-color: #efb3a8; background: #fff0ed; color: #9c3422; }
.review-status.approved { border-color: #a7dfcb; background: var(--green-050); color: #087b70; }
.review-status.approved::before { content: '✓'; }
.mech-safety, .vl-disclaimer, .visual-fallback-note, .legal-callout { border-radius: 14px; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 1120px) {
  .today-grid { grid-template-columns: 1fr; }
  .today-goals { display: block; }
  .today-goals .goal-ring-wrap { justify-content: flex-start; }
  .quick-actions { grid-template-columns: repeat(2,1fr); }
  .path-preview-grid { grid-template-columns: repeat(2,1fr); }
}

@media (max-width: 760px) {
  html, body { max-width: 100%; overflow-x: hidden; }
  body:not(.onboarding-mode) #app { padding-bottom: calc(132px + env(safe-area-inset-bottom)); }
  body.side-open .mobile-nav { display: none !important; }
  .side-nav-label { margin-top: 13px; font-size: 10px; }
  .side-link { min-height: 44px; }
  .side-close, .hamburger { min-width: 44px !important; min-height: 44px !important; }
  .topbar { min-height: 62px; }
  .streak-chip { min-width: 44px !important; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; gap: 3px; }
  .streak-chip span { display: none; }.streak-chip .streak-zero { display: inline; }

  .mobile-nav {
    position: fixed;
    z-index: 68;
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    display: grid;
    grid-template-columns: repeat(5,1fr);
    min-height: 66px;
    padding: 5px;
    border: 1px solid rgba(214,209,236,.92);
    border-radius: 20px;
    background: rgba(255,255,255,.94);
    box-shadow: 0 15px 45px rgba(38,24,90,.22);
    backdrop-filter: blur(14px);
  }
  .mobile-link { display: grid; place-items: center; align-content: center; gap: 3px; min-width: 0; min-height: 54px; padding: 3px 2px; border: 0; border-radius: 15px; background: transparent; color: var(--ink-soft); font-size: 10.5px; font-weight: 650; cursor: pointer; }
  .mobile-link svg { width: 20px; height: 20px; }.mobile-link.active { background: var(--primary-050); color: var(--primary-700); }.mobile-link:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
  .nadi-dock { bottom: calc(84px + env(safe-area-inset-bottom)) !important; }
  .nadi-dock { display: none !important; }
  .nadi-consent { padding: 24px 16px; }.nadi-consent h2 { font-size: 21px; }

  body.onboarding-mode #app { padding: 14px 16px 64px; }
  .welcome-nav { margin-bottom: 32px; }
  .welcome-hero { grid-template-columns: 1fr; gap: 38px; min-height: 0; }
  .welcome-hero-copy .hero-title { font-size: clamp(42px,13vw,58px); }
  .welcome-hero-copy .hero-lead { font-size: 15px; }
  .welcome-actions { display: grid; }.welcome-actions .btn { width: 100%; }
  .welcome-preview { padding: 15px; border-radius: 23px; }
  .preview-primary { grid-template-columns: 38px 1fr; padding: 14px; }.preview-arrow { display: none; }
  .welcome-proof { grid-template-columns: repeat(2,1fr); gap: 0; margin: 48px 0 72px; }
  .welcome-proof span { min-height: 70px; padding: 12px; border-bottom: 1px solid var(--border); }
  .welcome-proof span:nth-child(2) { border-right: 0; }.welcome-proof span:nth-child(3), .welcome-proof span:nth-child(4) { border-bottom: 0; }.welcome-proof strong { font-size: 21px; }
  .welcome-feature-grid { grid-template-columns: 1fr; margin-bottom: 72px; }
  .welcome-v2 .steps { grid-template-columns: 1fr; }
  .trust-footer { display: grid; justify-items: center; text-align: center; }

  .ux-dashboard { gap: 14px; }
  .today-card { padding: 15px; border-radius: 20px; }
  .today-card-head h1 { font-size: 24px; }.today-time { display: none; }
  .today-grid { gap: 10px; }
  .today-grid .dash-hero { min-height: 0; padding: 17px; }
  .today-grid .dash-hero-title { font-size: 22px; }
  .today-goals { padding: 15px; border-radius: 17px; }
  .quick-actions { grid-template-columns: repeat(2,1fr); gap: 9px; }
  .quick-actions button { grid-template-columns: 34px 1fr; min-height: 74px; padding: 11px; }
  .quick-actions button > span { width: 34px; height: 34px; }.quick-actions strong { font-size: 12px; }.quick-actions small { font-size: 10.5px; }
  .path-context { display: grid; gap: 13px; padding: 16px; border-radius: 18px; }.path-context .btn { justify-self: start; min-height: 40px; }
  .ux-dashboard .weekly-plan { padding: 17px 15px; }
  .weekly-plan-head { display: grid; }.weekly-plan-head > span { justify-self: start; }
  .progress-snapshot { grid-template-columns: 1fr; }.progress-snapshot > div { min-height: 58px; }
  .library-shell { padding: 16px; border-radius: 20px; }
  .section-heading { display: grid; align-items: start; }.section-heading .btn { justify-self: start; }
  .topic-search-wrap > input { min-height: 54px; padding-left: 44px; font-size: 16px; }
  .topic-search-clear { width: 44px; height: 44px; top: 5px; }
  .topic-search-results { position: fixed; left: 12px; right: 12px; top: 126px; max-height: min(64vh,520px); overflow-y: auto; z-index: 90; }
  .topic-search-results button { min-height: 62px; }
  .path-preview-head { display: grid; }.path-preview-grid { grid-template-columns: 1fr; }
  .together-row { width: 100%; min-width: 0; grid-template-columns: minmax(0,1fr); }.together-card, .invite-card { width: 100%; min-width: 0; min-height: 0; padding: 17px; }.together-card h2 { font-size: 21px; }
  #rail-invite > div { display: grid !important; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px !important; min-width: 0; }
  #rail-invite #invite-link { grid-column: 1 / -1; width: 100%; min-width: 0; min-height: 44px; }
  #rail-invite #invite-copy, #rail-invite #invite-share { width: 100%; min-height: 44px; }
  .progress-details > summary { min-height: 72px; padding-inline: 14px; }.progress-details summary b { display: none; }
  .progress-details .mastery-map { padding: 15px; }

  /* Mobile clarity and touch safety across legacy feature surfaces. */
  .btn, .btn-sm, .hub-tab, .mode-tab, .auth-close, .pro-close, .nadi-close,
  .mech-tabs button, .mech-quiz button, .anatomy3d-toolbar button { min-height: 44px; }
  input, select, textarea, .input, .hb-input, .chat-input { font-size: 16px !important; }
  .community-side { order: initial !important; }
  .community-main { order: -1; }
  .hub-tabs { position: sticky; top: 63px; z-index: 20; display: flex; width: 100%; flex-wrap: nowrap; overflow-x: auto; box-sizing: border-box; border-radius: 15px; background: rgba(244,242,253,.97); scrollbar-width: none; scroll-snap-type: x proximity; scroll-padding-inline: 8px; overscroll-behavior-inline: contain; box-shadow: inset -20px 0 18px -22px rgba(33,28,54,.75); }
  .hub-tabs::-webkit-scrollbar { display: none; }.hub-tab { flex: 0 0 auto; min-height: 44px; }
  .hub-tab { scroll-snap-align: center; }
  .community-starters button { min-height: 44px; }
  .community-layout { grid-template-columns: minmax(0,1fr); gap: 16px; }
  .room-controls { bottom: calc(82px + env(safe-area-inset-bottom)); }
  .community-post-actions button, .grp-report { min-width: 44px; min-height: 44px; }
  .path-grid { gap: 8px; }
  .path-card { min-height: 78px; padding: 12px 38px 12px 13px; }
  .path-card-title { font-size: .9rem; }.path-card-sub { font-size: .74rem; }
  .wizard-nav { position: sticky; bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 15; padding: 10px; border: 1px solid var(--border); border-radius: 16px; background: rgba(255,255,255,.96); box-shadow: var(--shadow); backdrop-filter: blur(12px); }
}

@media (max-width: 400px) {
  .quick-actions { grid-template-columns: 1fr 1fr; }
  .quick-actions button { display: flex; flex-wrap: wrap; align-content: center; }
  .quick-actions button > span { flex: 0 0 34px; }.quick-actions button strong { flex: 1; }.quick-actions button small { display: none; }
  .today-card-head h1 { font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .quick-actions button { transition: none; }
}
