:root {
  --bg: #eef7fb;
  --ink: #102a43;
  --muted: #647785;
  --brand: #047fa3;
  --brand-dark: #075f76;
  --teal: #047fa3;
  --amber: #d99413;
  --accent: #17b89c;
  --card: rgba(255, 255, 255, 0.90);
  --line: rgba(173, 203, 214, 0.58);
  --soft: #e9f7fb;
  --shadow: 0 26px 70px rgba(8, 41, 57, 0.15);
  --shadow-soft: 0 16px 40px rgba(8, 41, 57, 0.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --glass: rgba(255, 255, 255, 0.76);
  --navy: #0b2f44;
  --success: #0f8a72;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, Helvetica, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% -8%, rgba(23, 184, 156, 0.26) 0, transparent 32%),
    radial-gradient(circle at 88% 3%, rgba(4, 127, 163, 0.22) 0, transparent 34%),
    radial-gradient(circle at 40% 95%, rgba(217, 148, 19, 0.12) 0, transparent 34%),
    linear-gradient(135deg, #f8fcfd 0%, var(--bg) 52%, #e7f1f6 100%);
  background-attachment: fixed;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(8, 41, 57, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(8, 41, 57, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent 78%);
  z-index: -1;
}

.beta-environment-banner {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 16px;
  background:
    linear-gradient(135deg, #7c4a03, #d99413 52%, #f8c65d);
  color: #fff7df;
  box-shadow: 0 10px 30px rgba(80, 52, 6, 0.22);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.beta-environment-banner strong {
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.beta-environment-banner span {
  opacity: 0.95;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(244,250,252,0.76));
  backdrop-filter: blur(18px) saturate(135%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.65);
  box-shadow: 0 18px 52px rgba(8, 41, 57, 0.08);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 50px;
  height: 50px;
  border-radius: 16px;
  box-shadow: 0 14px 32px rgba(4, 127, 163, 0.24);
  border: 1px solid rgba(255,255,255,0.85);
}

h1,
h2,
h3,
p {
  margin: 0;
}

.brand h1 {
  font-size: 20px;
  letter-spacing: -0.02em;
  color: var(--navy);
}

.brand p {
  margin-top: 3px;
  color: var(--muted);
  font-size: 13px;
}

button {
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), #06a4bd);
  color: white;
  padding: 12px 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 26px rgba(4, 127, 163, 0.22);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

button:hover {
  background: var(--brand-dark);
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2, 132, 168, 0.22);
}

.demo-button {
  background: linear-gradient(135deg, #f5b342, var(--amber));
  color: #ffffff;
}

.demo-button:hover {
  background: #d97706;
}

.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 13px;
  text-decoration: none;
  font-weight: 800;
}

.link-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 28px rgba(2, 132, 168, 0.16);
}

button:disabled,
textarea:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

button:disabled:hover {
  background: var(--brand);
}

.layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 54px;
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: stretch;
  margin-top: 12px;
}

.hero > div,
.status-card,
.card,
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px) saturate(120%);
}

.hero > div {
  padding: 42px;
  position: relative;
  overflow: hidden;
}

.hero > div::after {
  content: "";
  position: absolute;
  right: -80px;
  top: -100px;
  width: 260px;
  height: 260px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(23, 184, 156, 0.18), transparent 64%);
  pointer-events: none;
}

.portal-intro .helper-note {
  margin-top: 14px;
  font-size: 14px;
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  color: #075f76;
  background: rgba(233, 247, 251, 0.88);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 18px;
}

.hero h2 {
  font-size: clamp(30px, 5vw, 52px);
  line-height: 0.98;
  max-width: 760px;
  letter-spacing: -0.055em;
  color: var(--navy);
}

.hero p {
  margin-top: 18px;
  max-width: 720px;
  line-height: 1.55;
  color: var(--muted);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
}

.preview-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed rgba(245, 158, 11, 0.55);
  border-radius: 14px;
  background: #fffbeb;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.preview-panel small {
  grid-column: 1 / -1;
  color: var(--muted);
}

.how-to-use-panel {
  border-top: 5px solid rgba(245, 158, 11, 0.72);
}

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

.home-step-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff, #f8fbfc);
}

.home-step-card strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: #fffbeb;
  color: var(--amber);
  font-size: 15px;
  margin-bottom: 12px;
}

.home-step-card h3 {
  font-size: 16px;
  margin-bottom: 8px;
}

.home-step-card p {
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.access-divider {
  margin: 18px 0 12px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.secondary-link {
  color: var(--brand-dark);
  font-weight: 700;
  text-decoration: none;
}

.status-card {
  padding: 24px;
}

.status-card {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(239, 250, 252, 0.86)),
    radial-gradient(circle at 100% 0, rgba(23,184,156,0.14), transparent 32%);
}

.status-card ul {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.status-card li {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(4, 127, 163, 0.12);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 8px 20px rgba(8, 41, 57, 0.04);
}

.status-card h3 {
  margin-bottom: 14px;
}

.collapsible-status-card details {
  display: grid;
  gap: 14px;
}

.collapsible-status-card summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}

.collapsible-status-card summary::-webkit-details-marker {
  display: none;
}

.collapsible-status-card summary h3 {
  margin: 0;
}

.collapsible-status-card summary > span {
  width: auto;
  height: auto;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.10);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.status-card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 13px;
}

.status-card li {
  color: var(--muted);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.status-card li:hover {
  border-color: rgba(2, 132, 168, 0.28);
  background: rgba(255, 255, 255, 0.92);
  transform: translateY(-1px);
}

.status-card-link {
  appearance: none;
  width: 100%;
  border: 0;
  background: transparent;
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 0 10px;
  align-items: start;
  text-align: left;
  color: inherit;
  text-decoration: none;
  font: inherit;
  cursor: pointer;
}

.status-card-link strong {
  display: block;
  color: var(--ink);
  font-size: 14px;
  line-height: 1.25;
}

.status-card-link small {
  display: block;
  grid-column: 2;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.status-card span {
  display: inline-block;
  width: 10px;
  height: 10px;
  background: var(--accent);
  border-radius: 50%;
  margin-right: 8px;
}

.collapsible-status-card summary > span {
  width: auto;
  height: auto;
  margin: 0;
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.10);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.collapsible-status-card details[open] .details-closed-label,
.collapsible-status-card details:not([open]) .details-open-label {
  display: none;
}

.collapsible-status-card details:not([open]) .details-closed-label {
  display: inline-block;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.dashboard-pulse {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
}

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

.left-analytics-rail,
.left-admin-trigger-rail {
  display: none;
}

.left-admin-trigger-rail {
  gap: 12px;
}

.admin-trigger-card {
  border-color: rgba(217, 144, 22, 0.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(255, 251, 235, 0.74));
}

.admin-trigger-card::after {
  background: rgba(245, 158, 11, 0.10);
}

.admin-trigger-card .big {
  color: #b86f0d;
}

.left-analytics-heading {
  display: grid;
  gap: 2px;
  padding: 0 2px 4px;
}

.left-analytics-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.left-analytics-heading strong {
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -0.03em;
}

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

.left-analytics-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(173, 203, 214, 0.58);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,253,255,0.88));
  box-shadow: 0 14px 34px rgba(17, 61, 78, 0.10);
}

.left-analytics-card .mini-donut {
  width: 62px;
  height: 62px;
}

.left-analytics-card .mini-donut span {
  font-size: 12px;
}

.left-analytics-card strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
  letter-spacing: -0.02em;
}

.left-analytics-card p {
  margin: 3px 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.25;
}

.left-analytics-card small {
  color: var(--muted);
  font-size: 12px;
}

.demo-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 0.9fr;
  gap: 18px;
  margin-top: 18px;
}

.staff-demo-warning {
  margin-top: 14px;
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
  border-radius: 12px;
  background: #eefbff;
  color: var(--brand-dark);
  font-weight: 800;
  line-height: 1.45;
}

.demo-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fbfdfe;
}

.demo-card h3 {
  margin-bottom: 8px;
}

.demo-card p {
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 12px;
}

.training-suggestion-card,
.continuous-assessment-card {
  margin-top: 18px;
  border: 1px solid rgba(245, 158, 11, 0.38);
  border-radius: 22px;
  padding: 20px;
  background: linear-gradient(180deg, #fffaf0, #ffffff);
}

.training-suggestion-card h3,
.continuous-assessment-card h2 {
  margin-bottom: 8px;
}

.training-suggestion-card p,
.continuous-assessment-card p {
  color: var(--muted);
  line-height: 1.5;
}

.training-suggestion-card > label,
.continuous-assessment-card > label {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  color: var(--ink);
  font-weight: 700;
}

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

.assessment-case-card {
  display: grid;
  gap: 10px;
}

.assessment-case-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.assessment-case-heading span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.18);
  color: #92400e;
  font-size: 12px;
  font-weight: 900;
}

.assessment-case-card h4,
.assessment-result h4 {
  margin-top: 8px;
  margin-bottom: 6px;
}

.assessment-case-card ul,
.assessment-result ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.6;
}

.assessment-result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 12px 0 16px;
}

.assessment-result-item {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #ffffff;
}

.assessment-result-item span {
  color: var(--ink);
  font-weight: 800;
}

.assessment-result-item small {
  color: var(--muted);
  font-weight: 800;
}

.assessment-result-item.matched {
  border-color: rgba(14, 126, 112, 0.35);
  background: #f0fdf9;
}

.assessment-result-item.needs-review {
  border-color: rgba(245, 158, 11, 0.42);
  background: #fffbeb;
}

