* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #f4f7fb;
  --bg-soft: #eef4ff;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
}

body {
  font-family: Arial, sans-serif;
  background: linear-gradient(135deg, var(--bg), var(--bg-soft));
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

.navbar {
  width: 100%;
  background: #0f172a;
  color: white;
  padding: 18px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

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

.navbar h1 {
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.navbar-brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 6px;
  flex-shrink: 0;
}

.navbar-brand-mark span {
  display: block;
  width: 46px;
  height: 8px;
  border-radius: 999px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.18);
}

.navbar-brand-mark span:nth-child(1) {
  background: #7be043;
}

.navbar-brand-mark span:nth-child(2) {
  background: #e48a24;
}

.navbar-brand-mark span:nth-child(3) {
  background: #c22d20;
}

.logout-btn {
  text-decoration: none;
  background: var(--primary);
  color: white;
  padding: 10px 18px;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.2s ease, transform 0.2s ease;
}

.logout-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

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

.nav-link-btn {
  text-decoration: none;
  color: #d8e5ff;
  border: 1px solid rgba(219, 234, 254, 0.35);
  padding: 10px 16px;
  border-radius: 10px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease;
}

.nav-link-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.container {
  max-width: 1500px;
  margin: 36px auto;
  padding: 0 24px 48px;
}

.hero {
  background: var(--card);
  border-radius: 20px;
  padding: 28px 30px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

.hero h2 {
  font-size: 2rem;
  margin-bottom: 8px;
  color: var(--text);
}

.hero p {
  font-size: 1rem;
  color: var(--muted);
}

.data-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.card {
  background: var(--card);
  border-radius: 18px;
  padding: 24px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
  color: var(--text);
}

.scan-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.scan-card {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  background: #f8fafc;
}

.scan-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 12px;
  flex-wrap: wrap;
}

.scan-header h4 {
  font-size: 1.1rem;
  color: var(--text);
}

.scan-id {
  font-size: 0.94rem;
  color: var(--muted);
  font-weight: 600;
}

.scan-detail {
  margin-bottom: 8px;
  color: #334155;
}

.scan-stats {
  margin-bottom: 18px;
  color: #1e293b;
  font-weight: 600;
  line-height: 1.7;
  background: #eef4ff;
  border: 1px solid #dbeafe;
  border-radius: 12px;
  padding: 12px 14px;
}

.chart-block {
  margin-bottom: 22px;
}

.chart-block h5 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1rem;
}

.scan-canvas {
  width: 100%;
  max-width: 100%;
  height: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
  padding: 0;
}

.view-toggle {
  margin-top: 18px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.view-toggle button {
  border: none;
  padding: 10px 16px;
  border-radius: 10px;
  background: #e5e7eb;
  color: #0f172a;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.2s ease;
}

.view-toggle button:hover {
  background: #dbe3ea;
}

.view-toggle button.active {
  background: #2563eb;
  color: white;
}

.scan-filter-panel {
  margin-top: 24px;
  padding: 18px 20px;
  border-radius: 18px;
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  border: 1px solid #d8e4f8;
}

.scan-filter-heading h3 {
  font-size: 1.15rem;
  color: #17345e;
  margin-bottom: 4px;
}

.scan-filter-heading p {
  font-size: 0.98rem;
  color: #5a6c83;
}

.scan-filter-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: end;
  margin-top: 16px;
}

.scan-filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 200px;
}

.scan-filter-field span {
  font-size: 0.95rem;
  font-weight: 700;
  color: #25436f;
}

.scan-filter-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #bfd0ee;
  background: #ffffff;
  color: #1b2f4f;
  font-size: 0.98rem;
}

.scan-filter-clear {
  border: none;
  padding: 12px 18px;
  border-radius: 12px;
  background: #23487f;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.scan-filter-clear:hover {
  background: #1a3866;
  transform: translateY(-1px);
}

.empty-filter-state {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 244, 255, 0.94));
  border: 1px solid #d7e3f6;
  border-radius: 20px;
  padding: 28px 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.empty-filter-state h3 {
  font-size: 1.3rem;
  color: #17345e;
  margin-bottom: 8px;
}

