:root {
  --ink: #261f2b;
  --muted: #675f6b;
  --paper: #f7f4f8;
  --paper-warm: #fcfafc;
  --panel: #ffffff;
  --line: #ded8e1;
  --line-strong: #94859f;
  --primary: #705d99;
  --primary-strong: #594575;
  --primary-deep: #352a44;
  --primary-deepest: #261d31;
  --primary-soft: #eee9f4;
  --primary-soft-strong: #ddd3e7;
  --primary-wash: #f7f4f8;
  --teal: #14756d;
  --teal-strong: #0f5f58;
  --teal-soft: #d8ebe6;
  --moss: #667d45;
  --moss-soft: #e3ead7;
  --coral: #c75f4a;
  --coral-soft: #f5ddd6;
  --gold: #d8a53a;
  --gold-soft: #f3e8bd;
  --violet: #4e659b;
  --violet-soft: #e1e7f2;
  --sky: #3d7f9c;
  --sky-soft: #dbeaf0;
  --danger: #9f3526;
  --success: #2f7a45;
  --shadow: 0 18px 48px rgba(38, 31, 43, 0.12);
  --shadow-soft: 0 10px 28px rgba(38, 31, 43, 0.08);
  --radius: 8px;
  --page-pad: clamp(20px, 5vw, 72px);
  --section-pad: clamp(34px, 5vw, 72px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
  background: var(--paper);
}

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(53, 42, 68, 0.035) 1px, transparent 1px) 0 0 / 44px 44px,
    linear-gradient(180deg, #faf8f4 0%, var(--paper) 36%, #f2edf5 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

button,
input,
select,
textarea {
  font: inherit;
}

p,
li {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  color: var(--ink);
  overflow-wrap: break-word;
}

h1 {
  margin: 0;
  font-size: clamp(2.6rem, 7vw, 6.7rem);
  line-height: 0.93;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.65rem, 3vw, 3rem);
  line-height: 1.02;
  letter-spacing: 0;
}

h3 {
  margin: 14px 0 8px;
  font-size: 1.15rem;
  line-height: 1.25;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px var(--page-pad);
  background: rgba(251, 250, 244, 0.9);
  border-bottom: 1px solid rgba(22, 33, 31, 0.08);
  backdrop-filter: blur(18px);
}

.brand,
.site-nav {
  display: flex;
  align-items: center;
}

.brand {
  gap: 12px;
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: 0 8px 18px rgba(63, 43, 84, 0.24);
}

.site-nav {
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.site-nav a,
.link-button {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(22, 33, 31, 0.09);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a:hover,
.link-button:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.messages {
  padding: 16px var(--page-pad) 0;
}

.message {
  max-width: 1120px;
  margin: 0 auto 10px;
  padding: 12px 14px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 5px solid var(--sky);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.message.error {
  border-left-color: var(--danger);
  background: #fff3f0;
}

.message.success {
  border-left-color: var(--success);
  background: #eff9f0;
}

.message.warning {
  border-left-color: var(--gold);
  background: #fff9df;
}

.eyebrow,
.chip {
  margin: 0 0 12px;
  color: var(--primary-strong);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.chip,
.status-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(112, 93, 153, 0.2);
  border-radius: var(--radius);
  background: var(--primary-soft);
}

.status-chip {
  margin: 0;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: none;
}

.chip.coral,
.status-chip.coral {
  background: var(--coral-soft);
  border-color: rgba(199, 95, 74, 0.22);
  color: #8c382b;
}

.chip.gold,
.status-chip.gold {
  background: var(--gold-soft);
  border-color: rgba(216, 165, 58, 0.26);
  color: #755514;
}

.chip.violet,
.status-chip.violet {
  background: var(--violet-soft);
  border-color: rgba(78, 101, 155, 0.24);
  color: #354d80;
}

.chip.teal,
.status-chip.teal,
.chip.success,
.status-chip.success {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-color: rgba(20, 117, 109, 0.24);
}

.muted,
.feature-card p,
.dashboard-card p,
.row-card p {
  color: var(--muted);
  line-height: 1.55;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 17px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-soft);
}

.button.primary {
  color: white;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.button.primary:hover {
  background: var(--primary-deep);
  border-color: var(--primary-deep);
}

.button.danger {
  color: #842d22;
  background: #fff4f1;
  border-color: #c96252;
}

.button.danger:hover {
  color: #fff;
  background: #983729;
  border-color: #983729;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.74);
}

.button.soft {
  color: var(--primary-strong);
  border-color: var(--primary-soft-strong);
  background: var(--primary-soft);
}

.button.full {
  width: 100%;
}

.hero {
  position: relative;
  min-height: calc(100vh - 72px);
  padding: clamp(36px, 6vw, 80px) var(--page-pad);
  overflow: hidden;
}

.landing-hero {
  display: grid;
  align-items: end;
  min-height: calc(100vh - 72px);
  color: white;
  isolation: isolate;
}

.landing-hero .hero-image {
  position: absolute;
  inset: 0;
  z-index: -2;
  border-radius: 0;
  box-shadow: none;
}

.landing-hero .hero-image::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(12, 20, 19, 0.78) 0%, rgba(12, 20, 19, 0.48) 48%, rgba(12, 20, 19, 0.12) 100%),
    linear-gradient(0deg, rgba(12, 20, 19, 0.54), transparent 44%);
}

.landing-hero .hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-copy {
  max-width: 780px;
  padding-bottom: clamp(26px, 5vw, 70px);
}

.landing-hero h1,
.landing-hero .eyebrow,
.landing-hero .hero-text {
  color: white;
}

.hero-text {
  max-width: 660px;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.35rem);
  line-height: 1.55;
}

.hero-ribbon {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  width: min(100%, 900px);
  margin-top: 34px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
}

.hero-ribbon span {
  display: grid;
  gap: 4px;
  min-height: 74px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.hero-ribbon strong {
  font-size: 0.95rem;
}

.hero-ribbon small {
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.35;
}

.dashboard-hero {
  position: relative;
  padding: var(--section-pad) var(--page-pad);
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(112, 93, 153, 0.11) 0 1px, transparent 1px) 0 0 / 36px 36px,
    linear-gradient(135deg, #eee9f4 0%, #faf7ed 52%, #e3f1ed 100%);
  border-bottom: 1px solid rgba(22, 33, 31, 0.08);
}

.dashboard-hero.compact {
  padding-block: clamp(28px, 4vw, 54px);
}

.dashboard-hero h1 {
  max-width: 980px;
  font-size: clamp(2.25rem, 6vw, 5.2rem);
}

.dashboard-hero > p:last-of-type {
  max-width: 760px;
  color: #43524f;
  font-size: 1.16rem;
  line-height: 1.55;
}

.hero-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(240px, 0.42fr);
  gap: clamp(18px, 4vw, 48px);
  align-items: end;
}

.hero-aside {
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(22, 33, 31, 0.09);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hero-aside p {
  margin: 0;
}

.hero-aside strong {
  display: block;
  margin-top: 8px;
  font-size: 1.35rem;
}

.section,
.feature-grid,
.dashboard-grid,
.action-panel,
.workspace-grid {
  padding: var(--section-pad) var(--page-pad);
}

.section.alt {
  background: rgba(255, 255, 255, 0.42);
  border-block: 1px solid rgba(22, 33, 31, 0.06);
}

.intro,
.split {
  display: grid;
  grid-template-columns: minmax(240px, 0.82fr) minmax(280px, 1.18fr);
  gap: clamp(22px, 4vw, 46px);
  align-items: start;
}

.intro p,
.split p {
  margin: 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.section-head p {
  margin: 0;
}

.feature-grid,
.dashboard-grid,
.workspace-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.workspace-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.feature-card,
.feature-grid article,
.dashboard-card,
.auth-panel,
.action-panel,
.panel-form,
.row-card,
.empty-state,
.mini-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.feature-card,
.feature-grid article,
.dashboard-card,
.mini-card {
  position: relative;
  min-height: 210px;
  padding: 22px;
  overflow: hidden;
}

.feature-card::before,
.feature-grid article::before,
.dashboard-card::before,
.mini-card::before {
  display: block;
  width: 42px;
  height: 5px;
  margin-bottom: 18px;
  background: var(--primary);
  border-radius: 999px;
  content: "";
}

.feature-grid article:nth-child(2n)::before,
.dashboard-card:nth-child(2n)::before,
.mini-card:nth-child(2n)::before {
  background: var(--coral);
}

.feature-grid article:nth-child(3n)::before,
.dashboard-card:nth-child(3n)::before,
.mini-card:nth-child(3n)::before {
  background: var(--gold);
}

.feature-grid article:nth-child(4n)::before,
.dashboard-card:nth-child(4n)::before,
.mini-card:nth-child(4n)::before {
  background: var(--violet);
}

.dashboard-card {
  min-height: 230px;
}

.dashboard-card h2,
.feature-grid h3,
.mini-card h3 {
  margin-top: 0;
}

.card-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-bottom: 18px;
  color: var(--ink);
  background: var(--gold-soft);
  border-radius: var(--radius);
  font-weight: 950;
}

.dashboard-card a,
.clean-list a {
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
}

.clean-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  padding: 13px 14px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.action-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.75fr) minmax(260px, 1.25fr);
  gap: 24px;
  margin: 0 var(--page-pad) var(--section-pad);
  padding: 24px;
}

.action-panel ul,
.step-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.action-panel li,
.step-list li {
  position: relative;
  min-height: 46px;
  padding: 11px 14px 11px 44px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  line-height: 1.45;
}

.action-panel li::before,
.step-list li::before {
  position: absolute;
  top: 12px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  content: "";
}

.table-list {
  display: grid;
  gap: 14px;
}

.row-card {
  display: grid;
  min-width: 0;
  max-width: 100%;
  grid-template-columns: minmax(250px, 0.95fr) minmax(280px, 1.05fr);
  gap: 18px;
  align-items: start;
  padding: 18px;
}

.row-card h2 {
  margin: 0;
  font-size: 1.24rem;
  line-height: 1.2;
}

.row-card p:first-child {
  margin-top: 0;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.empty-state {
  display: grid;
  gap: 10px;
  justify-items: start;
  padding: 22px;
}

.empty-state h2,
.empty-state p {
  margin: 0;
}

.empty-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--ink);
  background: var(--gold-soft);
  border-radius: var(--radius);
  font-weight: 950;
}

.auth-shell {
  display: grid;
  place-items: center;
  min-height: calc(100vh - 72px);
  padding: 34px 20px;
}

.auth-shell.story {
  grid-template-columns: minmax(280px, 0.95fr) minmax(320px, 1.05fr);
  gap: clamp(22px, 5vw, 60px);
  align-items: stretch;
  padding: var(--section-pad) var(--page-pad);
}

.auth-story {
  display: grid;
  align-content: end;
  min-height: 520px;
  padding: 28px;
  color: white;
  background:
    linear-gradient(0deg, rgba(18, 29, 27, 0.74), rgba(18, 29, 27, 0.24)),
    url("/static/img/autisync-hero.f3af1436440f.png") center / cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.auth-story h1,
.auth-story h2,
.auth-story .eyebrow,
.auth-story p {
  color: white;
}

.auth-story h2 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1;
}

.auth-story p {
  max-width: 520px;
  font-size: 1.08rem;
  line-height: 1.55;
}

.auth-panel {
  width: min(100%, 460px);
  padding: 30px;
}

.auth-panel.wide {
  width: min(100%, 680px);
}

.auth-panel h1 {
  font-size: clamp(2rem, 7vw, 3.35rem);
}

.auth-form {
  display: grid;
  gap: 15px;
  margin-top: 24px;
}

.auth-form label {
  display: grid;
  gap: 8px;
  font-weight: 850;
}

.auth-form input,
.auth-form select,
.auth-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fcfdf9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.auth-form textarea {
  min-height: 110px;
  resize: vertical;
}

.auth-form input:focus,
.auth-form select:focus,
.auth-form textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(112, 93, 153, 0.16);
  outline: 0;
}

.panel-form {
  padding: 22px;
}

.permission-list {
  display: grid;
  gap: 10px;
}

.permission-list label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--muted);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 850;
}

.permission-list input {
  width: 18px;
  min-height: 18px;
}

.compact-list ul {
  display: grid;
  gap: 8px;
  max-height: 320px;
  margin: 0;
  padding: 0;
  overflow: auto;
  list-style: none;
}

.compact-list li label {
  align-items: flex-start;
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.auth-switch a {
  color: var(--primary-strong);
  font-weight: 900;
}

.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.errorlist {
  margin: 0;
  padding-left: 20px;
  color: var(--danger);
  line-height: 1.5;
}

.profile-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: var(--section-pad) var(--page-pad);
  background: #edf3ec;
}

.profile-summary article {
  min-height: 190px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.timeline-list {
  position: relative;
  display: grid;
  gap: 14px;
}

.timeline-list::before {
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 17px;
  width: 2px;
  background: var(--line);
  content: "";
}

.timeline-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  padding-left: 54px;
}

.timeline-card::before {
  position: absolute;
  top: 18px;
  left: 8px;
  width: 20px;
  height: 20px;
  background: var(--coral);
  border: 4px solid var(--paper);
  border-radius: 999px;
  content: "";
}

.review-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(180px, 1.2fr) auto auto;
  gap: 10px;
}

.review-form input,
.review-form select {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

@media (max-width: 1080px) {
  .feature-grid,
  .dashboard-grid,
  .workspace-grid,
  .workspace-grid.three,
  .profile-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .intro,
  .split,
  .action-panel,
  .hero-panel,
  .auth-shell.story {
    grid-template-columns: 1fr;
  }

  .auth-story {
    min-height: 360px;
  }

  .row-card,
  .review-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* --------------------------------------------------------------------------
   Authenticated workspace shell
   -------------------------------------------------------------------------- */

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  top: 10px;
  left: 12px;
  z-index: 1000;
  padding: 11px 15px;
  color: #fff;
  background: var(--primary-deep);
  border: 2px solid #fff;
  border-radius: 10px;
  box-shadow: 0 0 0 3px var(--primary-deep);
  font-weight: 850;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

html:not(.js) [data-command-open],
html:not(.js) [data-calm-toggle] {
  display: none;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 5px #fff;
}

.app-body {
  --page-pad: clamp(18px, 3vw, 46px);
  --section-pad: clamp(28px, 4vw, 52px);
  background: var(--primary-wash);
}

.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: 100vh;
  min-height: 100dvh;
}

.app-sidebar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  flex-direction: column;
  width: 252px;
  height: 100vh;
  height: 100dvh;
  padding: 18px 14px 14px;
  overflow: auto;
  color: #f9f6fb;
  background:
    radial-gradient(circle at 12% 10%, rgba(112, 93, 153, 0.24), transparent 27%),
    radial-gradient(circle at 88% 88%, rgba(20, 117, 109, 0.16), transparent 32%),
    linear-gradient(180deg, var(--primary-deep) 0%, var(--primary-deepest) 100%);
  border-right: 1px solid rgba(38, 29, 49, 0.32);
}

.sidebar-brand-row,
.app-brand,
.workspace-identity,
.workspace-nav a,
.sidebar-tool,
.topbar-start,
.topbar-actions,
.command-button,
.privacy-indicator,
.quick-search,
.quick-results a,
.quick-dialog-foot {
  display: flex;
  align-items: center;
}

.sidebar-brand-row {
  justify-content: space-between;
  gap: 10px;
  padding: 0 5px 16px;
}

.app-brand {
  min-width: 0;
  color: #fff;
}

.app-brand > span:last-child {
  display: grid;
  min-width: 0;
}

.app-brand strong {
  color: #fff;
  font-size: 1.02rem;
}

.app-brand small {
  color: rgba(249, 246, 251, 0.72);
  font-size: 0.73rem;
  font-weight: 700;
}

.app-sidebar .brand-mark {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  color: var(--primary-deep);
  background: linear-gradient(145deg, #f5f0f8, var(--primary-soft-strong));
  box-shadow: none;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.icon-button svg,
.workspace-nav svg,
.sidebar-tool svg,
.command-button svg,
.privacy-indicator svg,
.quick-search svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.sidebar-close {
  display: none;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.workspace-identity {
  gap: 10px;
  min-height: 66px;
  margin: 2px 4px 20px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
}

.workspace-identity > span:nth-child(2) {
  display: grid;
  flex: 1 1 auto;
  min-width: 0;
  gap: 2px;
}

.workspace-identity strong,
.workspace-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.workspace-identity strong {
  color: #fff;
  font-size: 0.84rem;
}

.workspace-identity small {
  color: rgba(249, 246, 251, 0.72);
  font-size: 0.72rem;
}

.identity-avatar {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--primary-deepest);
  background: #f0d594;
  border-radius: 12px;
  font-weight: 950;
}

.workspace-nav {
  display: grid;
  gap: 4px;
}

.nav-label {
  margin: 14px 12px 5px;
  color: rgba(249, 246, 251, 0.68);
  font-size: 0.68rem;
  font-weight: 850;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.workspace-nav a,
.sidebar-tool {
  gap: 11px;
  width: 100%;
  min-height: 46px;
  padding: 9px 11px;
  color: rgba(249, 246, 251, 0.82);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 760;
  text-align: left;
  text-decoration: none;
}

.workspace-nav a:hover,
.sidebar-tool:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.075);
}

.workspace-nav a[aria-current="page"] {
  color: var(--primary-deepest);
  background: var(--primary-soft);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 8px 22px rgba(24, 15, 31, 0.28);
}

.workspace-nav a > span:not(.nav-count),
.sidebar-tool span {
  min-width: 0;
  flex: 1;
}

.nav-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  color: var(--primary-deepest);
  background: #f0d594;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 950;
}

.sidebar-footer {
  display: grid;
  gap: 3px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer form {
  margin: 0;
}

.app-frame {
  min-width: 0;
  background: var(--primary-wash);
}

.app-topbar {
  position: sticky;
  top: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 10px var(--page-pad);
  background: rgba(247, 244, 248, 0.92);
  border-bottom: 1px solid rgba(53, 42, 68, 0.1);
  backdrop-filter: blur(16px);
}

.topbar-start,
.topbar-actions {
  gap: 12px;
  min-width: 0;
}

.topbar-context {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.topbar-context span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.topbar-context strong {
  overflow: hidden;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-toggle {
  display: none;
}

.command-button {
  gap: 9px;
  min-height: 44px;
  padding: 0 10px 0 13px;
  color: #42504d;
  background: #fff;
  border: 1px solid #d5ddd8;
  border-radius: 12px;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 750;
}

.command-button kbd,
.quick-dialog-foot kbd {
  min-width: 24px;
  padding: 3px 6px;
  color: #5b6764;
  background: #f1f3ef;
  border: 1px solid #d6ddd8;
  border-bottom-width: 2px;
  border-radius: 6px;
  font: 700 0.68rem/1.2 ui-monospace, SFMono-Regular, Menlo, monospace;
  text-align: center;
}

.privacy-indicator {
  gap: 6px;
  min-height: 40px;
  padding: 0 10px;
  color: #286659;
  background: #e5f2eb;
  border: 1px solid #c8e3d6;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 850;
}

.privacy-indicator svg {
  width: 16px;
  height: 16px;
}

.app-main {
  min-width: 0;
  min-height: calc(100vh - 68px);
  background:
    radial-gradient(circle at 85% 0%, rgba(112, 93, 153, 0.1), transparent 25rem),
    radial-gradient(circle at 8% 38%, rgba(20, 117, 109, 0.055), transparent 22rem),
    var(--primary-wash);
}

.app-main:focus {
  outline: none;
}

.app-body .messages {
  padding-inline: var(--page-pad);
}

.app-body .message {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: none;
  border-radius: 13px;
}

.message [data-dismiss-message] {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1.4rem;
}

.app-body .dashboard-hero {
  margin: 24px var(--page-pad) 0;
  padding: clamp(25px, 4vw, 44px);
  background:
    radial-gradient(circle at 90% 5%, rgba(20, 117, 109, 0.13), transparent 19rem),
    linear-gradient(135deg, #ece6f2 0%, #faf7ed 58%, #e3f1ed 100%);
  border: 1px solid rgba(112, 93, 153, 0.17);
  border-radius: 24px;
  box-shadow: 0 12px 38px rgba(63, 43, 84, 0.08);
}

.app-body .dashboard-hero h1 {
  max-width: 780px;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  line-height: 0.98;
  letter-spacing: -0.035em;
}

.app-body .hero-aside,
.app-body .feature-card,
.app-body .feature-grid article,
.app-body .dashboard-card,
.app-body .auth-panel,
.app-body .action-panel,
.app-body .panel-form,
.app-body .row-card,
.app-body .empty-state,
.app-body .mini-card,
.app-body .visual-panel,
.app-body .metric-tile,
.app-body .client-signal-card,
.app-body .plan-panel,
.app-body .document-card {
  border-radius: 17px;
}

.app-body .button,
.app-body input,
.app-body select,
.app-body textarea {
  border-radius: 11px;
}

.app-body .button {
  min-height: 44px;
}

.app-body .site-nav a,
.app-body .link-button {
  min-height: 44px;
}

.nav-scrim {
  display: none;
}

.quick-navigator {
  width: min(660px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 36px));
  padding: 0;
  color: var(--ink);
  background: #fbfcf9;
  border: 1px solid #d7dfda;
  border-radius: 20px;
  box-shadow: 0 30px 90px rgba(46, 31, 59, 0.3);
}

.quick-navigator::backdrop {
  background: rgba(38, 29, 49, 0.5);
  backdrop-filter: blur(4px);
}

.quick-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 22px 12px;
}

.quick-dialog-head h2 {
  font-size: clamp(1.45rem, 4vw, 2rem);
}

.quick-dialog-head .eyebrow {
  margin-bottom: 6px;
}

.quick-dialog-head form {
  margin: 0;
}

.quick-search {
  gap: 10px;
  margin: 8px 22px 14px;
  padding: 0 13px;
  color: var(--muted);
  background: #fff;
  border: 1px solid #c9d4ce;
  border-radius: 13px;
}

.quick-search:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(112, 93, 153, 0.16);
}

.quick-search input {
  width: 100%;
  min-height: 48px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
}

.quick-results {
  display: grid;
  max-height: 430px;
  padding: 0 14px 12px;
  overflow: auto;
}

.quick-group-label {
  margin: 12px 9px 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.quick-results a {
  justify-content: space-between;
  gap: 16px;
  min-height: 52px;
  padding: 9px 11px;
  color: var(--ink);
  border-radius: 11px;
  text-decoration: none;
}

.quick-results a:hover,
.quick-results a:focus-visible {
  background: var(--primary-soft);
}

.quick-results a span {
  font-weight: 850;
}

.quick-results a small {
  color: var(--muted);
  text-align: right;
}

.quick-empty {
  margin: 12px 22px 22px;
  padding: 17px;
  color: var(--muted);
  background: #f3f3ee;
  border-radius: 12px;
}

.quick-dialog-foot {
  justify-content: flex-end;
  gap: 16px;
  padding: 11px 22px;
  color: var(--muted);
  background: var(--primary-wash);
  border-top: 1px solid var(--line);
  font-size: 0.7rem;
}

.quick-dialog-foot span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.collection-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin: 0 var(--page-pad) 16px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.collection-search {
  position: relative;
  display: flex;
  align-items: center;
  min-width: min(100%, 300px);
  flex: 1;
}

.collection-search svg {
  position: absolute;
  left: 12px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.collection-search input {
  width: 100%;
  min-height: 46px;
  padding: 9px 12px 9px 41px;
  color: var(--ink);
  background: #fafbf8;
  border: 1px solid var(--line-strong);
}

.filter-pills,
.view-switcher {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pills button,
.view-switcher button {
  min-height: 40px;
  padding: 7px 12px;
  color: var(--muted);
  background: #faf8fb;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  font-weight: 800;
}

.filter-pills button[aria-pressed="true"],
.view-switcher button[aria-pressed="true"] {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.filter-empty {
  margin: 0 var(--page-pad) var(--section-pad);
}

.profile-section-nav {
  position: sticky;
  top: 68px;
  z-index: 30;
  display: flex;
  gap: 6px;
  margin: 18px var(--page-pad) 0;
  padding: 7px;
  overflow-x: auto;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(24, 52, 47, 0.08);
  backdrop-filter: blur(14px);
  scrollbar-width: thin;
}

.profile-section-nav a {
  min-height: 40px;
  padding: 9px 12px;
  color: var(--muted);
  border-radius: 9px;
  font-size: 0.82rem;
  font-weight: 820;
  text-decoration: none;
  white-space: nowrap;
}

.profile-section-nav a:hover,
.profile-section-nav a[aria-current="location"] {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.app-body section[id] {
  scroll-margin-top: 132px;
}

.quiet-mode .app-main,
.quiet-mode .app-frame,
.quiet-mode .app-body,
.quiet-mode .dashboard-hero,
.quiet-mode .story-band,
.quiet-mode .dashboard-hero {
  background-image: none !important;
}

.quiet-mode .app-body :where(.dashboard-hero, .metric-tile, .visual-panel, .client-signal-card, .hero-aside, .row-card, .panel-form, .dashboard-card, .document-card, .plan-panel, .collection-toolbar) {
  box-shadow: none !important;
}

.quiet-mode .app-body :where(*, *::before, *::after) {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Practitioner record editing and structured patient intake */
.record-editor-shell {
  display: grid;
  gap: 22px;
  max-width: 1120px;
  margin: 0 auto;
}

.record-editor-intro,
.record-editor-section,
.record-editor-actions {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.record-editor-intro {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
}

.record-editor-intro h1 {
  margin: 4px 0 8px;
  color: var(--ink);
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.record-editor-intro p:last-child {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
}

.record-editor-form {
  display: grid;
  gap: 18px;
}

.record-editor-section {
  min-width: 0;
  margin: 0;
  padding: 24px;
}

.record-editor-section legend {
  padding: 0 8px;
  color: var(--ink);
  font-size: 1.15rem;
  font-weight: 900;
}

.record-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.record-editor-grid > label {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
  color: var(--ink);
  font-size: 0.86rem;
  font-weight: 850;
}

.record-editor-grid input:not([type="checkbox"]),
.record-editor-grid textarea,
.record-editor-grid select {
  width: 100%;
}

.record-editor-grid .span-two {
  grid-column: 1 / -1;
}

.record-status-toggle .check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 46px;
  padding: 11px 13px;
  background: var(--primary-soft);
  border: 1px solid rgba(20, 117, 109, 0.22);
  border-radius: 12px;
}

.record-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 18px 22px;
}

@media (max-width: 760px) {
  .record-editor-intro {
    display: grid;
  }

  .record-editor-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .record-editor-grid .span-two {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .record-editor-intro,
  .record-editor-section {
    padding: 18px;
  }

  .record-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .record-editor-actions .button {
    width: 100%;
  }
}

.patient-import-workspace {
  display: grid;
  gap: 22px;
  max-width: 1240px;
  margin: 0 auto;
}

.patient-import-workspace svg,
.clinical-record-workspace svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.import-hero,
.import-review-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 30px;
  color: #fff;
  background:
    radial-gradient(circle at 84% 10%, rgba(255, 255, 255, 0.17), transparent 24%),
    linear-gradient(135deg, #123f4d, #176b69 58%, #3c777f);
  border-radius: 25px;
  box-shadow: 0 22px 46px rgba(20, 63, 71, 0.22);
}

.import-hero .eyebrow,
.import-review-hero .eyebrow {
  color: #b8f2e8;
}

.import-hero h1,
.import-review-hero h1 {
  max-width: 760px;
  margin: 5px 0 8px;
  color: #fff;
  font-size: clamp(1.9rem, 3.4vw, 3.1rem);
  line-height: 1.08;
}

.import-hero p:last-child,
.import-review-hero p:last-child {
  max-width: 740px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.import-hero .button,
.import-review-hero .button {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
}

.import-stepper {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
  list-style: none;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.import-stepper li {
  position: relative;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 10px;
  align-items: center;
  min-height: 78px;
  padding: 14px 18px;
}

.import-stepper li:not(:last-child)::after {
  position: absolute;
  top: 20%;
  right: 0;
  width: 1px;
  height: 60%;
  background: var(--line);
  content: "";
}

.import-stepper li > span {
  display: grid;
  grid-row: 1 / 3;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--muted);
  background: #edf2f2;
  border-radius: 50%;
  font-weight: 900;
}

.import-stepper strong {
  color: var(--ink);
  font-size: 0.9rem;
}

.import-stepper small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.import-stepper .is-current {
  background: linear-gradient(135deg, var(--primary-soft), rgba(224, 243, 240, 0.32));
}

.import-stepper .is-current > span,
.import-stepper .is-complete > span {
  color: #fff;
  background: var(--primary);
}

.import-stepper .is-complete > span::after {
  content: "✓";
}

.import-stepper .is-complete > span {
  color: transparent;
  font-size: 0;
}

.import-stepper .is-complete > span::after {
  color: #fff;
  font-size: 0.9rem;
}

.import-start-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(290px, 0.75fr);
  gap: 20px;
  align-items: start;
}

.import-upload-card,
.import-format-card,
.import-history,
.import-row-section,
.import-complete-banner,
.clinical-record-workspace {
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow-soft);
}

.import-upload-card,
.import-format-card,
.import-history,
.import-row-section {
  padding: 24px;
}

.import-upload-card > header,
.import-format-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.import-upload-card h2,
.import-format-card h2,
.import-history h2,
.import-row-section h2,
.clinical-record-heading h2 {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 1.45rem;
}

.import-lock-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.import-upload-form {
  display: grid;
  gap: 18px;
}

.import-file-drop {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 18px;
  color: var(--ink);
  background: linear-gradient(135deg, #f7fbfa, #f2f7f8);
  border: 1.5px dashed #92bbb7;
  border-radius: 16px;
  cursor: pointer;
}

.import-file-drop > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.import-file-drop small,
.import-form-grid small,
.import-submit-row small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 700;
}

.import-file-drop input[type="file"] {
  grid-column: 1 / -1;
  width: 100%;
  padding: 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 11px;
}

.import-file-drop input[type="file"]::file-selector-button {
  min-height: 34px;
  margin-right: 12px;
  padding: 7px 12px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border: 0;
  border-radius: 8px;
  font-weight: 850;
  cursor: pointer;
}

.import-file-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 14px;
}

.import-file-icon svg {
  width: 25px;
}

.import-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
}

.import-form-grid label {
  display: grid;
  gap: 6px;
  color: var(--ink);
  font-size: 0.82rem;
  font-weight: 850;
}

.import-form-grid input,
.import-form-grid select,
.import-decision select {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
}

.import-form-grid input:focus,
.import-form-grid select:focus,
.import-decision select:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(112, 93, 153, 0.16);
  outline-offset: 1px;
}

.import-submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
}

.import-submit-row > span {
  display: grid;
  gap: 2px;
}

.import-format-list {
  display: grid;
  gap: 11px;
  margin-top: 18px;
}

.import-format-list article {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  padding: 13px;
  background: #f7faf9;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.import-format-list article > span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 11px;
  font-size: 0.76rem;
  font-weight: 950;
}

.import-format-list article > div {
  display: grid;
  gap: 3px;
}

.import-format-list small,
.import-safety-note p {
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.45;
}

.import-safety-note {
  margin-top: 15px;
  padding: 14px;
  color: #574513;
  background: #fff8df;
  border: 1px solid #eadba8;
  border-radius: 13px;
}

.import-safety-note p {
  margin: 5px 0 0;
  color: #756329;
}

.import-template-link {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  margin-top: 15px;
  color: var(--primary-strong);
  font-size: 0.8rem;
  font-weight: 900;
}

.import-history-list,
.import-row-list {
  display: grid;
  gap: 10px;
  margin-top: 17px;
}

.import-history-list > a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto 56px 20px;
  gap: 12px;
  align-items: center;
  min-height: 66px;
  padding: 10px 12px;
  color: inherit;
  background: #fbfcfc;
  border: 1px solid var(--line);
  border-radius: 13px;
  text-decoration: none;
}

.import-history-list > a > span:nth-child(2),
.import-history-count {
  display: grid;
  gap: 2px;
}

.import-history-list small,
.import-history-count small {
  color: var(--muted);
  font-size: 0.72rem;
}

.import-history-list svg {
  width: 18px;
  color: var(--muted);
}

.import-history-format {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 11px;
  font-size: 0.72rem;
  font-weight: 950;
}

.import-history-count {
  text-align: center;
}

.import-status,
.import-action,
.verification-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.import-status.status-staged,
.import-action.action-conflict,
.verification-pill.status-imported_unverified {
  color: #745615;
  background: #fff2c8;
}

.import-status.status-committed,
.import-action.action-link,
.verification-pill.status-confirmed {
  color: #17635c;
  background: #dff3ef;
}

.import-action.action-create {
  color: #315b86;
  background: #e3effa;
}

.import-status.status-failed,
.import-status.status-canceled,
.import-status.status-expired,
.import-action.action-error,
.verification-pill.status-entered_in_error {
  color: #873f38;
  background: #f9e4e1;
}

.import-action.action-skip {
  color: #5e6872;
  background: #edf0f2;
}

.import-empty-history {
  display: grid;
  gap: 3px;
  padding: 22px;
  color: var(--ink);
  background: #fafcfc;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  text-align: center;
}

.import-empty-history small {
  color: var(--muted);
}

.import-review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
  justify-content: flex-end;
}

.import-review-hero .import-status {
  color: #fff;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.27);
}

.import-review-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-soft);
}