.assessment-note {
  margin-top: 12px;
  font-size: 13px;
  font-weight: 800;
}

.demo-practice-graph {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 16px;
  align-items: center;
}

.demo-practice-graph ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.analytics-card {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #ffffff;
}

.analytics-card h3 {
  margin-bottom: 12px;
}

.period-toggle {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.period-toggle .secondary-button {
  padding: 9px 12px;
  font-size: 13px;
}

.period-toggle .active-period {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(2, 132, 168, 0.20);
}

.period-toggle .role-interval-hidden {
  display: none;
}

.analytics-subtitle {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  margin: -4px 0 12px;
}

.interval-analytics-card {
  grid-column: 1 / -1;
  border-color: rgba(14, 116, 144, 0.24);
  background:
    radial-gradient(circle at 10% 18%, rgba(245, 158, 11, 0.13), transparent 28%),
    linear-gradient(135deg, rgba(238, 249, 252, 0.95), rgba(255, 255, 255, 0.98));
}

.interval-card-heading {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.interval-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(14, 116, 144, 0.20);
  background: #ffffff;
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.role-interval-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
}

.governance-card {
  border-color: rgba(2, 132, 168, 0.28);
  background:
    linear-gradient(180deg, rgba(233, 247, 251, 0.72), rgba(255, 255, 255, 0.96));
}

.condition-drilldown,
.rank-list,
.mini-donut-grid,
.circle-metric-grid {
  display: grid;
  gap: 10px;
}

.condition-group {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f7fbfd;
  color: var(--ink);
  font-weight: 700;
  text-align: left;
}

.condition-group span {
  color: var(--brand-dark);
  font-size: 13px;
}

.condition-group.active-condition {
  background: var(--brand);
  color: #ffffff;
  border-color: var(--brand);
}

.condition-group.active-condition span {
  color: #ffffff;
}

.condition-group.future-condition {
  cursor: not-allowed;
  opacity: 0.72;
  background: #f3f6f7;
}

.condition-group.future-condition span {
  color: var(--muted);
}

.condition-breakdown:not(.mini-donut-grid),
.rank-list > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.condition-breakdown:not(.mini-donut-grid) {
  display: grid;
  padding: 12px 14px;
  border-left: 4px solid var(--brand);
  background: #ffffff;
  border-radius: 14px;
  box-shadow: 0 10px 24px rgba(17, 61, 78, 0.06);
}

.condition-breakdown:not(.mini-donut-grid) div,
.rank-list > div {
  padding: 8px 0;
  border-bottom: 1px solid #eef5f7;
}

.condition-breakdown:not(.mini-donut-grid) div:last-child,
.rank-list > div:last-child {
  border-bottom: 0;
}

.condition-breakdown:not(.mini-donut-grid) span,
.rank-list span {
  color: var(--muted);
}

.condition-breakdown:not(.mini-donut-grid) strong,
.rank-list strong {
  color: var(--brand-dark);
  text-align: right;
}

.mini-donut-grid,
.circle-metric-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-donut-card,
.circle-metric-card {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid #eef5f7;
  border-radius: 16px;
  background: #f8fdff;
  text-align: center;
}

.mini-donut {
  --value: 50;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle closest-side, #ffffff 62%, transparent 64%),
    conic-gradient(var(--brand) calc(var(--value) * 1%), #e7eef1 0);
}

.mini-donut span,
.circle-metric span {
  font-weight: 800;
  color: var(--brand-dark);
  font-size: 14px;
}

.circle-metric {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 10px solid rgba(2, 132, 168, 0.18);
  background: #ffffff;
  box-shadow: inset 0 0 0 2px rgba(2, 132, 168, 0.10);
}

.circle-metric.warning-circle {
  border-color: rgba(245, 158, 11, 0.28);
  box-shadow: inset 0 0 0 2px rgba(245, 158, 11, 0.16);
}

.circle-metric.warning-circle span {
  color: var(--amber);
}

.mini-donut-card p,
.circle-metric-card p {
  margin: 0;
  font-weight: 800;
  color: var(--ink);
  font-size: 13px;
}

.mini-donut-card small,
.circle-metric-card small {
  color: var(--muted);
  font-size: 12px;
}

.projection-list strong {
  color: var(--amber);
}

.chart-row {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 16px;
  align-items: center;
}

.chart-row ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.donut-chart {
  --value: 50;
  width: 112px;
  height: 112px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle closest-side, #ffffff 68%, transparent 70%),
    conic-gradient(var(--brand) calc(var(--value) * 1%), #e7eef1 0);
}

.donut-chart span {
  font-weight: 800;
  color: var(--brand-dark);
}

.card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "";
  position: absolute;
  right: -24px;
  top: -24px;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.08);
}

.card h3 {
  font-size: 16px;
}

.card .big {
  margin-top: 16px;
  font-size: 40px;
  color: var(--brand);
  font-weight: 800;
}

.card p:last-child {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.45;
}

.dashboard-case-card {
  padding: 0;
}

.dashboard-case-card details {
  position: relative;
  z-index: 1;
  padding: 22px;
}

.dashboard-case-card summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.dashboard-case-card summary::-webkit-details-marker {
  display: none;
}

.dashboard-case-card summary::marker,
.collapsible-status-card summary::marker,
.access-request-panel summary::marker,
.multi-select-dropdown summary::marker {
  content: "";
  font-size: 0;
}

.dashboard-case-card summary > span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.10);
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  transition: transform 0.18s ease, background 0.18s ease;
}

.dashboard-case-card details[open] summary > span {
  transform: rotate(180deg);
  background: rgba(245, 158, 11, 0.18);
  color: #a35f00;
}

.dashboard-card-case-list {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  max-height: 300px;
  overflow-y: auto;
  padding-right: 6px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(2, 132, 168, 0.35) rgba(226, 232, 240, 0.55);
}

.dashboard-card-case-list::-webkit-scrollbar {
  width: 8px;
}

.dashboard-card-case-list::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.55);
  border-radius: 999px;
}

.dashboard-card-case-list::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 168, 0.35);
  border-radius: 999px;
}

.dashboard-mini-case-list {
  display: grid;
  gap: 10px;
}

.dashboard-mini-case {
  display: grid;
  gap: 5px;
  padding: 11px;
  border-radius: 14px;
  cursor: pointer;
}

.assessment-triage-disabled {
  opacity: 0.74;
}

.assessment-triage-disabled select {
  cursor: not-allowed;
  background: #eef2f7;
  color: #64748b;
}

.field-note {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dashboard-mini-case-title {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.25;
}

.dashboard-mini-case-meta,
.dashboard-mini-case-summary {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.dashboard-mini-case-summary {
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.take-case-button {
  justify-self: start;
  margin-top: 4px;
  padding: 7px 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.12);
  color: var(--teal);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.take-case-button:hover {
  background: var(--teal);
  color: #ffffff;
}

.panel {
  margin-top: 22px;
  padding: 26px;
  box-shadow: var(--shadow-soft);
}

.panel h2 {
  font-size: 22px;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 16px;
}

.panel-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.panel-collapse-btn {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  min-width: 42px;
  width: 42px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(2, 132, 168, 0.18);
  background: rgba(255, 255, 255, 0.86);
  color: var(--teal);
  font-size: 0;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.panel-collapse-btn::before {
  content: "";
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.18s ease;
}

.collapsible-panel.is-collapsed > .panel-heading .panel-collapse-btn::before {
  transform: rotate(45deg);
}

.panel-collapse-btn:hover {
  background: rgba(231, 246, 250, 0.96);
}

.collapsible-panel.is-collapsed {
  padding-bottom: 18px;
}

.collapsible-panel.is-collapsed > .panel-heading {
  margin-bottom: 0;
}

.collapsible-panel.is-collapsed > :not(.panel-heading) {
  display: none !important;
}

.secondary-button {
  background: #e7eef1;
  color: var(--ink);
}

.secondary-button:hover {
  background: #d8e4e8;
}

.case-list {
  display: grid;
  gap: 12px;
}

.case-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfeff;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.case-item:hover {
  transform: translateY(-1px);
  border-color: rgba(2, 132, 168, 0.35);
  box-shadow: 0 12px 28px rgba(17, 61, 78, 0.08);
}

.case-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.case-title {
  font-weight: 800;
}

.case-meta {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.case-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  background: var(--soft);
  color: var(--brand-dark);
}

.tag.pending {
  background: #fff4e5;
  color: #9b5a00;
}

.tag.flag {
  background: #ffe9e9;
  color: #a22626;
}

.case-summary {
  color: var(--muted);
  line-height: 1.45;
  margin-top: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.case-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 4px 0 16px;
}

.case-filter-bar .active-filter {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 10px 22px rgba(2, 132, 168, 0.18);
}

.case-queue-note {
  margin: 4px 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(173, 203, 214, 0.58);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.84), rgba(248,253,255,0.78));
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.case-queue {
  border: 1px solid rgba(173, 203, 214, 0.62);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.92), rgba(248,253,255,0.82));
  box-shadow: 0 16px 38px rgba(8, 41, 57, 0.08);
  overflow: hidden;
}

.case-queue + .case-queue {
  margin-top: 12px;
}

.case-queue summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 16px;
  cursor: pointer;
  list-style: none;
  color: var(--navy);
  font-weight: 900;
}

.case-queue summary::-webkit-details-marker {
  display: none;
}