.empty-filter-state p {
  color: #58697d;
  font-size: 1rem;
}

.scan-canvas.line-mode {
  background: #fcfcfd;
}

pre {
  background: #0f172a;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 0.92rem;
  line-height: 1.55;
  min-height: 220px;
}

.loading {
  color: var(--muted);
  font-style: italic;
}

.error {
  color: #b91c1c;
  font-weight: 600;
}

.graph-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.graph-row.single {
  grid-template-columns: 1fr;
}

.chart-block {
  margin-bottom: 0;
}

.chart-block h5 {
  margin-bottom: 10px;
  color: var(--text);
  font-size: 1rem;
}

.scan-canvas {
  width: 100%;
  height: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
  display: block;
}

@media (max-width: 1100px) {
  .graph-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .navbar {
    padding: 16px 20px;
  }

  .hero {
    padding: 22px;
  }

  .hero h2 {
    font-size: 1.6rem;
  }

  .card {
    padding: 18px;
  }

  .scan-card {
    padding: 16px;
  }

  .scan-stats {
    font-size: 0.95rem;
  }
}
/* Bar-graph cards styled to match the patient dashboard screenshot */
.chart-block.bar-chart-block {
  background: #eceff2;
  border: 2px solid #57709a;
  border-radius: 16px;
  box-shadow: 4px 4px 0 rgba(33, 41, 54, 0.45);
  padding: 8px 8px 10px;
}

.chart-block.bar-chart-block h5 {
  font-size: 0.82rem;
  margin-bottom: 6px;
  letter-spacing: 0.02em;
  color: #334155;
  text-transform: uppercase;
}

.scan-canvas.bar-mode {
  border: none;
  border-radius: 11px;
  background: #eef1f4;
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

@media (max-width: 900px) {
  .scan-canvas.bar-mode {
    max-width: 100%;
  }
}

.portal-page {
  --portal-bg-1: #eff3f8;
  --portal-bg-2: #dfe7f3;
  --portal-accent: #335c9b;
  --portal-accent-dark: #233f6d;
  --portal-warm: #e48a24;
  --portal-card: rgba(255, 255, 255, 0.82);
  --portal-border: rgba(51, 92, 155, 0.28);
  min-height: 100vh;
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(228, 138, 36, 0.18), transparent 28%),
    radial-gradient(circle at right center, rgba(51, 92, 155, 0.18), transparent 32%),
    linear-gradient(145deg, var(--portal-bg-1), var(--portal-bg-2));
}

.portal-shell {
  min-height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 56px;
  display: grid;
  align-items: center;
  gap: 28px;
}

.portal-hero-card {
  position: relative;
  overflow: hidden;
  background: var(--portal-card);
  border: 1px solid var(--portal-border);
  border-radius: 32px;
  padding: 40px;
  box-shadow:
    0 24px 60px rgba(18, 31, 53, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
}

.portal-hero-card::before,
.portal-hero-card::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.portal-hero-card::before {
  width: 260px;
  height: 260px;
  right: -70px;
  top: -80px;
  background: radial-gradient(circle, rgba(51, 92, 155, 0.2), transparent 68%);
}

.portal-hero-card::after {
  width: 220px;
  height: 220px;
  left: -80px;
  bottom: -90px;
  background: radial-gradient(circle, rgba(228, 138, 36, 0.16), transparent 70%);
}

.portal-hero-card-compact {
  max-width: 760px;
  justify-self: center;
}

.portal-loading-card,
.portal-feedback-card {
  position: relative;
  overflow: hidden;
  max-width: 760px;
  margin: 36px auto 0;
  padding: 34px 32px;
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.14), transparent 30%),
    radial-gradient(circle at bottom left, rgba(228, 138, 36, 0.14), transparent 34%),
    rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow:
    0 26px 60px rgba(15, 23, 42, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.75);
  text-align: center;
}

.portal-loading-card::before,
.portal-feedback-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 4px;
  background: linear-gradient(90deg, #7be043 0%, #e48a24 55%, #c22d20 100%);
}