.import-review-summary > div {
  display: grid;
  gap: 2px;
  padding: 17px 16px;
  text-align: center;
}

.import-review-summary > div:not(:last-child) {
  border-right: 1px solid var(--line);
}

.import-review-summary strong {
  color: var(--ink);
  font-size: 1.45rem;
}

.import-review-summary span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
}

.import-state-message {
  padding: 13px 15px;
  color: #6e423b;
  background: #fff0ed;
  border: 1px solid #ecc9c3;
  border-radius: 12px;
  font-weight: 750;
}

.import-complete-banner {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 17px;
  align-items: center;
  padding: 22px 24px;
  background: linear-gradient(135deg, #effaf7, #f8fcfb);
  border-color: #badfd7;
}

.import-complete-banner > span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
}

.import-complete-banner svg {
  width: 28px;
}

.import-complete-banner h2 {
  margin: 3px 0 4px;
  color: var(--ink);
  font-size: 1.25rem;
}

.import-complete-banner p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.import-commit-form {
  display: grid;
  gap: 17px;
}

.import-row-card {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid #82a6aa;
  border-radius: 15px;
}

.import-row-card.action-create {
  border-left-color: #5c8eb9;
}

.import-row-card.action-link {
  border-left-color: var(--primary);
}

.import-row-card.action-conflict {
  border-left-color: #d3a536;
}

.import-row-card.action-error {
  border-left-color: #c86558;
}

.import-row-card > header {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: #fafcfc;
  border-bottom: 1px solid var(--line);
}

.import-row-number {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--muted);
  background: #edf2f2;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 900;
}

.import-row-card h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.import-row-card header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.76rem;
}

.import-row-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.32fr);
  gap: 14px 22px;
  padding: 16px;
}

.import-row-body dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-column: 1 / -1;
  gap: 10px;
  margin: 0;
}

.import-row-body dl > div {
  min-width: 0;
  padding: 10px;
  background: #f7f9f9;
  border-radius: 10px;
}

.import-row-body dt {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.import-row-body dd {
  overflow-wrap: anywhere;
  margin: 0;
  color: var(--ink);
  font-size: 0.78rem;
  font-weight: 750;
}

.import-issues {
  display: grid;
  gap: 4px;
  grid-column: 1;
  margin: 0;
  padding: 11px 12px 11px 30px;
  border-radius: 10px;
  font-size: 0.76rem;
}

.import-issues.errors {
  color: #7d3c35;
  background: #fff0ed;
}

.import-issues.warnings {
  color: #705518;
  background: #fff8df;
}

.import-decision {
  display: grid;
  grid-column: 2;
  grid-row: 2 / span 2;
  gap: 6px;
  align-content: start;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 900;
}

.import-decision select {
  width: 100%;
}

.import-row-body > .button.compact {
  grid-column: 2;
  align-self: end;
}

.import-commit-bar {
  position: sticky;
  z-index: 8;
  bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 15px 17px;
  background: rgba(242, 250, 248, 0.97);
  border: 1px solid #b8dcd5;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(30, 79, 74, 0.18);
  backdrop-filter: blur(12px);
}

.import-commit-bar > span {
  display: grid;
  gap: 2px;
}

.import-commit-bar small {
  color: var(--muted);
  font-size: 0.73rem;
}

.import-cancel-form {
  display: flex;
  justify-content: flex-end;
}

.clinical-record-workspace {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.clinical-record-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.clinical-record-heading p:last-child {
  max-width: 720px;
  margin: 7px 0 0;
  color: var(--muted);
}

.clinical-review-count {
  display: grid;
  min-width: 92px;
  padding: 10px 13px;
  color: #6e5314;
  background: #fff4d2;
  border-radius: 13px;
  text-align: center;
}

.clinical-review-count strong {
  font-size: 1.35rem;
}

.clinical-review-count small {
  font-size: 0.68rem;
  font-weight: 850;
}

.clinical-record-group {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.clinical-record-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 15px;
  background: #f5f8f8;
  border-bottom: 1px solid var(--line);
}

.clinical-record-group h3 {
  margin: 0;
  color: var(--ink);
  font-size: 1rem;
}

.clinical-record-group > header span {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 26px;
  padding: 0 8px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
}

.clinical-record-list {
  display: grid;
}

.clinical-record-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 15px;
}

.clinical-record-card + .clinical-record-card {
  border-top: 1px solid var(--line);
}

.clinical-record-card.verification-entered_in_error {
  opacity: 0.7;
  background: #fafafa;
}

.clinical-record-main {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
}

.clinical-kind-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 11px;
  font-size: 0.8rem;
  font-weight: 950;
}

.clinical-kind-icon.kind-allergy {
  color: #9a4c41;
  background: #fae9e6;
}

.clinical-kind-icon.kind-medication {
  color: #345f8b;
  background: #e8f1fa;
}

.clinical-record-main h4 {
  margin: 1px 0 3px;
  color: var(--ink);
  font-size: 0.94rem;
}

.clinical-record-main p {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.clinical-record-main .clinical-record-note {
  margin-top: 7px;
  color: var(--ink-soft, #3d4a4a);
}

.clinical-record-main small {
  display: block;
  margin-top: 7px;
  color: #7b8587;
  font-size: 0.68rem;
  overflow-wrap: anywhere;
}

.clinical-record-review {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
}

.clinical-record-review form {
  display: flex;
  gap: 6px;
}

.clinical-record-review button {
  padding: 7px 9px;
  color: var(--primary-strong);
  background: #fff;
  border: 1px solid #aed4ce;
  border-radius: 9px;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 850;
  cursor: pointer;
}

.clinical-record-review button.mark-error {
  color: #8a473e;
  border-color: #dfb9b3;
}

.clinical-record-empty {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 22px;
  background: #f8fbfa;
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
}

.clinical-record-empty > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 12px;
}

.clinical-record-empty svg {
  width: 23px;
}

.clinical-record-empty > div {
  display: grid;
  gap: 3px;
}

.clinical-record-empty small {
  color: var(--muted);
}

.profile-tab-count {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  margin-left: 3px;
  padding: 0 5px;
  color: #725513;
  background: #ffecb4;
  border-radius: 999px;
  font-size: 0.65rem;
}

@media (max-width: 1080px) {
  .import-start-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-format-card {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 15px;
    align-items: start;
  }

  .import-format-card > header,
  .import-format-list {
    grid-column: 1 / -1;
  }

  .import-format-card > header {
    margin-bottom: 0;
  }

  .import-format-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 0;
  }

  .import-safety-note,
  .import-template-link {
    margin-top: 0;
  }

  .import-template-link {
    align-self: center;
    justify-self: start;
  }

  .import-review-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .import-review-summary > div:nth-child(3) {
    border-right: 0;
  }

  .import-review-summary > div:nth-child(-n + 3) {
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 820px) {
  .import-hero,
  .import-review-hero,
  .clinical-record-heading {
    display: grid;
  }

  .import-review-actions {
    justify-content: flex-start;
  }

  .import-stepper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-stepper li:nth-child(2)::after {
    display: none;
  }

  .import-stepper li:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .import-format-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-format-card > header,
  .import-format-list,
  .import-safety-note,
  .import-template-link {
    grid-column: 1;
  }

  .import-format-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-form-grid,
  .import-row-body,
  .clinical-record-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-row-body dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-decision,
  .import-row-body > .button.compact {
    grid-column: 1;
    grid-row: auto;
  }

  .clinical-record-review {
    justify-items: start;
  }
}

@media (max-width: 620px) {
  .import-hero,
  .import-review-hero,
  .import-upload-card,
  .import-format-card,
  .import-history,
  .import-row-section,
  .clinical-record-workspace {
    padding: 18px;
  }

  .import-submit-row,
  .import-commit-bar {
    display: grid;
  }

  .import-submit-row .button,
  .import-commit-bar .button {
    width: 100%;
  }

  .import-history-list > a {
    grid-template-columns: 42px minmax(0, 1fr) 18px;
  }

  .import-history-list .import-status,
  .import-history-count {
    display: none;
  }

  .import-review-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .import-review-summary > div:nth-child(3) {
    border-right: 1px solid var(--line);
  }

  .import-review-summary > div:nth-child(2n) {
    border-right: 0;
  }

  .import-review-summary > div:nth-child(-n + 4) {
    border-bottom: 1px solid var(--line);
  }

  .import-row-card > header {
    grid-template-columns: 32px minmax(0, 1fr);
  }

  .import-row-card > header .import-action {
    grid-column: 2;
    justify-self: start;
  }

  .import-row-body dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .import-complete-banner {
    grid-template-columns: minmax(0, 1fr);
  }

  .clinical-record-review form {
    flex-wrap: wrap;
  }
}

/* Isolated demo, role switching, and disclosure navigation ---------------- */

.site-nav .site-nav-demo,
.button.demo-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #8e72b2 58%, #399487);
  border-color: transparent;
  box-shadow: 0 9px 22px rgba(82, 56, 113, 0.2);
}

.site-nav .site-nav-demo:hover,
.button.demo-button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--primary-strong), #755d99 58%, #287a70);
}

.workspace-nav-parent-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  align-items: center;
  gap: 2px;
  min-width: 0;
}

.workspace-nav-parent-row .workspace-nav-parent {
  min-width: 0;
}

.workspace-nav-disclosure {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: rgba(249, 246, 251, 0.78);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
}

.workspace-nav-disclosure:hover,
.workspace-nav-disclosure:focus-visible {
  color: #fff;
  background: rgba(255, 255, 255, 0.09);
}

.workspace-nav-disclosure .nav-parent-arrow {
  margin: 0;
  transform: none;
  transition: transform 160ms ease;
}

.workspace-nav-disclosure[aria-expanded="true"] .nav-parent-arrow {
  opacity: 1;
  transform: rotate(90deg);
}

.workspace-nav-subtree[hidden] {
  display: none !important;
}

.identity-demo-chip {
  flex: 0 0 auto;
  justify-self: end;
  padding: 4px 7px;
  color: #2d1e3b;
  background: #f0d594;
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.privacy-indicator.is-demo {
  color: #513a69;
  background: linear-gradient(135deg, #f0e8f7, #dff1eb);
  border-color: #cbb9de;
}

.demo-workspace-banner {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px;
  margin: 14px var(--page-pad) 0;
  padding: 10px 14px;
  color: #3e2c50;
  background:
    radial-gradient(circle at 5% 20%, rgba(255, 255, 255, 0.76), transparent 26%),
    linear-gradient(115deg, #eee5f6, #f8f5fa 50%, #dcefe8);
  border: 1px solid #cdbbdf;
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(73, 50, 96, 0.09);
}

.demo-workspace-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--teal-strong));
  border-radius: 12px;
  font-weight: 950;
}

.demo-workspace-banner p {
  min-width: 0;
  margin: 0;
}

.demo-workspace-banner p > * {
  display: block;
}

.demo-workspace-banner p span {
  margin-top: 2px;
  color: #695d72;
  font-size: 0.75rem;
}

.demo-countdown {
  min-width: 92px;
  color: #5f4776;
  font-size: 0.73rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.demo-workspace-banner > a {
  min-height: 40px;
  padding: 10px 12px;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-size: 0.74rem;
  font-weight: 900;
  text-decoration: none;
}

.demo-entry-shell {
  display: grid;
  grid-template-columns: minmax(280px, 0.78fr) minmax(520px, 1.22fr);
  gap: clamp(26px, 5vw, 72px);
  width: min(1320px, calc(100% - 40px));
  margin: 0 auto;
  padding: clamp(42px, 7vw, 90px) 0 80px;
}

.demo-entry-intro {
  align-self: start;
  padding-top: 24px;
}

.demo-entry-intro h1 {
  max-width: 720px;
  margin: 8px 0 18px;
  font-size: clamp(2.6rem, 5vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
}

.demo-entry-lead {
  max-width: 650px;
  color: var(--muted);
  font-size: clamp(1rem, 1.45vw, 1.2rem);
  line-height: 1.65;
}

.demo-safety-grid {
  display: grid;
  gap: 10px;
  margin-top: 34px;
}

.demo-safety-grid article {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 1px 12px;
  padding: 15px 16px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(112, 93, 153, 0.16);
  border-radius: 15px;
}

.demo-safety-grid article > span {
  grid-row: 1 / 3;
  align-self: center;
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 950;
}

.demo-safety-grid p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.demo-role-form {
  padding: clamp(22px, 4vw, 38px);
  background:
    radial-gradient(circle at 100% 0, rgba(213, 235, 226, 0.72), transparent 34%),
    rgba(255, 255, 255, 0.94);
  border: 1px solid rgba(112, 93, 153, 0.17);
  border-radius: 28px;
  box-shadow: 0 24px 70px rgba(53, 36, 72, 0.14);
}

.demo-role-form-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.demo-role-form-head h2 {
  max-width: 620px;
  margin: 5px 0 0;
  font-size: clamp(1.65rem, 3vw, 2.55rem);
  line-height: 1.08;
}

.demo-time-chip,
.role-current-chip {
  flex: 0 0 auto;
  padding: 8px 11px;
  color: #543d6c;
  background: #eee5f6;
  border: 1px solid #d0bee0;
  border-radius: 999px;
  font-size: 0.73rem;
  font-weight: 900;
}

.demo-notice {
  margin: 18px 0 0;
  padding: 12px 14px;
  color: #3c5d55;
  background: #e2f1eb;
  border-left: 4px solid var(--teal-strong);
  border-radius: 10px;
}

.demo-notice.is-error {
  color: #7a2f28;
  background: #fbe7e3;
  border-left-color: #bd4b3f;
}

.demo-role-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.demo-role-card {
  position: relative;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 22px;
  align-items: center;
  gap: 11px;
  min-height: 88px;
  padding: 13px;
  background: #fbfafc;
  border: 1px solid #ddd4e5;
  border-radius: 15px;
  cursor: pointer;
  transition: transform 150ms ease, border-color 150ms ease, box-shadow 150ms ease;
}

.demo-role-card:hover {
  transform: translateY(-2px);
  border-color: #b8a2cc;
  box-shadow: 0 10px 24px rgba(70, 48, 91, 0.09);
}

.demo-role-card:has(input:checked) {
  background: linear-gradient(135deg, #f1eaf7, #f9fbfa);
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(112, 93, 153, 0.12);
}

.demo-role-card input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.demo-role-card:focus-within {
  outline: 3px solid rgba(112, 93, 153, 0.28);
  outline-offset: 2px;
}

.demo-role-icon,
.role-setting-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), #4b998d);
  border-radius: 13px;
  font-weight: 950;
}

.demo-role-card strong,
.demo-role-card small {
  display: block;
}

.demo-role-card small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.35;
}

.demo-role-check {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  color: transparent;
  border: 1px solid #c8bdcf;
  border-radius: 50%;
  font-size: 0.72rem;
  font-weight: 950;
}

.demo-role-card:has(input:checked) .demo-role-check {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.honeypot-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.demo-human-check {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(250px, 310px);
  align-items: center;
  gap: 16px;
  margin-top: 20px;
  padding: 14px;
  background: #f7f4f9;
  border: 1px solid #ded3e6;
  border-radius: 14px;
}

.demo-human-check p {
  margin: 0;
}

.demo-human-check p > * {
  display: block;
}

.demo-human-check p span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.74rem;
}

.demo-start-button {
  display: flex;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  margin-top: 18px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #4d968a);
}

.demo-entry-footnote {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.5;
  text-align: center;
}

.auth-demo-option {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  text-align: center;
}

.auth-demo-option > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 850;
  text-transform: uppercase;
}

.auth-demo-option small {
  color: var(--muted);
}

.role-settings-page {
  width: min(1120px, calc(100% - (2 * var(--page-pad))));
  margin: 0 auto;
  padding: clamp(36px, 6vw, 70px) 0 90px;
}

.role-settings-hero {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: clamp(24px, 4vw, 42px);
  background:
    radial-gradient(circle at 90% 10%, rgba(216, 237, 229, 0.86), transparent 30%),
    linear-gradient(135deg, #eee6f5, #fff 62%);
  border: 1px solid #d8cbe3;
  border-radius: 24px;
}

.role-settings-hero h1 {
  margin: 6px 0 10px;
  font-size: clamp(2rem, 4vw, 3.7rem);
}

.role-settings-hero p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.role-settings-demo-note {
  margin-top: 18px;
  padding: 17px 19px;
  color: #425e57;
  background: #e3f1ec;
  border-left: 4px solid var(--teal-strong);
  border-radius: 13px;
}

.role-settings-demo-note p {
  margin: 4px 0 0;
}

.role-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.role-setting-card {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 13px;
  min-height: 86px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.role-setting-card.is-current {
  background: linear-gradient(135deg, #f0e9f7, #f7fbf9);
  border-color: #baa6cd;
}

.role-setting-card strong,
.role-setting-card small {
  display: block;
}

.role-setting-card small {
  margin-top: 3px;
  color: var(--muted);
}

.role-setting-card button,
.role-setting-status {
  min-height: 40px;
  padding: 9px 12px;
  color: #fff;
  background: var(--primary);
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-size: 0.74rem;
  font-weight: 900;
}

.role-setting-status {
  display: inline-grid;
  place-items: center;
  color: #3e5c54;
  background: #dceee7;
}

.role-settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 24px;
}

.role-settings-actions form {
  margin: 0;
}

@media (max-width: 980px) {
  .demo-entry-shell {
    grid-template-columns: minmax(0, 1fr);
    width: min(760px, calc(100% - 32px));
    padding-top: 38px;
  }

  .demo-entry-intro,
  .demo-role-form {
    min-width: 0;
  }

  .demo-entry-intro {
    padding-top: 0;
  }

  .demo-safety-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .demo-safety-grid article {
    grid-template-columns: 1fr;
  }

  .demo-safety-grid article > span {
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .demo-workspace-banner {
    grid-template-columns: 34px minmax(0, 1fr) auto;
    margin: 10px 10px 0;
  }

  .demo-workspace-banner > a {
    display: none;
  }

  .demo-workspace-banner p span {
    display: none;
  }

  .demo-countdown {
    min-width: 74px;
    font-size: 0.66rem;
  }

  .demo-role-grid,
  .role-settings-grid {
    grid-template-columns: 1fr;
  }

  .demo-safety-grid {
    grid-template-columns: 1fr;
  }

  .demo-human-check {
    grid-template-columns: 1fr;
  }

  .role-settings-hero {
    align-items: start;
    flex-direction: column;
  }
}

@media (max-width: 420px) {
  .site-header {
    align-items: stretch;
    flex-direction: column;
  }

  .site-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .site-nav a {
    justify-content: center;
    min-width: 0;
    padding-inline: 7px;
    text-align: center;
  }

  .demo-entry-shell {
    width: min(100% - 20px, 760px);
    padding-top: 24px;
  }

  .demo-role-form {
    padding: 17px;
    border-radius: 20px;
  }

  .demo-role-form-head {
    align-items: start;
    flex-direction: column;
  }

  .demo-role-card {
    grid-template-columns: 38px minmax(0, 1fr) 22px;
    min-height: 82px;
    padding: 11px;
  }

  .demo-role-icon {
    width: 38px;
    height: 38px;
  }

  .role-setting-card {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .role-setting-card > form,
  .role-setting-status {
    grid-column: 1 / -1;
    width: 100%;
  }

  .role-setting-card button {
    width: 100%;
  }

  .role-settings-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .role-settings-actions .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .workspace-nav-disclosure .nav-parent-arrow,
  .demo-role-card {
    transition: none;
  }
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr);
  }

  .js .app-sidebar {
    position: fixed;
    left: 0;
    width: min(286px, calc(100vw - 54px));
    transform: translateX(-105%);
    transition: transform 180ms ease;
  }

  .js .nav-open .app-sidebar {
    transform: translateX(0);
  }

  .js .sidebar-close,
  .js .nav-toggle {
    display: inline-grid;
  }

  .js .nav-scrim {
    position: fixed;
    inset: 0;
    z-index: 55;
    display: block;
    padding: 0;
    visibility: hidden;
    background: rgba(38, 29, 49, 0.5);
    border: 0;
    opacity: 0;
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  .js .nav-open .nav-scrim {
    visibility: visible;
    opacity: 1;
  }

  .nav-locked {
    overflow: hidden;
  }

  html:not(.js) .app-shell {
    display: block;
  }

  html:not(.js) .app-sidebar {
    position: static;
    width: 100%;
    height: auto;
  }

  html:not(.js) .workspace-nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  html:not(.js) .nav-label {
    grid-column: 1 / -1;
  }

  html:not(.js) .sidebar-footer {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-body {
    --page-pad: 14px;
    --section-pad: 30px;
  }

  .app-topbar {
    min-height: 62px;
    padding-block: 8px;
  }

  .topbar-context span,
  .command-button span,
  .command-button kbd,
  .privacy-indicator span {
    display: none;
  }

  .command-button {
    display: inline-grid;
    place-items: center;
    width: 44px;
    padding: 0;
  }

  .privacy-indicator {
    display: inline-grid;
    place-items: center;
    width: 42px;
    padding: 0;
  }

  .app-body .dashboard-hero {
    margin-top: 14px;
    padding: 23px 18px;
    border-radius: 18px;
  }

  .app-body .dashboard-hero h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .collection-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .collection-search {
    min-width: 100%;
  }

  .filter-pills,
  .view-switcher {
    width: 100%;
  }

  .filter-pills button {
    flex: 1;
  }

  .profile-section-nav {
    top: 62px;
    margin-inline: 0;
    border-inline: 0;
    border-radius: 0;
  }

  .quick-dialog-foot {
    display: none;
  }

  .quick-results a {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .quick-results a small {
    text-align: left;
  }
}

@media (max-width: 620px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }

  .hero,
  .landing-hero {
    min-height: 680px;
  }

  .hero-ribbon,
  .feature-grid,
  .dashboard-grid,
  .workspace-grid,
  .workspace-grid.three,
  .profile-summary {
    grid-template-columns: 1fr;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-panel,
  .auth-panel.wide {
    padding: 22px;
  }
}

.story-band {
  padding: var(--section-pad) var(--page-pad);
  background:
    linear-gradient(135deg, rgba(112, 93, 153, 0.11), rgba(216, 165, 58, 0.12)),
    var(--paper-warm);
  border-block: 1px solid rgba(22, 33, 31, 0.07);
}

.story-band.dark {
  color: white;
  background:
    radial-gradient(circle at 90% 20%, rgba(20, 117, 109, 0.22), transparent 20rem),
    linear-gradient(135deg, var(--primary-deepest), var(--primary-deep));
}

.story-band.dark h2,
.story-band.dark h3,
.story-band.dark .eyebrow,
.story-band.dark p {
  color: white;
}

.story-band.dark .muted {
  color: rgba(255, 255, 255, 0.72);
}

.care-path {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 26px;
}

.path-step {
  min-height: 190px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.story-band.dark .path-step {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.18);
}

.path-number {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-bottom: 18px;
  color: var(--ink);
  background: var(--gold-soft);
  border-radius: var(--radius);
  font-size: 0.84rem;
  font-weight: 950;
}

.constellation {
  display: grid;
  grid-template-columns: 1.2fr repeat(2, minmax(0, 0.9fr));
  gap: 12px;
  margin-top: 26px;
}

.constellation-item {
  min-height: 132px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.constellation-item.featured {
  grid-row: span 2;
  display: grid;
  align-content: end;
  min-height: 276px;
  color: white;
  background:
    linear-gradient(0deg, rgba(22, 33, 31, 0.84), rgba(22, 33, 31, 0.2)),
    url("/static/img/autisync-hero.f3af1436440f.png") center / cover;
  border-color: rgba(255, 255, 255, 0.18);
}

.constellation-item.featured h3,
.constellation-item.featured p,
.constellation-item.featured .chip {
  color: white;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--page-pad) var(--section-pad);
  margin-top: calc(var(--section-pad) * -0.4);
}

.metric-tile {
  min-height: 120px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.metric-tile strong {
  display: block;
  margin-top: 8px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
  overflow-wrap: anywhere;
}

.metric-tile span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.insight-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(280px, 1.2fr);
  gap: 18px;
  padding: var(--section-pad) var(--page-pad);
  background: rgba(255, 255, 255, 0.5);
  border-block: 1px solid rgba(22, 33, 31, 0.06);
}

.insight-panel {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.insight-panel.highlight {
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  border-color: rgba(255, 255, 255, 0.2);
}

.insight-panel.highlight h2,
.insight-panel.highlight h3,
.insight-panel.highlight p,
.insight-panel.highlight .eyebrow {
  color: white;
}

.lens-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: var(--section-pad) var(--page-pad) 0;
}

.lens-card {
  min-height: 178px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.lens-card strong {
  display: block;
  margin: 10px 0 8px;
  font-size: 1.25rem;
}

.connection-map {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: var(--section-pad) var(--page-pad) 0;
}

.connection-step {
  min-height: 160px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.connection-step strong {
  display: block;
  margin: 12px 0 8px;
  font-size: 1.18rem;
}

.permission-deck {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: var(--section-pad) var(--page-pad) 0;
}

.permission-card {
  min-height: 150px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.form-note {
  padding: 14px;
  color: var(--muted);
  background: var(--sky-soft);
  border: 1px solid rgba(61, 127, 156, 0.18);
  border-radius: var(--radius);
  line-height: 1.5;
}

.practitioner-hero {
  background:
    linear-gradient(90deg, rgba(61, 127, 156, 0.13) 0 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(135deg, #e9f2ef 0%, #fbf5e5 48%, #e6edf5 100%);
}

.practitioner-aside {
  border-top: 5px solid var(--primary);
}

.visual-command-board,
.client-signal-grid {
  display: grid;
  gap: 16px;
  padding: 0 var(--page-pad) var(--section-pad);
}

.visual-command-board {
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
}

.visual-panel,
.client-signal-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.visual-panel {
  padding: 20px;
}

.age-bars {
  display: grid;
  gap: 12px;
}

.age-bar-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 32px;
  gap: 10px;
  align-items: center;
}

.age-bar-row span,
.age-bar-row strong {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 900;
}

.age-bar-track {
  height: 16px;
  overflow: hidden;
  background: #eef3ef;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.age-bar-track i {
  display: block;
  min-width: 6px;
  height: 100%;
  background: var(--primary);
}

.age-bar-track i.gold,
.signal-tile.gold span {
  background: var(--gold);
}

.age-bar-track i.coral,
.signal-tile.coral span {
  background: var(--coral);
}

.age-bar-track i.violet,
.signal-tile.violet span {
  background: var(--violet);
}

.signal-tile.sky span {
  background: var(--sky);
}

.signal-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(108px, 1fr));
  gap: 10px;
}

.signal-tile {
  min-height: 128px;
  padding: 14px;
  display: grid;
  align-content: space-between;
  background: #fbfcf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.signal-tile span,
.signal-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  font-weight: 950;
}

.signal-tile strong {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
}

.signal-tile small,
.signal-card-head small {
  color: var(--muted);
  font-weight: 850;
}

.client-signal-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding-top: 0;
}

.client-signal-card {
  min-height: 188px;
  padding: 16px;
  display: grid;
  gap: 14px;
  align-content: space-between;
  color: var(--ink);
  text-decoration: none;
  border-top: 5px solid var(--client-color, var(--teal));
}

.client-signal-card:hover {
  border-color: var(--client-color, var(--teal));
  box-shadow: var(--shadow-strong);
}

.signal-card-head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.signal-avatar {
  width: 46px;
  height: 46px;
  background:
    linear-gradient(135deg, var(--client-color, var(--teal)) 0 58%, var(--clinic-color, var(--gold)) 58% 100%);
}

.signal-card-head strong {
  display: block;
  line-height: 1.15;
}

.progress-lane {
  height: 12px;
  overflow: hidden;
  background: #eef3ef;
  border-radius: 999px;
}

.progress-lane i {
  display: block;
  min-width: 8px;
  height: 100%;
  background:
    linear-gradient(90deg, var(--client-color, var(--teal)), var(--clinic-color, var(--gold)));
}

.signal-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(38px, 1fr));
  gap: 6px;
}

.signal-pills span {
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  color: var(--muted);
  background: #f6f8f4;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 950;
}

.signal-pills .alert {
  color: #7a2b24;
  background: var(--coral-soft);
  border-color: rgba(199, 95, 74, 0.28);
}

.practitioner-shell,
.session-board,
.client-workspace,
.session-file-layout {
  display: grid;
  gap: 18px;
  padding: var(--section-pad) var(--page-pad);
}

.practitioner-shell {
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.45fr);
  align-items: start;
}

.practitioner-main,
.practitioner-side,
.session-board > article,
.client-chat,
.client-session-panel,
.session-file-layout > article,
.session-file-layout > aside {
  padding: 22px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.calendar-legend,
.client-stack,
.session-list,
.chat-thread {
  display: grid;
  gap: 10px;
}

.calendar-legend {
  grid-auto-flow: column;
  justify-content: end;
  align-items: center;
}

.calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 850;
}

.calendar-legend i,
.client-swatch,
.session-marker {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  background: var(--clinic-color, var(--teal));
  border-radius: 3px;
}

.session-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.calendar-day {
  min-height: 154px;
  padding: 10px;
  background: #fbfcf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.calendar-day.today {
  border-color: var(--primary);
  box-shadow: inset 0 0 0 2px rgba(112, 93, 153, 0.14);
}

.calendar-day header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.calendar-day header span {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.calendar-day header strong {
  font-size: 1.1rem;
}

.calendar-events {
  display: grid;
  gap: 7px;
}

.calendar-event {
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 8px 7px 10px;
  color: var(--ink);
  background:
    linear-gradient(90deg, var(--clinic-color, var(--gold)) 0 5px, transparent 5px),
    color-mix(in srgb, var(--client-color, var(--teal)) 13%, white);
  border: 1px solid color-mix(in srgb, var(--client-color, var(--teal)) 32%, white);
  border-radius: 6px;
  text-decoration: none;
}

.calendar-event span,
.calendar-event strong,
.calendar-empty {
  font-size: 0.78rem;
  line-height: 1.25;
}

.calendar-event strong {
  font-weight: 950;
}

.calendar-empty {
  color: #87918e;
  font-weight: 850;
}

.client-row,
.session-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 68px;
  padding: 12px;
  color: var(--ink);
  background: #fbfcf7;
  border: 1px solid var(--line);
  border-left: 5px solid var(--client-color, var(--teal));
  border-radius: var(--radius);
  text-decoration: none;
}

.client-row:hover,
.session-row:hover,
.calendar-event:hover {
  border-color: var(--client-color, var(--teal));
  box-shadow: var(--shadow-soft);
}

.client-row strong,
.session-row strong {
  display: block;
  line-height: 1.2;
}

.client-row small,
.session-row small,
.client-row em,
.session-row em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
  line-height: 1.35;
}

.client-row em,
.session-row em {
  font-weight: 900;
}

.client-swatch {
  width: 18px;
  height: 36px;
  background:
    linear-gradient(180deg, var(--client-color, var(--teal)) 0 50%, var(--clinic-color, var(--gold)) 50% 100%);
}

.session-marker {
  width: 16px;
  height: 40px;
  background:
    linear-gradient(180deg, var(--client-color, var(--teal)) 0 62%, var(--clinic-color, var(--gold)) 62% 100%);
}

.session-board,
.session-file-layout {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 0;
}

.client-workspace {
  grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
}

.chat-bubble {
  max-width: 82%;
  padding: 13px;
  background: var(--sky-soft);
  border: 1px solid rgba(61, 127, 156, 0.18);
  border-radius: var(--radius);
}

.chat-bubble.user {
  justify-self: end;
  background: var(--primary-soft);
  border-color: rgba(112, 93, 153, 0.22);
}

.chat-bubble p {
  margin: 6px 0 0;
  color: var(--ink);
  line-height: 1.45;
}

.chat-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 14px;
}

.chat-input input {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.context-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
}

.care-plan-section {
  background:
    linear-gradient(90deg, rgba(216, 165, 58, 0.1) 0 1px, transparent 1px) 0 0 / 36px 36px,
    rgba(255, 255, 255, 0.28);
  border-block: 1px solid rgba(22, 33, 31, 0.06);
}

.care-plan-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.care-plan-grid,
.context-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(280px, 0.55fr);
  gap: 18px;
  align-items: start;
}