.case-queue summary::before {
  content: "⌄";
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border-radius: 999px;
  background: rgba(4, 127, 163, 0.10);
  color: var(--brand-dark);
  transition: transform 0.18s ease;
}

.case-queue[open] summary::before {
  transform: rotate(180deg);
}

.case-queue summary span {
  flex: 1;
}

.case-queue summary strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #eef8fb;
  color: var(--brand-dark);
  font-size: 13px;
}

.case-queue-body {
  padding: 0 14px 14px;
  border-top: 1px solid rgba(173, 203, 214, 0.42);
}

.compact-case-list {
  padding-top: 12px;
}

.compact-empty-state {
  margin-top: 14px;
}

.case-queue-more {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(233, 247, 251, 0.82);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.case-detail-panel {
  margin-top: 18px;
  border: 1px solid rgba(2, 132, 168, 0.22);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 18px 38px rgba(17, 61, 78, 0.08);
  overflow: hidden;
}

.main-case-workspace {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.main-case-snapshot-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(173, 203, 214, 0.62);
  border-radius: 18px;
  padding: 15px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,253,255,0.82));
  box-shadow: 0 14px 34px rgba(8, 41, 57, 0.08);
}

.current-case-snapshot-card {
  border-color: rgba(4, 127, 163, 0.34);
  background:
    radial-gradient(circle at top right, rgba(23, 184, 156, 0.18), transparent 36%),
    linear-gradient(135deg, rgba(255,255,255,0.98), rgba(237, 250, 253, 0.92));
  box-shadow: 0 18px 42px rgba(4, 127, 163, 0.12);
}

.main-case-snapshot-label,
.snapshot-section-heading span {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.main-case-snapshot-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 18px;
  letter-spacing: -0.02em;
}

.main-case-view-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.case-view-tab {
  border: 1px solid rgba(4, 127, 163, 0.18);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.case-view-tab:hover {
  border-color: rgba(4, 127, 163, 0.36);
  background: rgba(232, 248, 252, 0.96);
}

.case-view-tab.active-case-view-tab {
  background: linear-gradient(135deg, #f6b44b, #d99016);
  border-color: rgba(217, 144, 22, 0.84);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(217, 144, 22, 0.22);
}

.main-case-snapshot-summary {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.48;
  white-space: pre-wrap;
  max-height: 190px;
  overflow-y: auto;
  padding: 11px 12px;
  border: 1px solid rgba(226, 232, 240, 0.78);
  border-radius: 14px;
  background: rgba(248, 250, 252, 0.76);
  scrollbar-width: thin;
  scrollbar-color: rgba(2, 132, 168, 0.35) rgba(226, 232, 240, 0.55);
}

.main-case-snapshot-summary::-webkit-scrollbar {
  width: 7px;
}

.main-case-snapshot-summary::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.55);
  border-radius: 999px;
}

.main-case-snapshot-summary::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 168, 0.35);
  border-radius: 999px;
}

.main-case-snapshot-actions {
  margin-top: 2px;
}

.last-case-snapshot-section {
  display: grid;
  gap: 10px;
}

.snapshot-section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.snapshot-section-heading small {
  color: var(--muted);
  font-size: 12px;
}

.last-case-snapshot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.last-case-snapshot-grid .main-case-snapshot-card h3 {
  font-size: 15px;
}

.last-case-snapshot-grid .main-case-snapshot-summary {
  max-height: 128px;
}

.case-flag-tool {
  border-color: rgba(185, 123, 25, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 248, 231, 0.96), rgba(255, 255, 255, 0.94));
}

.case-flag-tool h2 {
  color: #8a5313;
}

.case-detail-header {
  padding: 16px;
  background:
    linear-gradient(135deg, rgba(2, 132, 168, 0.08), rgba(85, 198, 216, 0.06)),
    #f8fdff;
  border-bottom: 1px solid var(--line);
}

.case-detail-header h3 {
  font-size: 18px;
  margin-bottom: 6px;
}

.case-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.case-detail-body {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.case-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.case-detail-field {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px;
  background: #fbfeff;
}

.case-detail-field strong {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}

.case-detail-field span {
  font-weight: 800;
  color: var(--ink);
}

.case-detail-block {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: #ffffff;
}

.case-detail-block h4 {
  font-size: 14px;
  margin-bottom: 8px;
}

.case-detail-block pre {
  white-space: pre-wrap;
  font-family: inherit;
  color: var(--muted);
  line-height: 1.5;
  margin: 0;
}

.case-review-action-bar {
  position: sticky;
  bottom: 0;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-top: 1px solid rgba(173, 203, 214, 0.62);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,253,255,0.98));
  box-shadow: 0 -14px 34px rgba(8, 41, 57, 0.08);
}

.case-review-action-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.empty-state {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.steps div {
  padding: 16px;
  border-radius: 18px;
  background: #f7fbfd;
  border: 1px solid var(--line);
}

.steps strong {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--brand);
  color: white;
  margin-bottom: 10px;
}

.steps p {
  line-height: 1.45;
  color: var(--muted);
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(8, 33, 44, 0.58);
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal-window {
  width: min(980px, 100%);
  height: min(860px, 96vh);
  background: white;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(255, 255, 255, 0.55);
}

.modal-header {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, #ffffff, #f3fbfd);
}

.modal-header h2 {
  font-size: 18px;
}

.modal-header p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 3px;
}

.case-flag-route-window {
  width: min(620px, 100%);
  height: auto;
  max-height: calc(100vh - 36px);
}

.case-flag-route-body {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.route-choice-card {
  display: grid;
  gap: 6px;
  text-align: left;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.38);
  background: #ffffff;
  color: var(--ink);
  box-shadow: 0 16px 38px rgba(8, 41, 57, 0.08);
  cursor: pointer;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease;
}

.route-choice-card span {
  font-weight: 900;
  font-size: 1.02rem;
}

.route-choice-card strong {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

.route-choice-card:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 22px 48px rgba(8, 41, 57, 0.14);
}

.admin-route-choice {
  border-left: 6px solid #f59e0b;
}

.clinical-route-choice {
  border-left: 6px solid var(--teal);
}

.case-override-window {
  width: min(760px, 100%);
  height: auto;
  max-height: calc(100vh - 36px);
}

.case-override-body {
  display: grid;
  gap: 14px;
  padding: 18px;
  overflow-y: auto;
}

.case-override-body label {
  display: grid;
  gap: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.case-override-body label span {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.case-override-body textarea {
  min-height: 94px;
  resize: vertical;
}

#caseOverrideOriginal {
  min-height: 76px;
  color: var(--muted);
  background: rgba(248, 250, 252, 0.92);
}

.case-override-actions {
  position: static;
  margin: 2px -18px -18px;
}

.case-override-action {
  border-color: rgba(217, 144, 22, 0.46);
  color: #8a5313;
  background: rgba(255, 248, 231, 0.82);
}

.case-override-action:hover {
  background: #fff7df;
}

.case-override-highlight {
  border: 1px solid rgba(217, 119, 6, 0.34);
  border-left: 6px solid #f59e0b;
  background:
    linear-gradient(135deg, rgba(255, 247, 237, 0.96), rgba(255, 251, 235, 0.92));
  box-shadow: 0 18px 42px rgba(146, 64, 14, 0.12);
}

.override-highlight-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 12px;
}

.override-highlight-header h4 {
  margin: 6px 0 0;
  color: #7c2d12;
}

.override-pill {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 10px;
  color: #7c2d12;
  background: rgba(251, 191, 36, 0.28);
  font-size: 0.72rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.override-id {
  border-radius: 999px;
  padding: 5px 9px;
  color: #92400e;
  background: rgba(255, 255, 255, 0.76);
  font-size: 0.72rem;
  font-weight: 850;
  white-space: nowrap;
}

.override-highlight-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.override-highlight-field {
  border: 1px solid rgba(217, 119, 6, 0.18);
  border-radius: 16px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.78);
}

.override-highlight-field strong {
  display: block;
  margin-bottom: 7px;
  color: #92400e;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.override-highlight-field pre {
  max-height: 210px;
  margin: 0;
  overflow: auto;
  color: #422006;
  white-space: pre-wrap;
}

.emphasized-override-field {
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(255, 251, 235, 0.96);
}

.route-choice-card:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.case-review-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  scroll-behavior: smooth;
}

.case-review-body::-webkit-scrollbar {
  width: 10px;
}

.case-review-body::-webkit-scrollbar-track {
  background: rgba(226, 232, 240, 0.62);
  border-radius: 999px;
}

.case-review-body::-webkit-scrollbar-thumb {
  background: rgba(2, 132, 168, 0.42);
  border-radius: 999px;
}

.close-btn {
  position: relative;
  z-index: 5;
  pointer-events: auto;
  background: #e7eef1;
  color: var(--ink);
}

iframe {
  width: 100%;
  flex: 1;
  border: 0;
}

.hidden {
  display: none !important;
}

.role-hidden {
  display: none !important;
}

.support-popout-host {
  display: contents;
}