.portal-loading-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.76rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 800;
  color: #28508b;
  background: rgba(37, 99, 235, 0.1);
}

.portal-loading-orbit {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin: 22px 0 20px;
}

.portal-loading-orbit span {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  animation: portal-loading-bounce 1.2s ease-in-out infinite;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.14);
}

.portal-loading-orbit span:nth-child(1) {
  background: #7be043;
  animation-delay: 0s;
}

.portal-loading-orbit span:nth-child(2) {
  background: #e48a24;
  animation-delay: 0.18s;
}

.portal-loading-orbit span:nth-child(3) {
  background: #c22d20;
  animation-delay: 0.36s;
}

.portal-loading-card h3,
.portal-feedback-card h3 {
  font-size: 1.6rem;
  color: #12233e;
  margin-bottom: 8px;
}

.portal-loading-card p,
.portal-feedback-card p {
  max-width: 520px;
  margin: 0 auto;
  color: #5a6c83;
  font-size: 1rem;
}

.portal-feedback-error h3 {
  color: #8f1d1d;
}

.portal-feedback-error p {
  color: #7a3030;
}

@keyframes portal-loading-bounce {
  0%,
  80%,
  100% {
    transform: translateY(0) scale(0.9);
    opacity: 0.6;
  }

  40% {
    transform: translateY(-8px) scale(1.08);
    opacity: 1;
  }
}

.portal-brand {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 28px;
}

.portal-brand-mark {
  display: inline-flex;
  flex-direction: column;
  gap: 8px;
  padding: 10px 0;
}

.portal-brand-mark span {
  display: block;
  width: 54px;
  height: 10px;
  border-radius: 999px;
  box-shadow: 0 2px 4px rgba(12, 20, 34, 0.18);
}

.portal-brand-mark span:nth-child(1) {
  background: #7be043;
}

.portal-brand-mark span:nth-child(2) {
  background: #e48a24;
}

.portal-brand-mark span:nth-child(3) {
  background: #c22d20;
}

.portal-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.8rem;
  color: var(--portal-accent);
  font-weight: 700;
  margin-bottom: 6px;
}

.portal-brand h1 {
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 0.98;
  color: #132033;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.portal-copy {
  max-width: 680px;
}

.portal-kicker {
  font-size: clamp(1.05rem, 2vw, 1.3rem);
  font-weight: 700;
  color: #243b63;
  margin-bottom: 12px;
}

.portal-description {
  font-size: 1.03rem;
  color: #44556f;
  max-width: 60ch;
}

.portal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.portal-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  padding: 14px 22px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 700;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.portal-button:hover {
  transform: translateY(-2px);
}

.portal-button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--portal-accent), var(--portal-accent-dark));
  box-shadow: 0 12px 28px rgba(35, 63, 109, 0.24);
}

.portal-button-secondary {
  color: var(--portal-accent-dark);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(51, 92, 155, 0.18);
}

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

.portal-feature-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(51, 92, 155, 0.16);
  border-radius: 22px;
  padding: 22px 20px;
  box-shadow: 0 16px 30px rgba(18, 31, 53, 0.08);
}

.portal-feature-card h2 {
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: #1f3356;
}

.portal-feature-card p {
  color: #516176;
  font-size: 0.96rem;
}

@media (max-width: 900px) {
  .portal-shell {
    padding: 24px 16px 40px;
  }

  .portal-hero-card {
    padding: 28px 22px;
    border-radius: 24px;
  }

  .portal-details {
    grid-template-columns: 1fr;
  }

  .portal-brand {
    align-items: flex-start;
  }

  .portal-brand h1 {
    font-size: clamp(2rem, 11vw, 3rem);
  }

  .portal-actions {
    flex-direction: column;
  }

  .portal-button {
    width: 100%;
  }
}

.scan-card {
  padding: 0;
  overflow: hidden;
  border: 1px solid #c8d7ee;
  box-shadow: 0 14px 34px rgba(26, 41, 70, 0.08);
}

