:root {
  --page: #f8f4ea;
  --cream: #fffaf0;
  --ink: #152b45;
  --muted: #617187;
  --panel: rgba(255, 252, 245, 0.84);
  --panel-strong: #ffffff;
  --line: rgba(21, 43, 69, 0.13);
  --navy: #082f57;
  --navy-2: #0e5684;
  --gold: #b78a33;
  --gold-2: #d9b468;
  --gold-soft: #f8ead0;
  --green: #317a5a;
  --green-soft: #dff4ea;
  --red: #a74d42;
  --sky: #dcebf3;
  --shadow: 0 28px 80px rgba(8, 47, 87, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  height: 100vh;
  overflow: hidden;
  font-family: "Plus Jakarta Sans", sans-serif;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(8, 47, 87, 0.035) 1px, transparent 1px),
    linear-gradient(180deg, rgba(8, 47, 87, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 10% 10%, rgba(217, 180, 104, 0.34), transparent 28%),
    radial-gradient(circle at 92% 6%, rgba(8, 47, 87, 0.18), transparent 24%),
    linear-gradient(180deg, #fffaf0 0%, var(--page) 48%, #eef6f6 100%);
  background-size: 44px 44px, 44px 44px, auto, auto, auto;
}

.background-art {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
}

.art-ring {
  position: absolute;
  border-radius: 999px;
  border: 1px solid rgba(183, 138, 51, 0.2);
}

.art-ring-one {
  width: 520px;
  height: 520px;
  top: 80px;
  right: -180px;
}

.art-ring-two {
  width: 340px;
  height: 340px;
  left: -120px;
  bottom: 120px;
}

.art-leaf {
  position: absolute;
  width: 260px;
  height: 120px;
  border-radius: 999px 999px 999px 12px;
  background: rgba(8, 47, 87, 0.08);
  transform: rotate(-18deg);
}

.art-leaf-one {
  top: 210px;
  left: 46%;
}

.art-leaf-two {
  right: 5%;
  bottom: 120px;
  background: rgba(183, 138, 51, 0.12);
  transform: rotate(20deg);
}

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

button {
  border: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-shell {
  width: calc(100% - 24px);
  height: calc(100vh - 24px);
  margin: 12px auto;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 12px;
  overflow: hidden;
}

.topbar,
.panel,
.hero-card,
.video-room {
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.topbar {
  position: relative;
  top: auto;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  border-radius: 24px;
  background: rgba(255, 250, 240, 0.86);
}

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  color: white;
  font-weight: 800;
}

.brand small,
.label {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.brand strong {
  display: block;
}

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

.nav a,
.portal-tab {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
}

.portal-switcher {
  padding: 6px;
  border: 1px solid rgba(21, 43, 69, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
}

.portal-tab {
  background: transparent;
  font-weight: 800;
  transition: background 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.nav a:hover,
.portal-tab:hover,
.portal-tab.active {
  background: rgba(16, 42, 66, 0.07);
  color: var(--navy);
}

.portal-tab.active {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  color: white;
  box-shadow: 0 10px 24px rgba(8, 47, 87, 0.18);
}

.primary-btn,
.secondary-btn,
.danger-btn,
.quick-action,
.disabled-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 10px 15px;
  font-weight: 800;
}

.primary-btn {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent),
    linear-gradient(135deg, var(--navy), var(--navy-2));
  color: white;
}

.secondary-btn,
.quick-action {
  background: rgba(16, 42, 66, 0.08);
  color: var(--navy);
}

.danger-btn {
  background: rgba(167, 77, 66, 0.12);
  color: var(--red);
}

.disabled-link {
  pointer-events: none;
  opacity: 0.46;
}

.large-btn {
  padding: 11px 16px;
}

main {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

body[data-portal="customer"] main {
  grid-template-columns: minmax(420px, 0.72fr) minmax(560px, 1.28fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "intake video";
}

body[data-portal="agent"] main {
  grid-template-columns: minmax(420px, 0.9fr) minmax(540px, 1.1fr);
  grid-template-rows: minmax(0, 1fr);
  grid-template-areas:
    "agentMain agentMain";
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  align-items: stretch;
  grid-area: hero;
  min-height: 0;
}

body[data-portal="customer"] .hero {
  display: none;
}

.portal-section {
  min-height: 0;
  animation: portalReveal 280ms ease both;
}

@keyframes portalReveal {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-copy,
.hero-card,
.panel,
.video-room {
  border-radius: 34px;
  background: var(--panel);
}

.hero-copy {
  padding: 22px;
  background:
    linear-gradient(115deg, rgba(255, 250, 240, 0.94), rgba(255, 250, 240, 0.72) 54%, rgba(220, 235, 243, 0.72)),
    radial-gradient(circle at 86% 20%, rgba(217, 180, 104, 0.22), transparent 26%);
  border: 1px solid rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 800;
}

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

h1,
.section-heading h2 {
  font-family: "Instrument Serif", serif;
  font-weight: 400;
  line-height: 0.98;
}

h1 {
  max-width: 10.8ch;
  margin-bottom: 12px;
  font-size: clamp(2.4rem, 4vw, 4.6rem);
}

.hero-text {
  max-width: 68ch;
  color: var(--muted);
  line-height: 1.45;
  font-size: 0.92rem;
}

.hero-actions,
.trust-row,
.video-controls,
.action-stack {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.video-controls {
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(21, 43, 69, 0.1);
  border-radius: 28px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(255, 250, 240, 0.66)),
    radial-gradient(circle at 18% 0%, rgba(217, 180, 104, 0.22), transparent 38%);
  box-shadow: 0 18px 45px rgba(8, 47, 87, 0.1);
}

.video-controls .primary-btn,
.video-controls .secondary-btn,
.video-controls .danger-btn {
  position: relative;
  min-height: 46px;
  padding: 0 18px 0 44px;
  border: 1px solid transparent;
  letter-spacing: -0.02em;
  box-shadow: 0 12px 28px rgba(8, 47, 87, 0.1);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.video-controls .primary-btn::before,
.video-controls .secondary-btn::before,
.video-controls .danger-btn::before {
  content: "";
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 7px rgba(255, 255, 255, 0.18);
}

.video-controls .primary-btn {
  background:
    radial-gradient(circle at 24% 20%, rgba(255, 255, 255, 0.24), transparent 28%),
    linear-gradient(135deg, #063153, #0b6094);
}

.video-controls .secondary-btn {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(231, 236, 235, 0.76));
  color: var(--navy);
  border-color: rgba(21, 43, 69, 0.08);
}

.video-controls .danger-btn {
  background:
    linear-gradient(135deg, rgba(255, 247, 241, 0.95), rgba(244, 226, 216, 0.84));
  color: #984337;
  border-color: rgba(167, 77, 66, 0.16);
}

.video-controls .danger-btn::before {
  background: rgba(167, 77, 66, 0.14);
  box-shadow: inset 0 0 0 7px rgba(167, 77, 66, 0.1);
}

.video-controls .primary-btn:hover,
.video-controls .secondary-btn:hover,
.video-controls .danger-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 38px rgba(8, 47, 87, 0.16);
}

.video-controls .primary-btn:active,
.video-controls .secondary-btn:active,
.video-controls .danger-btn:active {
  transform: translateY(0);
}

.video-controls .disabled-link {
  box-shadow: none;
}

.trust-row {
  margin-top: 14px;
}

.trust-row span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(16, 42, 66, 0.07);
  color: var(--navy);
  font-weight: 700;
  font-size: 0.88rem;
}

.hero-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  overflow: hidden;
  position: relative;
  background:
    linear-gradient(180deg, rgba(8, 47, 87, 0.94), rgba(14, 86, 132, 0.86)),
    radial-gradient(circle at 50% 10%, rgba(217, 180, 104, 0.4), transparent 28%);
  color: white;
}

.hero-card-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #bdf4d9;
  font-weight: 800;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 7px rgba(47, 135, 95, 0.12);
}

.hero-card h2 {
  margin-bottom: 0;
  font-size: 1rem;
  color: white;
}

.time-card {
  display: grid;
  place-items: center;
  min-height: 92px;
  border-radius: 22px;
  color: white;
  background:
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.22), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.time-card strong {
  font-size: 2.7rem;
  line-height: 1;
}

.mini-agenda,
.packet-card,
.routing-list,
.queue-list {
  display: grid;
  gap: 8px;
}

.mini-agenda article,
.packet-card,
.routing-list article,
.guide-card,
.vitals-card,
.summary-card,
.sidebar-block,
.queue-item {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel-strong);
}

.hero-card .mini-agenda article {
  border-color: rgba(255, 255, 255, 0.16);
  background: rgba(255, 255, 255, 0.1);
}

.hero-card .mini-agenda span {
  color: rgba(255, 255, 255, 0.7);
}

.family-graphic {
  position: relative;
  min-height: 92px;
  margin: -8px -8px 0;
  border-radius: 26px;
  background:
    radial-gradient(circle at 22% 24%, rgba(217, 180, 104, 0.26), transparent 24%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  border: 1px solid rgba(255, 255, 255, 0.13);
  overflow: hidden;
}

.sun-shape {
  position: absolute;
  top: 22px;
  right: 30px;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--gold-2), #f7df9b);
  box-shadow: 0 0 0 18px rgba(217, 180, 104, 0.1);
}

.person {
  position: absolute;
  bottom: 28px;
  width: 34px;
  height: 52px;
  border-radius: 999px 999px 18px 18px;
  background: #fff6e7;
}

.person::before {
  content: "";
  position: absolute;
  top: -18px;
  left: 50%;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: inherit;
  transform: translateX(-50%);
}

.person-one {
  left: 28%;
  height: 60px;
  background: #f4d08a;
}

.person-two {
  left: 45%;
  background: #eaf4f8;
}

.person-three {
  left: 62%;
  height: 44px;
  background: #fff9ed;
}

.ground-shape {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 22px;
  height: 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.section-grid,
.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

.section-grid {
  grid-area: intake;
  grid-template-columns: 1fr;
  grid-template-rows: minmax(0, 1fr);
  overflow: hidden;
}

.agent-grid {
  display: grid;
  grid-template-columns: minmax(420px, 0.9fr) minmax(540px, 1.1fr);
  grid-template-areas: "packet controls";
  grid-area: agentMain;
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.agent-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.agent-selected-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(21, 43, 69, 0.1);
  border-radius: 24px;
  background:
    radial-gradient(circle at 94% 4%, rgba(217, 180, 104, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 250, 240, 0.72));
}

.selected-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.selected-card-header strong {
  display: block;
  margin: 8px 0;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2rem, 3vw, 3.5rem);
  font-weight: 400;
  line-height: 1;
}

.wait-chip {
  flex: 0 0 auto;
  display: grid;
  gap: 2px;
  min-width: 96px;
  padding: 10px 12px;
  border-radius: 18px;
  background: rgba(8, 47, 87, 0.08);
  text-align: center;
}

.wait-chip span {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.wait-chip strong {
  color: var(--navy);
  font-size: 1.2rem;
}

.selected-meta,
.selected-question {
  padding: 12px;
  border: 1px solid rgba(21, 43, 69, 0.08);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.58);
}

.selected-meta strong {
  display: block;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.agent-selected-card p,
.selected-question p {
  color: var(--muted);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.agent-grid .panel:first-child {
  grid-area: packet;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  overflow-y: auto;
}

.agent-grid .panel:last-child {
  grid-area: controls;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  gap: 12px;
}

.agent-video-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 28px;
  background:
    radial-gradient(circle at 18% 18%, rgba(217, 180, 104, 0.2), transparent 24%),
    radial-gradient(circle at 82% 24%, rgba(125, 184, 204, 0.18), transparent 22%),
    linear-gradient(135deg, #08233c 0%, #0e5684 56%, #07121d 100%);
}

.agent-video-frame.has-iframe .video-orb,
.agent-video-frame.has-iframe .video-content {
  display: none;
}

.agent-video-frame .video-content h3 {
  font-size: clamp(2rem, 3.4vw, 3.8rem);
}

.panel {
  min-height: 0;
  overflow: hidden;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(255, 252, 245, 0.9), rgba(255, 255, 255, 0.74));
}

.consult-panel {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 3vw, 36px);
}

.consult-panel::-webkit-scrollbar {
  width: 10px;
}

.consult-panel::-webkit-scrollbar-track {
  background: rgba(8, 47, 87, 0.06);
  border-radius: 999px;
}

.consult-panel::-webkit-scrollbar-thumb {
  background: rgba(8, 47, 87, 0.22);
  border-radius: 999px;
}

.consult-panel .section-heading h2 {
  max-width: 17ch;
  font-size: clamp(1.55rem, 2.6vw, 2.8rem);
}

.consult-panel .section-heading p:not(.eyebrow) {
  max-width: 48ch;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.section-heading h2 {
  max-width: 12ch;
  margin-bottom: 10px;
  font-size: clamp(1.55rem, 2.6vw, 2.8rem);
}

.section-heading p {
  color: var(--muted);
  line-height: 1.35;
}

.centered {
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}

.centered h2 {
  max-width: none;
}

.centered p:not(.eyebrow) {
  display: none;
}

.consult-form {
  display: grid;
  align-content: start;
  gap: 18px;
}

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

.consult-form label {
  display: grid;
  gap: 9px;
}

.consult-form label span {
  color: var(--muted);
  font-weight: 800;
  font-size: 1rem;
}

.consult-form input,
.consult-form select,
.consult-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  min-height: 58px;
  border-radius: 18px;
  padding: 16px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
}

.consult-form textarea {
  min-height: 116px;
  resize: vertical;
}

.consult-form .primary-btn {
  min-height: 58px;
  margin-top: 4px;
  font-size: 1rem;
}

.consult-form input:focus,
.consult-form select:focus,
.consult-form textarea:focus {
  outline: 3px solid rgba(198, 146, 63, 0.16);
  border-color: rgba(198, 146, 63, 0.45);
}

.packet-card strong,
.packet-card p {
  overflow-wrap: anywhere;
}

.routing-list article.active {
  border-color: rgba(198, 146, 63, 0.35);
  background: var(--gold-soft);
}

.routing-list strong,
.queue-item strong,
.guide-card strong {
  display: block;
  margin-bottom: 6px;
}

.routing-list span,
.queue-item span,
.guide-card p,
.summary-card p {
  color: var(--muted);
  line-height: 1.35;
  font-size: 0.88rem;
}

.vitals-card {
  display: grid;
  gap: 12px;
  background:
    radial-gradient(circle at 90% 0%, rgba(49, 122, 90, 0.16), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(240, 248, 245, 0.82));
}

.vitals-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.vitals-card-header strong {
  display: block;
  margin-top: 5px;
}

.vitals-updated {
  flex: 0 0 auto;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(49, 122, 90, 0.1);
  color: var(--green);
  font-size: 0.74rem;
  font-weight: 800;
}

.wellness-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(49, 122, 90, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at 15% 10%, rgba(198, 146, 63, 0.18), transparent 32%),
    linear-gradient(135deg, rgba(7, 39, 69, 0.96), rgba(20, 93, 91, 0.9));
  color: #fff;
  box-shadow: 0 18px 34px rgba(7, 39, 69, 0.16);
}

.wellness-score {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.wellness-score strong {
  display: block;
  margin: 0;
  font-size: 2rem;
  line-height: 0.9;
  letter-spacing: -0.08em;
}

.wellness-score span,
.wellness-hero small {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wellness-hero p {
  margin: 0 0 8px;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.35;
  font-size: 0.9rem;
}

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

.vitals-grid article {
  padding: 10px;
  border: 1px solid rgba(21, 43, 69, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.vitals-grid span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vitals-grid strong {
  color: var(--navy);
  font-size: 1rem;
}

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

.wellness-metrics article,
.wellness-empty {
  padding: 10px;
  border: 1px solid rgba(21, 43, 69, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.72);
}

.wellness-metrics article.ecg-metric {
  grid-column: 1 / -1;
}

.wellness-metrics span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.wellness-metrics strong {
  display: block;
  color: var(--navy);
  font-size: 0.98rem;
}

.wellness-metrics small,
.wellness-empty {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}

.ecg-ribbon {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 76px;
  padding: 10px 12px;
  border-radius: 18px;
  background:
    linear-gradient(90deg, rgba(8, 47, 87, 0.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(8, 47, 87, 0.055) 1px, transparent 1px),
    rgba(255, 255, 255, 0.78);
  background-size: 18px 18px;
}

.ecg-ribbon span {
  width: 12px;
  min-height: 16px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--green), #66a77f);
  transition: height 240ms ease, opacity 240ms ease;
}

.ecg-ribbon span.inactive {
  opacity: 0.28;
}

.ecg-ribbon-inline {
  min-height: 56px;
  margin-top: 10px;
  padding: 8px 10px;
  gap: 5px;
}

.ecg-ribbon-inline span {
  width: 8px;
}

.video-section {
  grid-area: video;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
  min-height: 0;
}

.video-room {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 0;
  padding: 12px;
}

.video-stage {
  display: grid;
  grid-template-rows: 1fr auto;
  gap: 16px;
  min-height: 0;
}

.video-frame {
  position: relative;
  min-height: 0;
  overflow: hidden;
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 20%, rgba(217, 180, 104, 0.22), transparent 24%),
    radial-gradient(circle at 70% 24%, rgba(125, 184, 204, 0.18), transparent 22%),
    linear-gradient(135deg, #08233c 0%, #0e5684 56%, #07121d 100%);
}

.pexip-frame {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  border: 0;
  background: #07121d;
}

.commercial-video {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #07121d;
}

.hidden {
  display: none;
}

.video-frame.has-iframe .video-orb,
.video-frame.has-iframe .video-content,
.video-frame.has-iframe .pip-card {
  display: none;
}

.video-frame.has-commercial .video-orb,
.video-frame.has-commercial .video-content,
.video-frame.has-commercial .pip-card {
  display: none;
}

.video-orb {
  position: absolute;
  width: 280px;
  height: 280px;
  border-radius: 999px;
  filter: blur(12px);
  opacity: 0.45;
}

.video-orb.one {
  top: 8%;
  right: 10%;
  background: var(--gold);
}

.video-orb.two {
  bottom: -14%;
  left: 10%;
  background: #5eb3d8;
}

.video-content {
  position: absolute;
  left: 28px;
  bottom: 28px;
  max-width: 540px;
  color: white;
}

.meeting-pill {
  display: inline-flex;
  margin-bottom: 14px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  font-weight: 800;
}

.video-content h3 {
  max-width: 12ch;
  margin-bottom: 10px;
  font-family: "Instrument Serif", serif;
  font-size: clamp(2rem, 3.6vw, 3.8rem);
  font-weight: 400;
  line-height: 0.98;
}

.video-content p {
  color: rgba(255, 255, 255, 0.76);
}

.pip-card {
  position: absolute;
  right: 24px;
  top: 24px;
  width: 180px;
  min-height: 96px;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.pip-card span {
  color: rgba(255, 255, 255, 0.68);
}

.pip-card strong {
  display: block;
  margin-top: 8px;
}

.live-session {
  background:
    linear-gradient(145deg, rgba(8, 47, 87, 0.94), rgba(14, 86, 132, 0.84)),
    radial-gradient(circle at top right, rgba(217, 180, 104, 0.35), transparent 34%);
  color: white;
}

.live-session .label,
.live-session p {
  color: rgba(255, 255, 255, 0.72);
}

.live-session p {
  margin: 8px 0 0;
  line-height: 1.55;
}

.queue-item {
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease;
}

.queue-item:hover,
.queue-item.active {
  transform: translateY(-2px);
  border-color: rgba(198, 146, 63, 0.42);
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 340px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(16, 42, 66, 0.95);
  color: white;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1050px) {
  body {
    height: auto;
    overflow: auto;
  }

  .app-shell {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body[data-portal="customer"] main,
  body[data-portal="agent"] main {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    grid-template-areas: none;
    overflow: visible;
  }

  .topbar,
  .hero,
  .section-grid,
  .agent-grid,
  .video-room {
    grid-template-columns: 1fr;
  }

  .hero,
  .section-grid,
  .video-section,
  .agent-grid .panel:first-child,
  .agent-grid .panel:last-child {
    grid-area: auto;
  }

  .agent-grid {
    display: grid;
  }

  .video-frame {
    min-height: 460px;
  }

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

  .nav,
  .topbar > .primary-btn {
    justify-content: center;
  }
}

@media (max-width: 720px) {
  body {
    min-height: 100svh;
    overflow-x: hidden;
  }

  .app-shell {
    width: min(100% - 16px, 1440px);
    min-height: 100svh;
    margin: 8px auto;
    gap: 8px;
  }

  main {
    gap: 8px;
  }

  .topbar {
    gap: 12px;
    padding: 12px;
    border-radius: 22px;
  }

  .brand {
    justify-content: center;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
    border-radius: 14px;
  }

  .brand small {
    font-size: 0.62rem;
    letter-spacing: 0.16em;
  }

  .brand strong {
    font-size: 0.98rem;
  }

  .portal-switcher {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    gap: 6px;
    padding: 5px;
    border-radius: 20px;
  }

  .portal-tab {
    min-height: 44px;
    padding: 8px 10px;
    border-radius: 16px;
    font-size: 0.86rem;
    white-space: nowrap;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .video-room {
    border-radius: 22px;
  }

  .panel,
  .consult-panel {
    padding: 18px;
  }

  .consult-panel {
    overflow: visible;
  }

  .consult-panel .section-heading h2,
  .section-heading h2 {
    max-width: 13ch;
    font-size: clamp(1.85rem, 10vw, 2.7rem);
  }

  .eyebrow {
    margin-bottom: 8px;
    font-size: 0.68rem;
  }

  .consult-form {
    gap: 14px;
  }

  .name-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .consult-form label {
    gap: 7px;
  }

  .consult-form label span {
    font-size: 0.9rem;
  }

  .consult-form input,
  .consult-form select,
  .consult-form textarea {
    min-height: 54px;
    border-radius: 16px;
    padding: 14px;
    font-size: 16px;
  }

  .consult-form textarea {
    min-height: 102px;
  }

  .consult-form .primary-btn {
    width: 100%;
    min-height: 56px;
  }

  .video-section {
    gap: 8px;
  }

  .video-section .section-heading {
    padding: 2px 8px 0;
  }

  .video-section .section-heading h2 {
    max-width: 15ch;
    margin-inline: auto;
  }

  .video-room {
    padding: 8px;
  }

  .video-stage {
    gap: 0;
  }

  .video-frame {
    min-height: min(62svh, 430px);
    aspect-ratio: 16 / 11;
    border-radius: 20px;
  }

  .commercial-video,
  .pexip-frame {
    border-radius: 20px;
  }

  .video-content {
    left: 18px;
    right: 18px;
    bottom: 18px;
    max-width: none;
  }

  .meeting-pill {
    margin-bottom: 10px;
    padding: 7px 10px;
    font-size: 0.78rem;
  }

  .video-content h3 {
    max-width: 11ch;
    font-size: clamp(2.05rem, 12vw, 3.2rem);
  }

  .video-content p {
    max-width: 28ch;
    font-size: 0.92rem;
  }

  .pip-card {
    position: relative;
    top: auto;
    right: auto;
    margin: 18px;
    width: max-content;
    min-height: 0;
    padding: 12px 14px;
    border-radius: 18px;
  }

  .toast {
    right: 10px;
    bottom: 10px;
    left: 10px;
    max-width: none;
    text-align: center;
  }
}

@media (max-width: 430px) {
  .app-shell {
    width: 100%;
    margin: 0;
  }

  .topbar {
    border-radius: 0 0 22px 22px;
    border-top: 0;
  }

  main {
    padding: 0 8px 8px;
  }

  .panel,
  .consult-panel {
    padding: 16px;
  }

  .video-frame {
    min-height: 360px;
    aspect-ratio: auto;
  }

  .portal-tab {
    font-size: 0.8rem;
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    height: auto;
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  * {
    max-width: 100%;
  }

  .app-shell {
    display: block;
    height: auto;
    overflow: visible;
  }

  main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: visible;
  }

  .portal-section.hidden,
  .hidden {
    display: none !important;
  }

  body[data-portal="customer"] .customer-portal:not(.hidden),
  body[data-portal="agent"] .agent-portal:not(.hidden) {
    display: block;
    width: 100%;
    min-height: auto;
    overflow: visible;
  }

  body[data-portal="customer"] .hero {
    display: none;
  }

  .section-grid,
  .video-section,
  .agent-grid {
    width: 100%;
    min-width: 0;
    min-height: auto;
    overflow: visible;
  }

  .consult-panel,
  .video-room,
  .video-stage,
  .agent-grid .panel:first-child,
  .agent-grid .panel:last-child {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: auto;
    overflow: visible;
  }

  .video-frame,
  .agent-video-frame {
    width: 100%;
    min-width: 0;
    min-height: clamp(320px, 58svh, 430px);
  }

  .pexip-frame,
  .commercial-video {
    width: 100%;
    height: 100%;
  }

  .packet-card,
  .vitals-card,
  .agent-actions,
  .action-stack {
    width: 100%;
  }

  .vitals-card-header,
  .wellness-hero,
  .vitals-grid,
  .wellness-metrics {
    grid-template-columns: 1fr;
  }

  .vitals-card-header {
    display: grid;
  }

  .agent-actions .primary-btn,
  .agent-actions .secondary-btn,
  .action-stack .quick-action {
    width: 100%;
  }
}