.ask-dr-bubble {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: 999px;
  padding: 12px 14px 12px 16px;
  background: linear-gradient(135deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 24px 58px rgba(8, 41, 57, 0.24);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ask-dr-bubble strong {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  font-size: 0;
  line-height: 0;
}

.ask-dr-bubble strong::before {
  content: "";
  width: 15px;
  height: 10px;
  border: 2px solid currentColor;
  border-radius: 7px;
  box-sizing: border-box;
}

.ask-dr-bubble strong::after {
  content: "";
  position: absolute;
  right: 8px;
  bottom: 7px;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(38deg);
}

.ask-dr-bubble:hover {
  transform: translateY(-2px);
  box-shadow: 0 28px 70px rgba(8, 41, 57, 0.30);
}

.ask-dr-bubble.active {
  background: linear-gradient(135deg, var(--accent), #b67a11);
  box-shadow: 0 30px 76px rgba(182, 122, 17, 0.32);
}

.admin-support-bubble {
  left: 24px;
  right: auto;
  background: linear-gradient(135deg, #f59e0b, #9a5b05);
}

.admin-support-bubble strong::before {
  width: 14px;
  height: 16px;
  border-radius: 4px;
}

.admin-support-bubble strong::after {
  right: auto;
  bottom: auto;
  top: 10px;
  left: 9px;
  width: 10px;
  height: 2px;
  border: 0;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
  transform: none;
}

.admin-support-bubble.active {
  background: linear-gradient(135deg, #f97316, #7c2d12);
  box-shadow: 0 30px 76px rgba(154, 91, 5, 0.32);
}

.ask-dr-popout {
  position: fixed !important;
  right: 24px;
  bottom: 88px;
  z-index: 60;
  width: min(430px, calc(100vw - 32px));
  max-height: min(76vh, 720px);
  overflow: auto;
  border: 1px solid rgba(19, 86, 111, 0.14);
  border-radius: 24px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 251, 252, 0.98));
  box-shadow: 0 32px 90px rgba(8, 41, 57, 0.26);
}

.ask-dr-popout-header {
  position: sticky;
  top: -20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(19, 86, 111, 0.10);
  border-radius: 24px 24px 0 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.ask-dr-popout-header h2 {
  margin: 0;
}

.ask-dr-popout label {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.ask-dr-popout textarea,
.ask-dr-popout select {
  width: 100%;
}

.ask-dr-popout textarea {
  min-height: 110px;
}

.admin-support-popout {
  position: fixed !important;
  left: 24px;
  bottom: 88px;
  z-index: 60;
  width: min(430px, calc(100vw - 32px));
  max-height: min(76vh, 720px);
  overflow: auto;
  border: 1px solid rgba(154, 91, 5, 0.18);
  border-radius: 24px;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 250, 235, 0.98));
  box-shadow: 0 32px 90px rgba(92, 51, 12, 0.24);
}

.admin-support-popout-header {
  position: sticky;
  top: -20px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 14px;
  padding: 16px 18px;
  border-bottom: 1px solid rgba(154, 91, 5, 0.12);
  border-radius: 24px 24px 0 0;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.admin-support-popout-header h2 {
  margin: 0;
}

.support-rail {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(173, 203, 214, 0.58);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,253,255,0.88));
  box-shadow: 0 18px 44px rgba(8, 41, 57, 0.10);
}

.admin-support-rail {
  display: none !important;
}

.support-rail-heading {
  display: grid;
  gap: 2px;
  padding: 4px 6px 8px;
}

.support-rail-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.support-rail-heading strong {
  color: var(--ink);
  font-size: 1rem;
}

.support-rail button {
  display: grid;
  gap: 5px;
  width: 100%;
  border: 1px solid rgba(173, 203, 214, 0.62);
  border-radius: 16px;
  padding: 12px 13px;
  text-align: left;
  color: #173f52;
  background: rgba(255, 255, 255, 0.78);
  cursor: pointer;
  transition:
    transform 0.16s ease,
    box-shadow 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease;
}

.support-rail button:hover {
  transform: translateY(-1px);
  border-color: rgba(4, 127, 163, 0.32);
  background: #ffffff;
  box-shadow: 0 14px 30px rgba(8, 41, 57, 0.10);
}

.support-rail button small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.35;
}

.admin-support-rail {
  border-left: 5px solid rgba(217, 148, 19, 0.74);
}

.clinical-support-rail {
  border-left: 5px solid rgba(4, 127, 163, 0.74);
}

@media (max-width: 820px) {
  .topbar {
    padding: 14px 16px;
  }

  .topbar > button {
    display: none;
  }

  .hero,
  .cards,
  .home-step-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .hero > div {
    padding: 26px;
  }

  .modal {
    padding: 0;
  }

  .modal-window {
    height: 100vh;
    border-radius: 0;
  }

  .ask-dr-bubble {
    right: 14px;
    bottom: 14px;
    padding: 12px;
  }

  .ask-dr-bubble span {
    display: none;
  }

  .ask-dr-popout {
    right: 12px;
    bottom: 74px;
    width: calc(100vw - 24px);
    max-height: 72vh;
    border-radius: 20px;
    padding: 16px;
  }

  .ask-dr-popout-header {
    top: -16px;
    margin: -16px -16px 12px;
    padding: 14px 16px;
    border-radius: 20px 20px 0 0;
  }

  .admin-support-bubble {
    left: 14px;
    right: auto;
    bottom: 14px;
  }

  .admin-support-popout {
    left: 12px;
    bottom: 74px;
    width: calc(100vw - 24px);
    max-height: 72vh;
    border-radius: 20px;
    padding: 16px;
  }

  .admin-support-popout-header {
    top: -16px;
    margin: -16px -16px 12px;
    padding: 14px 16px;
    border-radius: 20px 20px 0 0;
  }

  .support-rail {
    border-radius: 20px;
  }
}


/* =====================================
   LIVE PORTAL V1 ADDITIONS
   ===================================== */

.top-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.signed-in-chip {
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 999px;
  padding: 9px 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.top-view-as-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid rgba(245, 158, 11, 0.36);
  border-radius: 999px;
  background: rgba(255, 251, 235, 0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.70);
}

.top-view-as-control label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #7c4a03;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.top-view-as-control select {
  min-width: 150px;
  height: 34px;
  padding: 5px 28px 5px 10px;
  border: 1px solid rgba(180, 83, 9, 0.28);
  border-radius: 999px;
  background-color: #ffffff;
  color: #422006;
  font-size: 12px;
  font-weight: 800;
}

.top-view-as-control button {
  min-height: 34px;
  padding: 7px 11px;
  border-radius: 999px;
  font-size: 12px;
}

.graph-export-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.graph-export-actions button {
  min-height: 38px;
  border-color: rgba(2, 132, 168, 0.26);
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(235,248,252,0.94));
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.secondary-button {
  background: #eaf2f5;
  color: var(--ink);
}

.auth-panel {
  margin-bottom: 20px;
  border-top: 5px solid rgba(2, 132, 168, 0.78);
}

.signin-card {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid rgba(2, 132, 168, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(238, 249, 252, 0.88)),
    radial-gradient(circle at 100% 0, rgba(2, 132, 168, 0.10), transparent 34%);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08);
}

.signin-grid {
  display: grid;
  grid-template-columns: minmax(240px, 420px);
  gap: 14px;
  margin-top: 12px;
}

.signin-actions {
  margin-top: 16px;
}

.access-request-panel {
  margin-top: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.78);
  overflow: hidden;
}

.access-request-panel > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  color: var(--muted);
  font-weight: 800;
  list-style: none;
}

.access-request-panel > summary::-webkit-details-marker {
  display: none;
}

.access-request-panel > summary strong {
  color: var(--teal);
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(2, 132, 168, 0.10);
}

.access-request-panel[open] > summary {
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

.access-request-body {
  padding: 18px;
}

.access-helper {
  margin: 0 0 4px;
  color: var(--muted);
  line-height: 1.55;
}

.locked-notice {
  border-color: #cfe4eb;
  background: linear-gradient(135deg, #f8fcfd, #eef8fb);
}

.locked-notice h2 {
  margin-bottom: 8px;
}

.locked-notice p {
  color: var(--muted);
  line-height: 1.55;
  margin-top: 6px;
}

.quick-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.quick-nav-group {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(173, 203, 214, 0.52);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.quick-nav-group-label {
  flex: 0 0 auto;
  padding: 0 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.quick-nav-clinical {
  border-color: rgba(2, 132, 168, 0.24);
}

.quick-nav-review {
  border-color: rgba(30, 64, 175, 0.18);
}

.live-workspace-status {
  flex: 1 1 100%;
  border-color: rgba(124, 58, 237, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(245, 243, 255, 0.9));
}

.workspace-model-status {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.workspace-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 10px;
  background: #f8fafc;
  border: 1px solid rgba(148, 163, 184, 0.35);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.workspace-edit-active,
.workspace-edit-mode #toggleWorkspaceEditBtn {
  border-color: rgba(245, 158, 11, 0.65) !important;
  background: #fffbeb !important;
  color: #92400e !important;
}

.workspace-edit-mode .live-workspace-status {
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.14);
}

.workspace-personal-hidden {
  display: none !important;
}

.workspace-personal-pinned {
  order: -20;
  box-shadow: 0 14px 34px rgba(14, 116, 144, 0.12);
}

.workspace-personal-collapsed {
  opacity: 0.96;
}

.workspace-personal-ordered {
  position: relative;
}

.workspace-drag-handle {
  display: none;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  min-height: 30px;
  margin-right: 6px;
  padding: 0;
  border: 1px solid rgba(245, 158, 11, 0.44);
  border-radius: 999px;
  background:
    linear-gradient(135deg, #fffbeb, #ffffff);
  color: #a16207;
  font-size: 16px;
  font-weight: 950;
  cursor: grab;
  box-shadow: 0 8px 20px rgba(120, 53, 15, 0.08);
}

.workspace-edit-mode .workspace-drag-handle {
  display: inline-flex;
}

.workspace-edit-mode .workspace-draggable {
  outline: 2px dashed rgba(245, 158, 11, 0.24);
  outline-offset: 3px;
}

.workspace-edit-mode .workspace-draggable:hover {
  outline-color: rgba(245, 158, 11, 0.58);
  box-shadow: 0 18px 44px rgba(120, 53, 15, 0.10);
}

.workspace-drag-handle:active {
  cursor: grabbing;
}

.workspace-dragging {
  opacity: 0.62;
  transform: scale(0.985);
  outline: 3px solid rgba(245, 158, 11, 0.72) !important;
  box-shadow: 0 26px 70px rgba(120, 53, 15, 0.22) !important;
}

.quick-nav a,
.quick-nav button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--ink);
  background: #ffffff;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
  font: inherit;
  cursor: pointer;
}

.quick-nav a:hover,
.quick-nav button:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.clinical-warning {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 4px solid var(--amber);
  border-radius: 12px;
  background: #fffbeb;
  color: #7c4a03;
  font-weight: 800;
}

.portal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: center;
  width: min(1180px, calc(100% - 32px));
  margin: 10px auto 24px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 12px 30px rgba(16, 42, 67, 0.06);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.portal-footer span {
  display: inline-flex;
  align-items: center;
}

.portal-footer span + span::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 18px;
  border-radius: 999px;
  background: var(--line);
}

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

label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(217, 232, 237, 0.9);
  border-radius: 16px;
  background: #fbfeff;
}