.scan-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
  border: none;
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.scan-toggle:hover {
  background: rgba(37, 99, 235, 0.04);
}

.scan-heading-group {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex: 1;
  flex-wrap: wrap;
}

.scan-heading-main {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.scan-header h4,
.scan-heading-main h4 {
  font-size: 1.62rem;
  line-height: 1.1;
  color: var(--text);
}

.scan-date,
.scan-id {
  font-size: 1.18rem;
  color: #334155;
  font-weight: 700;
}

.scan-chevron {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.scan-chevron span {
  width: 11px;
  height: 11px;
  border-right: 3px solid #35588e;
  border-bottom: 3px solid #35588e;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.scan-chevron.open span {
  transform: rotate(225deg);
}

.scan-content {
  padding: 0 24px 26px;
}

.scan-meta-card {
  background: linear-gradient(180deg, #f8fbff 0%, #edf4ff 100%);
  border: 1px solid #c8d9f7;
  border-radius: 18px;
  padding: 18px 20px;
  margin-top: 22px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.scan-meta-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.scan-meta-card-header h5 {
  font-size: 1.2rem;
  color: #17345e;
  font-weight: 800;
}

.scan-meta-grid {
  display: grid;
  gap: 10px;
}

.scan-meta-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px 18px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.86);
  align-items: start;
}

.scan-meta-label {
  font-size: 1.12rem;
  font-weight: 800;
  color: #1e3a5f;
}

.scan-meta-value {
  font-size: 1.12rem;
  color: #334155;
  word-break: break-word;
}

.chart-block h5 {
  font-size: 1.16rem;
}

.chart-block.bar-chart-block h5 {
  font-size: 1.04rem;
}

.hub-shell,
.coming-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px 24px 56px;
}

.hub-hero {
  display: block;
  margin-bottom: 26px;
}

.hub-copy,
.hub-summary-card,
.hub-card,
.coming-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 244, 255, 0.94));
  border: 1px solid #d7e3f6;
  border-radius: 24px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.08);
}

.hub-copy {
  padding: 34px 34px 30px;
}

.hub-eyebrow,
.coming-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.82rem;
  font-weight: 800;
  color: #365d99;
  margin-bottom: 10px;
}

.hub-copy h2,
.coming-card h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  color: #13233c;
  margin-bottom: 14px;
}

.hub-copy p,
.hub-summary-card span,
.hub-card p,
.coming-card p {
  font-size: 1.06rem;
  color: #516176;
  line-height: 1.7;
}

.hub-summary-card {
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #27497c, #183255);
  color: #f8fbff;
}

.hub-summary-card strong {
  font-size: 1.4rem;
}

.hub-summary-card .hub-summary-label {
  color: #bed3ff;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 800;
}

.hub-summary-card span {
  color: #deebff;
}

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

.hub-card {
  padding: 28px 24px;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.hub-card h3 {
  font-size: 1.35rem;
  color: #122543;
  margin-bottom: 10px;
}

.hub-link-text {
  display: inline-block;
  margin-top: 18px;
  color: #29518c;
  font-weight: 800;
}

.hub-icon {
  width: 64px;
  height: 64px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #edf4ff, #d7e7ff);
  color: #2d5796;
}

.hub-icon svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.coming-shell {
  min-height: calc(100vh - 88px);
  display: grid;
  place-items: center;
}

.coming-card {
  max-width: 760px;
  padding: 42px 36px;
  text-align: left;
}

.coming-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.coming-back-btn {
  color: #ffffff;
  background: linear-gradient(135deg, #183255, #0f223d);
  box-shadow: 0 12px 28px rgba(15, 34, 61, 0.28);
}

.contact-shell {
  max-width: 1320px;
  margin: 0 auto;
  padding: 38px 24px 56px;
}

.contact-hero,
.contact-summary-card,
.contact-card,
.message-card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 244, 255, 0.94));
  border: 1px solid #d7e3f6;
  border-radius: 24px;
  box-shadow: 0 18px 42px rgba(18, 38, 69, 0.1);
}

