:root {
  color-scheme: light;
  --ink: #172230;
  --muted: #6f7a86;
  --quiet: #8c98a4;
  --bg: #f8fafb;
  --paper: rgba(255,255,255,0.78);
  --paper-solid: #fff;
  --line: rgba(23,34,48,0.1);
  --line-strong: rgba(23,34,48,0.16);
  --navy: #213345;
  --teal: #76c8bf;
  --sky: #d8edf8;
  --mint: #e7f6f1;
  --lilac: #e6e2fb;
  --rose: #f7e6ea;
  --ok: #258268;
  --warn: #ba7b2c;
  --bad: #b64545;
  --shadow: 0 18px 55px rgba(39, 54, 68, 0.08);
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { min-height: 100%; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(118deg, rgba(216,237,248,.72), transparent 30%),
    linear-gradient(248deg, rgba(230,226,251,.68), transparent 32%),
    linear-gradient(18deg, rgba(231,246,241,.72), transparent 36%),
    var(--bg);
  overflow: hidden;
}
body.auth-locked .sidebar,
body.auth-locked .mobile-bar,
body.auth-locked #appPanel,
body.auth-locked #mobileTabs {
  display: none !important;
}
body.auth-locked .app-shell {
  grid-template-columns: minmax(0, 1fr);
}
body.auth-locked .main-stage {
  grid-column: 1 / -1;
}
body.auth-locked .login-view {
  display: grid;
}
button, input, textarea, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

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

.sidebar {
  direction: rtl;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 22px 18px;
  background: rgba(255,255,255,.58);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.profile-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.profile-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: linear-gradient(135deg, var(--sky), var(--mint) 54%, var(--lilac));
  color: var(--navy);
  font-weight: 900;
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 10px 28px rgba(35,51,69,.08);
}
.profile-avatar.small { width: 34px; height: 34px; font-size: 13px; }
.profile-copy { min-width: 0; }
.profile-name {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 850;
  direction: ltr;
  text-align: left;
}
.profile-sub { margin-top: 2px; color: var(--muted); font-size: 12px; text-align: left; direction: ltr; }
.project-code,
.login-project-code {
  width: fit-content;
  direction: ltr;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.62);
  color: var(--navy);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .02em;
}
.project-code {
  margin-top: 7px;
  padding: 4px 7px;
  text-align: left;
}

.sidebar-actions { display: grid; gap: 10px; }
.action-button {
  height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--navy);
  color: #fff;
  font-weight: 850;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(33,51,69,.12);
}
.search-box {
  display: grid;
  gap: 6px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 800;
}
.search-box input {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  padding: 0 12px;
  color: var(--ink);
  outline: 0;
}

.conversation-section {
  min-height: 0;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr);
  gap: 7px;
}
.section-label {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 850;
  padding: 4px 4px 0;
}
.conversation-list {
  min-height: 38px;
  display: grid;
  align-content: start;
  gap: 4px;
  overflow: auto;
  padding-left: 2px;
}
.pinned-list { max-height: 128px; }
.conversation-row {
  width: 100%;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20px;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: transparent;
  color: var(--ink);
  text-align: right;
  cursor: pointer;
}
.conversation-row:hover { background: rgba(33,51,69,.055); }
.conversation-row.active { background: rgba(33,51,69,.09); }
.conversation-main { min-width: 0; display: grid; gap: 3px; }
.conversation-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 820;
}
.conversation-meta { color: var(--quiet); font-size: 11px; }
.pin-dot {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}
.sidebar-empty {
  padding: 8px 10px;
  color: var(--quiet);
  font-size: 12px;
}

.sidebar-bottom {
  display: grid;
  gap: 6px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.rail-button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #536272;
  text-align: right;
  padding: 8px 10px;
  font-weight: 820;
  cursor: pointer;
}
.rail-button.active { background: rgba(33,51,69,.09); color: var(--navy); }

.mobile-bar, .mobile-tabs { display: none; }

.main-stage {
  direction: rtl;
  height: 100vh;
  min-width: 0;
  padding: 24px 30px;
  display: grid;
}
.login-view { display: grid; place-items: center; }
.login-card {
  width: min(430px, 100%);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  background: rgba(255,255,255,.82);
  box-shadow: var(--shadow);
}
h1, p { margin: 0; }
h1 { font-size: 25px; letter-spacing: 0; }
p { margin-top: 8px; color: var(--muted); line-height: 1.75; font-size: 14px; }
.login-project-code {
  margin-top: 12px;
  padding: 5px 8px;
}
.google-button, .access-form button, .upload-submit, .admin-form button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--navy);
  color: #fff;
  text-decoration: none;
  font-weight: 850;
  cursor: pointer;
}
.google-button { width: 100%; margin-top: 22px; }
.google-button.disabled { opacity: .52; cursor: not-allowed; }
.oauth-note, .form-note { min-height: 20px; margin-top: 10px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.access-form { margin-top: 14px; display: grid; grid-template-columns: minmax(0,1fr) 82px; gap: 8px; }
input, textarea, select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.88);
  color: var(--ink);
  outline: 0;
  padding: 11px 12px;
}
input:focus, textarea:focus, select:focus { border-color: rgba(33,51,69,.34); box-shadow: 0 0 0 3px rgba(118,200,191,.16); }

.workspace {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 16px;
}
.workspace-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
}
.view-title { font-size: 20px; font-weight: 900; }
.view-subtitle { margin-top: 3px; color: var(--muted); font-size: 13px; }
.head-actions { display: flex; align-items: center; gap: 8px; }
.ghost-button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.58);
  color: var(--navy);
  padding: 8px 10px;
  font-weight: 820;
  cursor: pointer;
}
.ghost-button:disabled { opacity: .45; cursor: not-allowed; }
.status-pill {
  direction: ltr;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  background: rgba(255,255,255,.68);
}
.status-pill[data-kind="ok"] { color: var(--ok); }
.status-pill[data-kind="bad"] { color: var(--bad); }