.field-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

input,
select,
textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  font: inherit;
  color: var(--ink);
  background: #ffffff;
  outline: none;
}

.multi-select-dropdown {
  position: relative;
}

.multi-select-dropdown summary {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 12px;
  color: var(--ink);
  background: #ffffff;
  cursor: pointer;
  list-style: none;
}

.multi-select-dropdown summary::-webkit-details-marker {
  display: none;
}

.multi-select-dropdown summary::after {
  content: "⌄";
  float: right;
  color: var(--muted);
}

.multi-select-dropdown[open] summary {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(2, 132, 168, 0.10);
}

.multi-select-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: var(--shadow);
  padding: 8px;
}

.multi-select-options label {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 8px;
  border-radius: 10px;
  color: var(--ink);
  font-weight: 700;
}

.multi-select-options label:hover {
  background: #f3fbfd;
}

.multi-select-options input {
  width: auto;
}

textarea {
  min-height: 94px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(2, 132, 168, 0.10);
}

.error-text {
  color: #b42318 !important;
}

.tools-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.tools-grid article {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fbfdfe;
  box-shadow: 0 10px 24px rgba(17, 61, 78, 0.06);
}

.tools-grid article h2 {
  display: flex;
  align-items: center;
  gap: 9px;
}

.tools-grid article h2::before {
  content: "";
  width: 9px;
  height: 22px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.tools-grid article p {
  color: var(--muted);
  margin-top: 7px;
  margin-bottom: 14px;
  line-height: 1.5;
}

.system-maintenance-card {
  margin-bottom: 18px;
  border: 1px solid rgba(124, 58, 237, 0.22);
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(124, 58, 237, 0.08), rgba(2, 132, 168, 0.06)),
    #ffffff;
}

.system-maintenance-card h2 {
  font-size: 19px;
}

.system-maintenance-card p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

.benefits-viewer-card {
  margin-bottom: 18px;
  border: 1px solid rgba(2, 132, 168, 0.22);
  border-radius: 18px;
  padding: 18px;
  background:
    linear-gradient(135deg, rgba(232, 249, 251, 0.96), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.benefits-viewer-card h2 {
  font-size: 19px;
}

.benefits-viewer-card p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.5;
}

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

.system-status-grid div {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.78);
}

.system-status-grid strong,
.system-status-grid span {
  display: block;
}

.system-status-grid strong {
  font-size: 12px;
  color: var(--muted);
}

.system-status-grid span {
  margin-top: 6px;
  font-weight: 800;
  color: var(--ink);
}

.developer-view-as {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 16px;
  background: rgba(255, 251, 235, 0.86);
}

.developer-view-as h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.developer-view-as .form-grid {
  grid-template-columns: minmax(240px, 1fr);
  max-width: 420px;
}

.developer-view-as .actions {
  margin-top: 14px;
}

.mini-list,
.review-output {
  margin-top: 14px;
  border: 1px solid var(--line);
  background: #ffffff;
  border-radius: 16px;
  padding: 12px;
  color: var(--muted);
  min-height: 48px;
}

.mini-item {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.mini-item:last-child {
  border-bottom: 0;
}

.mini-item span {
  color: var(--muted);
  font-size: 13px;
}

.ask-dr-responder {
  margin-top: 22px;
  padding-top: 10px;
}

.ask-dr-responder hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 18px 0;
}

.ask-dr-queue-item {
  width: 100%;
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.ask-dr-queue-item:last-child {
  border-bottom: 0;
}

.ask-dr-queue-item:hover,
.ask-dr-queue-item:focus {
  background: #f7fbfd;
  outline: none;
}

.ask-dr-queue-item strong {
  font-size: 14px;
}

.ask-dr-queue-item span,
.ask-dr-queue-item small {
  color: var(--muted);
  font-size: 13px;
}

.ask-dr-thread {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f8fbfc;
  padding: 14px;
}

.ask-dr-message {
  align-items: flex-start;
}

.ask-dr-message p {
  margin: 8px 0 0;
  color: var(--ink);
  white-space: pre-wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(14, 126, 112, 0.12);
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.online-user-item {
  align-items: center;
}

.online-user-item > div:first-child,
.online-status {
  display: grid;
  gap: 4px;
}

.online-status {
  text-align: right;
}

.online-status strong {
  color: var(--brand);
}

.online-work-line {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.review-output strong {
  color: var(--ink);
}

.review-output ul {
  margin: 8px 0 14px;
  padding-left: 20px;
}

.case-item {
  cursor: pointer;
}

.case-item.selected {
  border-color: var(--brand);
  background: #f3fbfd;
  box-shadow: 0 0 0 4px rgba(2, 132, 168, 0.08);
}

.help-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 10px 14px;
}

.button-icon {
  position: relative;
  display: inline-block;
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
}

.button-icon-help {
  border: 2px solid currentColor;
  border-radius: 50%;
}

.button-icon-help::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid currentColor;
  border-radius: 50%;
  opacity: 0.55;
}

.button-icon-help::after {
  content: "";
  position: absolute;
  left: 7px;
  top: 1px;
  width: 2px;
  height: 14px;
  border-radius: 999px;
  background: currentColor;
  box-shadow: 7px 7px 0 -1px currentColor, -7px 7px 0 -1px currentColor;
  opacity: 0.7;
}

.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
}

.guided-cursor {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 84;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  transition:
    transform 520ms cubic-bezier(0.2, 0.82, 0.2, 1),
    opacity 180ms ease;
  filter: drop-shadow(0 18px 30px rgba(15, 23, 42, 0.22));
}

.guided-cursor.hidden {
  opacity: 0;
  visibility: hidden;
}

.guided-cursor-pointer {
  position: relative;
  width: 24px;
  height: 34px;
  transform: rotate(-18deg);
  border-radius: 9px 9px 14px 14px;
  background:
    linear-gradient(135deg, #f59e0b, #facc15);
  clip-path: polygon(0 0, 100% 43%, 62% 54%, 81% 100%, 55% 100%, 37% 60%, 0 83%);
  animation: guidedCursorPulse 1.25s ease-in-out infinite;
}

.guided-cursor-label {
  max-width: min(260px, calc(100vw - 80px));
  padding: 8px 11px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 999px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.98), rgba(255, 255, 255, 0.96));
  color: #7c4a03;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.human-helper {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 88;
  display: grid;
  justify-items: center;
  gap: 12px;
  pointer-events: none;
}

.human-helper-button {
  position: relative;
  width: 64px;
  height: 64px;
  min-height: 64px;
  padding: 0;
  border: 1px solid rgba(245, 158, 11, 0.42);
  border-radius: 50%;
  background:
    radial-gradient(circle at 32% 24%, rgba(255,255,255,0.92), transparent 32%),
    linear-gradient(135deg, #f59e0b, #0e7490);
  color: #ffffff;
  box-shadow:
    0 22px 52px rgba(8, 41, 57, 0.26),
    0 0 0 8px rgba(245, 158, 11, 0.12);
  pointer-events: auto;
  cursor: pointer;
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.human-helper-button:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow:
    0 28px 66px rgba(8, 41, 57, 0.30),
    0 0 0 10px rgba(245, 158, 11, 0.16);
}

.human-helper-button::after {
  content: "";
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 2px solid rgba(245, 158, 11, 0.28);
  animation: humanHelperPulse 2.4s ease-in-out infinite;
}

.human-helper-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.human-helper-head {
  position: absolute;
  top: 15px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: inset -3px -3px 0 rgba(14, 116, 144, 0.18);
}

.human-helper-body {
  position: absolute;
  bottom: 13px;
  width: 34px;
  height: 19px;
  border-radius: 18px 18px 10px 10px;
  background: #ffffff;
  box-shadow: inset -5px -4px 0 rgba(14, 116, 144, 0.16);
}

.human-helper-badge {
  position: absolute;
  right: 0;
  top: -2px;
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid #ffffff;
  background: #ef4444;
  color: #ffffff;
  font-size: 12px;
  font-weight: 950;
}

.human-helper-popout {
  order: -1;
  width: min(380px, calc(100vw - 32px));
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.30);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.96));
  box-shadow: 0 30px 78px rgba(8, 41, 57, 0.25);
  pointer-events: auto;
}