.contact-hero {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 30px;
  margin-bottom: 24px;
}

.contact-hero h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.02;
  color: #13233c;
  margin: 10px 0 14px;
}

.contact-hero p {
  font-size: 1.06rem;
  color: #516176;
  line-height: 1.7;
  max-width: 760px;
}

.contact-hero-actions {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  flex-wrap: wrap;
}

.contact-summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 24px;
}

.contact-summary-card {
  padding: 24px;
}

.contact-summary-card span {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #60779f;
  margin-bottom: 12px;
}

.contact-summary-card strong {
  font-size: 1.7rem;
  color: #122543;
}

.contact-card {
  padding: 28px 24px;
}

.compose-card {
  margin-bottom: 24px;
}

.compose-card-header {
  margin-bottom: 18px;
}

.contact-card h3 {
  font-size: 1.45rem;
  color: #122543;
  margin-bottom: 10px;
}

.contact-card p {
  color: #54667e;
  font-size: 1rem;
  line-height: 1.7;
}

.contact-messages-grid {
  display: grid;
  gap: 18px;
}

.compose-form {
  display: grid;
  gap: 16px;
}

.compose-field {
  display: grid;
  gap: 8px;
}

.compose-field span {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #60779f;
}

.compose-field input,
.compose-field select,
.compose-field textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d7e3f6;
  border-radius: 16px;
  background: #fbfdff;
  color: #1a2f52;
  font: inherit;
  padding: 14px 16px;
}

.compose-field textarea {
  resize: vertical;
  min-height: 148px;
}

.compose-field input:focus,
.compose-field select:focus,
.compose-field textarea:focus {
  outline: none;
  border-color: #7e98d5;
  box-shadow: 0 0 0 4px rgba(126, 152, 213, 0.14);
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.compose-count {
  color: #60779f;
  font-size: 0.92rem;
  font-weight: 700;
}

.compose-submit {
  min-width: 190px;
}

.message-card {
  padding: 24px;
}

.message-card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.message-card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.8rem;
  font-weight: 800;
  color: #60779f;
  margin-bottom: 8px;
}

.message-card h3 {
  font-size: 1.35rem;
  color: #122543;
}

.message-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #e7eefb;
  color: #284267;
  font-weight: 800;
  font-size: 0.92rem;
  white-space: nowrap;
}

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

.message-meta-item {
  padding: 14px 16px;
  border: 1px solid #dde7f4;
  border-radius: 16px;
  background: rgba(251, 253, 255, 0.88);
}

.message-meta-item span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #60779f;
  margin-bottom: 8px;
}

.message-meta-item strong {
  color: #1a2f52;
  font-size: 1rem;
  line-height: 1.5;
  display: block;
  word-break: break-word;
}

.message-body-card {
  margin-top: 16px;
  padding: 18px 18px 20px;
  border: 1px solid #dbe6f4;
  border-radius: 18px;
  background: rgba(249, 252, 255, 0.92);
}

.message-body-card span {
  display: block;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #60779f;
  margin-bottom: 10px;
}

.message-body-card p {
  margin: 0;
  color: #223b66;
  font-size: 1.02rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

.scan-history-page,
.scan-detail-page {
  background: #f5f7fb;
}

.history-shell,
.detail-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px 56px;
}

.history-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #38598c;
  text-decoration: none;
  font-weight: 700;
  margin-bottom: 22px;
}

.history-back-link::before {
  content: "<";
  font-size: 1rem;
}

.patient-summary-card,
.history-card,
.detail-header-card,
.detail-graph-card,
.detail-summary-card {
  background: #ffffff;
  border: 1px solid #d9e2f1;
  border-radius: 24px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
}

.patient-summary-card {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px;
  margin-bottom: 24px;
}

.patient-summary-main {
  display: flex;
  align-items: center;
  gap: 18px;
}

.patient-avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  background: #eef2f8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #66748c;
}

.patient-avatar svg {
  width: 34px;
  height: 34px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.patient-summary-main h2 {
  font-size: 2rem;
  color: #122543;
  margin-bottom: 6px;
}

.patient-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  color: #63738b;
  font-size: 1rem;
}