.context-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.55fr);
}

.plan-panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.goal-stack,
.task-stack,
.context-stack {
  display: grid;
  gap: 12px;
}

.goal-card,
.task-card,
.context-stack article {
  display: grid;
  gap: 12px;
  padding: 14px;
  background: #fbfcf7;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.goal-card {
  grid-template-columns: minmax(0, 1fr) minmax(92px, 0.28fr);
  align-items: center;
}

.goal-card h3,
.task-card h3 {
  margin: 0;
}

.goal-card p,
.task-card p,
.preference-panel p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.goal-meter {
  display: grid;
  gap: 8px;
  justify-items: end;
}

.goal-meter strong {
  font-size: 1.35rem;
}

.goal-meter small,
.signal-activity-label {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
}

.goal-meter i {
  width: 100%;
  height: 12px;
  overflow: hidden;
  background: #eef3ef;
  border-radius: 999px;
}

.goal-meter b {
  display: block;
  min-width: 6px;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--gold));
}

.task-card {
  border-left: 5px solid var(--sky);
}

.task-card.high,
.task-card.urgent,
.task-card.overdue,
.vault-stat.urgent span {
  border-color: var(--coral);
}

.vault-stat.urgent span {
  background: var(--coral);
}

.task-status-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.task-status-form select {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fcfdf9;
}

.preference-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.preference-grid span,
.soft-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  color: var(--muted);
  background: #f5f2e7;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
}

.preference-grid .on,
.soft-link {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: rgba(112, 93, 153, 0.22);
}

.care-plan-forms {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.context-stack article {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.context-stack span {
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  font-weight: 950;
}

.audit-board {
  padding-top: var(--section-pad);
}

.vault-section {
  background: rgba(255, 255, 255, 0.34);
  border-block: 1px solid rgba(22, 33, 31, 0.06);
}

.vault-overview {
  display: grid;
  grid-template-columns: minmax(150px, 0.28fr) minmax(170px, 0.34fr) minmax(280px, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.vault-stat,
.vault-sensitivity,
.document-card {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.vault-stat {
  min-height: 142px;
  display: grid;
  align-content: space-between;
  padding: 16px;
}

.vault-stat span,
.document-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: white;
  background: var(--violet);
  border-radius: 999px;
  font-weight: 950;
}

.vault-stat.teal span {
  background: var(--teal);
}

.vault-stat strong {
  font-size: clamp(2.15rem, 5vw, 3.6rem);
  line-height: 0.95;
}

.vault-stat small,
.document-card small {
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.vault-sensitivity {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.sensitivity-bars {
  display: grid;
  gap: 8px;
}

.sensitivity-row {
  display: grid;
  grid-template-columns: minmax(98px, 0.38fr) minmax(0, 1fr) 28px;
  gap: 10px;
  align-items: center;
}

.sensitivity-row span,
.sensitivity-row em {
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
  font-weight: 900;
}

.sensitivity-row i {
  height: 13px;
  overflow: hidden;
  background: #eef3ef;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.sensitivity-row b {
  display: block;
  min-width: 8px;
  height: 100%;
  background: var(--primary);
}

.sensitivity-row.clinical b,
.document-icon.clinical {
  background: var(--coral);
}

.sensitivity-row.school b,
.document-icon.school {
  background: var(--sky);
}

.sensitivity-row.assessment b,
.document-icon.assessment {
  background: var(--gold);
}

.sensitivity-row.safety_restricted b,
.document-icon.safety_restricted {
  background: var(--danger);
}

.sensitivity-row.admin_only b,
.document-icon.admin_only {
  background: var(--ink);
}

.vault-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.42fr);
  gap: 18px;
  align-items: start;
}

.document-grid {
  display: grid;
  gap: 12px;
}

.document-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 16px;
}

.document-card.compact {
  align-items: center;
}

.document-card h3 {
  margin: 0;
}

.document-card p {
  margin: 8px 0;
  color: var(--muted);
  line-height: 1.45;
}

.document-actions {
  display: grid;
  gap: 8px;
  min-width: 128px;
}

.vault-upload {
  position: sticky;
  top: 92px;
}

.checkbox-label {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.checkbox-label input {
  width: 18px;
  min-height: 18px;
}

.document-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: var(--section-pad) var(--page-pad);
}

.session-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  padding: var(--section-pad) var(--page-pad);
}

.session-notes {
  min-height: 190px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.session-notes p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

@media (max-width: 1080px) {
  .care-path,
  .metric-strip,
  .permission-deck,
  .session-detail-grid,
  .document-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .constellation,
  .connection-map,
  .lens-grid,
  .visual-command-board,
  .practitioner-shell,
  .client-workspace,
  .care-plan-grid,
  .context-grid,
  .care-plan-forms,
  .vault-layout,
  .vault-overview,
  .session-board,
  .session-file-layout {
    grid-template-columns: 1fr;
  }

  .client-signal-grid,
  .signal-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .constellation-item.featured {
    grid-row: auto;
  }
}

@media (max-width: 780px) {
  .care-path,
  .metric-strip,
  .care-plan-overview,
  .permission-deck,
  .insight-band,
  .client-signal-grid,
  .signal-tiles,
  .session-calendar,
  .session-detail-grid,
  .document-detail-grid {
    grid-template-columns: 1fr;
  }

  .calendar-legend {
    grid-auto-flow: row;
    justify-content: start;
  }

  .chat-input,
  .client-row,
  .session-row,
  .goal-card,
  .task-status-form,
  .document-card {
    grid-template-columns: 1fr;
  }

  .vault-upload {
    position: static;
  }
}

.assessment-studio {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 46px);
  padding: var(--section-pad) var(--page-pad);
  background: rgba(255, 255, 255, 0.38);
  border-bottom: 1px solid rgba(22, 33, 31, 0.07);
}

.studio-copy {
  position: sticky;
  top: 96px;
  align-self: start;
}

.studio-copy p {
  margin: 0;
}

.studio-board {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.42fr);
  gap: 16px;
  align-items: stretch;
}

.form-builder-card,
.form-preview-panel,
.result-panel,
.respondent-card,
.assignment-card,
.result-profile-card,
.question-result-card,
.assignment-result {
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.form-builder-card,
.form-preview-panel,
.result-panel,
.respondent-card,
.result-profile-card,
.question-result-card,
.assignment-result {
  padding: 20px;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-field {
  min-width: 0;
}

.form-field .errorlist {
  margin-top: 7px;
}

.form-grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.builder-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.builder-footer .checkbox-label {
  width: auto;
  min-width: 150px;
  margin: 0;
}

.questionnaire-builder,
.assignment-builder {
  margin-top: 0;
}

.question-picker {
  padding: 12px;
  background: #f7faf4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.form-preview-panel {
  display: grid;
  gap: 14px;
  align-content: start;
  background:
    linear-gradient(135deg, rgba(112, 93, 153, 0.11), rgba(216, 165, 58, 0.1)),
    rgba(255, 255, 255, 0.94);
}

.preview-sheet {
  display: grid;
  gap: 14px;
  min-height: 280px;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preview-sheet h3 {
  margin: 0;
}

.scale-preview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.scale-preview span,
.type-palette span {
  display: grid;
  place-items: center;
  min-height: 42px;
  color: var(--ink);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 950;
}

.preview-lines {
  display: grid;
  gap: 9px;
}

.preview-lines i {
  display: block;
  height: 13px;
  background: #e8eee8;
  border-radius: 999px;
}

.preview-lines i:nth-child(2) {
  width: 78%;
}

.preview-lines i:nth-child(3) {
  width: 56%;
}

.question-options-label[hidden] {
  display: none;
}

.preview-choice-grid,
.preview-radio-list,
.preview-input-line,
.preview-textarea-lines,
.preview-number-line {
  display: grid;
  gap: 10px;
}

.preview-choice-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-choice-grid span,
.preview-radio-list span,
.preview-input-line,
.preview-number-line {
  min-height: 42px;
  padding: 10px 12px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 900;
}

.preview-radio-list span {
  display: flex;
  align-items: center;
  gap: 10px;
}

.preview-radio-list i {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid var(--primary);
  border-radius: 999px;
}

.preview-textarea-lines {
  padding: 12px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.preview-textarea-lines i {
  display: block;
  height: 13px;
  background: #e8eee8;
  border-radius: 999px;
}

.preview-textarea-lines i:nth-child(2) {
  width: 82%;
}

.preview-textarea-lines i:nth-child(3) {
  width: 58%;
}

.type-palette {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.type-palette span:nth-child(2) {
  background: var(--gold-soft);
}

.type-palette span:nth-child(3) {
  background: var(--coral-soft);
}

.type-palette span:nth-child(4) {
  background: var(--violet-soft);
}

.type-palette span:nth-child(5) {
  background: var(--sky-soft);
}

.respondent-grid,
.assignment-list,
.results-dashboard,
.question-result-grid,
.result-profile-list {
  display: grid;
  gap: 14px;
}

.respondent-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.respondent-card {
  display: grid;
  gap: 14px;
}

.respondent-card h3 {
  margin: 0;
}

.respondent-card p {
  margin: 6px 0 0;
}

.respondent-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.respondent-chips span {
  display: inline-grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 8px;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 7px 10px;
  background: #f7faf4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 900;
}

.respondent-chips.compact span {
  min-height: 38px;
  font-size: 0.9rem;
}

.respondent-chips b {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: white;
  background: var(--primary);
  border-radius: 999px;
  font-size: 0.78rem;
}

.respondent-chips small {
  grid-column: 2;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 850;
}

.assessment-row {
  grid-template-columns: minmax(0, 0.9fr) minmax(260px, 1fr);
}

.row-actions {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.row-actions p {
  margin: 0;
}

.assignment-list {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.assignment-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 18px;
}

.assignment-card h3,
.assignment-card p,
.assignment-card small {
  margin: 8px 0 0;
}

.assignment-card small {
  display: block;
  color: var(--muted);
  font-weight: 850;
  line-height: 1.35;
}

.assignment-stats {
  display: grid;
  place-items: center;
  min-width: 108px;
  padding: 12px;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.assignment-stats strong {
  font-size: 2rem;
  line-height: 1;
}

.assignment-stats span,
.assignment-stats em {
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 900;
}

.assessment-metrics {
  background: rgba(255, 255, 255, 0.28);
}

.results-dashboard {
  align-items: start;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: var(--section-pad) var(--page-pad);
}

.result-panel {
  min-height: 300px;
}

.result-panel h2 {
  font-size: clamp(1.35rem, 2vw, 2rem);
}

.bar-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  min-height: 190px;
  padding-top: 16px;
  overflow-x: auto;
}

.bar-column {
  display: grid;
  grid-template-rows: minmax(120px, 1fr) auto auto;
  gap: 7px;
  justify-items: center;
  min-width: 54px;
}

.bar-column i {
  align-self: end;
  display: block;
  width: 34px;
  min-height: 8px;
  background: linear-gradient(180deg, var(--primary), var(--sky));
  border-radius: var(--radius) var(--radius) 2px 2px;
}

.trend-chart .bar-column i {
  background: linear-gradient(180deg, var(--coral), var(--gold));
}

.bar-column span,
.bar-column strong,
.trend-summary {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.trend-summary {
  margin: 8px 0 0;
}

.distribution-list {
  display: grid;
  gap: 10px;
}

.distribution-list.compact {
  gap: 7px;
}

.distribution-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.42fr) minmax(0, 1fr) 34px;
  gap: 9px;
  align-items: center;
}

.distribution-row span,
.distribution-row strong {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.distribution-row i {
  height: 13px;
  overflow: hidden;
  background: #eef3ef;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.distribution-row b {
  display: block;
  min-width: 7px;
  height: 100%;
  background: var(--violet);
}

.text-answer-list {
  display: grid;
  gap: 10px;
}

.text-answer-list blockquote {
  margin: 0;
  padding: 12px;
  background: #f7faf4;
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: var(--radius);
}

.text-answer-list.compact blockquote {
  padding: 10px;
}

.text-answer-list p {
  margin: 0;
  color: var(--ink);
  line-height: 1.45;
}

.text-answer-list cite {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 850;
}

.chart-builder {
  grid-template-columns: minmax(260px, 1fr) auto;
  align-items: end;
  margin: 0 0 14px;
}

.custom-chart-panel {
  max-width: 980px;
}

.result-profile-card {
  display: grid;
  gap: 18px;
}

.result-profile-card > header,
.assignment-result-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.result-profile-card h2,
.result-profile-card h3,
.assignment-result h3 {
  margin: 0;
}

.assignment-result {
  display: grid;
  gap: 16px;
  background: rgba(247, 250, 244, 0.76);
}

.question-result-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.question-result-card {
  display: grid;
  gap: 10px;
  align-content: start;
}

.question-result-card h3 {
  font-size: 1rem;
  line-height: 1.3;
}

.question-result-card p {
  margin: 0;
}

.mini-trend {
  display: flex;
  align-items: end;
  gap: 6px;
  min-height: 82px;
  padding: 8px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.mini-trend span {
  display: grid;
  align-items: end;
  width: 16px;
  height: 64px;
}

.mini-trend i {
  display: block;
  min-height: 6px;
  background: var(--coral);
  border-radius: 999px 999px 2px 2px;
}

.json-snapshot {
  background: var(--ink);
  color: white;
  border-radius: var(--radius);
  overflow: hidden;
}

.json-snapshot summary {
  padding: 13px 15px;
  cursor: pointer;
  font-weight: 900;
}

.json-snapshot pre {
  max-height: 360px;
  margin: 0;
  padding: 15px;
  overflow: auto;
  background: #101816;
  color: #e8f3ed;
  font-size: 0.82rem;
  line-height: 1.45;
}

.respond-form {
  display: grid;
  gap: 16px;
  max-width: 920px;
}

.respond-question {
  display: grid;
  gap: 16px;
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.respond-question-head {
  display: grid;
  gap: 10px;
}

.respond-question h2 {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.answer-options > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.answer-options label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 46px;
  padding: 10px 13px;
  background: #f7faf4;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 900;
}

.answer-options input {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.scale-options label {
  min-width: 54px;
  justify-content: center;
}

.yes-no-options label:first-child {
  background: var(--teal-soft);
}

.yes-no-options label:last-child {
  background: var(--coral-soft);
}

.answer-text input,
.answer-text textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 12px;
  color: var(--ink);
  background: #fcfdf9;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.answer-text textarea {
  min-height: 150px;
  resize: vertical;
}

.answer-text input:focus,
.answer-text textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(112, 93, 153, 0.16);
  outline: 0;
}

.respond-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 1500px) {
  .results-dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .question-result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .assessment-studio,
  .studio-board,
  .respondent-grid,
  .assignment-list,
  .results-dashboard,
  .question-result-grid,
  .form-grid.two,
  .chart-builder {
    grid-template-columns: 1fr;
  }

  .studio-copy {
    position: static;
  }

  .assessment-row,
  .assignment-card {
    grid-template-columns: 1fr;
  }

  .row-actions {
    justify-items: start;
  }

  .result-profile-card > header,
  .assignment-result-head {
    display: grid;
  }
}

/* Dashboard workflow components (kept last to override legacy dashboard rules). */

.dashboard-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  padding: 0 var(--page-pad) 18px;
}

.dashboard-section-heading h2 {
  font-size: clamp(1.75rem, 3vw, 2.6rem);
}

.dashboard-section-heading p {
  margin: 0;
  color: var(--muted);
}

.dashboard-section-heading .eyebrow {
  margin-bottom: 7px;
  color: var(--primary);
}

.app-body .metric-strip {
  position: relative;
  z-index: 2;
}

.today-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  padding: 0 var(--page-pad) var(--section-pad);
}

.today-board-head {
  grid-column: 1 / -1;
  margin-bottom: 4px;
}

.today-board-head h2 {
  font-size: clamp(1.8rem, 3vw, 2.7rem);
}

.today-panel {
  min-width: 0;
  padding: 19px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 17px;
  box-shadow: var(--shadow-soft);
}

.today-panel .section-head {
  align-items: center;
  margin-bottom: 13px;
}

.today-panel h3 {
  margin: 0;
  font-size: 1.23rem;
}

.today-panel .eyebrow {
  margin-bottom: 5px;
}

.panel-count {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  padding: 0 9px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 11px;
  font-size: 1.05rem;
}

.priority-list {
  display: grid;
  gap: 7px;
}

.priority-list > a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 62px;
  padding: 10px 11px;
  color: var(--ink);
  background: #f8faf6;
  border: 1px solid #e0e6e1;
  border-radius: 12px;
  text-decoration: none;
}

.priority-list > a:hover {
  background: var(--primary-wash);
  border-color: var(--primary-soft-strong);
}

.priority-list > a > span:first-child {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.priority-list > a strong,
.priority-list > a small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-list > a strong {
  font-size: 0.88rem;
}

.priority-list > a small {
  color: var(--muted);
  font-size: 0.75rem;
}

.priority-list .status-chip {
  flex: 0 0 auto;
  font-size: 0.7rem;
}

.compact-empty {
  display: grid;
  gap: 5px;
  min-height: 112px;
  align-content: center;
  padding: 17px;
  color: var(--muted);
  background: #f6f7f3;
  border: 1px dashed #cad4ce;
  border-radius: 12px;
}

.compact-empty strong {
  color: var(--ink);
}

.compact-empty span {
  font-size: 0.84rem;
  line-height: 1.45;
}

.dashboard-profile-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--page-pad) var(--section-pad);
}

.profile-quick-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 82px;
  padding: 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.profile-quick-card:hover {
  border-color: #b6a6c8;
  transform: translateY(-1px);
}

.profile-quick-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-quick-card strong,
.profile-quick-card small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-quick-card small {
  color: var(--muted);
}

.profile-initial {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 13px;
  font-weight: 950;
}

.admin-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--page-pad) var(--section-pad);
}

.admin-quick-actions > a {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 92px;
  padding: 15px;
  color: var(--ink);
  background: var(--primary-wash);
  border: 1px solid var(--line);
  border-radius: 15px;
  text-decoration: none;
}

.admin-quick-actions > a > span:last-child {
  display: grid;
  gap: 3px;
}

.admin-quick-actions small {
  color: var(--muted);
}

.admin-quick-actions .card-index {
  margin: 0;
  flex: 0 0 auto;
}

.secondary-insights {
  padding-top: 0;
}

.secondary-insights > details {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 17px;
}

.secondary-insights summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 14px 18px;
  cursor: pointer;
  list-style: none;
}

.secondary-insights summary::-webkit-details-marker {
  display: none;
}

.secondary-insights summary > span:first-child {
  display: grid;
}

.secondary-insights summary .eyebrow {
  margin: 0 0 4px;
}

.secondary-insights summary > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 780;
}

.secondary-insights details[open] summary {
  border-bottom: 1px solid var(--line);
}

.secondary-insights .visual-command-board {
  padding: 18px;
}

.signal-tile .signal-name,
.signal-tile.gold .signal-name,
.signal-tile.coral .signal-name,
.signal-tile.violet .signal-name,
.signal-tile.sky .signal-name {
  display: inline-flex;
  align-items: center;
  width: auto;
  height: auto;
  min-height: 28px;
  justify-self: start;
  padding: 4px 8px;
  color: #31504a;
  background: #e6f0eb;
  border-radius: 8px;
  font-size: 0.7rem;
  line-height: 1.2;
}

.signal-pills {
  grid-template-columns: repeat(auto-fit, minmax(72px, 1fr));
}

.signal-pills span {
  padding: 4px 7px;
  text-align: center;
}

@media (max-width: 1120px) {
  .today-board,
  .dashboard-profile-grid,
  .admin-quick-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .today-panel:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .dashboard-section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .today-board,
  .dashboard-profile-grid,
  .admin-quick-actions {
    grid-template-columns: 1fr;
  }

  .today-panel:last-child {
    grid-column: auto;
  }

  .priority-list > a {
    align-items: flex-start;
    flex-direction: column;
  }

  .secondary-insights summary > span:last-child {
    display: none;
  }

  .secondary-insights .visual-command-board {
    grid-template-columns: 1fr;
    padding: 12px;
  }
}

.action-disclosure {
  margin-top: 18px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.action-disclosure > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 13px 17px;
  cursor: pointer;
  list-style: none;
}

.action-disclosure > summary::-webkit-details-marker {
  display: none;
}

.action-disclosure > summary > span:first-child {
  display: grid;
  gap: 3px;
}

.action-disclosure > summary small {
  color: var(--muted);
  font-weight: 600;
}

.action-disclosure > summary > span:last-child {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 10px;
  font-size: 1.35rem;
  font-weight: 500;
  transition: transform 160ms ease;
}

.action-disclosure[open] > summary {
  border-bottom: 1px solid var(--line);
}

.action-disclosure[open] > summary > span:last-child {
  transform: rotate(45deg);
}

.action-disclosure .care-plan-forms {
  padding: 16px;
}

.message-disclosure {
  margin: 0;
}

.message-disclosure .panel-form {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.care-profile-browser[data-view="list"] {
  grid-template-columns: 1fr;
}

.care-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-height: 146px;
  color: var(--ink);
  text-decoration: none;
}

.care-profile-card::before {
  display: none;
}

.care-profile-card-copy {
  display: grid;
  min-width: 0;
  justify-items: start;
}

.care-profile-card h2 {
  margin: 10px 0 2px;
  font-size: 1.35rem;
}

.care-profile-card p {
  margin: 0;
}

.care-profile-arrow {
  color: var(--primary);
  font-size: 1.35rem;
}

.care-profile-browser[data-view="list"] .care-profile-card {
  min-height: 88px;
}

@media (max-width: 720px) {
  .action-disclosure > summary {
    align-items: flex-start;
  }

  .action-disclosure .care-plan-forms {
    padding: 10px;
  }

  .care-profile-card {
    min-height: 106px;
    padding: 15px;
  }
}

/* Progress and patterns workspace */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.progress-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: clamp(22px, 5vw, 72px);
  align-items: end;
  padding: clamp(38px, 7vw, 94px) var(--page-pad) 34px;
  background:
    radial-gradient(circle at 84% 18%, rgba(216, 165, 58, 0.2), transparent 28%),
    linear-gradient(145deg, rgba(238, 233, 244, 0.94), rgba(227, 241, 237, 0.74));
  border-bottom: 1px solid rgba(112, 93, 153, 0.16);
}

.progress-hero h1 {
  max-width: 980px;
  font-size: clamp(2.7rem, 6.4vw, 6rem);
}