.human-helper-popout.hidden {
  display: none;
}

.human-helper-popout-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.human-helper-eyebrow {
  display: block;
  color: #b45309;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.human-helper-popout h3 {
  margin: 3px 0 0;
  color: #173f52;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.human-helper-close {
  width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  background: #ffffff;
  color: #92400e;
  font-size: 20px;
  line-height: 1;
}

.human-helper-popout p {
  margin: 12px 0 14px;
  color: #315665;
  font-weight: 760;
  line-height: 1.55;
}

.human-helper-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.human-helper-actions button {
  min-height: 38px;
  padding: 8px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

@keyframes humanHelperPulse {
  0%,
  100% {
    opacity: 0.25;
    transform: scale(0.96);
  }
  50% {
    opacity: 0.62;
    transform: scale(1.08);
  }
}

@keyframes guidedCursorPulse {
  0%,
  100% {
    transform: rotate(-18deg) translateY(0);
  }
  50% {
    transform: rotate(-18deg) translateY(-5px);
  }
}

.tutorial-card {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: min(480px, calc(100vw - 32px));
  max-height: min(76vh, 680px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 28px 80px rgba(17, 61, 78, 0.22);
  pointer-events: auto;
}

.tutorial-step-label {
  display: inline-flex;
  padding: 6px 10px;
  border-radius: 999px;
  background: #fffbeb;
  color: #a16207;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 10px;
}

.tutorial-card h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.tutorial-card p,
.tutorial-text {
  color: var(--muted);
  line-height: 1.55;
}

.tutorial-text p {
  margin: 0 0 10px;
}

.tutorial-text ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: #315466;
  line-height: 1.5;
}

.tutorial-text li + li {
  margin-top: 7px;
}

.tutorial-note {
  margin-top: 12px !important;
  padding: 10px 12px;
  border-radius: 14px;
  background: #fffbeb;
  color: #92400e !important;
  font-weight: 700;
}

.tutorial-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.tutorial-highlight {
  position: relative;
  z-index: 70;
  outline: 4px solid rgba(245, 158, 11, 0.72);
  outline-offset: 7px;
  box-shadow: 0 0 0 9999px rgba(9, 29, 38, 0.18);
}

@media (min-width: 1180px) {
  body.portal-unlocked .layout {
    width: min(980px, calc(100% - 680px));
    margin-left: clamp(16px, 3vw, 48px);
    margin-right: auto;
  }

  .cards.dashboard-pulse {
    position: fixed;
    top: 92px;
    right: 18px;
    z-index: 8;
    width: min(600px, calc(100vw - 40px));
    max-height: calc(100vh - 118px);
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 6px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 0;
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 132, 168, 0.35) rgba(226, 232, 240, 0.55);
  }

  .cards.dashboard-pulse::-webkit-scrollbar {
    width: 8px;
  }

  .cards.dashboard-pulse::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.55);
    border-radius: 999px;
  }

  .cards.dashboard-pulse::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 168, 0.35);
    border-radius: 999px;
  }

  .dashboard-pulse .card {
    border-radius: 18px;
    box-shadow: 0 14px 34px rgba(17, 61, 78, 0.12);
  }

  .dashboard-case-card details {
    padding: 16px;
  }

  .dashboard-card-case-list {
    max-height: 230px;
  }

  .dashboard-pulse .card h3 {
    font-size: 13px;
  }

  .dashboard-pulse .card .big {
    margin-top: 8px;
    font-size: 28px;
  }

  .dashboard-pulse .card p:last-child {
    font-size: 12px;
  }
}

@media (min-width: 1500px) {
  body.portal-unlocked .layout {
    width: min(820px, calc(100% - 990px));
    margin-left: 340px;
    margin-right: 630px;
  }

  body.portal-unlocked .left-analytics-rail:not(.hidden):not(.role-hidden),
  body.portal-unlocked .left-admin-trigger-rail:not(.hidden):not(.role-hidden) {
    position: fixed;
    top: 104px;
    left: 18px;
    z-index: 7;
    width: 300px;
    max-height: calc(100vh - 124px);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: grid;
    gap: 12px;
    padding-right: 6px;
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 132, 168, 0.35) rgba(226, 232, 240, 0.55);
  }

  .left-analytics-rail::-webkit-scrollbar,
  .left-admin-trigger-rail::-webkit-scrollbar {
    width: 8px;
  }

  .left-analytics-rail::-webkit-scrollbar-track,
  .left-admin-trigger-rail::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.55);
    border-radius: 999px;
  }

  .left-analytics-rail::-webkit-scrollbar-thumb,
  .left-admin-trigger-rail::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 168, 0.35);
    border-radius: 999px;
  }
}

@media (max-width: 820px) {
  .top-actions {
    width: 100%;
    justify-content: space-between;
  }

  .form-grid,
  .tools-grid,
  .demo-grid,
  .status-card ul,
  .analytics-grid,
  .chart-row,
  .last-case-snapshot-grid,
  .case-detail-grid,
  .assessment-result-grid {
    grid-template-columns: 1fr;
  }

  .demo-practice-graph,
  .system-status-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-card {
    right: 12px;
    bottom: 12px;
  }
}

/* =====================================
   SOPHISTICATED VISUAL REFRESH
   v0.2.20
   ===================================== */

.panel,
.card,
.analytics-card,
.tools-grid article,
.demo-card,
.case-item,
.home-step-card,
.field-block,
label {
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.panel:hover,
.analytics-card:hover,
.tools-grid article:hover,
.home-step-card:hover,
.demo-card:hover {
  border-color: rgba(4, 127, 163, 0.22);
  box-shadow: 0 22px 56px rgba(8, 41, 57, 0.12);
}

.quick-nav {
  position: sticky;
  top: 88px;
  z-index: 7;
  background:
    linear-gradient(135deg, rgba(255,255,255,0.88), rgba(244,250,252,0.78));
  backdrop-filter: blur(16px) saturate(130%);
  border-radius: 999px;
  box-shadow: 0 18px 45px rgba(8, 41, 57, 0.10);
}

.quick-nav a,
.quick-nav button {
  border: 1px solid rgba(173, 203, 214, 0.54);
  background: rgba(255,255,255,0.82);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.quick-nav a:hover,
.quick-nav button:hover {
  transform: translateY(-1px);
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(8, 41, 57, 0.08);
}

.panel-heading h2,
.analytics-card h3,
.card h3,
.status-card h3,
.tools-grid article h2 {
  letter-spacing: -0.02em;
  color: var(--navy);
}

.card {
  isolation: isolate;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.96), rgba(248,253,255,0.88));
  border: 1px solid rgba(173, 203, 214, 0.54);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(4,127,163,0.08), transparent 52%);
  z-index: -1;
}

.card .big {
  letter-spacing: -0.06em;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.analytics-card,
.case-detail-panel,
.mini-list,
.review-output,
.training-suggestion-card,
.continuous-assessment-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,253,255,0.86));
  border-color: rgba(173, 203, 214, 0.58);
  box-shadow: 0 18px 44px rgba(8, 41, 57, 0.08);
}

.donut-chart,
.mini-donut {
  box-shadow:
    inset 0 0 0 1px rgba(255,255,255,0.86),
    0 16px 34px rgba(8, 41, 57, 0.10);
}

.donut-chart span,
.mini-donut span,
.circle-metric span {
  letter-spacing: -0.04em;
}

.condition-group,
.case-item,
.case-detail-field,
.case-detail-block,
.assessment-result-item,
.mini-donut-card,
.circle-metric-card,
.system-status-grid div {
  background: rgba(255, 255, 255, 0.78);
  border-color: rgba(173, 203, 214, 0.54);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}

.case-item {
  position: relative;
  overflow: hidden;
}

.case-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
  opacity: 0.78;
}

.case-title {
  color: var(--navy);
  letter-spacing: -0.015em;
}

.tag {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7);
}

.tag.pending {
  background: #fff4df;
  color: #8a5205;
}

.tag.flag {
  background: #fff0f0;
  color: #9b1c1c;
}

.case-action-chip {
  border: 0;
  cursor: pointer;
  font: inherit;
  transition: transform 0.14s ease, box-shadow 0.14s ease;
}

.case-action-chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(8, 41, 57, 0.12);
}

.auth-panel {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.94), rgba(243,250,252,0.88)),
    radial-gradient(circle at 100% 0, rgba(4,127,163,0.12), transparent 34%);
}

input,
select,
textarea,
.multi-select-dropdown summary {
  border-color: rgba(173, 203, 214, 0.72);
  background: rgba(255,255,255,0.92);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.88);
}

input:hover,
select:hover,
textarea:hover,
.multi-select-dropdown summary:hover {
  border-color: rgba(4, 127, 163, 0.32);
}

.field-block,
label {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.78), rgba(248,253,255,0.72));
}

.status-pill,
.signed-in-chip,
.online-status strong {
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.65);
}

.portal-footer {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.84), rgba(246,251,253,0.72));
  backdrop-filter: blur(12px);
  border-color: rgba(173, 203, 214, 0.52);
}

.modal-window,
.tutorial-card {
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,253,255,0.94));
  border: 1px solid rgba(255,255,255,0.82);
  box-shadow: 0 34px 95px rgba(8, 41, 57, 0.26);
}

.tutorial-highlight {
  outline: 4px solid rgba(217, 148, 19, 0.78);
  box-shadow: 0 0 0 9999px rgba(9, 29, 38, 0.24);
}