.patient-status-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: #dff4e6;
  color: #177245;
  font-weight: 700;
}

.patient-summary-stats {
  display: flex;
  gap: 34px;
}

.patient-summary-stats div {
  text-align: center;
}

.patient-summary-stats strong {
  display: block;
  font-size: 1.9rem;
  color: #122543;
}

.patient-summary-stats span {
  color: #6a7b94;
  font-size: 0.95rem;
}

.history-card {
  padding: 24px;
}

.history-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.history-card-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.82rem;
  font-weight: 800;
  color: #5d7296;
  margin-bottom: 6px;
}

.history-card-header h3 {
  font-size: 1.8rem;
  color: #122543;
}

.history-scan-count {
  color: #7d8ca3;
  font-weight: 700;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.history-toolbar-btn {
  border: 1px solid #d4deec;
  background: #ffffff;
  color: #122543;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 700;
  cursor: pointer;
}

.history-toolbar-btn:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.history-filter-card {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: end;
  padding: 18px;
  border-radius: 18px;
  background: #f7f9fc;
  margin-bottom: 18px;
}

.history-filter-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  flex: 1;
}

.history-filter-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.history-filter-field span {
  color: #25436f;
  font-weight: 700;
}

.history-filter-field input {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #c8d4e8;
  background: #ffffff;
  font-size: 1rem;
}

.history-apply-btn {
  border: none;
  padding: 13px 20px;
  border-radius: 12px;
  background: #14223a;
  color: #ffffff;
  font-weight: 700;
  cursor: pointer;
}

.history-table-wrap {
  overflow-x: auto;
}

.history-table {
  width: 100%;
  border-collapse: collapse;
}

.history-table th,
.history-table td {
  padding: 18px 12px;
  border-top: 1px solid #e5ebf4;
  text-align: left;
}

.history-table th {
  color: #6c7d96;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.82rem;
  font-weight: 800;
}

.history-table td {
  color: #1c2d4a;
  font-size: 1rem;
  vertical-align: middle;
}

.history-checkbox-cell {
  width: 42px;
}

.history-checkbox-cell input {
  width: 18px;
  height: 18px;
  accent-color: #6b58c4;
  cursor: pointer;
}

.history-empty-cell {
  color: #6c7d96;
}

.scan-type-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.9rem;
  font-weight: 700;
}

.scan-type-pill.cervical {
  background: #dfeaff;
  color: #2659c4;
}

.scan-type-pill.full {
  background: #f0e3ff;
  color: #8447d6;
}

.scan-view-link {
  color: #2452cb;
  text-decoration: none;
  font-weight: 800;
}

.detail-header-card {
  padding: 26px 28px;
  margin-bottom: 24px;
}

.detail-header-main {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-start;
}

.detail-title-row {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.detail-title-row h2 {
  font-size: 2.2rem;
  color: #122543;
}

.detail-submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
  color: #61728a;
  font-size: 1rem;
  margin-bottom: 8px;
}

.detail-scan-id {
  color: #8694ab;
  font-size: 0.98rem;
}

.detail-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.detail-toggle-group {
  display: inline-flex;
  background: #15233a;
  border-radius: 14px;
  padding: 4px;
}

.detail-toggle-group button,
.detail-action-btn {
  border: none;
  border-radius: 10px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}

.detail-toggle-group button {
  background: transparent;
  color: #cfdcf0;
}

.detail-toggle-group button.active {
  background: #223552;
  color: #ffffff;
}

.detail-action-btn {
  background: #ffffff;
  border: 1px solid #d4deec;
  color: #122543;
}

.detail-graph-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 26px;
}

.detail-graph-card {
  padding: 24px 26px 28px;
  max-width: 1180px;
  margin: 0 auto;
}

.detail-graph-card h3 {
  font-size: 1.3rem;
  color: #22395f;
  margin-bottom: 18px;
}

.detail-canvas {
  display: block;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
}

.detail-canvas.bar-mode {
  max-width: 640px;
}