.view-pane { min-height: 0; display: none; }
.view-pane.active { display: block; }
.chat-view, #chatView.active {
  position: relative;
  height: 100%;
  min-height: 0;
}
.thread {
  height: 100%;
  overflow: auto;
  padding: 22px min(12vw, 130px) 108px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.message {
  max-width: min(720px, 82%);
  border-radius: 8px;
  padding: 18px 20px;
  line-height: 1.82;
  font-size: 16px;
  white-space: pre-wrap;
  box-shadow: 0 12px 34px rgba(33,51,69,.055);
}
.message.system { align-self: flex-start; background: rgba(255,255,255,.78); border: 1px solid var(--line); }
.message.user { align-self: flex-end; background: rgba(33,51,69,.94); color: #fff; }
.message-time { margin-top: 10px; color: rgba(111,122,134,.8); font-size: 12px; text-align: left; direction: ltr; }
.message.user .message-time { color: rgba(255,255,255,.72); }
.composer {
  position: absolute;
  left: 14%;
  right: 14%;
  bottom: 10px;
  display: grid;
  grid-template-columns: 42px minmax(0,1fr) 42px;
  gap: 10px;
  align-items: center;
  background: rgba(39, 49, 64, .95);
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 18px 55px rgba(33,51,69,.16);
}
.composer textarea {
  resize: none;
  min-height: 42px;
  max-height: 150px;
  border: 0;
  background: transparent;
  color: #fff;
  padding-top: 12px;
}
.composer textarea::placeholder { color: rgba(255,255,255,.48); }
.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255,255,255,.13);
  color: #fff;
  font-size: 21px;
  cursor: pointer;
}
.icon-button.send { background: #fff; color: var(--navy); }

.chat-drop-overlay {
  position: absolute;
  inset: 0;
  z-index: 14;
  display: grid;
  place-items: center;
  padding: 28px;
  pointer-events: none;
  background: radial-gradient(circle at 50% 48%, rgba(118,200,191,.18), rgba(216,237,248,.14) 36%, rgba(248,250,251,.62) 76%);
  backdrop-filter: blur(2px);
}
.chat-drop-card {
  width: min(420px, 88vw);
  min-height: 168px;
  border: 1px dashed rgba(37,130,104,.46);
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 8px;
  padding: 26px;
  text-align: center;
  background: rgba(255,255,255,.84);
  box-shadow: 0 22px 62px rgba(33,51,69,.12);
}
.chat-drop-icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--teal), #87b9e8 58%, #c4a7ef);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 12px 28px rgba(118,200,191,.26);
}
.chat-drop-title { font-size: 18px; font-weight: 900; color: var(--navy); }
.chat-drop-subtitle { max-width: 310px; color: var(--muted); font-size: 13px; line-height: 1.65; }
#chatView.dragging-file .composer { box-shadow: 0 18px 70px rgba(118,200,191,.24); }
.message.attachment-message {
  max-width: min(680px, 86%);
  padding: 0;
  background: transparent;
  box-shadow: none;
  white-space: normal;
}
.attachment-stack { display: grid; gap: 8px; }
.attachment-card {
  min-width: min(520px, 78vw);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 8px;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(135deg, rgba(33,51,69,.96), rgba(49,61,80,.94));
  color: #fff;
  box-shadow: 0 14px 38px rgba(33,51,69,.14);
}
.attachment-card.saved { border-color: rgba(118,200,191,.52); }
.attachment-card.pending { border-color: rgba(135,185,232,.36); }
.attachment-card.failed { border-color: rgba(248,166,166,.55); }
.attachment-icon {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
}
.attachment-body { min-width: 0; display: grid; gap: 5px; }
.attachment-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
  font-size: 14px;
  font-weight: 900;
}
.attachment-meta { color: rgba(255,255,255,.68); font-size: 12px; direction: ltr; text-align: right; }
.attachment-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: rgba(255,255,255,.86);
  font-size: 11px;
  font-weight: 850;
}
.attachment-notes span {
  border-radius: 999px;
  padding: 4px 7px;
  background: rgba(255,255,255,.1);
}
.attachment-actions { display: flex; align-items: center; gap: 6px; }
.attachment-preview {
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.document-preview {
  position: fixed;
  inset: 0;
  z-index: 60;
  direction: rtl;
}
.preview-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(23,34,48,.42);
  backdrop-filter: blur(8px);
}
.preview-panel {
  position: absolute;
  inset: 5vh min(5vw, 70px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: 0 30px 90px rgba(23,34,48,.24);
}
.preview-head {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(231,246,241,.72), rgba(216,237,248,.58), rgba(230,226,251,.52));
}
.preview-title { font-size: 15px; font-weight: 950; color: var(--navy); direction: ltr; text-align: right; }
.preview-subtitle { margin-top: 3px; color: var(--muted); font-size: 12px; }
.preview-close {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  color: var(--navy);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}
.preview-body {
  min-height: 0;
  display: grid;
  background: #eef3f6;
}
.preview-frame, .preview-image {
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}
.preview-image {
  object-fit: contain;
  padding: 18px;
}
.dashboard-view.active, .protocol-view.active, .settings-view.active, .admin-view.active {
  height: 100%;
  overflow: auto;
  padding: 4px 2px 26px;
}
.dashboard-hero {
  min-height: 150px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, .72fr);
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 22px;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 8px;
  background:
    linear-gradient(110deg, rgba(255,255,255,.88), rgba(231,246,241,.72) 34%, rgba(216,237,248,.62) 68%, rgba(230,226,251,.6)),
    rgba(255,255,255,.78);
  box-shadow: var(--shadow);
}
.eyebrow {
  direction: ltr;
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(33,51,69,.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
}
.dashboard-hero h2,
.protocol-head h2 {
  margin: 10px 0 0;
  color: var(--navy);
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: 0;
}
.dashboard-hero p,
.protocol-head p {
  max-width: 760px;
  color: #556372;
  font-size: 13px;
}
.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.hero-stats article {
  min-height: 94px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 16px;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  background: rgba(255,255,255,.64);
  box-shadow: 0 10px 30px rgba(33,51,69,.045);
}
.hero-stats strong {
  direction: ltr;
  font-size: 34px;
  line-height: 1;
  font-weight: 950;
}
.hero-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
}
.health-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.signal-card {
  min-height: 230px;
  display: grid;
  grid-template-rows: auto auto auto 72px minmax(0, 1fr);
  gap: 10px;
  padding: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255,255,255,.9), rgba(255,255,255,.62)),
    var(--paper-solid);
  box-shadow: 0 14px 40px rgba(33,51,69,.055);
}
.signal-card.good { border-color: rgba(37,130,104,.18); background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(231,246,241,.66)); }
.signal-card.watch { border-color: rgba(186,123,44,.22); background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(255,246,224,.64)); }
.signal-card.alert { border-color: rgba(182,69,69,.2); background: linear-gradient(145deg, rgba(255,255,255,.94), rgba(247,230,234,.62)); }
.signal-card.pending { border-color: rgba(111,122,134,.14); }
.signal-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}
.signal-domain {
  color: var(--quiet);
  font-size: 11px;
  font-weight: 850;
}
.signal-title {
  margin-top: 2px;
  color: var(--navy);
  font-size: 15px;
  font-weight: 950;
}
.signal-status {
  width: fit-content;
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(33,51,69,.07);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
}
.signal-card.good .signal-status { background: rgba(231,246,241,.96); color: var(--ok); }
.signal-card.watch .signal-status { background: rgba(255,246,224,.96); color: #8a641f; }
.signal-card.alert .signal-status { background: rgba(247,230,234,.96); color: var(--bad); }
.signal-value {
  direction: ltr;
  text-align: right;
  font-size: 30px;
  line-height: 1.1;
  font-weight: 950;
  color: var(--ink);
}
.signal-delta {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}
.signal-chart {
  min-height: 72px;
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,255,255,.2)),
    repeating-linear-gradient(0deg, rgba(33,51,69,.05), rgba(33,51,69,.05) 1px, transparent 1px, transparent 22px);
}
.sparkline {
  width: 100%;
  height: 72px;
  display: block;
}
.sparkline polyline {
  fill: none;
  stroke: var(--teal);
  stroke-width: 4;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.signal-card.watch .sparkline polyline { stroke: #d7a04a; }
.signal-card.alert .sparkline polyline { stroke: var(--bad); }
.sparkline.empty {
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(216,237,248,.68), rgba(230,226,251,.5), rgba(231,246,241,.62));
  opacity: .62;
}
.signal-summary {
  color: #516071;
  font-size: 12px;
  line-height: 1.65;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}
.metric-card, .panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 10px 35px rgba(33,51,69,.045);
}
.metric-card { padding: 18px; }
.metric-value { direction: ltr; text-align: right; font-size: 32px; font-weight: 900; }
.metric-label { margin-top: 4px; color: var(--muted); font-size: 13px; font-weight: 760; }
.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  gap: 14px;
}
.dashboard-insights {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(300px, .9fr);
  gap: 14px;
  margin-bottom: 14px;
}
.panel { padding: 16px; }
.panel-title { font-size: 15px; font-weight: 900; margin-bottom: 10px; }
.profile-summary {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.report-list, .documents, .users-list, .trend-list, .medication-list, .next-actions, .risk-alerts, .protocol-mini { display: grid; gap: 8px; }
.report-row, .doc-row, .user-row, .empty-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.68);
  padding: 12px;
}
.action-row,
.risk-row,
.protocol-slot {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  padding: 12px;
}
.action-row {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.action-priority,
.risk-code {
  width: fit-content;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(33,51,69,.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}
.action-row.high .action-priority,
.risk-row.danger .risk-code { color: var(--bad); background: rgba(247,230,234,.84); }
.action-row.medium .action-priority,
.risk-row.warning .risk-code { color: #8a641f; background: rgba(255,246,224,.9); }
.action-title,
.risk-title {
  color: var(--navy);
  font-size: 13px;
  font-weight: 940;
}
.action-detail,
.risk-detail {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.risk-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}
.protocol-slot {
  display: grid;
  gap: 7px;
}
.protocol-slot.compact {
  min-height: 82px;
}
.slot-label {
  color: var(--navy);
  font-size: 13px;
  font-weight: 950;
}
.slot-items,
.slot-items-list {
  color: #334155;
  font-size: 13px;
  line-height: 1.7;
}
.slot-items-list {
  margin: 0;
  padding-inline-start: 20px;
}
.slot-notes {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.protocol-sheet {
  max-width: 1020px;
  margin: 0 auto;
  border: 1px solid rgba(255,255,255,.8);
  border-radius: 8px;
  background: rgba(255,255,255,.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.protocol-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px;
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(110deg, rgba(231,246,241,.76), rgba(216,237,248,.6), rgba(230,226,251,.52)),
    rgba(255,255,255,.82);
}
.protocol-sections {
  display: grid;
  gap: 14px;
  padding: 18px;
}
.protocol-section {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.72);
  padding: 16px;
}
.protocol-section h3 {
  margin: 0 0 12px;
  color: var(--navy);
  font-size: 17px;
}
.protocol-section ul {
  margin: 0;
  padding-inline-start: 20px;
  color: #334155;
  line-height: 1.85;
}
.protocol-schedule {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.doc-row.clickable { cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.doc-row.clickable:hover {
  border-color: rgba(37,130,104,.25);
  background: rgba(231,246,241,.44);
  transform: translateY(-1px);
}
.trend-row, .med-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,.7);
  padding: 12px;
}
.trend-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}
.trend-name { font-size: 13px; font-weight: 930; color: var(--navy); }
.trend-value { direction: ltr; text-align: left; font-size: 17px; font-weight: 950; color: var(--ink); }
.trend-meta { margin-top: 5px; color: var(--muted); font-size: 12px; line-height: 1.55; }
.trend-bar {
  position: relative;
  height: 5px;
  overflow: hidden;
  border-radius: 999px;
  margin-top: 9px;
  background: rgba(33,51,69,.08);
}
.trend-bar span {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  min-width: 18%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #87b9e8, #c4a7ef);
}
.trend-row.warn .trend-bar span { background: linear-gradient(90deg, #e6b05b, #d37f55); }
.trend-row.low .trend-bar span { background: linear-gradient(90deg, #87b9e8, #b6c8f2); }
.trend-row.up .trend-bar span { background: linear-gradient(90deg, var(--ok), var(--teal)); }
.trend-row.down .trend-bar span { background: linear-gradient(90deg, #8db8d8, #c2ace9); }
.med-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}
.med-kind {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(33,51,69,.08);
  color: var(--navy);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}
.med-main { min-width: 0; display: grid; gap: 4px; }
.med-title { font-size: 13px; font-weight: 920; overflow-wrap: anywhere; }
.med-meta { color: var(--muted); font-size: 12px; line-height: 1.55; }
.report-top { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.report-title, .doc-title, .user-email { font-size: 13px; font-weight: 900; overflow-wrap: anywhere; }
.report-status {
  color: var(--warn);
  background: rgba(247,230,234,.56);
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}
.report-summary { margin-top: 8px; color: #485666; line-height: 1.65; font-size: 13px; }
.report-status[data-state="complete"] { color: var(--ok); background: rgba(231,246,241,.78); }
.report-status[data-state="active"] { color: #8a641f; background: rgba(255,246,224,.86); }
.report-status[data-state="blocked"] { color: var(--bad); background: rgba(247,230,234,.76); }
.report-pipeline {
  --pipeline-progress: 28%;
  margin-top: 10px;
  display: grid;
  gap: 7px;
}
.pipeline-track {
  position: relative;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(216,237,248,.82), rgba(230,226,251,.78), rgba(231,246,241,.82));
}
.pipeline-track span {
  position: absolute;
  inset-block: 0;
  inset-inline-start: 0;
  width: var(--pipeline-progress);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--teal), #87b9e8 48%, #c4a7ef 100%);
  box-shadow: 0 0 18px rgba(118,200,191,.34);
}
.report-pipeline.active .pipeline-track span {
  background-size: 180% 100%;
  animation: pipelineFlow 1.9s ease-in-out infinite alternate;
}
.report-pipeline.blocked .pipeline-track span { background: linear-gradient(90deg, #e9a5a5, var(--bad)); }
.report-pipeline.complete .pipeline-track span { background: linear-gradient(90deg, var(--ok), var(--teal)); }
.pipeline-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
}
.pipeline-step {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--quiet);
  font-size: 11px;
  font-weight: 850;
}
.pipeline-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex: 0 0 auto;
  background: rgba(33,51,69,.16);
}
.pipeline-step.done { color: var(--ok); }
.pipeline-step.done .pipeline-dot { background: var(--ok); }
.pipeline-step.active { color: #8a641f; }
.pipeline-step.active .pipeline-dot {
  background: #d7a04a;
  box-shadow: 0 0 0 5px rgba(215,160,74,.16);
  animation: pipelinePulse 1.45s ease-in-out infinite;
}
.pipeline-step.blocked { color: var(--bad); }
.pipeline-step.blocked .pipeline-dot { background: var(--bad); }
.pipeline-detail {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
@keyframes pipelineFlow {
  from { filter: saturate(.96); transform: scaleX(.985); }
  to { filter: saturate(1.18); transform: scaleX(1.01); }
}
@keyframes pipelinePulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 4px rgba(215,160,74,.14); }
  50% { transform: scale(1.16); box-shadow: 0 0 0 8px rgba(215,160,74,.06); }
}
.report-meta, .doc-meta, .user-meta { margin-top: 5px; color: var(--quiet); font-size: 12px; }
.doc-state {
  margin-top: 8px;
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(33,51,69,.07);
  color: var(--navy);
  font-size: 11px;
  font-weight: 850;
}
.upload-box, .admin-form { margin-top: 14px; display: grid; gap: 10px; }
.file-input-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
.file-picker-card {
  width: 100%;
  min-height: 92px;
  border: 1px dashed rgba(33,51,69,.25);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  padding: 16px;
  background: rgba(255,255,255,.58);
  color: var(--ink);
  cursor: pointer;
  text-align: right;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
}
.file-picker-card:hover,
.file-picker-card.dragging {
  border-color: rgba(37,130,104,.55);
  background: rgba(231,246,241,.72);
  transform: translateY(-1px);
}
.file-picker-icon {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--navy);
  color: #fff;
  font-size: 24px;
  line-height: 1;
}
.file-picker-copy { display: grid; gap: 5px; min-width: 0; }
.file-picker-title { font-size: 15px; font-weight: 900; color: var(--navy); }
.file-picker-subtitle { color: var(--muted); font-size: 12px; line-height: 1.65; }
.selected-files-head {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}
.text-button {
  border: 0;
  background: transparent;
  color: var(--navy);
  padding: 6px 0;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
}
.text-button:disabled { color: var(--quiet); cursor: not-allowed; }
.selected-files {
  display: grid;
  gap: 8px;
  min-height: 54px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.54);
}
.selected-files.empty {
  place-items: center;
  color: var(--quiet);
  font-size: 12px;
}
.selected-file-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255,255,255,.78);
}
.selected-file-row.saved { border-color: rgba(37,130,104,.22); background: rgba(231,246,241,.5); }
.selected-file-row.failed { border-color: rgba(182,69,69,.24); background: rgba(247,230,234,.45); }
.selected-file-index {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: rgba(33,51,69,.08);
  color: var(--navy);
  font-weight: 900;
  font-size: 12px;
}
.selected-file-main { min-width: 0; display: grid; gap: 3px; }
.selected-file-name {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  direction: ltr;
  text-align: right;
}
.selected-file-meta { color: var(--quiet); font-size: 12px; }
.selected-file-status {
  white-space: nowrap;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(33,51,69,.07);
  color: var(--navy);
  font-size: 11px;
  font-weight: 850;
}
.saved-files-panel {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.panel-title.small { font-size: 13px; margin-bottom: 8px; color: var(--muted); }
.settings-documents { max-height: 320px; overflow: auto; }
.upload-submit { width: 100%; }
.admin-form { grid-template-columns: minmax(0, 1fr) 92px 70px; }
.user-row { display: flex; gap: 10px; justify-content: space-between; align-items: center; direction: ltr; text-align: left; }
.approve-button { border: 0; border-radius: 8px; background: rgba(33,51,69,.08); color: var(--navy); padding: 8px 10px; font-weight: 850; cursor: pointer; }
pre { overflow: auto; direction: ltr; text-align: left; font-size: 11px; line-height: 1.5; color: #334155; }
.hidden { display: none !important; }

@media (max-width: 900px) {
  body { overflow: hidden; background: #fbfcfd; }
  .app-shell { display: block; min-height: 100svh; }
  .sidebar { display: none; }
  .mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 58px;
    padding: 12px 16px 6px;
    direction: ltr;
  }
  .mobile-title { font-size: 18px; font-weight: 900; color: var(--ink); }
  .mobile-new {
    width: 34px;
    height: 34px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255,255,255,.8);
    color: var(--navy);
    font-size: 20px;
  }
  .main-stage { height: calc(100svh - 108px); padding: 0 12px 10px; display: block; }
  .workspace { height: 100%; gap: 8px; }
  .workspace-head { min-height: 44px; }
  .view-title { font-size: 16px; }
  .view-subtitle { max-width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }
  .head-actions { gap: 6px; }
  .ghost-button { display: none; }
  .status-pill { font-size: 11px; padding: 6px 9px; }
  #chatView.active { height: calc(100svh - 162px); }
  .thread {
    padding: 8px 2px 82px;
    gap: 10px;
  }
  .message {
    max-width: 92%;
    padding: 14px 15px;
    font-size: 15px;
    line-height: 1.72;
  }
  .composer {
    left: 12px;
    right: 12px;
    bottom: 10px;
    grid-template-columns: 40px minmax(0,1fr) 40px;
  }
  .composer textarea {
    font-size: 14px;
    line-height: 1.4;
    padding-top: 10px;
    overflow: hidden;
  }
  .icon-button { width: 40px; height: 40px; }
  .chat-drop-overlay { padding: 14px; }
  .chat-drop-card { min-height: 132px; padding: 18px; }
  .chat-drop-title { font-size: 16px; }
  .chat-drop-subtitle { font-size: 12px; }
  .attachment-card {
    min-width: min(88vw, 520px);
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .attachment-icon { width: 42px; height: 42px; font-size: 11px; }
  .attachment-actions { grid-column: 2; justify-content: flex-start; }
  .preview-panel { inset: 10px; }
  .preview-head { min-height: 58px; padding: 12px; }
  .preview-title { max-width: 210px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .dashboard-hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 16px;
  }
  .dashboard-hero h2,
  .protocol-head h2 {
    font-size: 22px;
  }
  .hero-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .hero-stats article {
    min-height: 74px;
    padding: 11px;
  }
  .hero-stats strong {
    font-size: 24px;
  }
  .health-signal-grid {
    grid-template-columns: 1fr;
  }
  .signal-card {
    min-height: 210px;
  }
  .dashboard-grid { grid-template-columns: 1fr 1fr 1fr; gap: 8px; }
  .metric-card { padding: 12px; }
  .metric-value { font-size: 24px; }
  .metric-label { font-size: 11px; }
  .dashboard-columns, .dashboard-insights { grid-template-columns: 1fr; }
  .dashboard-view.active, .protocol-view.active, .settings-view.active, .admin-view.active { height: calc(100svh - 162px); padding-bottom: 12px; }
  .protocol-head {
    display: grid;
    padding: 18px;
  }
  .protocol-sections {
    padding: 12px;
  }
  .protocol-schedule {
    grid-template-columns: 1fr;
  }
  .login-card { padding: 22px; }
  .access-form { grid-template-columns: 1fr; }
  .admin-form { grid-template-columns: 1fr; }
  .file-picker-card { min-height: 82px; padding: 13px; }
  .selected-files-head { align-items: flex-start; flex-direction: column; }
  .selected-file-row { grid-template-columns: 28px minmax(0, 1fr); }
  .selected-file-status { grid-column: 2; width: fit-content; }
  .mobile-tabs {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 10px;
    z-index: 20;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(18px);
    direction: rtl;
  }
  .mobile-tabs .rail-button {
    min-height: 34px;
    padding: 6px 4px;
    text-align: center;
    font-size: 12px;
  }
}

/* Entix Health clinical precision theme. Mirrors the uploaded VitalPulse dark glass direction. */
:root {
  color-scheme: dark;
  --ink: #e0e3e5;
  --muted: #aeb8c4;
  --quiet: #86948a;
  --bg: #0b0f10;
  --paper: rgba(29, 32, 34, 0.62);
  --paper-solid: #191c1e;
  --line: rgba(255,255,255,0.10);
  --line-strong: rgba(255,255,255,0.18);
  --navy: #e0e3e5;
  --teal: #4edea3;
  --sky: #c0c1ff;
  --mint: #10b981;
  --lilac: #9699ff;
  --rose: #ffb4ab;
  --ok: #4edea3;
  --warn: #f5c16c;
  --bad: #ffb4ab;
  --shadow: 0 24px 70px rgba(0,0,0,.36);
}
html { background: #0b0f10; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 18% 8%, rgba(78,222,163,.14), transparent 28%),
    radial-gradient(circle at 84% 18%, rgba(150,153,255,.12), transparent 30%),
    linear-gradient(160deg, #0b0f10 0%, #101415 45%, #0d1112 100%);
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: .18;
  background-image:
    linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 70%);
}
.app-shell { direction: ltr; }
.sidebar {
  direction: ltr;
  background: rgba(11,15,16,.72);
  border-right: 1px solid var(--line);
  border-left: 0;
  backdrop-filter: blur(18px);
}
.profile-name,
.profile-sub,
.project-code {
  color: var(--ink);
  text-align: left;
}
.profile-sub { color: var(--muted); }
.profile-avatar {
  background: linear-gradient(135deg, #4edea3, #10b981 56%, #9699ff);
  color: #002113;
}
.action-button,
.google-button,
.access-form button,
.upload-submit,
.admin-form button {
  background: linear-gradient(135deg, #4edea3, #10b981);
  color: #002113;
  box-shadow: 0 18px 38px rgba(78,222,163,.18);
}
.action-button:hover,
.google-button:hover,
.upload-submit:hover,
.admin-form button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}
.search-box input,
input,
textarea,
select {
  background: rgba(25,28,30,.72);
  border-color: var(--line);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder { color: rgba(224,227,229,.42); }
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(78,222,163,.72);
  box-shadow: 0 0 0 3px rgba(78,222,163,.14);
}
.conversation-row,
.rail-button {
  color: var(--muted);
  text-align: left;
}
.conversation-row:hover,
.conversation-row.active,
.rail-button.active {
  background: rgba(78,222,163,.10);
  color: var(--ink);
}
.section-label { color: var(--quiet); }
.main-stage {
  direction: ltr;
  background: transparent;
}
.private-landing {
  width: min(1180px, 100%);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr);
  gap: 24px;
  align-items: stretch;
}
.landing-copy,
.login-card,
.dashboard-hero,
.metric-card,
.panel,
.signal-card,
.protocol-sheet,
.preview-panel,
.file-picker-card,
.selected-file-row,
.document-row,
.report-row,
.trend-row,
.risk-row,
.action-row,
.protocol-slot,
.protocol-section {
  background: rgba(29,32,34,.48);
  border: 1px solid var(--line);
  border-top-color: rgba(255,255,255,.18);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}
.landing-copy {
  min-height: 520px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: clamp(32px, 6vw, 72px);
  border-radius: 18px;
  background:
    radial-gradient(circle at 14% 12%, rgba(78,222,163,.24), transparent 26%),
    radial-gradient(circle at 78% 16%, rgba(150,153,255,.22), transparent 28%),
    rgba(29,32,34,.50);
}
.landing-badge,
.eyebrow,
.project-code,
.login-project-code,
.signal-status,
.status-pill {
  background: rgba(78,222,163,.10);
  border-color: rgba(78,222,163,.24);
  color: var(--teal);
}
.landing-copy h1 {
  margin: 0;
  color: #f4f7f6;
  font-size: clamp(46px, 8vw, 98px);
  line-height: .94;
  letter-spacing: 0;
}
.landing-copy p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.72;
}
.landing-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.landing-metrics article {
  min-height: 118px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: rgba(25,28,30,.62);
}
.landing-metrics strong {
  color: var(--teal);
  font-size: 25px;
}
.landing-metrics span {
  color: var(--ink);
  font-weight: 850;
}
.landing-disclaimer {
  border-left: 3px solid var(--teal);
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(78,222,163,.08);
  font-size: 14px !important;
}
.login-card {
  align-self: center;
  justify-self: center;
  border-radius: 18px;
  background: rgba(25,28,30,.68);
}
.login-card h1,
.login-card h2,
.view-title,
.dashboard-hero h2,
.protocol-head h2,
.panel-title,
.signal-title {
  color: #f4f7f6;
}
p,
.view-subtitle,
.profile-summary,
.signal-summary,
.metric-label,
.hero-stats span,
.protocol-head p,
.dashboard-hero p {
  color: var(--muted);
}
.workspace-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}
.ghost-button {
  background: rgba(29,32,34,.58);
  border-color: var(--line);
  color: var(--ink);
}
.dashboard-hero {
  background:
    radial-gradient(circle at 16% 14%, rgba(78,222,163,.20), transparent 28%),
    radial-gradient(circle at 84% 22%, rgba(150,153,255,.16), transparent 34%),
    rgba(29,32,34,.54);
  border-radius: 18px;
}
.hero-stats article {
  background: rgba(25,28,30,.62);
  border-color: var(--line);
}
.hero-stats strong,
.metric-value,
.signal-value {
  color: #f7faf9;
}
.health-signal-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.signal-card {
  border-radius: 16px;
  background: rgba(29,32,34,.52);
}
.signal-card.good {
  border-color: rgba(78,222,163,.28);
  background: linear-gradient(145deg, rgba(29,32,34,.72), rgba(16,185,129,.10));
}
.signal-card.watch {
  border-color: rgba(245,193,108,.28);
  background: linear-gradient(145deg, rgba(29,32,34,.72), rgba(245,193,108,.08));
}
.signal-card.alert {
  border-color: rgba(255,180,171,.28);
  background: linear-gradient(145deg, rgba(29,32,34,.72), rgba(255,180,171,.08));
}
.signal-chart {
  background:
    linear-gradient(180deg, rgba(255,255,255,.04), transparent),
    repeating-linear-gradient(0deg, rgba(255,255,255,.05), rgba(255,255,255,.05) 1px, transparent 1px, transparent 22px);
}
.sparkline.empty {
  background: linear-gradient(90deg, rgba(78,222,163,.16), rgba(150,153,255,.14));
}
.dashboard-insights {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.composer {
  background: rgba(29,32,34,.92);
  border: 1px solid var(--line);
  border-top-color: rgba(255,255,255,.18);
  border-radius: 18px;
}
.icon-button.send {
  background: var(--teal);
  color: #002113;
}
.message.system {
  background: rgba(29,32,34,.66);
  border-color: var(--line);
  color: var(--ink);
}
.message.user {
  background: linear-gradient(135deg, rgba(78,222,163,.88), rgba(16,185,129,.82));
  color: #002113;
}
.settings-view .panel,
.admin-view .panel {
  background: rgba(29,32,34,.50);
}
.file-picker-card,
.selected-files,
.saved-files-panel {
  background: rgba(25,28,30,.56);
}
.mobile-tabs {
  background: rgba(11,15,16,.88) !important;
  border-color: var(--line) !important;
}

@media (max-width: 900px) {
  .private-landing {
    grid-template-columns: 1fr;
  }
  .landing-copy {
    min-height: 0;
    padding: 26px;
  }
  .landing-copy h1 {
    font-size: 46px;
  }
  .landing-metrics {
    grid-template-columns: 1fr;
  }
  .dashboard-insights,
  .health-signal-grid {
    grid-template-columns: 1fr;
  }
}

/* Entix Health light workspace. Inspired by the Eyesh public site: wide white space, blue actions, soft panels, and rounded healthcare-grade surfaces. */
:root {
  color-scheme: light;
  --ink: #172230;
  --muted: #65758a;
  --quiet: #8a98aa;
  --bg: #f8fbfd;
  --paper: rgba(255, 255, 255, .86);
  --paper-solid: #ffffff;
  --line: rgba(42, 67, 95, .12);
  --line-strong: rgba(42, 67, 95, .18);
  --navy: #172230;
  --teal: #16b89b;
  --sky: #eaf6ff;
  --mint: #eefbf6;
  --lilac: #f3f1ff;
  --rose: #fff3f3;
  --ok: #14a77e;
  --warn: #b97420;
  --bad: #c54545;
  --blue: #2f66ed;
  --blue-soft: #eaf1ff;
  --shadow: 0 24px 70px rgba(44, 68, 92, .10);
}
html { background: #f8fbfd; }
body {
  color: var(--ink);
  background:
    radial-gradient(circle at 7% 9%, rgba(220, 241, 255, .88), transparent 26%),
    radial-gradient(circle at 90% 6%, rgba(242, 239, 255, .92), transparent 28%),
    radial-gradient(circle at 82% 88%, rgba(234, 251, 246, .92), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, #f8fbfd 45%, #f5faf9 100%);
}
body::before {
  opacity: .42;
  background-image:
    linear-gradient(rgba(47, 102, 237, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 102, 237, .045) 1px, transparent 1px);
  background-size: 38px 38px;
  mask-image: radial-gradient(circle at 50% 12%, black, transparent 72%);
}
body.auth-locked {
  overflow: auto;
}
.app-shell,
.main-stage,
.sidebar {
  direction: ltr;
}
.sidebar {
  background: rgba(255,255,255,.72);
  border-right: 1px solid var(--line);
  border-left: 0;
  box-shadow: 12px 0 45px rgba(55, 78, 104, .05);
}
.profile-name,
.profile-sub,
.project-code {
  color: var(--ink);
  text-align: left;
}
.profile-sub,
.view-subtitle,
.dashboard-hero p,
.protocol-head p,
p {
  color: var(--muted);
}
.profile-avatar,
.brand-mark {
  background: linear-gradient(135deg, #eef8ff, #eefbf6 48%, #f3f1ff);
  color: var(--navy);
  border: 1px solid rgba(47, 102, 237, .12);
  box-shadow: 0 16px 38px rgba(44, 68, 92, .10);
}
.action-button,
.google-button,
.access-form button,
.upload-submit,
.admin-form button,
.hero-primary {
  border: 1px solid rgba(47, 102, 237, .16);
  background: linear-gradient(135deg, #2f66ed, #2862ef);
  color: #fff;
  box-shadow: 0 18px 34px rgba(47, 102, 237, .22);
}
.hero-secondary,
.ghost-button,
.rail-button,
.conversation-row,
.search-box input,
input,
textarea,
select {
  background: rgba(255,255,255,.82);
  border-color: var(--line);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: rgba(101, 117, 138, .72);
}
input:focus,
textarea:focus,
select:focus {
  border-color: rgba(47, 102, 237, .62);
  box-shadow: 0 0 0 4px rgba(47, 102, 237, .10);
}
.conversation-row:hover,
.conversation-row.active,
.rail-button.active {
  background: linear-gradient(135deg, rgba(47,102,237,.10), rgba(22,184,155,.08));
  color: var(--navy);
}
.section-label {
  color: var(--quiet);
}
.login-view {
  min-height: 100vh;
  align-items: start;
  padding: clamp(22px, 4vw, 52px);
}
.private-landing {
  width: min(1320px, 100%);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(34px, 5vw, 68px);
}
.landing-nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0 18px;
  border-bottom: 1px solid var(--line);
}
.landing-brand,
.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 14px;
}
.landing-brand {
  font-weight: 950;
  color: var(--navy);
  font-size: 21px;
}
.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 14px;
  position: relative;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: conic-gradient(from 20deg, var(--blue), var(--teal), #9bbcff, var(--blue));
  animation: slow-spin 8s linear infinite;
}
.landing-nav-links a,
.nav-pill,
.landing-tags span {
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,.68);
  padding: 10px 13px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 850;
}
.nav-pill {
  color: var(--blue);
  background: var(--blue-soft);
}
.landing-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(420px, .88fr);
  align-items: center;
  gap: clamp(36px, 6vw, 88px);
}
.landing-copy {
  min-height: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding: 0;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  background: transparent;
}
.landing-badge,
.eyebrow,
.project-code,
.login-project-code,
.signal-status,
.status-pill {
  width: fit-content;
  border: 1px solid rgba(47, 102, 237, .14);
  border-radius: 14px;
  background: rgba(234, 241, 255, .82);
  color: var(--blue);
  padding: 8px 11px;
  font-weight: 900;
}
.landing-copy h1 {
  max-width: 820px;
  margin: 0;
  color: var(--navy);
  font-size: clamp(52px, 6.8vw, 98px);
  line-height: .95;
  letter-spacing: 0;
  font-weight: 950;
}
.landing-copy p {
  max-width: 730px;
  margin: 0;
  color: var(--muted);
  font-size: clamp(17px, 1.8vw, 22px);
  line-height: 1.8;
}
.landing-actions,
.landing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.hero-primary,
.hero-secondary {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  padding: 0 18px;
  text-decoration: none;
  font-weight: 900;
}
.hero-secondary {
  background: rgba(255,255,255,.80);
  box-shadow: none;
}
.health-preview {
  position: relative;
}
.preview-window,
.landing-proof article,
.landing-access,
.login-card,
.dashboard-hero,
.metric-card,
.panel,
.signal-card,
.protocol-sheet,
.preview-panel,
.file-picker-card,
.selected-file-row,
.document-row,
.report-row,
.trend-row,
.risk-row,
.action-row,
.protocol-slot,
.protocol-section,
.composer,
.message.system,
.message.user {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255,255,255,.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}
.preview-window {
  padding: 18px;
  animation: float-card 6.5s ease-in-out infinite;
}
.preview-top,
.preview-kpis,
.preview-cards {
  display: grid;
  gap: 12px;
}
.preview-top {
  grid-template-columns: 1fr auto;
  align-items: center;
  padding-bottom: 14px;
  color: var(--muted);
  font-weight: 850;
  border-bottom: 1px solid var(--line);
}
.window-dots {
  display: flex;
  gap: 7px;
}
.window-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--teal);
}
.window-dots i:nth-child(2) { background: #f6b24b; }
.window-dots i:nth-child(3) { background: #f36d6d; }
.preview-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
}
.preview-kpis article,
.preview-card,
.preview-report,
.hero-stats article {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #f6f8fb;
  padding: 18px;
}
.preview-kpis strong,
.hero-stats strong,
.metric-value,
.signal-value {
  color: var(--navy);
}
.preview-kpis strong {
  display: block;
  font-size: 30px;
}
.preview-kpis span,
.preview-card span,
.preview-report span {
  color: var(--muted);
  font-weight: 800;
}
.preview-cards {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 14px;
}
.preview-card.blue {
  background: linear-gradient(135deg, #eef6ff, #f7faff);
}
.preview-card.mint {
  background: linear-gradient(135deg, #effbf6, #f8fffc);
}
.preview-card strong,
.preview-report strong {
  display: block;
  margin-top: 8px;
  color: var(--navy);
  font-size: 18px;
}
.mini-line {
  height: 8px;
  margin-top: 18px;
  border-radius: 99px;
  background: rgba(47,102,237,.12);
  overflow: hidden;
}
.mini-line b {
  display: block;
  height: 100%;
  width: 78%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--teal));
}
.preview-report {
  margin-top: 14px;
  background: #fff;
}
.landing-proof {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}
.landing-proof article {
  padding: 26px;
  min-height: 190px;
}
.landing-proof strong {
  color: var(--blue);
  font-size: 20px;
}
.landing-proof h3,
.landing-access h2,
.login-card h1,
.login-card h2,
.view-title,
.dashboard-hero h2,
.protocol-head h2,
.panel-title,
.signal-title {
  color: var(--navy);
}
.landing-proof h3 {
  margin: 38px 0 8px;
  font-size: 24px;
}
.landing-proof p {
  margin: 0;
  line-height: 1.7;
}
.landing-access {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
  align-items: center;
  gap: 28px;
  padding: clamp(26px, 5vw, 56px);
  background:
    radial-gradient(circle at 14% 22%, rgba(47, 102, 237, .10), transparent 28%),
    radial-gradient(circle at 88% 72%, rgba(22, 184, 155, .10), transparent 30%),
    rgba(255,255,255,.80);
}
.landing-access h2 {
  max-width: 760px;
  margin: 18px 0;
  font-size: clamp(34px, 5vw, 70px);
  line-height: 1;
}
.login-card {
  align-self: center;
  justify-self: stretch;
  padding: 26px;
  border-radius: 28px;
  background: #fff;
}
.dashboard-hero {
  background:
    radial-gradient(circle at 12% 20%, rgba(47,102,237,.10), transparent 28%),
    radial-gradient(circle at 84% 16%, rgba(22,184,155,.10), transparent 32%),
    rgba(255,255,255,.78);
  border-radius: 30px;
}
.signal-card.good {
  border-color: rgba(20,167,126,.20);
  background: linear-gradient(145deg, #ffffff, #f0fbf7);
}
.signal-card.watch {
  border-color: rgba(185,116,32,.22);
  background: linear-gradient(145deg, #ffffff, #fff8ec);
}
.signal-card.alert {
  border-color: rgba(197,69,69,.22);
  background: linear-gradient(145deg, #ffffff, #fff4f4);
}
.signal-chart {
  background:
    linear-gradient(180deg, rgba(47,102,237,.04), transparent),
    repeating-linear-gradient(0deg, rgba(23,34,48,.055), rgba(23,34,48,.055) 1px, transparent 1px, transparent 22px);
}
.sparkline.empty {
  background: linear-gradient(90deg, rgba(47,102,237,.14), rgba(22,184,155,.13));
}
.composer {
  background: #fff;
  border-radius: 24px;
}
.icon-button.send {
  background: var(--blue);
  color: #fff;
}
.message.system {
  color: var(--ink);
  background: #fff;
}
.message.user {
  color: #fff;
  background: linear-gradient(135deg, #24344a, #172230);
}
.settings-view .panel,
.admin-view .panel,
.file-picker-card,
.selected-files,
.saved-files-panel {
  background: rgba(255,255,255,.78);
}
.mobile-tabs {
  background: rgba(255,255,255,.92) !important;
  border-color: var(--line) !important;
}
@keyframes float-card {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
@keyframes slow-spin {
  to { transform: rotate(360deg); }
}
@media (max-width: 980px) {
  .landing-nav {
    align-items: flex-start;
    flex-direction: column;
  }
  .landing-nav-links {
    width: 100%;
    overflow-x: auto;
    padding-bottom: 4px;
  }
  .landing-hero,
  .landing-access {
    grid-template-columns: 1fr;
  }
  .landing-copy h1 {
    font-size: clamp(42px, 12vw, 62px);
  }
  .preview-kpis,
  .preview-cards,
  .landing-proof,
  .dashboard-insights,
  .health-signal-grid {
    grid-template-columns: 1fr;
  }
}

/* Comfort typography pass: softer than the first draft, closer to Eyesh's readable product cards. */
body,
button,
input,
textarea,
select {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", sans-serif;
}
.landing-brand {
  font-size: 20px;
  font-weight: 760;
}
.landing-nav-links a,
.nav-pill,
.landing-tags span,
.landing-badge,
.eyebrow,
.project-code,
.login-project-code,
.signal-status,
.status-pill {
  font-weight: 680;
}
.landing-copy {
  gap: 22px;
}
.landing-copy h1 {
  max-width: 760px;
  font-size: clamp(40px, 5.1vw, 68px);
  line-height: 1.06;
  font-weight: 760;
}
.landing-copy p {
  max-width: 680px;
  font-size: clamp(16px, 1.45vw, 19px);
  line-height: 1.82;
}
.hero-primary,
.hero-secondary,
.action-button,
.google-button,
.access-form button,
.upload-submit,
.admin-form button,
.ghost-button {
  font-weight: 700;
}
.preview-window {
  padding: 16px;
}
.preview-top {
  font-size: 13px;
  font-weight: 680;
}
.preview-kpis article,
.preview-card,
.preview-report {
  border-radius: 18px;
  padding: 16px;
}
.preview-kpis strong {
  font-size: 24px;
  font-weight: 720;
}
.preview-kpis span,
.preview-card span,
.preview-report span {
  font-size: 13px;
  font-weight: 690;
  line-height: 1.45;
}
.preview-card strong,
.preview-report strong {
  font-size: 15px;
  line-height: 1.35;
  font-weight: 660;
}
.landing-proof h3 {
  font-size: 21px;
  font-weight: 700;
}
.landing-access h2 {
  font-size: clamp(32px, 4.1vw, 52px);
  font-weight: 760;
  line-height: 1.08;
}
.login-card h2,
.dashboard-hero h2,
.protocol-head h2,
.view-title {
  font-weight: 720;
}
.panel-title,
.signal-title,
.conversation-title,
.doc-title,
.risk-title,
.action-title {
  font-weight: 680;
}
.hero-stats strong,
.metric-value,
.signal-value {
  font-weight: 720;
}

/* Entix Health cutover polish: private split login and footer. */
.landing-access {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 440px);
  border-radius: 34px;
}
.login-card {
  display: grid;
  gap: 14px;
  padding: 30px;
  border-radius: 34px;
  background:
    linear-gradient(180deg, rgba(255,255,255,.96), rgba(255,255,255,.88)),
    radial-gradient(circle at 20% 18%, rgba(47,102,237,.10), transparent 34%);
}
.login-card h2 {
  margin: 0;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.04;
  letter-spacing: 0;
}
.login-card p {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
}
.access-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 10px;
}
.access-form #loginEmail {
  grid-column: 1 / -1;
}
.access-form input {
  min-height: 48px;
  border-radius: 16px;
  background: rgba(255,255,255,.92);
  color: var(--ink);
}
.access-form button,
.google-button,
.hero-primary,
.nav-login {
  border-radius: 16px;
}
.landing-footer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 28px 0 8px;
  color: var(--muted);
  border-top: 1px solid var(--line);
}
.landing-footer div {
  display: grid;
  gap: 4px;
}
.landing-footer strong {
  color: var(--navy);
  font-size: 15px;
}
.landing-footer span,
.landing-footer a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
}
.landing-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: flex-end;
}
.ensidex-footer-link {
  color: var(--blue) !important;
}
@media (max-width: 760px) {
  .landing-access,
  .landing-footer {
    grid-template-columns: 1fr;
  }
  .landing-footer nav {
    justify-content: flex-start;
  }
  .access-form {
    grid-template-columns: 1fr;
  }
}

@media print {
  :root { color-scheme: light; }
  body {
    overflow: visible;
    background: #fff;
    color: #111827;
  }
  .sidebar,
  .mobile-bar,
  .mobile-tabs,
  .workspace-head,
  .chat-view,
  .dashboard-view,
  .settings-view,
  .admin-view,
  .login-view,
  .print-button,
  .document-preview {
    display: none !important;
  }
  .app-shell,
  .main-stage,
  .workspace,
  #appPanel {
    display: block !important;
    min-height: 0;
    height: auto;
    padding: 0;
  }
  .protocol-view,
  .protocol-view.active {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
    padding: 0;
  }
  .protocol-sheet {
    max-width: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: #fff;
  }
  .protocol-head {
    border-bottom: 2px solid #172230;
    background: #fff;
    padding: 0 0 18px;
  }
  .protocol-section,
  .protocol-slot {
    break-inside: avoid;
    background: #fff;
    border-color: #d7dde4;
  }
}