@media (min-width: 1180px) {
  .cards.dashboard-pulse {
    top: 104px;
  }

  .dashboard-pulse .card {
    border-radius: 22px;
    background:
      linear-gradient(180deg, rgba(255,255,255,0.94), rgba(248,253,255,0.86));
    backdrop-filter: blur(15px);
  }
}

@media (max-width: 820px) {
  .quick-nav {
    top: 74px;
    border-radius: 22px;
  }

  .portal-footer {
    border-radius: 22px;
  }
}

/* =====================================
   CRM WORKSPACE PATTERN
   v0.2.38
   ===================================== */

body.portal-unlocked {
  --crm-left: 290px;
  --crm-right: 310px;
}

body.portal-unlocked .topbar {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,253,255,0.90));
  border-bottom: 1px solid rgba(173, 203, 214, 0.58);
}

body.portal-unlocked .brand p {
  color: #426171;
}

.hidden-duplicate-case-list {
  display: none !important;
}

#recentCases.case-workstation-idle {
  display: none !important;
}

.queue-card {
  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    max-height 180ms ease;
}

.queue-card summary {
  list-style: none;
}

.queue-card summary::-webkit-details-marker {
  display: none;
}

.queue-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.queue-card-header h3 {
  margin: 0;
  flex: 1 1 auto;
}

.queue-card-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  margin-left: auto;
  margin-right: 42px;
  border-radius: 999px;
  border: 1px solid rgba(4, 127, 163, 0.16);
  background:
    linear-gradient(135deg, rgba(236, 254, 255, 0.96), rgba(255, 255, 255, 0.96));
  color: var(--brand-dark);
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.86);
}

.queue-card:not(.queue-card-is-collapsed) .queue-card-count-pill {
  border-color: rgba(217, 144, 22, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 248, 231, 0.98), rgba(255, 255, 255, 0.96));
  color: #9a5f0d;
}

.queue-card-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  border: 1px solid rgba(4, 127, 163, 0.18);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-dark);
  font-size: 15px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.queue-card[open] .queue-card-toggle::before {
  content: "";
}

.queue-card:not([open]) .queue-card-toggle::before {
  content: "";
}

.queue-card-toggle:hover {
  background: rgba(4, 127, 163, 0.10);
  border-color: rgba(4, 127, 163, 0.34);
}

.queue-card.queue-card-collapsed > p:not(.big),
.queue-card.queue-card-collapsed .dashboard-card-case-list,
.queue-card.queue-card-collapsed .queue-card-body {
  display: none !important;
}

.queue-card.queue-card-collapsed {
  padding-bottom: 14px;
}

.queue-card:not(.queue-card-is-collapsed) .queue-card-toggle::before {
  content: "";
}

.queue-card.queue-card-is-collapsed .queue-card-toggle::before {
  content: "";
}

.queue-card.queue-card-is-collapsed .queue-card-body {
  display: none !important;
}

.queue-card-body > .big {
  display: none !important;
}

.queue-card.queue-card-is-collapsed {
  padding-bottom: 14px;
}

.queue-card-toggle {
  transition:
    background 160ms ease,
    border-color 160ms ease,
    color 160ms ease,
    transform 160ms ease,
    box-shadow 160ms ease;
}

.queue-card:not(.queue-card-is-collapsed) .queue-card-toggle {
  background: linear-gradient(135deg, #f6b44b, #d99016);
  border-color: rgba(217, 144, 22, 0.88);
  color: #ffffff;
  box-shadow:
    0 10px 22px rgba(217, 144, 22, 0.26),
    inset 0 1px 0 rgba(255,255,255,0.42);
}

.queue-card:not(.queue-card-is-collapsed) .queue-card-toggle::before {
  content: "";
}

.queue-card.queue-card-is-collapsed .queue-card-toggle::before {
  content: "";
}

.queue-card-toggle:hover {
  transform: translateY(-1px);
  background: linear-gradient(135deg, #ffc861, #e29b1a);
  border-color: rgba(217, 144, 22, 0.94);
  color: #ffffff;
  box-shadow:
    0 12px 25px rgba(217, 144, 22, 0.28),
    inset 0 1px 0 rgba(255,255,255,0.45);
}

.queue-card {
  position: relative;
}

.queue-card-header {
  padding-right: 54px;
}

.queue-card-toggle {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 4;
  padding: 0;
  font-size: 0;
}

.queue-card-toggle::before {
  content: "" !important;
  width: 10px;
  height: 10px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-135deg);
  transition: transform 0.18s ease;
}

.queue-card.queue-card-is-collapsed .queue-card-toggle::before {
  transform: rotate(45deg);
}

.queue-card-toggle:focus-visible {
  outline: 3px solid rgba(245, 158, 11, 0.42);
  outline-offset: 3px;
}

.view-as-column {
  margin: 0;
  padding: 16px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.94), rgba(255, 255, 255, 0.90));
  box-shadow: 0 14px 34px rgba(120, 53, 15, 0.10);
}

.view-as-column-header {
  display: grid;
  gap: 2px;
  margin-bottom: 8px;
}

.view-as-column-header span {
  color: #9a5b00;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.view-as-column-header strong {
  color: #422006;
  font-size: 18px;
}

.view-as-column p {
  margin: 0 0 12px;
  color: #6b4b18;
  font-size: 12px;
  line-height: 1.45;
}

.view-as-column label {
  display: grid;
  gap: 6px;
  color: #422006;
  font-size: 12px;
  font-weight: 800;
}

.view-as-column select {
  width: 100%;
  border-color: rgba(180, 83, 9, 0.24);
  background: rgba(255, 255, 255, 0.92);
}

.view-as-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.view-as-actions button {
  width: 100%;
}

.governance-assurance-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.governance-manual-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 16px;
  margin: 18px 0;
}

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

.governance-manual-grid textarea {
  min-height: 96px;
}

.governance-target-board {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.governance-graph-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px;
  border: 1px solid rgba(4, 127, 163, 0.22);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(4, 127, 163, 0.14), transparent 34%),
    linear-gradient(145deg, rgba(255,255,255,0.98), rgba(239,249,252,0.84));
  box-shadow: 0 18px 46px rgba(8, 41, 57, 0.10);
}

.governance-graph-card h3 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 18px;
}

.governance-graph-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.governance-graph-row {
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 160px;
}

.governance-donut {
  width: 116px;
  height: 116px;
}

.target-input-label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.target-input-label input,
.governance-pillar-graph input {
  width: 82px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.42);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--ink);
  font-weight: 800;
  text-align: center;
}

.governance-target-status {
  display: inline-flex;
  width: fit-content;
  margin-top: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(4, 127, 163, 0.10);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 800;
}

.governance-target-status.is-below-target {
  background: rgba(245, 158, 11, 0.16);
  color: #a16207;
}

.governance-target-status.is-on-target {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.governance-pillar-graph-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(245px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.governance-pillar-graph {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(173, 203, 214, 0.58);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.84);
}

.governance-pillar-graph strong {
  display: block;
  color: var(--navy);
  font-size: 13px;
}

.governance-pillar-graph small {
  display: block;
  margin: 3px 0 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.governance-pillar-graph label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.governance-pillar-graph .governance-target-status {
  margin: 8px 0 0;
  font-style: normal;
}

.governance-assurance-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  border: 1px solid rgba(4, 127, 163, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), rgba(238, 250, 253, 0.72));
  box-shadow: 0 16px 36px rgba(8, 41, 57, 0.08);
}

.governance-assurance-card::after {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: rgba(4, 127, 163, 0.10);
}