.detail-summary-card {
  padding: 26px 24px;
}

.detail-summary-card h3 {
  font-size: 1.8rem;
  color: #122543;
  margin-bottom: 18px;
}

.scan-message-card {
  margin-top: 24px;
}

.scan-message-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.scan-message-intro {
  margin: 0;
}

.scan-message-toggle {
  min-width: 220px;
}

.scan-message-toggle.active {
  background: #edf3ff;
  border-color: #9db4e3;
  color: #223b66;
}

.detail-summary-group {
  margin-bottom: 24px;
}

.detail-summary-label {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #5b7197;
  font-size: 0.84rem;
  font-weight: 800;
  margin-bottom: 8px;
}

.detail-summary-text {
  color: #1e3150;
  font-size: 1.1rem;
  line-height: 1.7;
}

.detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-bottom: 26px;
}

.detail-stat-grid strong {
  display: block;
  font-size: 2rem;
  color: #122543;
}

.detail-stat-grid span {
  color: #64758d;
}

.detail-meta-grid {
  display: grid;
  gap: 12px;
}

.detail-meta-row {
  display: grid;
  grid-template-columns: minmax(180px, 240px) 1fr;
  gap: 10px 18px;
  padding: 14px 16px;
  border: 1px solid #dde5f0;
  border-radius: 16px;
  background: #fbfcfe;
}

.detail-meta-label {
  color: #2b4a76;
  font-weight: 800;
}

.detail-meta-value {
  color: #20324f;
}

.scan-message-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.scan-message-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: #284267;
}