.progress-lede {
  max-width: 820px;
  margin: 22px 0 0;
  color: #3f504c;
  font-size: clamp(1rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.progress-principle {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 20px;
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(112, 93, 153, 0.26);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
}

.progress-principle > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: white;
  background: var(--primary);
  border-radius: 14px;
  font-size: 1.35rem;
  font-weight: 900;
}

.progress-principle p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.period-switcher {
  position: sticky;
  top: 68px;
  z-index: 18;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  min-height: 58px;
  padding: 9px var(--page-pad);
  background: rgba(248, 249, 244, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.period-switcher > span {
  margin-right: 5px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.period-switcher a {
  min-height: 38px;
  padding: 8px 12px;
  color: #4d5d59;
  border: 1px solid transparent;
  border-radius: 10px;
  font-weight: 800;
  text-decoration: none;
}

.period-switcher a:hover {
  border-color: var(--line-strong);
}

.period-switcher a[aria-current="page"] {
  color: white;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.progress-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 26px var(--page-pad);
}

.progress-metrics article {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 92px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.progress-metrics article > div {
  display: grid;
  min-width: 0;
}

.progress-metrics strong {
  font-size: clamp(1.45rem, 2.4vw, 2rem);
  line-height: 1;
}

.progress-metrics small {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.metric-symbol {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 14px;
  font-weight: 950;
}

.metric-symbol.coral { color: #7c3024; background: var(--coral-soft); }
.metric-symbol.gold { color: #6f4e0b; background: var(--gold-soft); }
.metric-symbol.violet { color: #354d80; background: var(--violet-soft); }

.evidence-lanes {
  padding: 28px var(--page-pad) var(--section-pad);
}

.evidence-lane-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.evidence-lane-grid article {
  position: relative;
  min-height: 190px;
  padding: 22px;
  overflow: hidden;
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.96), rgba(238, 245, 239, 0.84));
  border: 1px solid var(--line);
  border-radius: 18px;
}

.evidence-lane-grid h3 {
  margin-top: 32px;
  font-size: 1.32rem;
}

.evidence-lane-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.lane-number {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: white;
  background: var(--primary);
  border-radius: 11px;
  font-weight: 950;
}

.lane-number.coral { background: var(--coral); }
.lane-number.gold { color: #3d2d08; background: var(--gold); }

.progress-goal-section {
  background: rgba(255, 255, 255, 0.44);
  border-block: 1px solid rgba(22, 33, 31, 0.07);
}

.progress-toolbar {
  margin: 0 0 18px;
}

.progress-toolbar .collection-search input {
  padding-left: 13px;
}

.progress-goal-list {
  display: grid;
  gap: 18px;
}

.progress-goal-card {
  min-width: 0;
  padding: clamp(18px, 3vw, 30px);
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-left: 5px solid var(--primary);
  border-radius: 20px;
  box-shadow: var(--shadow-soft);
  scroll-margin-top: 140px;
}

.progress-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
}

.progress-card-head h3 {
  margin: 14px 0 7px;
  font-size: clamp(1.45rem, 2.7vw, 2.15rem);
}

.progress-card-head p {
  max-width: 760px;
  margin: 0;
  color: var(--muted);
}

.goal-current-value {
  display: grid;
  min-width: 150px;
  padding: 14px 16px;
  text-align: right;
  background: var(--primary-soft);
  border: 1px solid rgba(112, 93, 153, 0.22);
  border-radius: 15px;
}

.goal-current-value span,
.goal-current-value small {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.goal-current-value strong {
  margin: 3px 0;
  color: var(--primary-strong);
  font-size: 2.15rem;
  line-height: 1;
}

.goal-anchor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 13px;
  align-items: stretch;
  margin: 22px 0;
}

.goal-anchor-grid article {
  padding: 15px;
  background: #f7f8f3;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.goal-anchor-grid article:last-child {
  background: #edf6ee;
  border-color: #cce1cf;
}

.goal-anchor-grid span:not(.anchor-arrow) {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-anchor-grid p {
  margin: 8px 0 0;
  line-height: 1.5;
}

.anchor-arrow {
  align-self: center;
  color: var(--primary);
  font-size: 1.5rem;
  font-weight: 900;
}

.trajectory-figure {
  min-width: 0;
  max-width: 100%;
  margin: 0;
  padding: 18px;
  background: #fbfcf8;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.trajectory-figure > figcaption,
.assessment-pattern-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.trajectory-figure h4 {
  margin: 3px 0 0;
  font-size: 1.08rem;
}

.change-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 10px;
  color: #0f5c53;
  background: var(--teal-soft);
  border: 1px solid rgba(20, 117, 109, 0.2);
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.change-chip.neutral {
  color: #4f596f;
  background: #ececf3;
  border-color: #d8d8e5;
}

.chart-summary {
  margin: 10px 0 8px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.line-chart-shell {
  width: 100%;
  max-width: 100%;
  min-height: 230px;
  padding: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.progress-line-chart {
  display: block;
  width: 100%;
  height: 230px;
  overflow: visible;
}

.progress-line-chart.compact {
  height: 190px;
}

.compact-chart-shell {
  min-height: 190px;
  padding: 0;
}

.chart-scroll-hint {
  display: none;
}

.chart-grid-line {
  stroke: #d8ded9;
  stroke-dasharray: 3 4;
  stroke-width: 1;
}

.chart-grid-line.target {
  stroke: #8db6a4;
  stroke-dasharray: 5 4;
}

.chart-series-line {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.chart-series-line.coral { stroke: var(--coral); }

.chart-point-halo {
  fill: rgba(112, 93, 153, 0.15);
  opacity: 0;
  transition: opacity 150ms ease;
}

.chart-point {
  fill: white;
  stroke: var(--primary);
  stroke-width: 3;
}

.chart-point-group.coral .chart-point { stroke: var(--coral); }
.chart-point-group.coral .chart-point-halo { fill: rgba(199, 95, 74, 0.15); }

.chart-point-group:hover .chart-point-halo,
.chart-point-group:focus .chart-point-halo {
  opacity: 1;
}

.chart-point-group:focus {
  outline: none;
}

.chart-point-group:focus .chart-point {
  stroke: var(--primary-deep);
  stroke-width: 4;
}

.chart-axis-label,
.chart-date-label,
.chart-point-code {
  fill: #67736f;
  font-family: inherit;
  font-size: 8px;
}

.chart-point-code {
  fill: #304b46;
  font-size: 6.5px;
  font-weight: 900;
}

.chart-date-label.end {
  text-anchor: end;
}

.chart-data-table {
  margin-top: 7px;
  border-top: 1px solid var(--line);
}

.assessment-pattern-card,
.assessment-pattern-card > header,
.assessment-pattern-card figure {
  min-width: 0;
  max-width: 100%;
}

.chart-data-table > summary {
  min-height: 44px;
  padding: 12px 3px 8px;
  color: #315c55;
  cursor: pointer;
  font-size: 0.86rem;
  font-weight: 850;
}

.table-scroll {
  max-width: 100%;
  overflow-x: auto;
  border-radius: 10px;
}

.chart-data-table table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: white;
}

.chart-data-table caption {
  padding: 10px;
  text-align: left;
  color: var(--muted);
  font-size: 0.78rem;
}

.chart-data-table th,
.chart-data-table td {
  padding: 10px;
  text-align: left;
  vertical-align: top;
  border-top: 1px solid var(--line);
  font-size: 0.82rem;
}

.chart-data-table td:last-child span {
  display: block;
  margin-top: 4px;
}

.chart-empty {
  display: grid;
  place-items: center;
  min-height: 150px;
  margin-top: 14px;
  padding: 20px;
  color: var(--muted);
  background: #f1f3ef;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  text-align: center;
}

.progress-entry-section {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(320px, 1.3fr);
  gap: clamp(22px, 5vw, 64px);
  align-items: start;
  background: linear-gradient(140deg, var(--primary-deep), var(--primary-strong));
}

.progress-entry-section h2,
.progress-entry-section .eyebrow,
.progress-entry-intro > p {
  color: white;
}

.progress-entry-intro > p:last-of-type {
  color: #d6e7e2;
  line-height: 1.6;
}

.entry-reminder {
  margin-top: 22px;
  padding: 16px;
  color: #183d38;
  background: #e3eee9;
  border-radius: 14px;
}

.entry-reminder ul {
  margin: 9px 0 0;
  padding-left: 20px;
}

.entry-reminder li + li { margin-top: 6px; }

.progress-entry-form {
  display: grid;
  gap: 14px;
  padding: clamp(18px, 3vw, 28px);
  background: white;
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(4, 24, 20, 0.28);
}

.progress-entry-form label {
  display: grid;
  gap: 7px;
  color: #263b37;
  font-weight: 850;
}

.progress-entry-form label small {
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.35;
}

.progress-entry-form input,
.progress-entry-form select,
.progress-entry-form textarea {
  width: 100%;
}

.selected-goal-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  padding: 14px;
  background: #eef6f1;
  border: 1px solid #c8ddd1;
  border-radius: 13px;
}

.selected-goal-preview[hidden] {
  display: none;
}

.selected-goal-preview > span,
.selected-goal-preview > strong {
  grid-column: 1 / -1;
}

.selected-goal-preview > span,
.selected-goal-preview small {
  color: #567069;
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.selected-goal-preview > div {
  padding: 10px;
  background: rgba(255, 255, 255, 0.74);
  border-radius: 9px;
}

.selected-goal-preview p {
  margin: 5px 0 0;
  color: #334844;
  font-size: 0.82rem;
  line-height: 1.45;
}

.assessment-patterns {
  background: rgba(245, 221, 214, 0.18);
}

.assessment-pattern-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.assessment-pattern-card {
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-top: 4px solid var(--coral);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.assessment-pattern-card h3 {
  margin: 11px 0 5px;
}

.assessment-pattern-card header p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.assessment-pattern-card figure {
  margin: 12px 0 0;
}

.data-warning {
  padding: 9px 11px;
  color: #684417;
  background: #fff3d2;
  border-left: 4px solid var(--gold);
  font-size: 0.82rem;
}

.activity-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(320px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.activity-chart {
  position: sticky;
  top: 138px;
  margin: 0;
  padding: 20px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-soft);
}

.activity-chart > figcaption {
  font-size: 1rem;
  font-weight: 900;
}

.activity-bars {
  display: flex;
  align-items: end;
  gap: 7px;
  min-height: 230px;
  margin-top: 15px;
  padding: 18px 8px 0;
  border-bottom: 1px solid var(--line-strong);
  background: repeating-linear-gradient(to top, transparent 0 54px, #edf0ec 54px 55px);
  overflow-x: auto;
}

.activity-bar-column {
  display: grid;
  grid-template-rows: 22px 170px 28px;
  gap: 5px;
  align-items: end;
  justify-items: center;
  min-width: 38px;
  flex: 1;
}

.activity-bar-column strong,
.activity-bar-column span {
  color: var(--muted);
  font-size: 0.7rem;
}

.activity-bar-column i {
  display: block;
  width: min(100%, 30px);
  height: var(--bar-height);
  min-height: 3px;
  max-height: 170px;
  background: linear-gradient(to top, var(--primary), #4da99e);
  border-radius: 7px 7px 2px 2px;
}

.activity-timeline {
  display: grid;
  gap: 0;
  padding: 4px 0;
}

.activity-event {
  position: relative;
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  min-height: 92px;
}

.activity-event::before {
  content: "";
  position: absolute;
  top: 24px;
  bottom: -4px;
  left: 10px;
  width: 2px;
  background: var(--line);
}

.activity-event:last-child::before { display: none; }

.activity-event-marker {
  position: relative;
  z-index: 1;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  background: var(--primary-soft);
  border: 5px solid var(--primary);
  border-radius: 50%;
}

.activity-event.task .activity-event-marker { background: var(--gold-soft); border-color: #9a6d12; }
.activity-event.session .activity-event-marker { background: var(--violet-soft); border-color: var(--violet); }
.activity-event.observation .activity-event-marker { background: var(--sky-soft); border-color: var(--sky); }
.activity-event.assessment .activity-event-marker { background: var(--coral-soft); border-color: var(--coral); }

.activity-event > div {
  padding: 0 0 19px 4px;
}

.activity-event time {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.activity-event h3 {
  margin: 4px 0;
  font-size: 1rem;
}

.activity-event p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.empty-state.compact {
  min-height: 110px;
  padding: 18px;
}

@media (max-width: 980px) {
  .progress-hero,
  .progress-entry-section,
  .activity-layout {
    grid-template-columns: 1fr;
  }

  .progress-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .evidence-lane-grid,
  .assessment-pattern-grid {
    grid-template-columns: 1fr;
  }

  .activity-chart {
    position: static;
  }
}

@media (max-width: 680px) {
  .progress-hero {
    padding-top: 34px;
  }

  .period-switcher {
    position: static;
    justify-content: flex-start;
  }

  .progress-metrics {
    grid-template-columns: 1fr;
  }

  .progress-card-head,
  .goal-anchor-grid,
  .form-grid.two,
  .selected-goal-preview {
    grid-template-columns: 1fr;
  }

  .selected-goal-preview > span,
  .selected-goal-preview > strong {
    grid-column: auto;
  }

  .goal-current-value {
    text-align: left;
  }

  .anchor-arrow {
    transform: rotate(90deg);
    justify-self: center;
  }

  .trajectory-figure > figcaption,
  .assessment-pattern-card > header {
    align-items: flex-start;
    flex-direction: column;
  }

  .line-chart-shell {
    min-height: 170px;
    padding: 0;
  }

  .progress-line-chart,
  .progress-line-chart.compact {
    height: 175px;
  }
}

@media (max-width: 580px) {
  .line-chart-shell,
  .compact-chart-shell {
    min-height: 185px;
    padding-bottom: 10px;
    scrollbar-width: thin;
  }

  .line-chart-shell .progress-line-chart {
    width: 480px;
    min-width: 480px;
    height: 175px;
  }

  .chart-scroll-hint {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 5px 0 8px;
    color: #48645f;
    font-size: 0.78rem;
    font-weight: 800;
  }

  .chart-scroll-hint span {
    color: var(--primary);
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .app-body .dashboard-hero h1.long-title {
    overflow-wrap: normal;
    font-size: clamp(1.95rem, 9vw, 2.3rem);
  }

  .progress-goal-card {
    padding-inline: 14px;
  }

  .trajectory-figure {
    padding-inline: 12px;
  }
}

/* --------------------------------------------------------------------------
   Responsive usability hardening
   -------------------------------------------------------------------------- */

:root {
  --shadow-strong: 0 18px 44px rgba(63, 43, 84, 0.16);
}

.mobile-nav-dock {
  display: none;
}

html:not(.js) .mobile-nav-dock {
  display: none;
}

.quick-navigator[open] {
  display: flex;
  flex-direction: column;
  max-height: calc(100dvh - 36px);
  overflow: hidden;
}

.quick-navigator[open] .quick-results {
  min-height: 0;
  flex: 1;
  max-height: none;
}

.message [data-dismiss-message],
.filter-pills button,
.view-switcher button,
.profile-section-nav a,
.period-switcher a,
.site-nav a {
  min-height: 44px;
}

.soft-link {
  min-height: 44px;
}

.permission-list label {
  min-height: 44px;
}

.status-chip,
.row-card strong,
.row-card small,
.document-card strong,
.document-card small,
.session-row strong,
.session-row small {
  min-width: 0;
  overflow-wrap: anywhere;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}

.auth-form :where(input, select, textarea):focus-visible,
.answer-text :where(input, textarea):focus-visible,
.quick-search input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px #fff;
}

.progress-entry-form :where(input:not([type="hidden"]), select, textarea) {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fcfdf9;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
}

.progress-entry-form textarea {
  min-height: 120px;
  resize: vertical;
}

.progress-entry-form :where(input, select, textarea):focus-visible {
  border-color: var(--primary);
}

.profile-action-disclosure {
  flex: 1 1 100%;
}

.profile-action-disclosure > summary {
  width: max-content;
  list-style: none;
}

.profile-action-disclosure > summary::-webkit-details-marker {
  display: none;
}

.profile-action-disclosure > summary span {
  display: inline-block;
  margin-left: 8px;
  font-size: 1.15rem;
  line-height: 1;
}

.profile-action-disclosure[open] > summary span {
  transform: rotate(45deg);
}

.profile-action-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding-top: 10px;
}

.calendar-legend {
  display: flex;
  min-width: 0;
  max-width: 100%;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.calendar-legend span {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.practitioner-main {
  min-width: 0;
}

.chart-data-table {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
}

.table-scroll {
  width: 100%;
  min-width: 0;
  contain: inline-size;
}

.activity-layout,
.activity-chart,
.activity-timeline {
  min-width: 0;
  max-width: 100%;
}

@media (max-width: 980px) {
  .activity-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}

.calendar-event small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 750;
  line-height: 1.25;
}

.answer-options.scale-options > div {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.answer-options.scale-options label {
  min-width: 0;
  justify-content: center;
  padding-inline: 6px;
}

@media (max-width: 1280px) {
  .practitioner-shell {
    grid-template-columns: 1fr;
  }

  .care-plan-grid,
  .care-plan-forms {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .care-plan-grid .preference-panel,
  .care-plan-forms > :last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1080px) {
  .care-plan-grid,
  .care-plan-forms {
    grid-template-columns: 1fr;
  }

  .care-plan-grid .preference-panel,
  .care-plan-forms > :last-child {
    grid-column: auto;
  }
}

@media (max-width: 1120px) {
  .js .app-sidebar {
    visibility: hidden;
    pointer-events: none;
    transition: transform 180ms ease, visibility 0s linear 180ms;
  }

  .js .nav-open .app-sidebar {
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }
}

@media (max-width: 780px) {
  .session-calendar {
    display: flex;
    width: 100%;
    max-width: 100%;
    gap: 10px;
    margin-inline: -8px;
    padding: 3px 8px 12px;
    overflow-x: auto;
    scroll-padding-inline: 8px;
    scroll-snap-type: x proximity;
  }

  .calendar-day {
    min-width: min(78vw, 260px);
    min-height: 132px;
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .calendar-day.empty {
    min-width: 132px;
  }

  .client-row,
  .session-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .client-row em,
  .session-row em {
    grid-column: 2;
    justify-self: start;
  }

  .document-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .document-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .app-main {
    min-height: calc(100vh - 62px);
    min-height: calc(100dvh - 62px);
  }

  .has-mobile-nav .app-frame {
    padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }

  .has-mobile-nav .nav-toggle {
    display: none;
  }

  .mobile-nav-dock {
    position: fixed;
    right: 10px;
    bottom: max(8px, env(safe-area-inset-bottom));
    left: 10px;
    z-index: 50;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(0, 1fr);
    gap: 3px;
    min-height: 66px;
    padding: 5px;
    background: rgba(252, 250, 252, 0.97);
    border: 1px solid var(--primary-soft-strong);
    border-radius: 18px;
    box-shadow: 0 14px 40px rgba(46, 31, 59, 0.22);
    backdrop-filter: blur(18px);
  }

  .mobile-nav-dock a,
  .mobile-nav-dock button {
    position: relative;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 3px;
    min-width: 0;
    min-height: 54px;
    padding: 4px 2px;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 13px;
    cursor: pointer;
    font: inherit;
    font-size: 0.66rem;
    font-weight: 850;
    text-decoration: none;
  }

  .mobile-nav-dock a[aria-current="page"],
  .mobile-nav-dock button[aria-current="page"] {
    color: var(--primary-strong);
    background: var(--primary-soft);
  }

  .mobile-nav-dock svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
  }

  .mobile-nav-badge {
    position: absolute;
    top: 3px;
    left: calc(50% + 7px);
    display: grid;
    place-items: center;
    min-width: 17px;
    height: 17px;
    padding-inline: 4px;
    color: #fff;
    background: #9f3526;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.58rem;
    line-height: 1;
  }

  .app-topbar {
    padding-inline: 14px;
  }

  .topbar-actions {
    gap: 7px;
  }

  .period-switcher {
    top: 62px;
  }

  .auth-shell.story .auth-panel {
    order: -1;
  }

  .auth-shell.story .auth-story {
    min-height: 230px;
  }

  .site-header {
    position: sticky;
    align-items: center;
    flex-direction: row;
    gap: 10px;
    padding: 12px 14px;
  }

  .site-nav {
    flex-wrap: nowrap;
    justify-content: flex-end;
    gap: 6px;
  }

  .site-nav a {
    padding-inline: 10px;
  }

  .metric-strip:not(.progress-metrics) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metric-tile {
    min-height: 94px;
    padding: 15px;
  }

  .progress-toolbar .filter-pills {
    flex-wrap: nowrap;
    padding: 2px 1px 7px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
  }

  .progress-toolbar .filter-pills button {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .profile-action-disclosure > summary,
  .profile-action-links .button {
    width: 100%;
  }

  .priority-list > a strong,
  .priority-list > a small {
    display: block;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .result-panel {
    min-height: auto;
  }

  .quick-navigator[open] {
    max-height: calc(100dvh - 20px);
  }
}

@media (max-width: 350px) {
  .site-header {
    position: static;
    align-items: flex-start;
    flex-direction: column;
  }

  .site-nav {
    justify-content: flex-start;
  }
}

/* Practitioner workspace v2 -------------------------------------------------
   Kept as one final component layer so older dashboard rules cannot reverse
   laptop and phone breakpoints. */

.practitioner-dashboard,
.practitioner-directory,
.session-form-page {
  --workspace-primary: var(--primary);
  --workspace-navy: var(--primary-deep);
  --workspace-cream: #fffdf7;
  position: relative;
  min-width: 0;
  overflow: clip;
  background:
    radial-gradient(circle at 92% 3%, rgba(61, 127, 156, 0.13), transparent 24rem),
    radial-gradient(circle at 4% 30%, rgba(112, 93, 153, 0.1), transparent 22rem),
    linear-gradient(180deg, #faf8fb 0%, #f5f1f7 52%, #f8f5ed 100%);
}

.practitioner-dashboard::before,
.practitioner-directory::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  pointer-events: none;
  opacity: 0.45;
  background-image: radial-gradient(rgba(112, 93, 153, 0.13) 0.7px, transparent 0.7px);
  background-size: 22px 22px;
  mask-image: linear-gradient(to bottom, black, transparent 42%);
}

.practitioner-dashboard > *,
.practitioner-directory > * {
  position: relative;
  z-index: 1;
}

.practitioner-dashboard svg,
.practitioner-directory svg,
.session-form-page svg,
.session-dialog svg,
.hero-actions .button svg,
.session-hero .button svg {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.practitioner-dashboard .button,
.practitioner-directory .button,
.session-form-page .button,
.session-hero .button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.app-body .practitioner-hero-v2 {
  margin: 0;
  padding: clamp(22px, 4vw, 48px) var(--page-pad) 28px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 18%, rgba(255, 255, 255, 0.92) 0 5rem, transparent 5.1rem),
    linear-gradient(125deg, #ece6f2 0%, #faf7ed 48%, #e3f1ed 100%);
  border: 0;
  border-bottom: 1px solid rgba(63, 43, 84, 0.12);
  border-radius: 0 0 28px 28px;
  box-shadow: 0 18px 44px rgba(23, 61, 75, 0.08);
}

.practitioner-hero-v2::after {
  position: absolute;
  top: -90px;
  right: -55px;
  width: 290px;
  height: 290px;
  content: "";
  background:
    linear-gradient(90deg, rgba(112, 93, 153, 0.16) 1px, transparent 1px),
    linear-gradient(rgba(112, 93, 153, 0.16) 1px, transparent 1px);
  background-size: 28px 28px;
  border-radius: 50%;
  transform: rotate(12deg);
  mask-image: radial-gradient(circle, black, transparent 70%);
}

.practitioner-hero-v2 .hero-panel {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, 0.65fr);
  gap: clamp(20px, 4vw, 52px);
  align-items: center;
}

.practitioner-hero-copy {
  min-width: 0;
}

.practitioner-hero-copy .eyebrow,
.directory-hero .eyebrow,
.session-form-hero .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--primary-strong);
}

.practitioner-hero-copy .eyebrow svg,
.directory-hero .eyebrow svg,
.session-form-hero .eyebrow svg {
  width: 17px;
  height: 17px;
}

.app-body .practitioner-hero-v2 h1 {
  max-width: 780px;
  font-size: clamp(2.7rem, 6vw, 5.8rem);
  line-height: 0.92;
  letter-spacing: -0.045em;
}

.practitioner-hero-copy > p:not(.eyebrow) {
  max-width: 690px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.55;
}

.practitioner-hero-actions {
  margin-top: 24px;
}

.practitioner-next-session {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  min-width: 0;
  min-height: 142px;
  padding: 20px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid rgba(112, 93, 153, 0.22);
  border-top: 0;
  border-radius: 20px;
  box-shadow: 0 18px 44px rgba(63, 43, 84, 0.14);
  text-decoration: none;
  backdrop-filter: blur(16px);
}

.practitioner-next-session::before {
  position: absolute;
  top: 0;
  right: 18px;
  left: 18px;
  height: 4px;
  content: "";
  background: linear-gradient(90deg, var(--primary), var(--gold), var(--sky));
  border-radius: 0 0 5px 5px;
}

.hero-aside-icon,
.panel-icon,
.attention-item-icon,
.metric-icon,
.signal-shortcut-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.hero-aside-icon {
  width: 48px;
  height: 48px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-deep));
  border-radius: 15px;
  box-shadow: 0 9px 20px rgba(63, 43, 84, 0.24);
}

.practitioner-next-session > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 5px;
}

.practitioner-next-session small {
  color: var(--primary);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.practitioner-next-session strong,
.practitioner-next-session span span {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.practitioner-next-session strong {
  font-size: 1.08rem;
}

.practitioner-next-session span span {
  color: var(--muted);
  font-size: 0.85rem;
}

.hero-aside-arrow,
.row-arrow,
.metric-arrow {
  width: 18px !important;
  height: 18px !important;
}

.practitioner-next-session:hover,
.practitioner-next-session:focus-visible {
  border-color: rgba(112, 93, 153, 0.52);
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(63, 43, 84, 0.18);
}

.practitioner-attention,
.pinned-client-section,
.signal-shortcuts,
.recent-session-section,
.client-directory-results,
.session-results {
  padding: var(--section-pad) var(--page-pad) 0;
}

.practitioner-attention .dashboard-section-heading,
.pinned-client-section .dashboard-section-heading,
.signal-shortcuts .dashboard-section-heading,
.recent-session-section .dashboard-section-heading,
.client-directory-results .dashboard-section-heading,
.session-results .dashboard-section-heading,
.clinic-directory .dashboard-section-heading {
  padding: 0 0 18px;
}

.attention-total {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  color: #842f23;
  background: #fae2dc;
  border: 1px solid rgba(199, 95, 74, 0.25);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 900;
}

.attention-total.clear {
  color: #22613b;
  background: #e1f0e5;
  border-color: rgba(47, 122, 69, 0.22);
}

.attention-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 14px;
}

.attention-panel {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(41, 78, 70, 0.13);
  border-radius: 20px;
  box-shadow: 0 12px 32px rgba(30, 60, 52, 0.07);
  backdrop-filter: blur(10px);
}

.attention-panel.overdue-panel {
  background:
    linear-gradient(180deg, rgba(250, 226, 220, 0.62), rgba(255, 255, 255, 0.94) 38%);
  border-color: rgba(199, 95, 74, 0.22);
}

.attention-panel > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}

.panel-icon {
  width: 40px;
  height: 40px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 12px;
}

.panel-icon.coral {
  color: #8a382b;
  background: var(--coral-soft);
}

.panel-icon.gold {
  color: #725411;
  background: var(--gold-soft);
}

.panel-icon.violet {
  color: #354d80;
  background: var(--violet-soft);
}

.panel-icon.sky {
  color: #285c74;
  background: var(--sky-soft);
}

.attention-panel > header > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attention-panel header small,
.session-editor-panel header small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.attention-panel h3 {
  margin: 0;
  font-size: 1.02rem;
}

.attention-panel > header > strong {
  display: grid;
  place-items: center;
  min-width: 34px;
  height: 34px;
  color: #35514b;
  background: #edf3ef;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
}

.attention-list {
  display: grid;
  gap: 7px;
}

.attention-list > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 66px;
  padding: 9px;
  color: var(--ink);
  background: rgba(249, 251, 247, 0.92);
  border: 1px solid #e2e9e3;
  border-radius: 13px;
  text-decoration: none;
}

.attention-list > a:hover,
.attention-list > a:focus-visible {
  background: #fff;
  border-color: #abcabd;
  box-shadow: 0 8px 18px rgba(22, 33, 31, 0.07);
}

.attention-item-icon {
  width: 34px;
  height: 34px;
  color: #285c74;
  background: var(--sky-soft);
  border-radius: 10px;
}

.attention-item-icon.task {
  color: #725411;
  background: var(--gold-soft);
}

.attention-item-icon.assessment {
  color: #354d80;
  background: var(--violet-soft);
}

.attention-item-icon svg {
  width: 17px;
  height: 17px;
}

.attention-list > a > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.attention-list > a small,
.attention-list > a strong,
.attention-list > a em {
  overflow: hidden;
  text-overflow: ellipsis;
}

.attention-list > a small {
  white-space: nowrap;
}

.attention-list > a strong,
.attention-list > a em {
  display: -webkit-box;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.attention-list > a small {
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.attention-list > a strong {
  font-size: 0.83rem;
}

.attention-list > a em {
  color: var(--muted);
  font-size: 0.71rem;
  font-style: normal;
}

.calm-empty {
  display: flex;
  gap: 11px;
  align-items: center;
  min-height: 86px;
  padding: 14px;
  color: #34534c;
  background: #f1f6f1;
  border: 1px dashed #bfd1c5;
  border-radius: 14px;
}

.calm-empty > svg {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  color: var(--success);
}

.calm-empty span {
  display: grid;
  gap: 3px;
}

.calm-empty small {
  color: var(--muted);
  line-height: 1.4;
}

.app-body .practitioner-metrics-v2 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding-top: var(--section-pad);
}

.app-body .practitioner-metrics-v2 .metric-tile {
  min-width: 0;
  min-height: 132px;
  padding: 17px;
}

.metric-link {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
  transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.metric-link::after {
  position: absolute;
  right: -28px;
  bottom: -42px;
  width: 110px;
  height: 110px;
  content: "";
  background: currentColor;
  border-radius: 50%;
  opacity: 0.055;
}

.metric-link:hover,
.metric-link:focus-visible {
  transform: translateY(-3px);
  border-color: var(--primary-soft-strong);
  box-shadow: 0 18px 38px rgba(63, 43, 84, 0.14);
}

.metric-icon {
  width: 47px;
  height: 47px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 14px;
}

.metric-link.sky .metric-icon {
  color: #285c74;
  background: var(--sky-soft);
}

.metric-link.gold .metric-icon {
  color: #725411;
  background: var(--gold-soft);
}

.metric-link.violet .metric-icon {
  color: #354d80;
  background: var(--violet-soft);
}

.metric-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.app-body .metric-link .metric-copy > span {
  color: #475c57;
  font-size: clamp(0.82rem, 1.2vw, 0.94rem);
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

.app-body .metric-link .metric-copy > strong {
  margin: 2px 0 0;
  font-size: clamp(1.9rem, 3.2vw, 2.8rem);
  line-height: 1;
  white-space: nowrap;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}

.app-body .metric-link .metric-copy > small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 900;
  text-decoration: none;
}

.section-link svg {
  width: 17px;
  height: 17px;
}

.pinned-client-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(300px, 1fr);
  gap: 14px;
  padding: 2px 2px 12px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scroll-padding-inline: 2px;
  scroll-snap-type: x proximity;
}

.pinned-client-rail > * {
  scroll-snap-align: start;
}

.client-card-v2 {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d9e2db;
  border-top: 4px solid var(--card-tone, var(--teal));
  border-radius: 18px;
  box-shadow: 0 11px 28px rgba(28, 61, 54, 0.08);
}

.client-card-v2.tone-coral { --card-tone: var(--coral); --card-soft: var(--coral-soft); }
.client-card-v2.tone-gold { --card-tone: #b4831f; --card-soft: var(--gold-soft); }
.client-card-v2.tone-violet { --card-tone: var(--violet); --card-soft: var(--violet-soft); }
.client-card-v2.tone-sky { --card-tone: var(--sky); --card-soft: var(--sky-soft); }
.client-card-v2.tone-olive { --card-tone: var(--moss); --card-soft: var(--moss-soft); }
.client-card-v2.tone-teal { --card-tone: var(--teal); --card-soft: var(--teal-soft); }

.client-card-v2 > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 15px 15px 11px;
}

.client-card-identity {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.client-card-avatar,
.client-chip-avatar {
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(145deg, var(--card-tone, var(--teal)), #294f5b);
  font-weight: 950;
}

.client-card-avatar {
  width: 47px;
  height: 47px;
  border-radius: 14px;
  box-shadow: 0 7px 18px color-mix(in srgb, var(--card-tone, var(--teal)) 22%, transparent);
}

.client-card-identity > span:last-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.client-card-identity strong,
.client-card-identity small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.client-card-identity strong {
  font-size: 1.02rem;
}

.client-card-identity small {
  color: var(--muted);
  font-size: 0.78rem;
}

.pin-button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #687773;
  background: #f5f7f3;
  border: 1px solid #dbe2dc;
  border-radius: 12px;
  cursor: pointer;
}

.pin-button.active {
  color: #7a5710;
  background: var(--gold-soft);
  border-color: rgba(180, 131, 31, 0.36);
}

.pin-button.active svg {
  fill: currentColor;
}

.pin-button:hover,
.pin-button:focus-visible {
  color: #725411;
  background: #fff4cc;
  border-color: #c5a04c;
}

.client-session-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 59px;
  margin: 0 15px;
  padding: 10px 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--card-soft, var(--teal-soft)) 54%, white);
  border: 1px solid color-mix(in srgb, var(--card-tone, var(--teal)) 17%, white);
  border-radius: 12px;
  text-decoration: none;
}

.client-session-summary > span:first-child {
  display: grid;
  gap: 2px;
}

.client-session-summary small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
}

.client-session-summary strong {
  font-size: 0.8rem;
}

.client-session-summary time,
.client-session-summary > .status-chip {
  flex: 0 0 auto;
  color: #31524b;
  font-size: 0.7rem;
  font-weight: 900;
  white-space: nowrap;
}

.client-signal-links {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 5px;
  padding: 11px 15px;
}

.client-signal-links a {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 48px;
  padding: 5px 2px;
  color: #63706d;
  background: #f7f8f5;
  border: 1px solid #e2e6e1;
  border-radius: 10px;
  font-size: 0.63rem;
  font-weight: 850;
  text-decoration: none;
}

.client-signal-links a span {
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 950;
  font-variant-numeric: tabular-nums;
}

.client-signal-links a:hover,
.client-signal-links a:focus-visible {
  color: var(--primary-strong);
  background: var(--primary-wash);
  border-color: var(--primary-soft-strong);
}

.client-card-v2 > footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 15px 14px;
  border-top: 1px solid #edf0ec;
}

.client-open-link,
.client-schedule-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  color: var(--primary);
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.client-open-link svg,
.client-schedule-link svg {
  width: 16px;
  height: 16px;
}

.client-schedule-link {
  padding: 8px 10px;
  color: #354d80;
  background: var(--violet-soft);
}

.pinned-empty,
.directory-empty {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 104px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px dashed #baccc1;
  border-radius: 18px;
}

.pinned-empty > span:nth-child(2),
.directory-empty > span:nth-child(2) {
  display: grid;
  flex: 1;
  gap: 4px;
}

.pinned-empty small,
.directory-empty small {
  color: var(--muted);
}

.signal-shortcuts .dashboard-section-heading > p {
  max-width: 400px;
  text-align: right;
}

.signal-shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.signal-shortcut {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  min-height: 96px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid #dce3dd;
  border-radius: 15px;
  box-shadow: 0 8px 20px rgba(28, 61, 54, 0.06);
  text-decoration: none;
}

.signal-shortcut > .row-arrow {
  display: none;
}

.signal-shortcut-icon {
  width: 38px;
  height: 38px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 11px;
}

.signal-shortcut.coral .signal-shortcut-icon { color: #8a382b; background: var(--coral-soft); }
.signal-shortcut.gold .signal-shortcut-icon { color: #725411; background: var(--gold-soft); }
.signal-shortcut.violet .signal-shortcut-icon { color: #354d80; background: var(--violet-soft); }
.signal-shortcut.sky .signal-shortcut-icon { color: #285c74; background: var(--sky-soft); }

.signal-shortcut > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.signal-shortcut strong {
  font-size: 1.45rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.signal-shortcut span span {
  overflow: hidden;
  font-size: 0.72rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-shortcut small {
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.signal-shortcut:hover,
.signal-shortcut:focus-visible {
  border-color: #b6a6c8;
  transform: translateY(-2px);
  box-shadow: 0 13px 28px rgba(63, 43, 84, 0.12);
}

.practitioner-calendar-section {
  margin: var(--section-pad) var(--page-pad) 0;
  padding: clamp(18px, 3vw, 28px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid #d5dfd7;
  border-radius: 22px;
  box-shadow: 0 18px 42px rgba(25, 61, 53, 0.09);
}

.calendar-command-bar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.calendar-command-bar h2 {
  font-size: clamp(1.8rem, 3vw, 2.65rem);
}

.calendar-command-bar > div > p:last-child {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.calendar-period-nav {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 4px;
  background: #f0f4ef;
  border: 1px solid #dce4dd;
  border-radius: 13px;
}

.calendar-period-nav a {
  display: inline-grid;
  place-items: center;
  min-width: 40px;
  min-height: 44px;
  padding: 7px 10px;
  color: #34524c;
  background: transparent;
  border-radius: 9px;
  font-size: 0.78rem;
  font-weight: 900;
  text-decoration: none;
}

.calendar-period-nav a:hover,
.calendar-period-nav a:focus-visible {
  background: #fff;
  box-shadow: 0 4px 12px rgba(24, 62, 53, 0.08);
}

.calendar-client-tray {
  display: grid;
  grid-template-columns: minmax(240px, 0.55fr) minmax(0, 1.45fr);
  gap: 14px;
  align-items: center;
  margin-bottom: 15px;
  padding: 12px;
  background:
    linear-gradient(110deg, rgba(216, 235, 230, 0.7), rgba(219, 234, 240, 0.62));
  border: 1px solid #cbded6;
  border-radius: 16px;
}

.calendar-client-tray-copy {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.calendar-client-tray-copy > span:last-child {
  display: grid;
  gap: 3px;
}

.calendar-client-tray-copy small {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.35;
}

.calendar-client-list {
  display: flex;
  gap: 7px;
  min-width: 0;
  padding: 2px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
}

.calendar-client-chip {
  --card-tone: var(--teal);
  display: grid;
  grid-template-columns: auto minmax(70px, 1fr) auto auto;
  gap: 7px;
  align-items: center;
  min-width: 246px;
  min-height: 49px;
  padding: 5px 7px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid #cfdbd3;
  border-radius: 12px;
  scroll-snap-align: start;
}

.calendar-client-chip.tone-coral { --card-tone: var(--coral); }
.calendar-client-chip.tone-gold { --card-tone: #b4831f; }
.calendar-client-chip.tone-violet { --card-tone: var(--violet); }
.calendar-client-chip.tone-sky { --card-tone: var(--sky); }
.calendar-client-chip.tone-olive { --card-tone: var(--moss); }
.calendar-client-chip.tone-teal { --card-tone: var(--teal); }

.calendar-client-chip.is-dragging {
  opacity: 0.48;
  cursor: grabbing;
}

.client-chip-avatar {
  width: 34px;
  height: 34px;
  border-radius: 10px;
}

.calendar-client-chip > a {
  display: flex;
  align-items: center;
  min-height: 44px;
  overflow: hidden;
  color: #294740;
  font-size: 0.76rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-decoration: none;
}

.calendar-client-chip > .client-chip-schedule {
  justify-content: center;
  min-width: 76px;
  min-height: 44px;
  padding: 5px 8px;
  color: #354d80;
  background: var(--violet-soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 0.67rem;
  font-weight: 900;
  white-space: nowrap;
  text-decoration: none;
}

.drag-handle {
  display: grid;
  place-items: center;
  width: 24px;
  color: #77847f;
  cursor: grab;
}

.drag-handle svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
  stroke: none;
}

.session-calendar-v2 {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  gap: 8px;
}

.session-calendar-v2 .calendar-day {
  min-width: 0;
  min-height: 166px;
  padding: 9px;
  background: #fafcf9;
  border-color: #dde5df;
  transition: background-color 120ms ease, border-color 120ms ease, transform 120ms ease;
}

.session-calendar-v2 .calendar-day.today {
  background: var(--primary-soft);
  border-color: #9d8bb5;
  box-shadow: inset 0 0 0 2px rgba(112, 93, 153, 0.14);
}

.session-calendar-v2 .calendar-day.is-drop-target {
  background: #fff8dc;
  border-color: #b88a2c;
  transform: translateY(-3px);
  box-shadow: 0 12px 24px rgba(107, 77, 15, 0.13);
}

.session-calendar-v2 .calendar-day > header {
  min-height: 38px;
}

.session-calendar-v2 .calendar-day time {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.day-add-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid var(--primary-soft-strong);
  border-radius: 10px;
  cursor: pointer;
  text-decoration: none;
}

.day-add-button svg {
  width: 16px;
  height: 16px;
}

.calendar-event-wrap {
  position: relative;
  min-width: 0;
}

.session-calendar-v2 .calendar-event {
  min-width: 0;
  min-height: 62px;
  padding: 8px 30px 8px 9px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-soft), #faf7ed);
  border-color: var(--primary-soft-strong);
  border-left: 4px solid var(--primary);
  border-radius: 10px;
}

.calendar-event-wrap.tone-teal .calendar-event {
  background: linear-gradient(135deg, #e8f3ee, #f6f2df);
  border-color: #c7dcd1;
  border-left-color: var(--teal);
}

.calendar-event-wrap.tone-coral .calendar-event {
  background: linear-gradient(135deg, #fae9e4, #fff8ee);
  border-color: #e7c4ba;
}

.calendar-event-wrap.tone-gold .calendar-event {
  background: linear-gradient(135deg, #f8edc9, #fffaf0);
  border-color: #dec986;
}

.calendar-event-wrap.tone-violet .calendar-event {
  background: linear-gradient(135deg, #eee7f7, #faf7fd);
  border-color: #d0c0e4;
}

.calendar-event-wrap.tone-sky .calendar-event {
  background: linear-gradient(135deg, #e1f0f5, #f5fbfc);
  border-color: #bdd7df;
}

.calendar-event-wrap.tone-olive .calendar-event {
  background: linear-gradient(135deg, #e9efdf, #f8faf3);
  border-color: #cad7b8;
}

.session-calendar-v2 .calendar-event[draggable="true"] {
  cursor: grab;
}

.session-calendar-v2 .calendar-event.is-dragging {
  opacity: 0.45;
  cursor: grabbing;
}

.session-calendar-v2 .calendar-event time,
.session-calendar-v2 .calendar-event strong,
.session-calendar-v2 .calendar-event small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.calendar-event-status {
  display: inline-flex;
  width: fit-content;
  padding: 2px 6px;
  color: #40534e;
  background: #edf1ee;
  border-radius: 999px;
  font-size: 0.61rem;
  font-weight: 900;
  line-height: 1.35;
}

.calendar-event-status.status-canceled {
  color: #7f3f46;
  background: #f9e6e8;
}

.calendar-event-status.status-completed {
  color: #285e51;
  background: #dbefe6;
}

.calendar-event-status.in-progress {
  color: #5a4610;
  background: #f7e8b5;
}

.session-calendar-v2 .calendar-event time {
  color: #315c51;
  font-size: 0.68rem;
  font-weight: 900;
}

.session-calendar-v2 .calendar-event strong {
  margin-top: 2px;
  font-size: 0.76rem;
}

.calendar-event-wrap.canceled {
  opacity: 0.65;
}

.calendar-edit-link {
  position: absolute;
  top: 5px;
  right: 5px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #37534d;
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(55, 83, 77, 0.15);
  border-radius: 8px;
}

.calendar-session-drag {
  position: absolute;
  right: 7px;
  bottom: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: #60716c;
  cursor: grab;
}

.calendar-session-drag svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  stroke: none;
}

.calendar-event-wrap.is-dragging {
  opacity: 0.5;
}

.calendar-edit-link svg {
  width: 14px;
  height: 14px;
}

.calendar-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 14px;
  padding-top: 13px;
  color: var(--muted);
  border-top: 1px solid #e4e9e4;
  font-size: 0.78rem;
}

.calendar-footer span,
.calendar-footer a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.calendar-footer a {
  min-height: 44px;
  color: var(--primary);
  font-weight: 900;
  text-decoration: none;
}

.calendar-footer svg {
  width: 16px;
  height: 16px;
}

.recent-session-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: var(--section-pad);
}

.recent-session-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 86px;
  padding: 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #dae2dc;
  border-radius: 15px;
  box-shadow: 0 8px 22px rgba(25, 61, 53, 0.06);
  text-decoration: none;
}

.recent-session-date {
  display: grid;
  place-items: center;
  width: 48px;
  height: 56px;
  color: #31574e;
  background: #e3f0ea;
  border-radius: 12px;
}

.recent-session-date strong {
  font-size: 1.25rem;
  line-height: 1;
}

.recent-session-date small {
  font-size: 0.68rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recent-session-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.recent-session-card > span:nth-child(2) > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-session-card > span:nth-child(2) > small {
  color: var(--primary);
  font-size: 0.65rem;
  font-weight: 900;
  text-transform: uppercase;
}

.recent-session-card > span:nth-child(2) > span {
  color: var(--muted);
  font-size: 0.76rem;
}

/* Practitioner client and session directories */

.directory-hero,
.session-form-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(34px, 6vw, 76px) var(--page-pad) 34px;
  background:
    radial-gradient(circle at 84% 15%, rgba(255, 255, 255, 0.85), transparent 13rem),
    linear-gradient(125deg, #ece6f2, #faf7ed 52%, #e3f1ed);
  border-bottom: 1px solid rgba(112, 93, 153, 0.15);
  border-radius: 0 0 28px 28px;
}

.directory-hero > div:first-child,
.session-form-hero > div:first-child {
  max-width: 800px;
}

.directory-hero h1,
.session-form-hero h1 {
  font-size: clamp(2.5rem, 5.8vw, 5.4rem);
  line-height: 0.95;
  letter-spacing: -0.045em;
}

.directory-hero > div:first-child > p:last-child,
.session-form-hero > div:first-child > p:last-child {
  max-width: 700px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.55;
}

.directory-hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 9px;
}

.directory-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: var(--section-pad) var(--page-pad) 0;
}

.directory-summary a {
  display: grid;
  gap: 3px;
  min-height: 96px;
  padding: 15px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d7e0d9;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(25, 61, 53, 0.06);
  text-decoration: none;
}

.directory-summary a[aria-current="page"],
.directory-summary a:hover,
.directory-summary a:focus-visible {
  background: var(--primary-soft);
  border-color: #b6a6c8;
}

.directory-summary a.coral[aria-current="page"],
.directory-summary a.coral:hover {
  background: #fbeae5;
  border-color: #d99788;
}

.directory-summary strong {
  font-size: 2rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.directory-summary span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}

.clinic-directory {
  padding: var(--section-pad) var(--page-pad) 0;
}

.clinic-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
}

.clinic-summary-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 94px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d6e1db;
  border-radius: 16px;
  text-decoration: none;
}

.clinic-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #285c74;
  background: var(--sky-soft);
  border-radius: 14px;
}

.clinic-summary-card > span:nth-child(2) {
  display: grid;
  min-width: 0;
  gap: 4px;
}

.clinic-summary-card > span:nth-child(2) strong,
.clinic-summary-card > span:nth-child(2) small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.clinic-summary-card > span:nth-child(2) small {
  color: var(--muted);
  font-size: 0.76rem;
}

.clinic-session-count {
  display: grid;
  justify-items: end;
  color: #244f62;
  font-size: 1.3rem;
  font-weight: 950;
}

.clinic-session-count small {
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 800;
}

.client-filter-panel {
  margin: var(--section-pad) var(--page-pad) 0;
  padding: 18px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d5dfd8;
  border-radius: 20px;
  box-shadow: 0 12px 30px rgba(25, 61, 53, 0.07);
}

.filter-panel-heading {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}

.filter-panel-heading > span:last-child {
  display: grid;
}

.filter-panel-heading .eyebrow {
  margin: 0 0 3px;
}

.filter-panel-heading h2 {
  font-size: 1.45rem;
}

.client-filter-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 11px;
  align-items: end;
}

.client-filter-form label,
.session-editor-grid label,
.session-dialog-grid label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #38534d;
  font-size: 0.76rem;
  font-weight: 900;
}

.client-filter-form input,
.client-filter-form select,
.session-editor-grid input,
.session-editor-grid select,
.session-editor-grid textarea,
.session-dialog-grid input,
.session-dialog-grid select {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 10px 11px;
  color: var(--ink);
  background: #fbfcf9;
  border: 1px solid #cbd7cf;
  border-radius: 11px;
}

.client-filter-form .span-two,
.session-editor-grid .span-two,
.session-dialog-grid .span-two {
  grid-column: span 2;
}

.filter-input-wrap {
  position: relative;
  display: block;
}

.filter-input-wrap svg {
  position: absolute;
  top: 50%;
  left: 12px;
  width: 18px;
  height: 18px;
  color: #71807b;
  transform: translateY(-50%);
}

.filter-input-wrap input {
  padding-left: 39px;
}

.filter-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-card-directory-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 22px 0 var(--section-pad);
}

.pagination a,
.pagination span {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 10px;
  font-size: 0.8rem;
  font-weight: 900;
}

.pagination a {
  color: var(--primary-strong);
  background: var(--primary-soft);
  text-decoration: none;
}

.session-directory-list {
  display: grid;
  gap: 9px;
  padding-bottom: var(--section-pad);
}

.session-directory-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #d8e1da;
  border-left: 5px solid var(--primary);
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(25, 61, 53, 0.055);
}

.session-directory-row.completed { border-left-color: var(--success); }
.session-directory-row.canceled { border-left-color: var(--coral); opacity: 0.75; }
.session-directory-row.overdue { border-left-color: #b78119; background: #fffdf5; }

.session-directory-main {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  color: var(--ink);
  text-decoration: none;
}

.session-date-block {
  display: grid;
  place-items: center;
  width: 55px;
  min-height: 64px;
  padding: 6px;
  color: #285c54;
  background: #e2f0e9;
  border-radius: 12px;
}

.session-date-block strong {
  font-size: 1.35rem;
  line-height: 1;
}

.session-date-block span,
.session-date-block small {
  font-size: 0.64rem;
  font-weight: 900;
  text-transform: uppercase;
}

.session-directory-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.session-directory-copy > * {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.session-directory-copy small {
  color: var(--primary);
  font-size: 0.7rem;
  font-weight: 900;
}

.session-directory-copy strong {
  font-size: 1rem;
}

.session-directory-copy span {
  color: var(--muted);
  font-size: 0.78rem;
}

.session-row-edit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 11px;
  color: #354d80;
  background: var(--violet-soft);
  border-radius: 10px;
  font-size: 0.76rem;
  font-weight: 900;
  text-decoration: none;
}

.session-row-edit svg {
  width: 16px;
  height: 16px;
}

/* Session forms and confirmation dialogs */

.session-form-page {
  min-height: calc(100vh - 62px);
}

.session-form-hero {
  padding-top: clamp(30px, 5vw, 60px);
}

.session-editor {
  display: grid;
  gap: 14px;
  padding: var(--section-pad) var(--page-pad);
}

.session-editor-panel {
  padding: clamp(16px, 3vw, 24px);
  background: rgba(255, 255, 255, 0.93);
  border: 1px solid #d5dfd8;
  border-radius: 20px;
  box-shadow: 0 10px 28px rgba(25, 61, 53, 0.07);
}

.session-editor-panel > header {
  display: flex;
  gap: 11px;
  align-items: center;
  margin-bottom: 16px;
}

.session-editor-panel > header > span:last-child {
  display: grid;
}

.session-editor-panel h2 {
  font-size: 1.45rem;
}

.session-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 13px;
}

.session-editor-grid textarea {
  min-height: 116px;
  resize: vertical;
}

.session-editor-grid label > small {
  color: var(--muted);
  font-weight: 600;
}

.session-editor-grid .errorlist,
.session-dialog-grid .errorlist {
  margin: 0;
  padding: 0;
  color: var(--danger);
  list-style: none;
  font-size: 0.72rem;
}

.session-editor-actions {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 12px;
  background: rgba(250, 251, 247, 0.92);
  border: 1px solid #d1dcd4;
  border-radius: 16px;
  box-shadow: 0 12px 30px rgba(20, 55, 48, 0.12);
  backdrop-filter: blur(15px);
}

.session-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  overflow: auto;
  color: var(--ink);
  background: #fbfcf8;
  border: 1px solid #cbd8d0;
  border-radius: 22px;
  box-shadow: 0 30px 90px rgba(46, 31, 59, 0.32);
}

.session-dialog.compact {
  width: min(560px, calc(100vw - 28px));
}

.session-dialog::backdrop {
  background: rgba(38, 29, 49, 0.6);
  backdrop-filter: blur(5px);
}

.session-dialog-form {
  padding: 20px;
}

.session-dialog-form > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.session-dialog-form > header > span:nth-child(2) {
  display: grid;
  gap: 2px;
}

.session-dialog-form > header small {
  color: var(--primary);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.session-dialog-form h2 {
  font-size: 1.35rem;
}

.session-dialog-form .form-note {
  margin: 15px 0;
}

.session-dialog-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.session-dialog-form > footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #e0e6e0;
}

/* Quiet mode keeps the information hierarchy while removing decoration. */

.quiet-mode .practitioner-dashboard,
.quiet-mode .practitioner-directory,
.quiet-mode .session-form-page,
.quiet-mode .practitioner-hero-v2,
.quiet-mode .directory-hero,
.quiet-mode .session-form-hero,
.quiet-mode .calendar-client-tray {
  background: var(--paper) !important;
}

.quiet-mode .practitioner-dashboard::before,
.quiet-mode .practitioner-directory::before,
.quiet-mode .practitioner-hero-v2::after,
.quiet-mode .metric-link::after {
  display: none;
}

.quiet-mode :where(.attention-panel, .metric-link, .client-card-v2, .signal-shortcut, .practitioner-calendar-section, .recent-session-card, .client-filter-panel, .session-editor-panel) {
  box-shadow: none !important;
  backdrop-filter: none;
}

@media (max-width: 1240px) {
  .attention-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .attention-panel.overdue-panel {
    grid-column: 1 / -1;
  }

  .signal-shortcut-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .client-card-directory-grid,
  .clinic-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .practitioner-hero-v2 .hero-panel {
    grid-template-columns: 1fr;
  }

  .practitioner-next-session {
    min-height: 108px;
  }

  .app-body .practitioner-metrics-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .calendar-client-tray {
    grid-template-columns: 1fr;
  }

  .session-calendar-v2 {
    display: flex;
    width: 100%;
    gap: 9px;
    padding: 3px 2px 13px;
    overflow-x: auto;
    scroll-padding-inline: 2px;
    scroll-snap-type: x proximity;
  }

  .session-calendar-v2 .calendar-day {
    min-width: 170px;
    flex: 0 0 170px;
    scroll-snap-align: start;
  }

  .directory-hero,
  .session-form-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .directory-hero-actions {
    justify-content: flex-start;
  }

  .client-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 780px) {
  .app-body .practitioner-hero-v2 {
    padding: 24px var(--page-pad) 22px;
    border-radius: 0 0 20px 20px;
  }

  .app-body .practitioner-hero-v2 h1 {
    font-size: clamp(2.55rem, 13vw, 4.2rem);
  }

  .practitioner-hero-copy > p:not(.eyebrow) {
    margin-top: 12px;
    font-size: 0.94rem;
  }

  .practitioner-hero-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 18px;
  }

  .practitioner-hero-actions .button.primary {
    grid-column: 1 / -1;
  }

  .practitioner-hero-actions .button {
    width: 100%;
    min-width: 0;
    padding-inline: 10px;
    font-size: 0.78rem;
  }

  .practitioner-next-session {
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 88px;
    padding: 14px;
    border-radius: 16px;
  }

  .hero-aside-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .practitioner-attention,
  .pinned-client-section,
  .signal-shortcuts,
  .recent-session-section,
  .client-directory-results,
  .session-results {
    padding-top: 28px;
  }

  .attention-grid,
  .recent-session-grid,
  .client-card-directory-grid,
  .clinic-card-grid {
    grid-template-columns: 1fr;
  }

  .attention-panel.overdue-panel {
    grid-column: auto;
  }

  .attention-list > a small,
  .attention-list > a strong,
  .attention-list > a em {
    white-space: normal;
  }

  .app-body .practitioner-metrics-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }

  .app-body .practitioner-metrics-v2 .metric-tile {
    min-height: 116px;
    padding: 13px;
  }

  .metric-link {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 9px;
  }

  .metric-arrow {
    display: none;
  }

  .metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .app-body .metric-link .metric-copy > strong {
    font-size: 2rem;
  }

  .app-body .metric-link .metric-copy > small {
    display: none;
  }

  .pinned-client-rail {
    grid-auto-columns: min(88vw, 340px);
  }

  .signal-shortcuts .dashboard-section-heading > p {
    text-align: left;
  }

  .signal-shortcut-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .signal-shortcut {
    min-height: 86px;
  }

  .practitioner-calendar-section {
    margin-top: 30px;
    padding: 14px;
    border-radius: 18px;
  }

  .calendar-command-bar {
    align-items: flex-start;
    flex-direction: column;
  }

  .calendar-period-nav {
    width: 100%;
  }

  .calendar-period-nav a {
    flex: 1;
  }

  .calendar-client-tray-copy small {
    display: none;
  }

  .calendar-client-chip {
    min-width: 222px;
  }

  .drag-handle {
    display: none;
  }

  .calendar-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .directory-hero,
  .session-form-hero {
    padding: 30px var(--page-pad) 25px;
    border-radius: 0 0 20px 20px;
  }

  .directory-hero h1,
  .session-form-hero h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .directory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .directory-summary a {
    min-height: 85px;
    padding: 12px;
  }

  .client-filter-panel {
    padding: 14px;
  }

  .client-filter-form,
  .session-editor-grid,
  .session-dialog-grid {
    grid-template-columns: 1fr;
  }

  .client-filter-form .span-two,
  .session-editor-grid .span-two,
  .session-dialog-grid .span-two {
    grid-column: auto;
  }

  .filter-form-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .session-directory-row {
    grid-template-columns: 1fr;
  }

  .session-row-edit {
    justify-self: stretch;
    justify-content: center;
  }

  .session-directory-main {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .session-directory-main > .status-chip {
    grid-column: 2;
    justify-self: start;
  }

  .session-directory-copy > * {
    display: block;
    overflow: visible;
    overflow-wrap: anywhere;
    white-space: normal;
    -webkit-line-clamp: unset;
  }

  .session-editor {
    padding-top: 28px;
  }

  .session-editor-actions {
    display: grid;
    grid-template-columns: 1fr;
    bottom: 78px;
  }

  .session-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 18px;
  }

  .session-dialog-form {
    padding: 15px;
  }

  .session-dialog-form > footer {
    display: grid;
    grid-template-columns: 1fr;
  }

  .mobile-nav-dock .mobile-secondary-link {
    display: none;
  }
}

@media (max-width: 390px) {
  .app-body .practitioner-metrics-v2 .metric-tile {
    min-height: 106px;
    padding: 11px;
  }

  .metric-icon {
    width: 36px;
    height: 36px;
  }

  .metric-icon svg {
    width: 17px;
    height: 17px;
  }

  .app-body .metric-link .metric-copy > span {
    font-size: 0.72rem;
  }

  .app-body .metric-link .metric-copy > strong {
    font-size: 1.75rem;
  }

  .client-signal-links {
    gap: 3px;
    padding-inline: 10px;
  }

  .client-signal-links a {
    font-size: 0.57rem;
  }

  .signal-shortcut {
    grid-template-columns: 30px minmax(0, 1fr);
    gap: 7px;
    min-height: 108px;
    padding: 9px;
  }

  .signal-shortcut-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .signal-shortcut-icon svg {
    width: 16px;
    height: 16px;
  }

  .signal-shortcut span span,
  .signal-shortcut small {
    overflow: visible;
    overflow-wrap: anywhere;
    text-overflow: clip;
    white-space: normal;
  }

  .signal-shortcut span span {
    font-size: 0.68rem;
    line-height: 1.15;
  }

  .signal-shortcut small {
    margin-top: 2px;
    font-size: 0.58rem;
    line-height: 1.25;
  }

  .pinned-empty,
  .directory-empty {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .pinned-empty .button,
  .directory-empty .button {
    width: 100%;
  }
}

@media (max-width: 340px) {
  .app-body .practitioner-metrics-v2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-body .practitioner-metrics-v2 .metric-tile {
    min-height: 106px;
  }

  .signal-shortcut-grid,
  .directory-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (hover: none), (pointer: coarse) {
  [draggable="true"] {
    -webkit-user-drag: none;
  }

  .drag-handle,
  .calendar-session-drag {
    display: none;
  }

  .day-add-button,
  .calendar-edit-link {
    width: 44px;
    height: 44px;
  }

  .session-calendar-v2 .calendar-event {
    padding-right: 48px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .metric-link,
  .signal-shortcut,
  .practitioner-next-session,
  .session-calendar-v2 .calendar-day {
    transition: none;
  }
}

/* Workspace hierarchy and contextual navigation ---------------------------
   The sidebar keeps its full information architecture on desktop. Compact
   viewports show the active branch in the drawer while the page-level
   context bar keeps nearby destinations one tap away. */

.workspace-nav a.workspace-nav-parent {
  position: relative;
}

.workspace-nav .nav-parent-arrow {
  width: 15px;
  height: 15px;
  margin-left: auto;
  opacity: 0.62;
  transform: rotate(90deg);
}

.workspace-nav a.workspace-nav-parent[aria-current="location"] {
  color: #fff;
  background:
    linear-gradient(
      90deg,
      rgba(185, 163, 211, 0.22),
      rgba(255, 255, 255, 0.07)
    );
  border-color: rgba(221, 211, 231, 0.26);
  box-shadow: inset 3px 0 0 #c9b8dc;
}

.workspace-nav a.workspace-nav-parent[aria-current="location"]
  .nav-parent-arrow {
  opacity: 1;
}

.workspace-nav-subtree {
  position: relative;
  display: grid;
  gap: 2px;
  margin: 1px 0 8px;
  padding: 2px 0 3px 31px;
}

.workspace-nav-subtree::before {
  position: absolute;
  top: 0;
  bottom: 8px;
  left: 20px;
  width: 1px;
  content: "";
  background: linear-gradient(
    180deg,
    rgba(210, 193, 225, 0.48),
    rgba(210, 193, 225, 0.09)
  );
}

.workspace-nav a.workspace-nav-child {
  position: relative;
  gap: 8px;
  min-height: 44px;
  padding: 7px 8px;
  color: rgba(249, 246, 251, 0.76);
  border-radius: 10px;
  font-size: 0.75rem;
  line-height: 1.2;
}

.workspace-nav a.workspace-nav-child:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.07);
}

.workspace-nav a.workspace-nav-child[aria-current="page"] {
  color: var(--primary-deepest);
  background: var(--primary-soft);
  border-color: rgba(255, 255, 255, 0.42);
  box-shadow: 0 7px 18px rgba(24, 15, 31, 0.23);
}

.workspace-nav a.workspace-nav-child > .nav-branch-dot {
  width: 7px;
  height: 7px;
  min-width: 7px;
  flex: 0 0 7px;
  background: rgba(221, 211, 231, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
}

.workspace-nav-child[aria-current="page"] .nav-branch-dot {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(112, 93, 153, 0.14);
}

.workspace-nav-child > span:nth-child(2) {
  min-width: 0;
  flex: 1;
  overflow-wrap: anywhere;
}

.workspace-nav-child .nav-count {
  min-width: 22px;
  height: 22px;
  flex: 0 0 auto;
  padding-inline: 5px;
  font-size: 0.67rem;
}

.workspace-context-nav {
  position: sticky;
  top: 68px;
  z-index: 42;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
  width: 100%;
  height: 60px;
  min-width: 0;
  padding: 7px var(--page-pad);
  color: var(--ink);
  background:
    linear-gradient(
      90deg,
      rgba(238, 233, 244, 0.97),
      rgba(250, 248, 251, 0.97) 48%,
      rgba(227, 241, 237, 0.97)
    );
  border-bottom: 1px solid rgba(79, 60, 102, 0.14);
  box-shadow: 0 7px 22px rgba(63, 43, 84, 0.08);
  backdrop-filter: blur(16px);
}

.workspace-context-trail,
.workspace-context-links,
.workspace-context-links a {
  display: flex;
  align-items: center;
}

.workspace-context-trail {
  gap: 7px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.workspace-context-trail svg {
  width: 19px;
  height: 19px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.workspace-context-trail a,
.workspace-context-trail strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.workspace-context-trail a {
  text-decoration: none;
}

.workspace-context-trail a:hover {
  color: var(--primary-strong);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.workspace-context-trail strong {
  color: var(--primary-deep);
}

.workspace-context-links {
  justify-content: flex-end;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 93, 153, 0.34) transparent;
  -webkit-overflow-scrolling: touch;
}

.workspace-context-links a {
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  flex: 0 0 auto;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.48);
  border: 1px solid transparent;
  border-radius: 11px;
  font-size: 0.77rem;
  font-weight: 820;
  line-height: 1.1;
  text-decoration: none;
  white-space: nowrap;
}

.workspace-context-links a:hover {
  color: var(--primary-deep);
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(112, 93, 153, 0.22);
}

.workspace-context-links a[aria-current="page"] {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  box-shadow: 0 7px 18px rgba(63, 43, 84, 0.22);
}

.workspace-context-links a.context-nav-action {
  color: var(--primary-deep);
  background: #f2dfaa;
  border-color: #dcc277;
}

.workspace-context-links a.context-nav-action[aria-current="page"] {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.workspace-context-links .context-nav-action span {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  color: #fff;
  background: var(--primary);
  border-radius: 50%;
  font-size: 1rem;
  line-height: 1;
}

.workspace-context-links
  .context-nav-action[aria-current="page"]
  span {
  color: var(--primary-strong);
  background: #fff;
}

.workspace-context-nav + .app-main .profile-section-nav {
  top: 128px;
}

.workspace-context-nav + .app-main section[id] {
  scroll-margin-top: 198px;
}

/* Tools hub --------------------------------------------------------------- */

.tools-workspace {
  position: relative;
  min-width: 0;
  padding: clamp(20px, 3.2vw, 46px) var(--page-pad)
    clamp(42px, 6vw, 80px);
  overflow: clip;
  background:
    radial-gradient(
      circle at 94% 4%,
      rgba(61, 127, 156, 0.13),
      transparent 25rem
    ),
    radial-gradient(
      circle at 2% 44%,
      rgba(112, 93, 153, 0.1),
      transparent 22rem
    ),
    linear-gradient(180deg, #faf8fb 0%, #f4f0f6 55%, #f8f6ee 100%);
}

.tools-workspace::before {
  position: absolute;
  inset: 0;
  content: "";
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(
    rgba(112, 93, 153, 0.15) 0.7px,
    transparent 0.7px
  );
  background-size: 23px 23px;
  mask-image: linear-gradient(to bottom, black, transparent 48%);
}

.tools-workspace > * {
  position: relative;
  z-index: 1;
}

.tools-workspace svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.tools-hub-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.75fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  min-height: 350px;
  padding: clamp(30px, 5vw, 62px);
  overflow: hidden;
  color: #f9f6fb;
  background:
    radial-gradient(
      circle at 85% 14%,
      rgba(205, 188, 222, 0.26),
      transparent 14rem
    ),
    radial-gradient(
      circle at 5% 100%,
      rgba(236, 208, 133, 0.15),
      transparent 18rem
    ),
    linear-gradient(132deg, var(--primary-deepest) 0%, var(--primary-deep) 48%, var(--primary) 100%);
  border: 1px solid rgba(38, 29, 49, 0.32);
  border-radius: 28px;
  box-shadow: 0 22px 58px rgba(46, 31, 59, 0.24);
}

.tools-hub-hero::after {
  position: absolute;
  right: -92px;
  bottom: -145px;
  width: 360px;
  height: 360px;
  content: "";
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      rgba(238, 233, 244, 0.13) 1px,
      transparent 1px
    ),
    linear-gradient(
      rgba(238, 233, 244, 0.13) 1px,
      transparent 1px
    );
  background-size: 26px 26px;
  border-radius: 50%;
  transform: rotate(14deg);
}

.tools-hero-copy {
  position: relative;
  z-index: 2;
  min-width: 0;
}

.tools-hero-copy .eyebrow {
  color: #f0d58e;
}

.tools-hero-copy h1 {
  max-width: 720px;
  color: #fff;
  font-size: clamp(2.75rem, 5.4vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.tools-hero-copy > p:not(.eyebrow) {
  max-width: 680px;
  margin: 20px 0 0;
  color: #f9f6fb;
  font-size: clamp(1rem, 1.5vw, 1.16rem);
  line-height: 1.65;
}

.tools-hero-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 25px;
}

.tools-hero-summary > span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 13px;
  color: #f9f6fb;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(238, 233, 244, 0.2);
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 820;
  backdrop-filter: blur(8px);
}

.tools-hero-summary svg {
  width: 17px;
  height: 17px;
  color: #f1d58d;
}

.tools-hero-graphic {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 265px;
}

.tool-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  border: 1px solid rgba(238, 233, 244, 0.26);
  border-radius: 50%;
  transform: translate(-50%, -50%);
}

.tool-orbit::before,
.tool-orbit::after {
  position: absolute;
  width: 10px;
  height: 10px;
  content: "";
  background: #f0d58e;
  border: 3px solid var(--primary-strong);
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(240, 213, 142, 0.1);
}

.tool-orbit-one {
  width: 250px;
  height: 250px;
}

.tool-orbit-one::before {
  top: 29px;
  right: 35px;
}

.tool-orbit-one::after {
  bottom: 29px;
  left: 35px;
}

.tool-orbit-two {
  width: 185px;
  height: 185px;
  border-style: dashed;
  transform: translate(-50%, -50%) rotate(28deg);
}

.tool-orbit-two::before {
  top: -6px;
  left: 82px;
}

.tool-orbit-two::after {
  right: -6px;
  bottom: 78px;
}

.tool-graphic-card {
  position: absolute;
  display: flex;
  border: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 42px rgba(28, 18, 36, 0.34);
  backdrop-filter: blur(8px);
}

.tool-graphic-form {
  top: 18px;
  left: 8%;
  flex-direction: column;
  gap: 14px;
  width: 158px;
  height: 204px;
  padding: 48px 19px 18px;
  background:
    linear-gradient(var(--primary), var(--primary)) 19px 18px / 54px 8px no-repeat,
    linear-gradient(
      145deg,
      rgba(255, 255, 255, 0.96),
      rgba(238, 233, 244, 0.93)
    );
  border-radius: 18px;
  transform: rotate(-7deg);
}

.tool-graphic-form i {
  display: block;
  height: 10px;
  background:
    linear-gradient(90deg, #d0e2da 0 74%, transparent 74%),
    #fff;
  border: 1px solid #c6d9d0;
  border-radius: 5px;
}

.tool-graphic-chart {
  right: 2%;
  bottom: 11px;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  width: 180px;
  height: 132px;
  padding: 29px 22px 18px;
  background:
    linear-gradient(#235c6a, #235c6a) 20px 17px / 67px 7px no-repeat,
    linear-gradient(
      145deg,
      rgba(250, 251, 244, 0.97),
      rgba(231, 241, 236, 0.93)
    );
  border-radius: 18px;
  transform: rotate(6deg);
}

.tool-graphic-chart i {
  display: block;
  width: 19px;
  background: linear-gradient(180deg, #54a192, #16675e);
  border-radius: 5px 5px 2px 2px;
}

.tool-graphic-chart i:nth-child(1) {
  height: 28%;
}

.tool-graphic-chart i:nth-child(2) {
  height: 67%;
}

.tool-graphic-chart i:nth-child(3) {
  height: 46%;
}

.tool-graphic-chart i:nth-child(4) {
  height: 88%;
  background: linear-gradient(180deg, #e6c56d, #c59528);
}

.tool-hub-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.75fr) minmax(280px, 0.55fr);
  align-items: end;
  justify-content: space-between;
  gap: 30px;
  margin: clamp(34px, 5vw, 60px) 0 20px;
}

.tool-hub-heading h2 {
  font-size: clamp(1.8rem, 3.2vw, 3.25rem);
}

.tool-hub-heading > p {
  justify-self: end;
  max-width: 570px;
  margin: 0;
  color: #60716c;
  line-height: 1.55;
}

.tool-hub-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 2vw, 22px);
  min-width: 0;
}

.tool-hub-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) 46px;
  align-items: center;
  gap: clamp(14px, 2vw, 22px);
  min-width: 0;
  min-height: 202px;
  padding: clamp(20px, 3vw, 30px);
  overflow: hidden;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: 0 13px 34px rgba(63, 43, 84, 0.11);
  text-decoration: none;
  transition:
    transform 170ms ease,
    border-color 170ms ease,
    box-shadow 170ms ease;
}

.tool-hub-card::before {
  position: absolute;
  top: -65px;
  right: -52px;
  width: 190px;
  height: 190px;
  content: "";
  pointer-events: none;
  background: rgba(112, 93, 153, 0.11);
  border-radius: 50%;
}

.tool-hub-card:hover {
  border-color: #b6a6c8;
  box-shadow: 0 20px 46px rgba(63, 43, 84, 0.17);
  transform: translateY(-3px);
}

.tool-hub-card-library {
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(112, 93, 153, 0.17),
      transparent 12rem
    ),
    linear-gradient(145deg, #fffdf7, var(--primary-soft));
}

.tool-hub-card-results {
  background:
    radial-gradient(
      circle at 100% 0%,
      rgba(61, 127, 156, 0.16),
      transparent 12rem
    ),
    linear-gradient(145deg, #fbfdf9, #e8f1f2);
  border-color: #cedee0;
}

.tool-card-icon,
.tool-card-arrow,
.tools-guidance-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.tool-card-icon {
  width: 64px;
  height: 64px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--primary-deep));
  border: 1px solid rgba(255, 255, 255, 0.46);
  border-radius: 18px;
  box-shadow: 0 11px 25px rgba(63, 43, 84, 0.24);
}

.tool-hub-card-results .tool-card-icon {
  background: linear-gradient(145deg, #3d7f9c, #225868);
  box-shadow: 0 11px 25px rgba(34, 88, 104, 0.22);
}

.tool-card-icon svg {
  width: 28px;
  height: 28px;
}

.tool-card-copy {
  display: grid;
  min-width: 0;
  gap: 7px;
}

.tool-card-copy > * {
  min-width: 0;
}

.tool-card-kicker {
  color: var(--primary-strong);
  font-size: 0.7rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tool-hub-card-results .tool-card-kicker {
  color: #316e85;
}

.tool-card-copy strong {
  color: var(--ink);
  font-size: clamp(1.25rem, 2vw, 1.65rem);
  line-height: 1.1;
}

.tool-card-copy > span:last-child {
  color: #60706c;
  font-size: 0.9rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.tool-card-arrow {
  position: relative;
  z-index: 1;
  width: 44px;
  height: 44px;
  color: var(--primary-strong);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid rgba(112, 93, 153, 0.18);
  border-radius: 14px;
  transition:
    color 170ms ease,
    background 170ms ease,
    transform 170ms ease;
}

.tool-hub-card:hover .tool-card-arrow {
  color: #fff;
  background: var(--primary);
  transform: translateX(3px);
}

.tools-guidance {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  align-items: start;
  gap: 15px;
  margin-top: clamp(20px, 3vw, 30px);
  padding: 20px clamp(18px, 3vw, 28px);
  color: #39534d;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid #d6e2dc;
  border-left: 4px solid #d6af4e;
  border-radius: 17px;
  box-shadow: 0 9px 26px rgba(22, 61, 54, 0.07);
}

.tools-guidance-icon {
  width: 46px;
  height: 46px;
  color: var(--teal-strong);
  background: #e0efe8;
  border-radius: 14px;
}

.tools-guidance strong {
  display: block;
  color: #214840;
  line-height: 1.35;
}

.tools-guidance p {
  margin: 5px 0 0;
  color: #64736f;
  line-height: 1.5;
}

.tools-guidance a {
  color: var(--teal-strong);
  font-weight: 820;
  text-underline-offset: 3px;
}

.quiet-mode .workspace-context-nav,
.quiet-mode .tools-workspace,
.quiet-mode .tools-hub-hero,
.quiet-mode .tool-hub-card {
  background-image: none !important;
}

.quiet-mode .tool-orbit,
.quiet-mode .tools-workspace::before,
.quiet-mode .tools-hub-hero::after,
.quiet-mode .tool-hub-card::before {
  display: none;
}

.quiet-mode .tools-hub-hero,
.quiet-mode .tool-hub-card,
.quiet-mode .tools-guidance {
  box-shadow: none;
}

@media (max-width: 1120px) {
  .workspace-nav-subtree {
    display: none;
  }

  .workspace-nav-parent[aria-current="location"]
    + .workspace-nav-subtree {
    display: grid;
  }

  .workspace-nav .nav-parent-arrow {
    transform: none;
  }

  .workspace-nav
    a.workspace-nav-parent[aria-current="location"]
    .nav-parent-arrow {
    transform: rotate(90deg);
  }

  html:not(.js) .workspace-nav-subtree {
    grid-column: auto;
  }

  .workspace-context-nav {
    grid-template-columns: minmax(110px, auto) minmax(0, 1fr);
  }

  .tools-hub-hero {
    grid-template-columns: minmax(0, 1fr) minmax(245px, 0.65fr);
  }

  .tool-hub-card {
    grid-template-columns: 56px minmax(0, 1fr) 44px;
    padding: 21px;
  }

  .tool-card-icon {
    width: 56px;
    height: 56px;
  }
}

@media (max-width: 840px) {
  .tools-hub-hero {
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-hero-graphic {
    width: min(420px, 100%);
    min-height: 220px;
    justify-self: center;
  }

  .tool-hub-heading {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .tool-hub-heading > p {
    justify-self: start;
  }

  .tool-hub-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .workspace-context-nav {
    top: 62px;
    display: block;
    height: 56px;
    padding: 6px 10px;
  }

  .workspace-context-trail {
    display: none;
  }

  .workspace-context-links {
    justify-content: flex-start;
    width: 100%;
    height: 44px;
    padding-inline: 1px;
    scroll-padding-inline: 8px;
  }

  .workspace-context-links a {
    min-height: 44px;
    padding-inline: 11px;
    scroll-snap-align: start;
  }

  .workspace-context-nav + .app-main .profile-section-nav {
    top: 118px;
  }

  .workspace-context-nav + .app-main section[id] {
    scroll-margin-top: 190px;
  }

  .tools-workspace {
    padding: 16px 14px 54px;
  }

  .tools-hub-hero {
    gap: 18px;
    min-height: 0;
    padding: 27px 22px 22px;
    border-radius: 22px;
  }

  .tools-hero-copy h1 {
    font-size: clamp(2.45rem, 12vw, 4rem);
  }

  .tools-hero-copy > p:not(.eyebrow) {
    margin-top: 16px;
    font-size: 0.96rem;
    line-height: 1.55;
  }

  .tools-hero-summary {
    margin-top: 19px;
  }

  .tools-hero-graphic {
    min-height: 180px;
  }

  .tool-orbit-one {
    width: 184px;
    height: 184px;
  }

  .tool-orbit-two {
    width: 136px;
    height: 136px;
  }

  .tool-graphic-form {
    top: 8px;
    left: calc(50% - 115px);
    width: 118px;
    height: 150px;
    padding: 39px 14px 14px;
    background-position: 14px 15px, 0 0;
    background-size: 45px 7px, auto;
    border-radius: 15px;
  }

  .tool-graphic-chart {
    right: calc(50% - 120px);
    bottom: 2px;
    width: 132px;
    height: 96px;
    gap: 7px;
    padding: 26px 16px 13px;
    background-position: 16px 13px, 0 0;
    background-size: 53px 6px, auto;
    border-radius: 15px;
  }

  .tool-graphic-chart i {
    width: 14px;
  }

  .tool-hub-heading {
    margin-top: 34px;
  }

  .tool-hub-card {
    min-height: 176px;
    border-radius: 19px;
  }
}

@media (max-width: 390px) {
  .workspace-context-links a {
    padding-inline: 10px;
    font-size: 0.72rem;
  }

  .tools-workspace {
    padding-inline: 10px;
  }

  .tools-hub-hero {
    padding: 23px 17px 18px;
    border-radius: 19px;
  }

  .tools-hero-copy h1 {
    font-size: clamp(2.25rem, 12vw, 3.25rem);
  }

  .tools-hero-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .tools-hero-summary > span {
    width: 100%;
  }

  .tools-hero-graphic {
    min-height: 160px;
  }

  .tool-hub-heading h2 {
    font-size: 1.7rem;
  }

  .tool-hub-card {
    grid-template-columns: 48px minmax(0, 1fr) 38px;
    gap: 10px;
    min-height: 168px;
    padding: 16px 13px;
  }

  .tool-card-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
  }

  .tool-card-icon svg {
    width: 23px;
    height: 23px;
  }

  .tool-card-copy {
    gap: 5px;
  }

  .tool-card-copy strong {
    font-size: 1.12rem;
  }

  .tool-card-copy > span:last-child {
    font-size: 0.78rem;
    line-height: 1.42;
  }

  .tool-card-arrow {
    width: 38px;
    height: 44px;
    border-radius: 12px;
  }

  .tools-guidance {
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 11px;
    padding: 16px 13px;
  }

  .tools-guidance-icon {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 340px) {
  .workspace-context-nav {
    padding-inline: 7px;
  }

  .workspace-context-links {
    gap: 3px;
  }

  .workspace-context-links a {
    padding-inline: 9px;
    font-size: 0.69rem;
  }

  .tools-workspace {
    padding-inline: 8px;
  }

  .tools-hub-hero {
    padding-inline: 15px;
  }

  .tool-hub-card {
    grid-template-columns: 44px minmax(0, 1fr) 34px;
    gap: 8px;
    padding-inline: 11px;
  }

  .tool-card-icon {
    width: 44px;
    height: 44px;
  }

  .tool-card-arrow {
    width: 34px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .workspace-nav a.workspace-nav-parent,
  .workspace-nav a.workspace-nav-child,
  .workspace-context-links a {
    transition:
      color 150ms ease,
      background 150ms ease,
      border-color 150ms ease,
      box-shadow 150ms ease;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-hub-card,
  .tool-card-arrow,
  .workspace-nav a.workspace-nav-parent,
  .workspace-nav a.workspace-nav-child,
  .workspace-context-links a {
    transition: none;
  }
}

/* Floating assistant --------------------------------------------------------
   Public, unapproved, and unsupported roles stay on local canned guidance.
   The live form is rendered only after server-side workspace authorization. */

.chatbot-root {
  --chatbot-safe-top: 84px;
  --chatbot-launcher-bottom: 24px;
  --chatbot-panel-bottom: 94px;
}

.public-body .chatbot-root {
  --chatbot-safe-top: 80px;
}

.app-body.has-context-nav .chatbot-root {
  --chatbot-safe-top: 144px;
}

.app-body:has(.profile-section-nav) .chatbot-root {
  --chatbot-safe-top: 202px;
}

html:not(.js) .chatbot-root {
  display: none;
}

.chatbot-launcher,
.chatbot-panel {
  position: fixed;
  right: 24px;
  z-index: 48;
}

.chatbot-launcher {
  bottom: var(--chatbot-launcher-bottom);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 58px;
  min-height: 58px;
  padding: 7px 15px 7px 7px;
  color: #fff;
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.25), transparent 34%),
    linear-gradient(135deg, var(--primary) 0%, var(--primary-strong) 58%, var(--primary-deep) 100%);
  border: 1px solid rgba(38, 29, 49, 0.38);
  border-radius: 999px;
  box-shadow:
    0 18px 42px rgba(63, 43, 84, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  cursor: pointer;
  isolation: isolate;
}

.chatbot-launcher::after {
  position: absolute;
  inset: -5px;
  z-index: -1;
  content: "";
  pointer-events: none;
  border: 1px solid rgba(112, 93, 153, 0.3);
  border-radius: inherit;
  animation: chatbot-breathe 3.2s ease-in-out infinite;
}

.chatbot-launcher[aria-expanded="true"] {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 255, 255, 0.24), transparent 34%),
    linear-gradient(135deg, var(--primary-strong), var(--primary-deepest));
}

.chatbot-launcher-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  color: var(--primary-deep);
  background: linear-gradient(145deg, #f8f4d9, var(--primary-soft));
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 50%;
  box-shadow: inset 0 -5px 11px rgba(112, 93, 153, 0.11);
}

.chatbot-launcher svg,
.chatbot-avatar svg,
.chatbot-close svg,
.chatbot-suggestions svg,
.chatbot-panel-footer svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.chatbot-launcher svg {
  width: 27px;
  height: 27px;
}

.chatbot-launcher svg path:nth-child(2) {
  stroke-width: 3.5;
}

.chatbot-launcher .chatbot-spark {
  color: #d69d32;
  stroke-width: 2;
}

.chatbot-launcher-copy {
  display: grid;
  gap: 1px;
  padding-right: 2px;
  text-align: left;
  white-space: nowrap;
}

.chatbot-launcher-copy small {
  color: rgba(249, 246, 251, 0.86);
  font-size: 0.62rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-transform: uppercase;
}

.chatbot-launcher-copy strong {
  color: #fff;
  font-size: 0.82rem;
  line-height: 1.2;
}

.chatbot-panel {
  bottom: var(--chatbot-panel-bottom);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: min(390px, calc(100vw - 48px));
  max-height: min(
    620px,
    calc(100vh - var(--chatbot-safe-top) - var(--chatbot-panel-bottom))
  );
  max-height: min(
    620px,
    calc(100dvh - var(--chatbot-safe-top) - var(--chatbot-panel-bottom))
  );
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(250, 248, 251, 0.99), rgba(252, 250, 244, 0.99));
  border: 1px solid rgba(112, 93, 153, 0.24);
  border-radius: 24px;
  box-shadow:
    0 26px 70px rgba(46, 31, 59, 0.29),
    0 4px 16px rgba(46, 31, 59, 0.12);
  animation: chatbot-panel-in 170ms ease-out;
}

.chatbot-panel-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-width: 0;
  padding: 15px 15px 14px 17px;
  color: #f9f6fb;
  background:
    radial-gradient(circle at 88% -20%, rgba(216, 165, 58, 0.28), transparent 45%),
    linear-gradient(130deg, var(--primary-deep) 0%, var(--primary-strong) 58%, var(--primary) 100%);
  border-bottom: 1px solid rgba(38, 29, 49, 0.34);
}

.chatbot-panel-header::after {
  position: absolute;
  right: 72px;
  bottom: 0;
  width: 68px;
  height: 26px;
  content: "";
  pointer-events: none;
  background-image: radial-gradient(rgba(240, 213, 148, 0.32) 1px, transparent 1px);
  background-size: 8px 8px;
  mask-image: linear-gradient(to top, #000, transparent);
}

.chatbot-heading {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 11px;
}

.chatbot-heading > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.chatbot-heading small {
  color: rgba(249, 246, 251, 0.86);
  font-size: 0.66rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  line-height: 1.2;
  text-transform: uppercase;
}

.chatbot-heading strong {
  overflow: hidden;
  color: #fff;
  font-size: 1rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-avatar {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: var(--primary-deep);
  background: linear-gradient(145deg, #fff8dd, var(--primary-soft));
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 14px;
  box-shadow: 0 8px 18px rgba(38, 29, 49, 0.22);
}

.chatbot-avatar svg {
  width: 25px;
  height: 25px;
}

.chatbot-avatar svg path:nth-child(2) {
  stroke-width: 3.4;
}

.chatbot-close {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 0;
  color: #eff8f4;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
  cursor: pointer;
}

.chatbot-close:hover {
  background: rgba(255, 255, 255, 0.18);
}

.chatbot-close svg {
  width: 20px;
  height: 20px;
}

.chatbot-panel-body {
  min-width: 0;
  min-height: 0;
  padding: 15px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.chatbot-mode-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
  gap: 8px;
  margin-bottom: 14px;
}

.chatbot-mode-chip,
.chatbot-preview-chip,
.chatbot-live-chip {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 850;
  line-height: 1.2;
}

.chatbot-mode-chip {
  gap: 6px;
  overflow: hidden;
  color: var(--teal-strong);
  background: #e1f0e8;
  border: 1px solid #c4dfd2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chatbot-mode-chip > span {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  background: #1b7b6d;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(27, 123, 109, 0.12);
}

.chatbot-preview-chip {
  flex: 0 0 auto;
  color: #6d5931;
  background: #f7edcf;
  border: 1px solid #ead8a7;
}

.chatbot-live-chip {
  flex: 0 0 auto;
  color: var(--teal-strong);
  background: var(--teal-soft);
  border: 1px solid #b7d8cf;
}

.chatbot-transcript {
  display: grid;
  min-width: 0;
  gap: 9px;
}

.chatbot-message {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.chatbot-message-mark {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: var(--primary);
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 900;
}

.chatbot-message p {
  min-width: 0;
  margin: 0;
  padding: 10px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 4px 14px 14px;
  box-shadow: 0 5px 14px rgba(63, 43, 84, 0.06);
  font-size: 0.8rem;
  line-height: 1.48;
}

.chatbot-message-user {
  grid-template-columns: minmax(0, 1fr) 36px;
  padding-left: 30px;
}

.chatbot-message-user .chatbot-message-mark {
  grid-column: 2;
  grid-row: 1;
  width: 36px;
  color: var(--primary-deep);
  background: var(--primary-soft);
  font-size: 0.58rem;
}

.chatbot-message-user p {
  grid-column: 1;
  grid-row: 1;
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
  border-radius: 14px 4px 14px 14px;
}

.chatbot-reply-details {
  display: grid;
  grid-column: 2;
  gap: 7px;
  min-width: 0;
  margin-top: -3px;
}

.chatbot-reply-note,
.chatbot-sources {
  min-width: 0;
  padding: 8px 10px;
  color: #4d4660;
  background: var(--primary-wash);
  border: 1px solid var(--primary-soft-strong);
  border-radius: 11px;
  font-size: 0.68rem;
  line-height: 1.4;
}

.chatbot-reply-note.is-safety {
  color: #70471a;
  background: #fff5dd;
  border-color: #edd49a;
}

.chatbot-sources strong {
  display: block;
  margin-bottom: 3px;
  color: var(--primary-deep);
  font-size: 0.67rem;
}

.chatbot-sources ul {
  display: grid;
  gap: 2px;
  margin: 0;
  padding-left: 16px;
  overflow-wrap: anywhere;
}

.chatbot-message-loading p {
  min-height: 42px;
}

.chatbot-loading-dots {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 18px;
}

.chatbot-loading-dots span {
  width: 6px;
  height: 6px;
  background: var(--primary);
  border-radius: 50%;
  animation: chatbot-loading-dot 1.1s ease-in-out infinite;
}

.chatbot-loading-dots span:nth-child(2) {
  animation-delay: 120ms;
}

.chatbot-loading-dots span:nth-child(3) {
  animation-delay: 240ms;
}

.chatbot-live-form {
  display: grid;
  gap: 12px;
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.chatbot-field {
  display: grid;
  min-width: 0;
  gap: 6px;
}

.chatbot-field label {
  color: var(--primary-deep);
  font-size: 0.72rem;
  font-weight: 850;
}

.chatbot-field select,
.chatbot-field textarea {
  width: 100%;
  min-width: 0;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cfc6d9;
  border-radius: 12px;
  font: inherit;
  font-size: 0.78rem;
}

.chatbot-field select {
  min-height: 44px;
  padding: 8px 34px 8px 10px;
}

.chatbot-field textarea {
  min-height: 84px;
  max-height: 160px;
  padding: 10px;
  line-height: 1.45;
  resize: vertical;
}

.chatbot-field select:focus,
.chatbot-field textarea:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(112, 93, 153, 0.17);
  outline-offset: 1px;
}

.chatbot-field select[aria-invalid="true"],
.chatbot-field textarea[aria-invalid="true"] {
  border-color: #b94e58;
}

.chatbot-field select[aria-invalid="true"]:focus,
.chatbot-field textarea[aria-invalid="true"]:focus {
  outline-color: rgba(185, 78, 88, 0.17);
}

.chatbot-field-help {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.35;
}

.chatbot-field-help span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.chatbot-verification {
  display: grid;
  min-width: 0;
  gap: 9px;
  padding: 10px;
  color: #4a4560;
  background: var(--primary-wash);
  border: 1px solid var(--primary-soft-strong);
  border-radius: 13px;
  overflow: hidden;
}

.chatbot-verification[hidden] {
  display: none;
}

.chatbot-verification p {
  display: grid;
  gap: 2px;
  margin: 0;
}

.chatbot-verification strong {
  color: var(--primary-deep);
  font-size: 0.71rem;
}

.chatbot-verification p span {
  font-size: 0.66rem;
  line-height: 1.35;
}

.chatbot-verification .cf-turnstile {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.chatbot-form-status {
  margin: 0;
  padding: 8px 10px;
  color: #51496a;
  background: var(--primary-wash);
  border: 1px solid var(--primary-soft-strong);
  border-radius: 10px;
  font-size: 0.68rem;
  line-height: 1.4;
}

.chatbot-form-status[hidden] {
  display: none;
}

.chatbot-form-status.is-error {
  color: #7b2f36;
  background: #fff0f1;
  border-color: #edc5c8;
}

.chatbot-form-status.is-success {
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-color: #b7d8cf;
}

.chatbot-send-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 9px 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border: 1px solid var(--primary-strong);
  border-radius: 13px;
  box-shadow: 0 8px 18px rgba(63, 43, 84, 0.17);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 850;
}

.chatbot-send-button:hover:not(:disabled) {
  background: linear-gradient(135deg, var(--primary-strong), var(--primary-deep));
}

.chatbot-send-button:focus-visible {
  outline: 3px solid rgba(112, 93, 153, 0.22);
  outline-offset: 2px;
}

.chatbot-send-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.chatbot-send-spinner {
  display: none;
  width: 15px;
  height: 15px;
  border: 2px solid rgba(255, 255, 255, 0.38);
  border-top-color: #fff;
  border-radius: 50%;
}

.chatbot-live-form.is-loading .chatbot-send-spinner {
  display: inline-block;
  animation: chatbot-spin 800ms linear infinite;
}

.chatbot-suggestions {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.chatbot-suggestions > p {
  margin: 0 2px 2px;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.chatbot-suggestions button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 48px;
  padding: 7px 10px 7px 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.83);
  border: 1px solid var(--line);
  border-radius: 13px;
  cursor: pointer;
  font-size: 0.77rem;
  font-weight: 800;
  text-align: left;
}

.chatbot-suggestions button::after {
  content: "\2192";
  color: var(--primary);
  font-size: 1rem;
  text-align: right;
}

.chatbot-suggestions button:hover {
  color: var(--primary-strong);
  background: var(--primary-wash);
  border-color: #b9a8cb;
}

.chatbot-suggestions svg {
  width: 32px;
  height: 32px;
  padding: 7px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 10px;
}

.chatbot-panel-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 15px;
  color: var(--muted);
  background: rgba(247, 244, 248, 0.98);
  border-top: 1px solid var(--line);
  font-size: 0.69rem;
  font-weight: 750;
}

.chatbot-connection-dot {
  width: 8px;
  height: 8px;
  background: #d09a31;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(208, 154, 49, 0.15);
}

.chatbot-connection-dot.is-connected {
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(20, 117, 109, 0.14);
}

.chatbot-panel-footer svg {
  width: 17px;
  height: 17px;
  color: #76817d;
}

.quiet-mode .chatbot-launcher,
.quiet-mode .chatbot-panel,
.quiet-mode .chatbot-panel-header {
  background-image: none;
  box-shadow: none;
}

.quiet-mode .chatbot-launcher::after {
  animation: none;
}

@keyframes chatbot-breathe {
  0%,
  100% {
    opacity: 0.35;
    transform: scale(0.98);
  }
  50% {
    opacity: 0.8;
    transform: scale(1.04);
  }
}

@keyframes chatbot-panel-in {
  from {
    opacity: 0;
    transform: translateY(9px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes chatbot-loading-dot {
  0%,
  60%,
  100% {
    opacity: 0.36;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-3px);
  }
}

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

@media (hover: hover) and (pointer: fine) {
  .chatbot-launcher {
    transition: box-shadow 150ms ease, transform 150ms ease;
  }

  .chatbot-launcher:hover {
    box-shadow:
      0 22px 48px rgba(63, 43, 84, 0.34),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
    transform: translateY(-2px);
  }

  .chatbot-suggestions button,
  .chatbot-send-button,
  .chatbot-close {
    transition:
      color 140ms ease,
      background 140ms ease,
      border-color 140ms ease,
      transform 140ms ease;
  }

  .chatbot-suggestions button:hover {
    transform: translateX(2px);
  }
}

@media (max-width: 1120px) {
  .chatbot-launcher,
  .chatbot-panel {
    right: 20px;
  }

  .chatbot-launcher {
    min-width: 56px;
    min-height: 56px;
    padding: 6px;
  }

  .chatbot-launcher-copy {
    display: none;
  }

  .chatbot-panel {
    width: min(380px, calc(100vw - 40px));
  }
}

@media (max-width: 720px) {
  .chatbot-root {
    --chatbot-safe-top: 76px;
    --chatbot-launcher-bottom: calc(14px + env(safe-area-inset-bottom));
    --chatbot-panel-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .app-body.has-context-nav .chatbot-root {
    --chatbot-safe-top: 136px;
  }

  .app-body:has(.profile-section-nav) .chatbot-root {
    --chatbot-safe-top: 194px;
  }

  .has-mobile-nav .chatbot-root {
    --chatbot-launcher-bottom: calc(78px + max(8px, env(safe-area-inset-bottom)));
    --chatbot-panel-bottom: calc(144px + max(8px, env(safe-area-inset-bottom)));
  }

  .has-mobile-nav:has(.session-editor-actions) .chatbot-root {
    --chatbot-launcher-bottom: calc(235px + max(8px, env(safe-area-inset-bottom)));
    --chatbot-panel-bottom: calc(301px + max(8px, env(safe-area-inset-bottom)));
  }

  .chatbot-launcher {
    right: 14px;
    min-width: 54px;
    min-height: 54px;
    padding: 5px;
  }

  .chatbot-launcher-icon {
    width: 44px;
    height: 44px;
  }

  .chatbot-launcher-copy {
    display: none;
  }

  .chatbot-panel {
    right: 10px;
    left: 10px;
    width: auto;
    max-width: none;
    border-radius: 20px;
  }

  .chatbot-panel-header {
    padding: 12px 12px 11px 14px;
  }

  .chatbot-panel-body {
    padding: 13px;
  }
}

@media (max-width: 360px) {
  .chatbot-launcher {
    min-width: 48px;
    min-height: 48px;
    padding: 4px;
  }

  .chatbot-launcher-icon {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .chatbot-launcher svg {
    width: 23px;
    height: 23px;
  }

  .chatbot-panel-header {
    gap: 8px;
  }

  .chatbot-heading {
    gap: 8px;
  }

  .chatbot-avatar {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    border-radius: 12px;
  }

  .chatbot-heading strong {
    font-size: 0.82rem;
  }

  .chatbot-close {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }

  .chatbot-mode-row {
    align-items: center;
    flex-flow: row wrap;
  }

  .chatbot-suggestions button {
    grid-template-columns: 30px minmax(0, 1fr) 15px;
    padding-right: 8px;
  }

  .chatbot-suggestions svg {
    width: 30px;
    height: 30px;
  }

  .public-body .chatbot-root {
    --chatbot-safe-top: 128px;
  }
}

@media (max-width: 720px) and (max-height: 600px) {
  .chatbot-root,
  .app-body.has-context-nav .chatbot-root,
  .app-body:has(.profile-section-nav) .chatbot-root {
    --chatbot-safe-top: 8px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .chatbot-launcher::after,
  .chatbot-panel,
  .chatbot-loading-dots span,
  .chatbot-send-spinner {
    animation: none;
  }

  .chatbot-launcher,
  .chatbot-suggestions button,
  .chatbot-send-button,
  .chatbot-close {
    transition: none;
  }
}

/* Final disclosure-state overrides must follow the legacy responsive layer. */
.workspace-nav-disclosure .nav-parent-arrow {
  margin: 0;
  transform: none;
}

.workspace-nav-disclosure[aria-expanded="true"] .nav-parent-arrow {
  transform: rotate(90deg);
}

.workspace-nav-subtree[hidden] {
  display: none !important;
}

.workspace-nav-subtree:not([hidden]) {
  display: grid;
}

@media (max-width: 360px) {
  .demo-entry-shell {
    width: calc(100% - 12px);
  }

  .demo-role-form {
    padding: 10px;
  }

  .demo-human-check {
    overflow: hidden;
    padding: 10px 8px;
  }

  .demo-human-check .cf-turnstile {
    width: 300px !important;
    max-width: none;
    margin-bottom: -7px;
    transform: scale(0.89);
    transform-origin: top left;
  }
}

/* Client profile workspace -------------------------------------------------
   A stable page shell with real in-page tabs. Purple is the primary visual
   language; green remains the supporting care/status colour. */

.client-profile-workspace {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 18px;
  padding: clamp(20px, 3.5vw, 44px) var(--page-pad)
    clamp(54px, 7vw, 92px);
  background:
    radial-gradient(circle at 92% 3%, rgba(112, 93, 153, 0.16), transparent 26rem),
    radial-gradient(circle at 2% 30%, rgba(20, 117, 109, 0.09), transparent 23rem),
    linear-gradient(180deg, #faf8fc 0%, #f5f1f8 44%, #f8f7f1 100%);
  isolation: isolate;
}

.client-profile-workspace::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  opacity: 0.4;
  background-image: radial-gradient(rgba(112, 93, 153, 0.19) 0.7px, transparent 0.7px);
  background-size: 24px 24px;
  mask-image: linear-gradient(to bottom, #000, transparent 42%);
}

.client-profile-header {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(330px, 0.62fr);
  gap: 16px;
  align-items: stretch;
}

.client-identity-card,
.profile-snapshot-card {
  min-width: 0;
  min-height: 300px;
  height: 100%;
  border: 1px solid rgba(112, 93, 153, 0.19);
  border-radius: 26px;
  box-shadow: 0 20px 52px rgba(53, 42, 68, 0.1);
}

.client-identity-card {
  display: grid;
  align-content: space-between;
  gap: 22px;
  padding: clamp(20px, 3vw, 32px);
  overflow: hidden;
  background:
    radial-gradient(circle at 92% 8%, rgba(216, 165, 58, 0.18), transparent 10rem),
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(247, 243, 250, 0.96));
}

.client-identity-topline {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: start;
}

.client-profile-avatar {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  color: #fff;
  background:
    linear-gradient(145deg, var(--primary), var(--primary-strong) 66%, var(--teal) 66%);
  border: 4px solid #fff;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(63, 43, 84, 0.22);
  font-size: 1.7rem;
  font-weight: 950;
}

.client-identity-heading {
  min-width: 0;
}

.client-identity-heading .eyebrow {
  margin-bottom: 7px;
}

.client-identity-heading h1 {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: clamp(2rem, 4.4vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

.client-full-name {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.profile-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--teal-strong);
  background: #e2f1ea;
  border: 1px solid #bcded1;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 900;
  white-space: nowrap;
}

.profile-status-pill i {
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(20, 117, 109, 0.12);
}

.profile-status-pill.is-inactive {
  color: #75594a;
  background: #f2eae4;
  border-color: #dfcfc5;
}

.profile-status-pill.is-inactive i {
  background: #8a6b5a;
  box-shadow: 0 0 0 4px rgba(138, 107, 90, 0.12);
}

.client-profile-summary {
  max-width: 860px;
  margin: 0;
  color: #4e4654;
  font-size: clamp(0.94rem, 1.3vw, 1.08rem);
  line-height: 1.6;
}

.client-identity-details {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.client-identity-details > div {
  display: grid;
  min-width: 0;
  gap: 4px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid rgba(112, 93, 153, 0.14);
  border-radius: 14px;
}

.client-identity-details dt,
.client-identity-details dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.client-identity-details dt {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.client-identity-details dd {
  color: var(--primary-deep);
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.35;
}

.profile-snapshot-card {
  display: grid;
  align-content: space-between;
  gap: 18px;
  padding: clamp(20px, 2.6vw, 28px);
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 95% 3%, rgba(216, 165, 58, 0.3), transparent 13rem),
    radial-gradient(circle at 0% 100%, rgba(20, 117, 109, 0.32), transparent 14rem),
    linear-gradient(145deg, var(--primary-deepest), var(--primary-deep) 55%, var(--primary-strong));
}

.profile-snapshot-card::after {
  position: absolute;
  content: "";
}

.snapshot-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.snapshot-heading .eyebrow,
.snapshot-heading h2 {
  color: #fff;
}

.snapshot-heading h2 {
  margin: 2px 0 0;
  font-size: clamp(1.45rem, 2.2vw, 2rem);
}

.snapshot-icon {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: var(--primary-deep);
  background: linear-gradient(145deg, #fff8dd, #eee9f4);
  border-radius: 16px;
  box-shadow: 0 10px 24px rgba(20, 10, 30, 0.24);
}

.snapshot-icon svg,
.client-profile-workspace svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.snapshot-icon svg {
  width: 25px;
  height: 25px;
}

.snapshot-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.snapshot-metrics > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 14px;
}

.snapshot-metrics strong {
  color: #fff;
  font-size: 1.55rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.snapshot-metrics span {
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.25;
}

.snapshot-latest {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.snapshot-latest > span {
  width: 10px;
  height: 10px;
  margin-top: 5px;
  background: #7bd1b6;
  border-radius: 50%;
  box-shadow: 0 0 0 5px rgba(123, 209, 182, 0.12);
}

.snapshot-latest p {
  display: grid;
  gap: 2px;
  margin: 0;
  color: rgba(255, 255, 255, 0.76);
  font-size: 0.73rem;
  line-height: 1.45;
}

.snapshot-latest strong {
  color: #fff;
}

.profile-navigation-shell {
  position: sticky;
  top: 68px;
  z-index: 29;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  min-width: 0;
  padding: 7px;
  background: rgba(252, 250, 253, 0.91);
  border: 1px solid rgba(112, 93, 153, 0.19);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(53, 42, 68, 0.12);
  backdrop-filter: blur(18px);
}

.workspace-context-nav + .app-main .profile-navigation-shell {
  top: 128px;
}

.profile-tab-list {
  display: flex;
  min-width: 0;
  gap: 4px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(112, 93, 153, 0.35) transparent;
}

.profile-tab-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: max-content;
  min-height: 48px;
  gap: 7px;
  padding: 8px 11px;
  color: #665e6b;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 850;
  line-height: 1.15;
  text-decoration: none;
  white-space: nowrap;
}

.profile-tab-list a svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
}

.profile-tab-list a:hover,
.profile-tab-list a:focus-visible {
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-color: var(--primary-soft-strong);
}

.profile-tab-list a[aria-selected="true"] {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: var(--primary-strong);
  box-shadow: 0 7px 18px rgba(63, 43, 84, 0.22);
}

.profile-tool-rail {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: max-content;
}

.profile-tool-rail > span {
  padding-inline: 6px 3px;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.profile-tool-rail > a,
.profile-tools-menu > summary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  gap: 6px;
  padding: 7px 9px;
  color: var(--primary-deep);
  background: #fff;
  border: 1px solid rgba(112, 93, 153, 0.17);
  border-radius: 11px;
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 850;
  text-decoration: none;
  white-space: nowrap;
}

.profile-tool-rail svg {
  width: 16px;
  height: 16px;
}

.profile-tools-menu {
  position: relative;
}

.profile-tools-menu > summary {
  list-style: none;
}

.profile-tools-menu > summary::-webkit-details-marker {
  display: none;
}

.profile-tools-menu[open] > summary {
  color: #fff;
  background: var(--primary-strong);
  border-color: var(--primary-strong);
}

.profile-tools-menu > div {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  width: 220px;
  gap: 4px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(53, 42, 68, 0.18);
}

.profile-tools-menu > div a {
  min-height: 42px;
  padding: 10px;
  color: var(--ink);
  border-radius: 9px;
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: none;
}

.profile-tools-menu > div a:hover,
.profile-tools-menu > div a:focus-visible {
  color: var(--primary-strong);
  background: var(--primary-soft);
}

.profile-tool-mobile-link {
  display: none;
}

.profile-tab-panel[hidden] {
  display: none !important;
}

.profile-tab-panel {
  scroll-margin-top: 220px;
}

.profile-tab-panel:not([hidden]) {
  min-width: 0;
  animation: profile-panel-reveal 180ms ease-out;
}

@keyframes profile-panel-reveal {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.profile-panel-section {
  min-width: 0;
  padding: clamp(20px, 3vw, 32px);
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(112, 93, 153, 0.15);
  border-radius: 24px;
  box-shadow: 0 16px 44px rgba(53, 42, 68, 0.08);
}

.profile-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 22px;
  margin-bottom: 22px;
}

.profile-section-heading > div:first-child {
  max-width: 850px;
}

.profile-section-heading h2 {
  margin: 7px 0 0;
  font-size: clamp(1.75rem, 3.4vw, 3rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
}

.profile-section-heading > div:first-child > p:last-child {
  max-width: 760px;
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.profile-heading-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.icon-button-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.icon-button-label svg {
  width: 17px;
  height: 17px;
}

.ai-heading-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.ai-mark {
  display: inline-flex;
  align-items: center;
  min-height: 31px;
  gap: 7px;
  padding: 5px 9px;
  color: var(--primary-strong);
  background: linear-gradient(135deg, #f1ebf8, #fff7dd);
  border: 1px solid #d8cbea;
  border-radius: 999px;
  font-size: 0.69rem;
  font-weight: 900;
}

.ai-mark svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.ai-mark.compact {
  min-height: 28px;
  font-size: 0.64rem;
}

.highlight-sticky-grid,
.team-sticky-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.highlight-sticky,
.team-sticky {
  position: relative;
  min-width: 0;
  padding: 24px 20px 19px;
  border: 1px solid rgba(80, 64, 88, 0.12);
  border-radius: 3px 16px 16px 5px;
  box-shadow: 0 14px 26px rgba(53, 42, 68, 0.1);
}

.highlight-sticky:nth-child(1) {
  transform: rotate(-0.7deg);
}

.highlight-sticky:nth-child(2) {
  transform: rotate(0.55deg) translateY(3px);
}

.highlight-sticky:nth-child(3) {
  transform: rotate(-0.35deg);
}

.note-lilac {
  background: linear-gradient(150deg, #f5eefc, #ece2f7);
}

.note-mint {
  background: linear-gradient(150deg, #eaf6f0, #d9ede5);
}

.note-gold {
  background: linear-gradient(150deg, #fff8df, #f5e9ba);
}

.sticky-pin {
  position: absolute;
  top: 9px;
  left: 50%;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 2px solid rgba(255, 255, 255, 0.75);
  border-radius: 50%;
  box-shadow: 0 4px 7px rgba(53, 42, 68, 0.28);
  transform: translateX(-50%);
}

.sticky-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--primary-deep);
  font-size: 0.72rem;
  font-weight: 900;
}

.sticky-label svg {
  width: 18px;
  height: 18px;
}

.highlight-sticky p {
  min-height: 74px;
  margin: 17px 0;
  color: #3f3745;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.55;
}

.highlight-sticky small,
.team-sticky small {
  color: #69616d;
  font-size: 0.65rem;
  font-weight: 750;
  line-height: 1.4;
}

.profile-essential-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.profile-essential-grid article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  padding: 14px;
  background: #faf9fc;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.profile-essential-grid article.is-restricted {
  background: #fffaf0;
  border-color: #ead8aa;
}

.essential-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 13px;
}

.essential-icon.coral {
  color: #7c3024;
  background: var(--coral-soft);
}

.essential-icon svg {
  width: 21px;
  height: 21px;
}

.profile-essential-grid small {
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.profile-essential-grid p {
  margin: 4px 0 0;
  color: #48404d;
  font-size: 0.82rem;
  line-height: 1.5;
}

.team-note-strip {
  margin-top: 26px;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.section-head.compact {
  align-items: center;
  margin-bottom: 13px;
}

.section-head.compact h3,
.section-head.compact p {
  margin: 0;
}

.team-sticky {
  padding: 17px;
  background: #fffdf4;
  border-left: 4px solid var(--gold);
  border-radius: 13px;
}

.team-sticky h4 {
  margin: 11px 0 5px;
}

.team-sticky p {
  margin: 0 0 12px;
  color: var(--muted);
  line-height: 1.48;
}

.highlight-composer {
  margin-top: 24px;
  overflow: hidden;
  background: linear-gradient(145deg, #f8f4fc, #f8fbf8);
  border: 1px solid #d9cdea;
  border-radius: 18px;
}

.highlight-composer > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 13px 16px;
  cursor: pointer;
  list-style: none;
}

.highlight-composer > summary::-webkit-details-marker {
  display: none;
}

.highlight-composer > summary > span:nth-child(2) {
  display: grid;
  gap: 3px;
}

.highlight-composer > summary small {
  color: var(--muted);
  font-weight: 600;
}

.composer-summary-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-radius: 13px;
  font-size: 1.5rem;
}

.composer-summary-action {
  color: var(--primary-strong);
  font-size: 0.76rem;
  font-weight: 900;
}

.highlight-composer[open] > summary {
  border-bottom: 1px solid #d9cdea;
}

.highlight-composer-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.22fr) minmax(280px, 0.78fr);
  gap: 14px;
  padding: 16px;
}

.highlight-note-form {
  margin: 0;
  padding: 17px;
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid var(--line);
  border-radius: 15px;
}

.note-form-actions,
.refine-preview-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.note-form-actions svg {
  width: 17px;
  height: 17px;
}

.local-refine-disclosure {
  margin: 0;
  padding: 10px;
  color: #5a5162;
  background: var(--primary-wash);
  border-left: 4px solid var(--primary);
  font-size: 0.72rem;
  line-height: 1.45;
}

.refine-preview-card {
  position: relative;
  min-width: 0;
  min-height: 250px;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(216, 165, 58, 0.19), transparent 10rem),
    #fff;
  border: 1px solid #d7cae7;
  border-radius: 17px;
}

.refine-preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.refine-preview-card > p:not(.sr-only) {
  min-height: 92px;
  margin: 24px 0;
  color: #443b4b;
  font-size: 0.9rem;
  line-height: 1.6;
}

.ai-thinking-stars {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.ai-thinking-stars i {
  position: absolute;
  display: block;
  width: 8px;
  height: 8px;
  opacity: 0;
  background: var(--gold);
  clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%);
}

.ai-thinking-stars i:nth-child(1) { top: 13%; left: 8%; }
.ai-thinking-stars i:nth-child(2) { top: 17%; right: 12%; width: 13px; height: 13px; }
.ai-thinking-stars i:nth-child(3) { right: 8%; bottom: 18%; }
.ai-thinking-stars i:nth-child(4) { bottom: 11%; left: 15%; width: 11px; height: 11px; }

.refine-preview-card.is-ai-thinking {
  border-color: #bba5d5;
  box-shadow:
    0 0 0 4px rgba(112, 93, 153, 0.1),
    0 16px 40px rgba(63, 43, 84, 0.13);
  animation: ai-card-glow 1.3s ease-in-out infinite;
}

.refine-preview-card.is-ai-thinking .ai-thinking-stars i {
  animation: ai-star-twinkle 1s ease-in-out infinite;
}

.refine-preview-card.is-ai-thinking .ai-thinking-stars i:nth-child(2) { animation-delay: 180ms; }
.refine-preview-card.is-ai-thinking .ai-thinking-stars i:nth-child(3) { animation-delay: 360ms; }
.refine-preview-card.is-ai-thinking .ai-thinking-stars i:nth-child(4) { animation-delay: 540ms; }

@keyframes ai-card-glow {
  50% {
    box-shadow:
      0 0 0 5px rgba(112, 93, 153, 0.16),
      0 18px 46px rgba(63, 43, 84, 0.18);
  }
}

@keyframes ai-star-twinkle {
  0%,
  100% {
    opacity: 0.15;
    transform: scale(0.65) rotate(0);
  }
  50% {
    opacity: 1;
    transform: scale(1.25) rotate(45deg);
  }
}

.trajectory-overview {
  margin-top: 18px;
}

.trajectory-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.trajectory-card-grid > .graphical-empty {
  grid-column: 1 / -1;
}

.trajectory-mini-card,
.profile-trajectory-card {
  min-width: 0;
  background: linear-gradient(150deg, #fff, #faf8fc);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 26px rgba(53, 42, 68, 0.06);
}

.trajectory-mini-card {
  padding: 15px;
}

.trajectory-mini-card > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.trajectory-mini-card header > div {
  min-width: 0;
}

.trajectory-mini-card header span,
.trajectory-current span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 850;
}

.trajectory-mini-card h3 {
  margin: 2px 0 0;
  overflow: hidden;
  font-size: 0.92rem;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.trajectory-mini-card header > strong {
  color: var(--primary-strong);
  font-size: 1.35rem;
}

.goal-domain-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  color: #fff;
  background: linear-gradient(145deg, var(--primary), var(--teal));
  border-radius: 13px;
  font-weight: 950;
}

.mini-chart-shell {
  min-width: 0;
  margin-top: 13px;
  padding: 6px;
  overflow-x: auto;
  background: #fafbf8;
  border: 1px solid #e3e0e5;
  border-radius: 13px;
}

.mini-chart-shell svg {
  display: block;
  width: 100%;
  min-width: 250px;
  height: 122px;
}

.trajectory-mini-card .chart-point-halo {
  opacity: 0.55;
}

.trajectory-mini-card footer {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  color: var(--teal-strong);
  font-size: 0.71rem;
  font-weight: 900;
}

.trajectory-mini-card footer small {
  color: var(--muted);
  font-weight: 750;
}

.graphical-empty {
  position: relative;
  justify-items: center;
  min-height: 210px;
  align-content: center;
  overflow: hidden;
  text-align: center;
}

.empty-orbit {
  position: relative;
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border: 1px dashed #b8a6cc;
  border-radius: 50%;
}

.empty-orbit i {
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border-radius: 50%;
}

.empty-orbit i:nth-child(1) { top: -4px; }
.empty-orbit i:nth-child(2) { right: -3px; bottom: 9px; background: var(--teal); }
.empty-orbit i:nth-child(3) { bottom: 3px; left: 2px; background: var(--gold); }

/* Progress tab */

.progress-reading-note,
.assistant-context-strip,
.session-context-lane {
  display: grid;
  align-items: center;
  min-width: 0;
  gap: 13px;
  padding: 15px;
  border-radius: 16px;
}

.progress-reading-note {
  grid-template-columns: auto minmax(0, 1fr);
  margin-bottom: 16px;
  color: #4e3f5d;
  background: linear-gradient(135deg, var(--primary-soft), #edf6f1);
  border: 1px solid #d4c7e2;
}

.progress-reading-note > span {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--primary);
  border-radius: 14px;
  font-size: 1.3rem;
}

.progress-reading-note p,
.assistant-context-strip p,
.session-context-lane p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.profile-trajectory-list {
  display: grid;
  gap: 16px;
}

.profile-trajectory-card {
  padding: clamp(16px, 2.6vw, 24px);
  border-left: 5px solid var(--primary);
}

.profile-trajectory-card > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.trajectory-title-group {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 12px;
}

.trajectory-title-group h3 {
  margin: 4px 0 0;
  font-size: clamp(1.15rem, 2.4vw, 1.7rem);
}

.trajectory-current {
  display: grid;
  min-width: 160px;
  gap: 2px;
  padding: 12px;
  text-align: right;
  background: var(--primary-soft);
  border: 1px solid #d5c8e3;
  border-radius: 14px;
}

.trajectory-current strong {
  color: var(--primary-strong);
  font-size: 2rem;
  line-height: 1;
}

.trajectory-current small {
  color: var(--muted);
  font-size: 0.68rem;
}

.goal-anchor-grid.compact {
  margin-block: 16px;
}

.profile-trajectory-figure {
  min-width: 0;
  margin: 0;
  padding: 15px;
  background: #fafbf8;
  border: 1px solid var(--line);
  border-radius: 15px;
}

.profile-trajectory-figure > figcaption {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profile-trajectory-figure > figcaption p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.profile-trajectory-figure .line-chart-shell {
  min-height: 205px;
}

.profile-trajectory-figure .progress-line-chart {
  min-width: 520px;
  height: 205px;
}

.session-context-lane {
  grid-template-columns: minmax(220px, 0.45fr) minmax(0, 1fr);
  margin-top: 18px;
  background: #f7f3fa;
  border: 1px solid #ddd2e7;
}

.session-context-pills {
  display: flex;
  min-width: 0;
  gap: 7px;
  overflow-x: auto;
}

.session-context-pills a {
  display: grid;
  min-width: 145px;
  min-height: 58px;
  gap: 3px;
  padding: 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--primary);
  border-radius: 11px;
  text-decoration: none;
}

.session-context-pills a.upcoming {
  border-left-color: var(--teal);
}

.session-context-pills span {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 900;
}

.session-context-pills strong {
  font-size: 0.76rem;
  line-height: 1.3;
}

/* Graphical care plan */

.graphical-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.profile-stat-card {
  display: flex;
  align-items: center;
  min-height: 88px;
  gap: 12px;
  padding: 14px;
  background: linear-gradient(145deg, #fff, #faf8fc);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.profile-stat-card.urgent {
  background: #fff8f5;
  border-color: #e4bfb5;
}

.profile-stat-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 15px;
}

.profile-stat-icon.teal { color: var(--teal-strong); background: var(--teal-soft); }
.profile-stat-icon.coral { color: #7c3024; background: var(--coral-soft); }

.profile-stat-icon svg {
  width: 23px;
  height: 23px;
}

.profile-stat-card > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.profile-stat-card strong {
  font-size: 1.7rem;
  line-height: 1;
}

.profile-stat-card small {
  color: var(--muted);
  font-weight: 800;
}

.visual-care-plan-grid {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(250px, 0.46fr);
  margin-top: 14px;
}

.visual-care-plan-grid .plan-panel {
  min-width: 0;
  padding: 17px;
  border-radius: 18px;
}

.visual-goal-card {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  padding: 14px;
  background: #fcfaff;
  border-left: 4px solid var(--primary);
  border-radius: 15px;
}

.goal-orbit {
  --goal-progress: 0%;
  position: relative;
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  flex: 0 0 72px;
  background: conic-gradient(var(--primary) var(--goal-progress), #e7e0ec 0);
  border-radius: 50%;
}

.goal-orbit::after {
  position: absolute;
  inset: 7px;
  background: #fff;
  border-radius: 50%;
  content: "";
}

.goal-orbit > span {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: baseline;
  color: var(--primary-strong);
}

.goal-orbit strong {
  font-size: 1.28rem;
}

.goal-orbit small {
  font-size: 0.65rem;
  font-weight: 900;
}

.goal-card-copy {
  min-width: 0;
}

.goal-card-copy h4,
.visual-task-card h4 {
  margin: 5px 0;
  font-size: 1rem;
}

.goal-card-copy > p {
  margin: 5px 0 11px;
  font-size: 0.78rem;
}

.goal-anchor-summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  padding: 9px;
  background: #f5f2f8;
  border-radius: 11px;
}

.goal-anchor-summary span {
  color: #504857;
  font-size: 0.69rem;
  line-height: 1.4;
}

.goal-anchor-summary small {
  display: block;
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 0.57rem;
  font-weight: 900;
  text-transform: uppercase;
}

.goal-anchor-summary i {
  color: var(--primary);
  font-style: normal;
}

.visual-task-card {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  padding: 14px 14px 14px 18px;
  overflow: hidden;
  background: #fbfcff;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.task-status-rail {
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--sky);
}

.visual-task-card.high .task-status-rail,
.visual-task-card.urgent .task-status-rail,
.visual-task-card.overdue .task-status-rail {
  background: var(--coral);
}

.visual-task-card p {
  margin: 8px 0;
  font-size: 0.78rem;
}

.visual-preference-panel {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 100% 0%, rgba(20, 117, 109, 0.18), transparent 10rem),
    #fff;
}

.preference-illustration {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin-bottom: 18px;
  color: var(--teal-strong);
  background: var(--teal-soft);
  border-radius: 18px;
}

.preference-illustration svg {
  width: 38px;
  height: 38px;
}

.plan-editor-disclosure {
  margin-top: 16px;
}

/* Sessions, documents, messages, assessments and activity */

.assistant-context-strip {
  grid-template-columns: auto minmax(0, 1fr) auto;
  margin-bottom: 16px;
  background: linear-gradient(135deg, #f2ecf8, #edf6f1);
  border: 1px solid #d6cae4;
}

.assistant-context-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: #fff;
  background: var(--primary);
  border-radius: 15px;
}

.assistant-context-icon svg {
  width: 24px;
  height: 24px;
}

.profile-session-board {
  gap: 12px;
  padding: 0;
}

.profile-session-board .client-session-panel {
  min-width: 0;
  padding: 17px;
  border-radius: 18px;
  box-shadow: none;
}

.profile-session-board .session-row {
  min-width: 0;
  border-radius: 13px;
}

.profile-vault-section .vault-overview {
  grid-template-columns: minmax(150px, 0.25fr) minmax(150px, 0.25fr) minmax(300px, 1fr);
}

.visual-vault-sensitivity {
  min-width: 0;
  border-radius: 16px;
}

.visual-document-card {
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(53, 42, 68, 0.06);
}

.vault-upload {
  top: 210px;
  border-radius: 18px;
}

.message-workspace-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.42fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.message-history-panel {
  min-width: 0;
  padding: 17px;
  background: #faf9fc;
  border: 1px solid var(--line);
  border-radius: 18px;
}

.visual-message-card {
  grid-template-columns: minmax(0, 1fr);
  gap: 5px;
  padding: 15px;
  border-left: 4px solid var(--primary);
  border-radius: 14px;
  box-shadow: none;
}

.visual-message-card h4 {
  margin: 0;
}

.assessment-profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.assessment-profile-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  min-width: 0;
  gap: 13px;
  padding: 17px;
  background: linear-gradient(145deg, #fff, #faf8fc);
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: 17px;
}

.assessment-card-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 15px;
}

.assessment-card-icon svg {
  width: 24px;
  height: 24px;
}

.assessment-profile-card h3 {
  margin: 0;
}

.assessment-profile-card p,
.assessment-profile-card small {
  color: var(--muted);
}

.activity-timeline {
  position: relative;
  display: grid;
  gap: 12px;
  padding-left: 18px;
}

.activity-timeline::before {
  position: absolute;
  top: 10px;
  bottom: 10px;
  left: 8px;
  width: 2px;
  content: "";
  background: linear-gradient(var(--primary), var(--teal));
}

.activity-note-card {
  position: relative;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.activity-marker {
  position: absolute;
  top: 25px;
  left: -16px;
  width: 12px;
  height: 12px;
  background: var(--primary);
  border: 3px solid #f7f3fa;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--primary);
}

.activity-date {
  display: grid;
  align-content: center;
  justify-items: center;
  min-height: 58px;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 13px;
}

.activity-date strong {
  font-size: 0.9rem;
}

.activity-date small {
  color: var(--muted);
  font-size: 0.65rem;
}

.activity-note-card h3 {
  margin: 0;
}

.activity-note-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

/* Assistant pop-out control */

.chatbot-panel-actions {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 5px;
}

.chatbot-popout,
.chatbot-new-chat {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #eff8f4;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 13px;
}

.chatbot-new-chat {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.chatbot-popout[hidden] {
  display: none;
}

.chatbot-popout:hover,
.chatbot-new-chat:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.18);
}

.chatbot-new-chat:disabled,
.chatbot-field select:disabled,
[data-chatbot-person-launch]:disabled {
  cursor: wait;
  opacity: 0.58;
}

.chatbot-popout svg,
.chatbot-new-chat svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.app-body:has(.profile-tab-list) .chatbot-root {
  --chatbot-safe-top: 210px;
}

/* Client profile responsive behavior */

@media (max-width: 1500px) {
  .profile-tool-rail > span,
  .profile-tool-rail > a {
    display: none;
  }

  .profile-tools-menu > div .profile-tool-mobile-link {
    display: block;
  }
}

@media (max-width: 1380px) {
  .profile-navigation-shell {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .profile-tool-rail {
    justify-content: flex-end;
    min-width: 0;
    padding: 0;
    border-top: 0;
  }

  .visual-care-plan-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .visual-preference-panel {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1120px) {
  .client-profile-header {
    grid-template-columns: minmax(0, 1.22fr) minmax(300px, 0.78fr);
  }

  .client-identity-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .highlight-sticky-grid,
  .trajectory-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .highlight-sticky-grid > :last-child,
  .trajectory-card-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .highlight-sticky-grid > :last-child {
    transform: none;
  }

  .profile-vault-section .vault-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-vault-section .visual-vault-sensitivity {
    grid-column: 1 / -1;
  }

  .vault-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .vault-upload {
    position: static;
  }
}

@media (max-width: 900px) {
  .client-profile-header {
    grid-template-columns: minmax(0, 1fr);
  }

  .client-identity-card,
  .profile-snapshot-card {
    min-height: 0;
  }

  .profile-navigation-shell,
  .workspace-context-nav + .app-main .profile-navigation-shell {
    top: 128px;
  }

  .profile-tool-rail {
    justify-content: flex-start;
    overflow-x: auto;
  }

  .profile-section-heading {
    flex-direction: column;
  }

  .profile-heading-actions {
    justify-content: flex-start;
  }

  .highlight-composer-layout,
  .message-workspace-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .visual-care-plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .visual-preference-panel {
    grid-column: auto;
  }

  .session-context-lane {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-profile-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 720px) {
  .client-profile-workspace {
    gap: 12px;
    padding: 12px 10px calc(92px + env(safe-area-inset-bottom));
  }

  .client-identity-card,
  .profile-snapshot-card,
  .profile-panel-section {
    border-radius: 19px;
  }

  .client-identity-card,
  .profile-snapshot-card {
    padding: 17px;
  }

  .client-identity-topline {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 11px;
  }

  .client-profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 17px;
    font-size: 1.35rem;
  }

  .profile-status-pill {
    grid-column: 2;
    justify-self: start;
  }

  .client-identity-heading h1 {
    font-size: clamp(1.85rem, 10vw, 3.3rem);
  }

  .client-identity-details {
    gap: 6px;
  }

  .client-identity-details > div {
    padding: 10px;
  }

  .profile-navigation-shell,
  .workspace-context-nav + .app-main .profile-navigation-shell {
    top: 124px;
    grid-template-columns: minmax(0, 1fr) auto;
    margin-inline: -2px;
    background: rgba(252, 250, 253, 0.99);
    border-radius: 15px;
  }

  .profile-tab-list a {
    min-height: 46px;
    padding-inline: 10px;
  }

  .profile-tool-rail > span {
    display: none;
  }

  .profile-tool-rail {
    justify-content: flex-end;
    min-width: 0;
    padding: 0;
    overflow: visible;
    border-top: 0;
  }

  .profile-tool-rail > a {
    display: none;
  }

  .profile-tools-menu > summary {
    min-height: 44px;
  }

  .profile-tools-menu > div {
    position: fixed;
    top: 188px;
    right: 12px;
    left: 12px;
    width: auto;
    max-height: calc(100dvh - 210px);
    overflow-y: auto;
  }

  .profile-tools-menu > div .profile-tool-mobile-link {
    display: block;
  }

  .profile-panel-section {
    padding: 17px 14px;
  }

  .profile-tab-panel {
    scroll-margin-top: 210px;
  }

  .profile-section-heading h2 {
    font-size: 1.85rem;
  }

  .profile-heading-actions,
  .profile-heading-actions .button {
    width: 100%;
  }

  .profile-heading-actions .button {
    justify-content: center;
  }

  .highlight-sticky-grid,
  .team-sticky-grid,
  .trajectory-card-grid,
  .profile-essential-grid,
  .graphical-stats {
    grid-template-columns: minmax(0, 1fr);
  }

  .highlight-sticky-grid > :last-child,
  .trajectory-card-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .highlight-sticky {
    transform: none !important;
  }

  .highlight-sticky p {
    min-height: 0;
  }

  .highlight-composer > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .composer-summary-action {
    display: none;
  }

  .form-grid.two,
  .care-plan-forms {
    grid-template-columns: minmax(0, 1fr);
  }

  .note-form-actions .button,
  .refine-preview-actions .button {
    flex: 1 1 150px;
  }

  .profile-trajectory-card > header {
    flex-direction: column;
  }

  .trajectory-current {
    width: 100%;
    min-width: 0;
    text-align: left;
  }

  .goal-anchor-grid.compact {
    grid-template-columns: minmax(0, 1fr);
  }

  .goal-anchor-grid.compact .anchor-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }

  .profile-trajectory-figure {
    padding: 11px;
  }

  .profile-trajectory-figure > figcaption {
    flex-direction: column;
  }

  .visual-goal-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .goal-orbit {
    width: 64px;
    height: 64px;
  }

  .goal-anchor-summary {
    grid-template-columns: minmax(0, 1fr);
  }

  .goal-anchor-summary i {
    justify-self: center;
    transform: rotate(90deg);
  }

  .assistant-context-strip {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assistant-context-strip > .status-chip {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .profile-session-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-session-board .session-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .profile-session-board .session-row em {
    grid-column: 2;
  }

  .profile-vault-section .vault-overview {
    grid-template-columns: minmax(0, 1fr);
  }

  .profile-vault-section .visual-vault-sensitivity {
    grid-column: auto;
  }

  .visual-document-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .visual-document-card .document-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assessment-profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assessment-profile-card > .button {
    grid-column: 1 / -1;
  }

  .activity-note-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .activity-date {
    width: fit-content;
    min-width: 58px;
    padding: 6px;
  }

  .app-body:has(.profile-tab-list) .chatbot-root {
    --chatbot-safe-top: 202px;
  }
}

@media (max-width: 420px) {
  .client-profile-workspace {
    padding-inline: 8px;
  }

  .profile-tool-rail > a {
    font-size: 0.67rem;
  }

  .profile-tab-list a span {
    font-size: 0.69rem;
  }

  .trajectory-title-group {
    align-items: flex-start;
  }

  .activity-timeline {
    padding-left: 14px;
  }

  .chatbot-panel-actions {
    gap: 3px;
  }

  .chatbot-popout,
  .chatbot-new-chat,
  .chatbot-panel-actions .chatbot-close {
    width: 40px;
    height: 40px;
    flex-basis: 40px;
  }
}

@media (hover: hover) and (pointer: fine) {
  .profile-tab-list a,
  .profile-tool-rail > a,
  .profile-tools-menu > summary,
  .highlight-sticky,
  .trajectory-mini-card,
  .visual-document-card,
  .assessment-profile-card,
  .chatbot-popout,
  .chatbot-new-chat {
    transition:
      color 150ms ease,
      background 150ms ease,
      border-color 150ms ease,
      box-shadow 150ms ease,
      transform 150ms ease;
  }

  .highlight-sticky:hover {
    z-index: 2;
    box-shadow: 0 19px 34px rgba(53, 42, 68, 0.15);
    transform: translateY(-4px) rotate(0);
  }

  .trajectory-mini-card:hover,
  .visual-document-card:hover,
  .assessment-profile-card:hover {
    border-color: #b7a5cc;
    box-shadow: 0 14px 32px rgba(53, 42, 68, 0.11);
    transform: translateY(-2px);
  }
}

.quiet-mode .client-profile-workspace,
.quiet-mode .client-identity-card,
.quiet-mode .profile-snapshot-card,
.quiet-mode .profile-panel-section {
  background-image: none;
}

.quiet-mode .client-profile-workspace::before,
.quiet-mode .ai-thinking-stars {
  display: none;
}

.quiet-mode .client-identity-card,
.quiet-mode .profile-snapshot-card,
.quiet-mode .profile-navigation-shell,
.quiet-mode .profile-panel-section,
.quiet-mode .highlight-sticky,
.quiet-mode .trajectory-mini-card {
  box-shadow: none;
}

.quiet-mode .highlight-sticky {
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .profile-tab-panel:not([hidden]),
  .refine-preview-card.is-ai-thinking,
  .refine-preview-card.is-ai-thinking .ai-thinking-stars i {
    animation: none;
  }

  .highlight-sticky {
    transform: none !important;
  }
}

/* --------------------------------------------------------------------------
   Assessment workflow refinement
   -------------------------------------------------------------------------- */

.assessment-flow-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0 var(--page-pad) var(--section-pad);
  margin-top: calc(var(--section-pad) * -0.22);
}

.assessment-flow-nav a {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
  min-width: 0;
  min-height: 88px;
  padding: 14px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}

.assessment-flow-nav a > span,
.workflow-step-chip {
  display: inline-grid;
  place-items: center;
  color: #fff;
  background: var(--primary);
  border-radius: 12px;
  font-weight: 950;
}

.assessment-flow-nav a > span {
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
}

.assessment-flow-nav strong,
.assessment-flow-nav small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.assessment-flow-nav strong {
  font-size: 0.94rem;
  line-height: 1.12;
}

.assessment-flow-nav small {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  line-height: 1.18;
}

.app-body .dashboard-hero.compact {
  margin-top: 16px;
  padding: clamp(19px, 2.2vw, 28px);
}

.app-body .dashboard-hero.compact .hero-panel {
  align-items: center;
  gap: clamp(16px, 2.5vw, 30px);
}

.app-body .dashboard-hero.compact h1 {
  max-width: 820px;
  margin-block: 6px 10px;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1;
}

.app-body .dashboard-hero.compact .hero-aside {
  padding: 14px 16px;
}

.app-body .dashboard-hero.compact .hero-aside strong {
  font-size: 1.15rem;
}

.assessment-workflow-section {
  scroll-margin-top: 150px;
}

.workflow-step-chip {
  width: fit-content;
  min-height: 30px;
  margin-bottom: 12px;
  padding: 5px 10px;
  font-size: 0.75rem;
}

.field-hint {
  margin: 0 0 8px !important;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.45;
}

.optional-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.form-grid .span-two,
.assignment-form-group .span-two {
  grid-column: span 2;
}

.form-grid .span-all {
  grid-column: 1 / -1;
}

.question-selection-fieldset,
.assignment-form-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.question-selection-fieldset > legend,
.assignment-form-group > legend {
  margin-bottom: 10px;
  color: var(--ink);
  font-size: 1rem;
  font-weight: 950;
}

.question-picker-toolbar {
  display: grid;
  grid-template-columns: minmax(190px, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.auth-form .question-picker-search {
  display: block;
}

.auth-form .question-picker-search input,
.assessment-list-search input {
  min-height: 44px;
  padding: 9px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}

.assessment-edit-schedule-shell {
  display: grid;
  justify-items: center;
}

.assignment-edit-form {
  width: min(100%, 1120px);
  margin-top: 0;
}

.assignment-locked-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.assignment-locked-group :disabled {
  color: var(--ink);
  background: #f0eef3;
  border-color: var(--line);
  opacity: 1;
  cursor: not-allowed;
}

.question-picker-actions,
.question-order-actions {
  display: flex;
  align-items: center;
  gap: 7px;
}

.button.compact {
  min-height: 40px;
  padding: 8px 11px;
  font-size: 0.78rem;
}

.question-picker {
  max-height: 410px;
  overflow: auto;
  overscroll-behavior: contain;
}

.question-picker > div {
  display: grid;
  gap: 8px;
}

.question-picker-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--line);
  border-radius: 13px;
}

.auth-form .question-picker-item > label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  line-height: 1.4;
  cursor: pointer;
}

.auth-form .question-picker-item input[type="checkbox"] {
  flex: 0 0 auto;
  width: 20px;
  min-height: 20px;
  margin-top: 1px;
  accent-color: var(--primary);
}

.question-picker-item.is-selected {
  background: var(--primary-soft);
  border-color: #baa9cc;
}

.question-order-actions {
  visibility: hidden;
}

.question-picker-item.is-selected .question-order-actions {
  visibility: visible;
}

.question-order-actions button {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--primary-strong);
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  cursor: pointer;
  font-size: 1rem;
  font-weight: 950;
}

.question-picker-count,
.question-picker-empty,
.assessment-list-count {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

html:not(.js) .question-picker-toolbar,
html:not(.js) .question-picker-count,
html:not(.js) .question-order-actions,
html:not(.js) .response-progress-dynamic {
  display: none;
}

.js .response-progress-fallback {
  display: none;
}

.assignment-form-group {
  display: grid;
  gap: 12px;
  padding: 18px;
  background: #faf9fc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.assignment-form-group > legend {
  padding: 0 8px;
}

.assignment-form-group > legend span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-right: 7px;
  color: #fff;
  background: var(--primary);
  border-radius: 9px;
  font-size: 0.78rem;
}

.assignment-timing-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.repeat-interval-control {
  display: grid;
  grid-template-columns: minmax(76px, 0.38fr) minmax(72px, auto);
  gap: 8px;
  align-items: center;
}

.repeat-interval-control > span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
}

.assignment-publish-group {
  grid-template-columns: minmax(160px, 0.3fr) minmax(260px, 1fr) auto;
  align-items: end;
}

.assignment-publish-group > legend {
  grid-column: 1 / -1;
}

.assignment-live-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 5px 10px;
  min-width: 0;
  padding: 13px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.assignment-live-summary .status-chip {
  grid-row: 1 / span 3;
  align-self: start;
}

.assignment-live-summary strong,
.assignment-live-summary p,
.assignment-live-summary small {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.assignment-live-summary p,
.assignment-live-summary small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.assignment-schedule-line,
.assignment-due-line,
.assessment-profile-schedule,
.response-hero-meta,
.available-assessment-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.assignment-schedule-line {
  margin-top: 11px;
}

.assignment-schedule-line span,
.assignment-due-line > span:not(.status-chip),
.assessment-profile-schedule > span:not(.status-chip),
.response-hero-meta > span:not(.status-chip),
.available-assessment-meta span {
  padding: 5px 8px;
  color: var(--muted);
  background: #f5f2f8;
  border-radius: 9px;
  font-size: 0.75rem;
  font-weight: 800;
}

.assignment-note,
.assignment-result-schedule {
  margin: 9px 0 !important;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.assessment-list-search {
  display: block;
  width: min(100%, 280px);
}

.assessment-list-search.wide {
  width: min(100%, 380px);
}

.assessment-list-search input {
  width: 100%;
}

.assessment-list-count {
  margin: -13px 0 14px;
}

.assessment-results-filter-panel {
  margin: 0 var(--page-pad) var(--section-pad);
  padding: 20px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.assessment-filter-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 16px;
}

.assessment-filter-heading h2,
.assessment-filter-heading p {
  margin: 0;
}

.assessment-results-filter-form {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  align-items: end;
  margin-top: 0;
}

.assessment-results-filter-form > .form-field,
.assessment-filter-actions {
  grid-column: span 2;
}

.assessment-filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.available-assessment-section {
  padding-top: 0;
}

.available-assessment-count {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 850;
}

.available-assessment-count b {
  color: var(--primary-strong);
  font-size: 1.6rem;
}

.available-assessment-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.available-assessment-card {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
  padding: 19px;
  background: linear-gradient(145deg, #fff, #f7f3fb);
  border: 1px solid #cbbdda;
  border-top: 5px solid var(--primary);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.available-assessment-card h3,
.available-assessment-card p {
  margin: 7px 0 0;
}

.available-assessment-card .button {
  align-self: end;
  justify-self: start;
}

.available-assessment-meta {
  display: grid;
}

.available-assessment-meta .completion-copy {
  color: var(--teal-strong);
  background: var(--teal-soft);
}

.respond-form {
  max-width: 1240px;
}

.respond-form-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.34fr);
  gap: 20px;
  align-items: start;
}

.respond-question-list {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.response-form-intro {
  padding: 18px 20px;
  background: var(--primary-soft);
  border: 1px solid #cbbdda;
  border-radius: var(--radius);
}

.response-form-intro h2,
.response-form-intro p {
  margin: 0;
}

.respond-question-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.question-number,
.required-label {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
}

.required-label {
  padding: 4px 7px;
  background: var(--gold-soft);
  border-radius: 8px;
}

.respond-question.is-complete {
  border-color: #92c6bd;
  box-shadow: inset 5px 0 0 var(--teal);
}

.answer-options label:has(input:checked) {
  color: var(--primary-deep);
  background: var(--primary-soft);
  border-color: #a894bf;
  box-shadow: 0 0 0 2px rgba(112, 93, 153, 0.12);
}

.respond-submit-panel {
  position: sticky;
  top: 144px;
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 19px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-top: 5px solid var(--teal);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.respond-submit-panel p,
.respond-submit-panel strong {
  margin: 0;
}

.response-progress-dynamic {
  display: grid;
  gap: 9px;
}

.response-progress-track {
  height: 12px;
  overflow: hidden;
  background: #e9eeeb;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.response-progress-track span {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--teal));
  border-radius: inherit;
  transition: width 180ms ease;
}

.response-progress-dynamic p,
.response-progress-fallback,
.response-save-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

.response-assignment-summary {
  display: grid;
  gap: 9px;
  margin: 0;
}

.response-assignment-summary > div {
  display: grid;
  gap: 2px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}

.response-assignment-summary dt {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.response-assignment-summary dd {
  margin: 0;
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.respond-actions.stacked {
  display: grid;
}

.respond-actions.stacked .button {
  width: 100%;
}

.assessment-error-summary {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  color: var(--danger);
  background: var(--coral-soft);
  border: 1px solid rgba(173, 67, 59, 0.28);
  border-radius: var(--radius);
}

.assessment-profile-schedule {
  margin-top: 10px;
}

.assessment-profile-actions {
  display: grid;
  gap: 8px;
  justify-items: stretch;
}

.assessment-profile-actions .button {
  white-space: nowrap;
}

.assessment-complete-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: var(--teal);
  border-radius: 13px;
  font-weight: 950;
}

.chart-data-details {
  margin-top: 14px;
  border-top: 1px solid var(--line);
}

.chart-data-details summary {
  min-height: 42px;
  padding: 11px 2px 7px;
  color: var(--primary-strong);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 900;
}

.chart-data-details.compact {
  margin-top: 2px;
}

.chart-data-details.compact summary {
  min-height: 38px;
  font-size: 0.76rem;
}

.chart-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.chart-data-details table {
  width: 100%;
  min-width: 260px;
  border-collapse: collapse;
  background: #fff;
  font-size: 0.8rem;
}

.chart-data-details caption {
  padding: 8px 9px;
  color: var(--muted);
  font-weight: 850;
  text-align: left;
}

.chart-data-details th,
.chart-data-details td {
  padding: 8px 9px;
  border: 1px solid var(--line);
  text-align: left;
}

.chart-data-details thead th {
  color: var(--ink);
  background: var(--paper-warm);
}

.latest-response-provenance {
  margin: 0;
  padding: 10px 12px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 800;
}

.technical-snapshot {
  color: var(--ink);
  background: #f5f2f8;
  border: 1px solid var(--line);
}

.technical-snapshot summary {
  color: var(--muted);
}

.technical-snapshot > p {
  margin: 0;
  padding: 0 15px 13px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.status-chip.published-lock {
  color: #584b65;
  background: #eee9f2;
  border-color: #d8cde0;
}

.question-order-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.assessment-library-section {
  padding-block: 14px;
}

.assessment-library-disclosure {
  overflow: hidden;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.assessment-library-disclosure > summary,
.assignment-response-details > summary {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.assessment-library-disclosure > summary::-webkit-details-marker,
.assignment-response-details > summary::-webkit-details-marker {
  display: none;
}

.assessment-library-disclosure > summary {
  min-height: 92px;
  padding: 18px 20px;
}

.assessment-library-disclosure > summary > span:first-child,
.assignment-response-details > summary > span:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.assessment-library-disclosure .eyebrow {
  margin: 0;
}

.assessment-library-title {
  color: var(--ink);
  font-size: 1.35rem;
  line-height: 1.2;
}

.assessment-library-disclosure small,
.assignment-response-details small {
  color: var(--muted);
  font-weight: 750;
  line-height: 1.35;
}

.assessment-library-disclosure-action,
.assignment-response-detail-count {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  flex: 0 0 auto;
  color: var(--primary-strong);
  font-size: 0.82rem;
  font-weight: 900;
}

.assessment-library-disclosure-action > span,
.assignment-response-detail-count > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  background: var(--primary-soft);
  border-radius: 9px;
  transition: transform 150ms ease;
}

.assessment-library-disclosure[open] > summary,
.assignment-response-details[open] > summary {
  border-bottom: 1px solid var(--line);
}

.assessment-library-disclosure[open] .assessment-library-disclosure-action > span,
.assignment-response-details[open] .assignment-response-detail-count > span {
  transform: rotate(180deg);
}

.assessment-library-disclosure-body {
  padding: 20px;
}

.assessment-library-disclosure-body > .section-head {
  margin-top: 0;
}

.assignment-response-details {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 13px;
}

.assignment-response-details > summary {
  min-height: 62px;
  padding: 11px 14px;
}

.assignment-response-detail-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.assignment-no-responses {
  margin: 0;
  padding: 11px 13px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  font-size: 0.82rem;
  font-weight: 750;
}

@media (hover: hover) and (pointer: fine) {
  .assessment-flow-nav a,
  .available-assessment-card,
  .question-picker-item {
    transition: border-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  }

  .assessment-flow-nav a:hover,
  .available-assessment-card:hover {
    border-color: #b7a5cc;
    box-shadow: 0 14px 30px rgba(53, 42, 68, 0.12);
    transform: translateY(-2px);
  }
}

@media (max-width: 1180px) {
  .assessment-flow-nav,
  .available-assessment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .assignment-publish-group,
  .respond-form-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .assignment-publish-group > legend {
    grid-column: auto;
  }

  .respond-submit-panel {
    position: static;
  }
}

@media (max-width: 900px) {
  .assessment-flow-nav,
  .available-assessment-grid,
  .assignment-timing-grid,
  .assessment-results-filter-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-results-filter-form > .form-field,
  .assessment-filter-actions,
  .form-grid .span-two,
  .assignment-form-group .span-two {
    grid-column: auto;
  }

  .assessment-filter-heading,
  .question-picker-toolbar {
    display: grid;
  }

  .assessment-list-search,
  .assessment-list-search.wide {
    width: 100%;
  }

  .assessment-profile-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .assignment-locked-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-profile-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .assessment-flow-nav,
  .available-assessment-grid,
  .assessment-profile-actions {
    grid-template-columns: minmax(0, 1fr);
  }

  .assessment-flow-nav a {
    min-height: 76px;
  }

  .question-picker-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .question-picker-actions .button {
    width: 100%;
  }

  .question-picker-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .question-order-actions {
    justify-content: end;
  }

  .assignment-form-group,
  .respond-question,
  .respond-submit-panel,
  .available-assessment-card {
    padding: 15px;
  }

  .assessment-library-disclosure > summary,
  .assignment-response-details > summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .assessment-library-disclosure-action,
  .assignment-response-detail-count {
    justify-content: space-between;
    width: 100%;
  }
}

.quiet-mode .assessment-flow-nav a,
.quiet-mode .assignment-form-group,
.quiet-mode .available-assessment-card,
.quiet-mode .respond-submit-panel,
.quiet-mode .assessment-results-filter-panel {
  background-image: none;
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .assessment-flow-nav a,
  .available-assessment-card,
  .question-picker-item,
  .response-progress-track span,
  .assessment-library-disclosure-action > span,
  .assignment-response-detail-count > span {
    transition: none;
  }
}