.governance-label {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(4, 127, 163, 0.10);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.governance-assurance-card h3 {
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
}

.governance-assurance-card p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

@media (min-width: 1180px) {
  body.portal-unlocked .layout {
    width: min(1580px, calc(100% - 32px));
    margin: 0 auto;
    padding-top: 22px;
    display: grid;
    grid-template-columns: var(--crm-left) minmax(0, 1fr) var(--crm-right);
    gap: 18px;
    align-items: start;
  }

  body.portal-unlocked .hero {
    grid-column: 1 / -1;
    margin: 0;
  }

  body.portal-unlocked .hero > div {
    padding: 22px 24px;
    border-radius: 24px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
  }

  body.portal-unlocked .hero > div::after {
    width: 180px;
    height: 180px;
    right: -70px;
    top: -80px;
  }

  body.portal-unlocked .hero h2 {
    font-size: clamp(24px, 2.2vw, 34px);
    line-height: 1.04;
    letter-spacing: -0.035em;
  }

  body.portal-unlocked .hero p {
    margin-top: 8px;
    max-width: 780px;
    font-size: 14px;
  }

  body.portal-unlocked .hero .actions {
    justify-content: flex-end;
    margin-top: 0;
    max-width: 560px;
  }

  body.portal-unlocked #quickNav {
    grid-column: 1 / -1;
    grid-row: 2;
    position: sticky;
    top: 76px;
    z-index: 12;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    margin: 0;
    border-radius: 999px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(2, 132, 168, 0.35) rgba(226, 232, 240, 0.55);
    background:
      linear-gradient(135deg, rgba(255,255,255,0.96), rgba(248,253,255,0.88));
    box-shadow: 0 16px 38px rgba(8, 41, 57, 0.12);
  }

  body.portal-unlocked #quickNav::-webkit-scrollbar {
    height: 7px;
  }

  body.portal-unlocked #quickNav::-webkit-scrollbar-track {
    background: rgba(226, 232, 240, 0.55);
    border-radius: 999px;
  }

  body.portal-unlocked #quickNav::-webkit-scrollbar-thumb {
    background: rgba(2, 132, 168, 0.35);
    border-radius: 999px;
  }

  body.portal-unlocked #quickNav::before {
    content: "";
    display: none;
  }

  body.portal-unlocked #quickNav .quick-nav-group {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    min-height: 48px;
  }

  body.portal-unlocked #quickNav .quick-nav-group-label {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 10px 0 6px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }

  body.portal-unlocked #quickNav a,
  body.portal-unlocked #quickNav button {
    width: auto;
    flex: 0 0 auto;
    justify-content: center;
    border-radius: 999px;
    padding: 10px 14px;
    color: #173f52;
    background: rgba(255, 255, 255, 0.76);
  }

  body.portal-unlocked #quickNav a:hover,
  body.portal-unlocked #quickNav button:hover {
    color: var(--brand-dark);
    border-color: rgba(4, 127, 163, 0.30);
    background: #ffffff;
  }

  body.portal-unlocked #leftAdminTriggerRail:not(.hidden):not(.role-hidden) {
    grid-column: 1;
    grid-row: 3;
    position: sticky;
    top: 150px;
    z-index: 6;
    width: auto;
    max-height: calc(100vh - 168px);
    overflow-y: auto;
    display: grid;
    gap: 12px;
    padding-right: 6px;
    align-self: start;
  }

  body.portal-unlocked #adminSupportRail:not(.hidden):not(.role-hidden) {
    display: none;
  }

  body.portal-unlocked #dashboard:not(.hidden):not(.role-hidden) {
    grid-column: 3;
    grid-row: 3;
    position: sticky;
    top: 150px;
    z-index: 7;
    width: auto;
    max-height: calc(100vh - 168px);
    overflow-y: auto;
    padding-right: 6px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    align-self: start;
  }

  body.portal-unlocked #dashboard .dashboard-card-case-list {
    max-height: 215px;
    overflow-y: auto;
  }

  body.portal-unlocked #recentCases,
  body.portal-unlocked #analyticsDashboard,
  body.portal-unlocked #governanceAssurancePanel,
  body.portal-unlocked #clinicalTools,
  body.portal-unlocked #roleDemoPanel,
  body.portal-unlocked #systemMaintenancePanel,
  body.portal-unlocked [data-role-panel="ask-dr-workflow"] {
    grid-column: 2;
  }

  body.portal-unlocked #analyticsDashboard {
    grid-column: 2;
    grid-row: 4;
  }

  body.portal-unlocked #governanceAssurancePanel {
    grid-column: 2;
    grid-row: 5;
  }

  body.portal-unlocked #recentCases {
    grid-row: 3;
  }

  body.portal-unlocked #clinicalTools {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.portal-unlocked .panel,
  body.portal-unlocked .card,
  body.portal-unlocked .tools-grid article {
    box-shadow: 0 16px 42px rgba(8, 41, 57, 0.10);
  }
}

@media (min-width: 1500px) {
  body.portal-unlocked .layout {
    width: min(1600px, calc(100% - 36px));
    margin-left: auto;
    margin-right: auto;
  }
}

/* =====================================
   BETA ADAPTIVE INTERFACE
   ===================================== */

.beta-adaptive-button {
  border-color: rgba(245, 158, 11, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(254, 243, 199, 0.86));
  color: #8a4b04;
}

.button-icon-adaptive {
  border-radius: 8px;
  background:
    linear-gradient(135deg, currentColor 0 0) left 2px top 2px / 6px 6px no-repeat,
    linear-gradient(135deg, currentColor 0 0) right 2px top 2px / 6px 10px no-repeat,
    linear-gradient(135deg, currentColor 0 0) left 2px bottom 2px / 10px 6px no-repeat;
  border: 2px solid currentColor;
  opacity: 0.86;
}

.adaptive-coach-strip {
  width: min(1440px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid rgba(245, 158, 11, 0.26);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.96), rgba(255, 255, 255, 0.92));
  box-shadow: 0 16px 34px rgba(120, 53, 15, 0.08);
  color: #7c4a03;
}

.adaptive-coach-strip strong {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.adaptive-coach-strip span {
  flex: 1;
  color: #5f3a05;
  font-size: 13px;
  font-weight: 700;
}

.adaptive-coach-strip button {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.adaptive-panel {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
}

.adaptive-panel.hidden {
  display: none;
}

.adaptive-panel-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 12% 10%, rgba(245, 158, 11, 0.18), transparent 32%),
    rgba(7, 28, 38, 0.54);
  backdrop-filter: blur(7px);
}

.adaptive-panel-card {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 28px));
  max-height: min(86vh, 780px);
  overflow-y: auto;
  padding: 24px;
  border: 1px solid rgba(245, 158, 11, 0.34);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.98), rgba(255, 251, 235, 0.94)),
    radial-gradient(circle at 100% 0%, rgba(4, 127, 163, 0.13), transparent 32%);
  box-shadow: 0 34px 90px rgba(8, 41, 57, 0.34);
}

.adaptive-close-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  border-radius: 999px;
  background: #ffffff;
  color: #8a4b04;
  border: 1px solid rgba(245, 158, 11, 0.30);
  font-size: 22px;
  line-height: 1;
}

.adaptive-panel-card .eyebrow {
  margin: 0 0 8px;
  color: #b45309;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

.adaptive-panel-card h2 {
  margin: 0;
  color: #173f52;
  font-size: clamp(26px, 4vw, 40px);
  letter-spacing: -0.04em;
}

.adaptive-panel-intro {
  max-width: 68ch;
  margin: 8px 0 20px;
  color: #5b6f7a;
  font-weight: 700;
  line-height: 1.6;
}

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

.adaptive-field,
.adaptive-toggle {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(4, 127, 163, 0.14);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.78);
}

.adaptive-field span,
.adaptive-toggle span {
  color: #173f52;
  font-size: 13px;
  font-weight: 950;
}

.adaptive-field select {
  width: 100%;
  min-height: 42px;
  border-radius: 14px;
  border: 1px solid rgba(4, 127, 163, 0.22);
  background: #ffffff;
  color: #102f40;
  font-weight: 850;
}

.adaptive-toggle {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.adaptive-toggle input {
  width: 18px;
  height: 18px;
  accent-color: #047fa3;
}

.adaptive-preview-box {
  margin-top: 16px;
  padding: 16px;
  border: 1px dashed rgba(245, 158, 11, 0.46);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(255, 251, 235, 0.92), rgba(240, 253, 250, 0.82));
  color: #173f52;
  font-weight: 750;
  line-height: 1.55;
}

.adaptive-preview-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.adaptive-suggestion-box {
  margin-top: 14px;
  padding: 16px;
  border: 1px solid rgba(4, 127, 163, 0.18);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(236, 253, 245, 0.92), rgba(255, 255, 255, 0.92));
  color: #173f52;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.82);
}

.adaptive-suggestion-box strong {
  display: block;
  color: #0f766e;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.adaptive-suggestion-box p {
  margin: 8px 0 12px;
  color: #315665;
  font-weight: 760;
  line-height: 1.55;
}

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

.adaptive-suggestion-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.adaptive-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 18px;
}

body.adaptive-density-compact .panel,
body.adaptive-density-compact .card,
body.adaptive-density-compact .tools-grid article,
body.adaptive-density-compact .case-item,
body.adaptive-density-compact .dashboard-mini-case {
  padding: 12px;
}

body.adaptive-density-compact .dashboard-card-case-list {
  max-height: 170px;
}

body.adaptive-guidance-minimal .panel-heading p,
body.adaptive-guidance-minimal .case-queue-note,
body.adaptive-guidance-minimal .access-helper,
body.adaptive-guidance-minimal .preview-panel small,
body.adaptive-guidance-minimal [data-adaptive-coaching] {
  display: none !important;
}

body.adaptive-guidance-full .adaptive-coach-strip {
  display: flex;
}

.adaptive-coach-strip.hidden {
  display: none !important;
}

body[data-adaptive-focus="forms"] .quick-nav-forms,
body[data-adaptive-focus="cases"] #dashboard,
body[data-adaptive-focus="cases"] #recentCases,
body[data-adaptive-focus="support"] #clinicalSupportRail,
body[data-adaptive-focus="support"] #adminSupportBubbleBtn,
body[data-adaptive-focus="governance"] #analyticsDashboard,
body[data-adaptive-focus="governance"] #governanceAssurancePanel,
body[data-adaptive-focus="appsheet"] #liveWorkspaceStatusPanel {
  outline: 3px solid rgba(245, 158, 11, 0.20);
  outline-offset: 3px;
}

body[data-adaptive-display="graphs-first"].portal-unlocked #analyticsDashboard {
  grid-row: 3;
}

body[data-adaptive-display="graphs-first"].portal-unlocked #recentCases {
  grid-row: 4;
}

body[data-adaptive-display="queues-first"].portal-unlocked #dashboard,
body[data-adaptive-display="queues-first"].portal-unlocked #leftAdminTriggerRail {
  top: 118px;
}

@media (max-width: 760px) {
  .human-helper {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
  }

  .human-helper-button {
    width: 58px;
    height: 58px;
    min-height: 58px;
  }

  .human-helper-actions {
    grid-template-columns: 1fr;
  }

  .interval-card-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .adaptive-coach-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .adaptive-grid {
    grid-template-columns: 1fr;
  }

  .adaptive-panel-card {
    padding: 20px 16px;
    border-radius: 22px;
  }
}