.scan-message-textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 16px 18px;
  border: 1px solid #ccdaee;
  border-radius: 18px;
  background: linear-gradient(180deg, #fbfdff, #f4f8ff);
  color: #173055;
  font: inherit;
  line-height: 1.55;
  box-sizing: border-box;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.scan-message-textarea:focus {
  outline: none;
  border-color: #5f7cc6;
  box-shadow: 0 0 0 4px rgba(95, 124, 198, 0.15);
  background: #ffffff;
}

.scan-message-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.scan-message-count {
  font-size: 0.92rem;
  font-weight: 600;
  color: #6881a4;
}

.scan-message-submit {
  min-width: 180px;
  background: linear-gradient(135deg, #2f4b86, #1e3159);
  color: #ffffff;
  border: none;
}

.scan-message-submit:hover:not(:disabled) {
  background: linear-gradient(135deg, #355596, #233967);
}

.scan-message-submit:disabled {
  opacity: 0.7;
  cursor: wait;
}

.scan-message-status {
  margin: 4px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 0.98rem;
  font-weight: 600;
}

.scan-message-status.success {
  background: #e8f8ee;
  color: #1d6f43;
  border: 1px solid #b8e3c7;
}

.scan-message-status.error {
  background: #fff0f0;
  color: #a12b2b;
  border: 1px solid #f1c1c1;
}

.compare-slider {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(500px, 1fr);
  gap: 26px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  padding: 6px 4px 12px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.compare-slider::-webkit-scrollbar {
  display: none;
}

.compare-scan-column {
  display: flex;
  flex-direction: column;
  gap: 22px;
  min-width: 500px;
}

.compare-scrollbar {
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: auto;
  scrollbar-color: #6e86c9 #dfe8fb;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(239, 245, 255, 0.95));
  border: 1px solid #d7e1f4;
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 10px 24px rgba(15, 23, 42, 0.08);
}

.compare-scrollbar::-webkit-scrollbar {
  height: 18px;
}

.compare-scrollbar::-webkit-scrollbar-track {
  background: #dfe8fb;
  border-radius: 999px;
}

.compare-scrollbar::-webkit-scrollbar-thumb {
  background: linear-gradient(90deg, #6e86c9, #4d67ad);
  border-radius: 999px;
  border: 3px solid #dfe8fb;
}

.compare-scrollbar-top {
  margin: 6px 0 18px;
}

.compare-scrollbar-bottom {
  margin: 18px 0 4px;
}

.compare-scrollbar-track {
  height: 1px;
}

.compare-scan-header {
  background: #ffffff;
  border: 1px solid #d9e2f1;
  border-radius: 22px;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
  padding: 22px 24px;
}

.compare-scan-header h3 {
  font-size: 1.1rem;
}

.compare-summary-card {
  margin-bottom: 0;
}

.export-shell {
  max-width: 1180px;
}

.export-scan-section {
  margin-bottom: 28px;
  break-inside: avoid;
}

.export-section-header {
  margin-bottom: 18px;
}

@media (max-width: 1100px) {
  .hub-hero,
  .hub-grid {
    grid-template-columns: 1fr;
  }

  .detail-graph-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .scan-toggle {
    padding: 18px 18px 16px;
    align-items: flex-start;
  }

  .scan-content {
    padding: 0 18px 18px;
  }

  .scan-heading-main {
    gap: 10px;
  }

  .scan-header h4,
  .scan-heading-main h4 {
    font-size: 1.36rem;
  }

  .scan-date,
  .scan-id,
  .scan-meta-label,
  .scan-meta-value {
    font-size: 1.02rem;
  }

  .scan-meta-row {
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 12px;
  }

  .history-shell,
  .detail-shell {
    padding: 24px 16px 40px;
  }

  .patient-summary-card,
  .detail-header-main,
  .history-card-header,
  .history-filter-card {
    flex-direction: column;
    align-items: stretch;
  }

  .patient-summary-stats {
    justify-content: space-between;
  }

  .history-filter-fields {
    grid-template-columns: 1fr;
  }

  .history-toolbar {
    justify-content: flex-start;
  }

  .detail-actions {
    justify-content: flex-start;
  }

  .detail-meta-row {
    grid-template-columns: 1fr;
  }

  .detail-stat-grid {
    grid-template-columns: 1fr;
  }

  .scan-message-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-message-toggle-row {
    flex-direction: column;
  }

  .scan-message-toggle {
    width: 100%;
  }

  .scan-message-submit {
    width: 100%;
  }

  .compare-slider {
    grid-auto-columns: minmax(320px, 86vw);
  }

  .compare-scan-column {
    min-width: 320px;
  }

  .compare-scrollbar {
    margin-left: 2px;
    margin-right: 2px;
  }

  .scan-filter-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .scan-filter-field {
    min-width: 100%;
  }

  .scan-filter-clear {
    width: 100%;
  }

  .navbar-actions {
    width: 100%;
    justify-content: flex-end;
    flex-wrap: wrap;
  }

  .navbar-brand {
    gap: 12px;
  }

  .navbar-brand-mark span {
    width: 38px;
    height: 7px;
  }

  .hub-shell,
  .coming-shell,
  .contact-shell {
    padding: 24px 16px 40px;
  }

  .hub-copy,
  .hub-summary-card,
  .hub-card,
  .coming-card,
  .contact-hero,
  .contact-summary-card,
  .contact-card,
  .message-card {
    border-radius: 20px;
  }

  .hub-copy,
  .coming-card,
  .contact-hero {
    padding: 28px 22px;
  }

  .contact-hero,
  .contact-summary-grid,
  .message-meta-grid {
    grid-template-columns: 1fr;
  }

  .contact-hero {
    flex-direction: column;
  }

  .contact-hero-actions {
    flex-direction: column;
  }

  .contact-hero-actions .portal-button {
    width: 100%;
  }

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

  .compose-submit {
    width: 100%;
  }

  .message-card-top {
    flex-direction: column;
  }

  .coming-actions {
    flex-direction: column;
  }

  .coming-actions .portal-button {
    width: 100%;
  }
}

@media print {
  .navbar,
  .history-toolbar,
  .detail-actions,
  .export-hide {
    display: none !important;
  }

  .export-page,
  .scan-detail-page {
    background: #ffffff !important;
  }

  .detail-shell,
  .export-shell {
    max-width: none;
    padding: 0;
  }

  .detail-graph-card,
  .detail-summary-card,
  .detail-header-card,
  .export-scan-section {
    box-shadow: none;
    break-inside: avoid;
  }
}
