:root {
  --bg: #ffffff;
  --panel: rgba(255, 255, 255, 0.94);
  --ink: #202124;
  --muted: #5f6368;
  --line: #e0e3e7;
  --line-soft: rgba(30, 142, 62, 0.12);
  --border: #e0e3e7;
  --accent: #0f5a2d;
  --accent-strong: #0a4723;
  --danger: #bf4f29;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: 'Google Sans', 'Roboto', 'Segoe UI', sans-serif;
  background: #ffffff;
}

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

.hidden {
  display: none !important;
}

.menu-shell {
  position: fixed;
  top: 18px;
  right: 18px;
  z-index: 30;
}

.menu-button {
  border: 1px solid #0a4723;
  border-radius: 999px;
  padding: 9px 12px;
  font-weight: 600;
  color: white;
  background: var(--accent);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 2px 6px rgba(60, 64, 67, 0.14);
  cursor: pointer;
}

.menu-drawer {
  position: absolute;
  top: 48px;
  right: 0;
  width: min(280px, calc(100vw - 32px));
  padding: 12px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 2px 8px rgba(60, 64, 67, 0.2);
}

.menu-drawer a {
  display: block;
  padding: 11px 12px;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.menu-drawer a:hover {
  background: rgba(30, 142, 62, 0.08);
}

.menu-label {
  margin: 0 0 8px;
  padding: 0 4px;
  color: var(--muted);
  font-size: 0.74rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.shell {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 3rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.home-link {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}

.badge {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(30, 142, 62, 0.12);
  color: #137333;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.76rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

.hero-panel,
.panel {
  padding: 1.5rem;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px rgba(60, 64, 67, 0.12);
}

.hero-panel h1,
.hero-panel p,
.panel h2,
.panel p {
  margin-top: 0;
}

.panel-copy {
  margin-bottom: 1rem;
}

.hero-panel h1 {
  margin-bottom: 0.75rem;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.96;
}

.hero-panel p,
.panel p,
.metric-label {
  color: var(--muted);
}

.hero-panel .big-number {
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 5rem);
  line-height: 1;
}

.layout {
  display: grid;
  grid-template-columns: minmax(420px, 460px) minmax(0, 1fr);
  gap: 1.5rem;
}

.controls {
  display: grid;
  gap: 1rem;
}

.selector-panel {
  align-content: start;
}

.field {
  display: grid;
  gap: 0.45rem;
}

.field label {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.85rem 0.95rem;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.86);
}

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

.search-input {
  width: 100%;
}

.results-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(33, 49, 58, 0.08);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.metric {
  padding: 1rem;
  border-radius: 18px;
  background: rgba(30, 142, 62, 0.08);
}

.metric strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.4rem;
}

.chart-panel {
  height: 440px;
  background: #ffffff;
}

.tall-chart {
  height: 520px;
}

.line-hover-chart-panel {
  position: relative;
}

.line-hover-card {
  position: absolute;
  top: 0.9rem;
  right: 0.9rem;
  z-index: 2;
  width: min(320px, calc(100% - 1.8rem));
  padding: 0.9rem 1rem;
  border-radius: 18px;
  border: 1px solid rgba(30, 142, 62, 0.16);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
  pointer-events: none;
}

.line-hover-eyebrow {
  margin-bottom: 0.35rem;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.line-hover-definition {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.5rem 0.75rem;
  margin: 0.75rem 0 0;
}

.line-hover-definition dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}

.line-hover-definition dd {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.45;
}

/* ── Compare bar (Google Finance-style inline drug comparison) ── */
.compare-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
  min-height: 36px;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.55rem 0.3rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--chip-color, #e0e3e7);
  background: color-mix(in srgb, var(--chip-color, #1e8e3e) 10%, transparent);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--ink);
}

.compare-chip-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--chip-color, #1e8e3e);
  flex-shrink: 0;
}

.compare-chip-name {
  max-width: 18ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compare-chip-remove {
  all: unset;
  cursor: pointer;
  line-height: 1;
  font-size: 1rem;
  color: var(--muted);
  padding: 0 0.1rem;
  border-radius: 50%;
}

.compare-chip-remove:hover {
  color: var(--ink);
}

.compare-add-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--accent-strong);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  white-space: nowrap;
}

.compare-add-btn:hover {
  background: rgba(15, 90, 45, 0.09);
  border-color: var(--accent-strong);
}

.compare-add-icon {
  font-size: 1rem;
  line-height: 1;
}

.compare-input-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.compare-input {
  width: 200px;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: #fff;
  font-size: 0.82rem;
  outline: none;
}

.compare-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  z-index: 10;
  min-width: 220px;
  margin: 0;
  padding: 0.35rem 0;
  list-style: none;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #fff;
  box-shadow: 0 4px 12px rgba(60, 64, 67, 0.2);
}

.compare-dropdown-item {
  padding: 0.55rem 1rem;
  font-size: 0.88rem;
  cursor: pointer;
  color: var(--ink);
}

.compare-dropdown-item:hover {
  background: rgba(30, 142, 62, 0.07);
}
/* ── end compare bar ── */

.insights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.insight-card {
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.insight-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.25rem;
}

.insight-copy p {
  margin-bottom: 0;
}

.empty {
  display: grid;
  place-items: center;
  height: 100%;
  border: 1px dashed var(--border);
  border-radius: 18px;
  color: var(--muted);
}

.small-empty {
  min-height: 96px;
  height: auto;
  padding: 1rem;
  text-align: center;
}

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

.table-wrap {
  overflow: auto;
}

.table th,
.table td {
  padding: 0.8rem 0.4rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.helper {
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.error-text {
  color: var(--danger);
}

.success-text {
  color: #137333;
}

.search-results,
.selected-drug-list {
  display: grid;
  gap: 0.85rem;
}

.search-results {
  max-height: 420px;
  overflow: auto;
  padding-right: 0.2rem;
}

.dose-entry-form {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.7);
}

.workspace-panel {
  display: grid;
  gap: 0.9rem;
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.74);
}

.workspace-panel h2,
.workspace-panel p {
  margin-top: 0;
}

.compliance-panel {
  display: grid;
  gap: 0.8rem;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.88);
}

.checkbox-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
  color: var(--ink);
  line-height: 1.45;
}

.checkbox-row input {
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
}

.notice-card {
  display: grid;
  gap: 0.4rem;
  padding: 0.85rem 0.95rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(248, 244, 235, 0.9);
}

.notice-card p,
.notice-card strong {
  margin: 0;
}

.notice-warning {
  border-color: rgba(191, 79, 41, 0.25);
  background: rgba(191, 79, 41, 0.08);
}

.notice-success {
  border-color: rgba(30, 142, 62, 0.25);
  background: rgba(30, 142, 62, 0.09);
}

.account-data-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.account-data-row {
  display: grid;
  gap: 0.3rem;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.account-data-row strong {
  font-size: 1rem;
  line-height: 1.35;
}

.auth-panel-shell {
  gap: 0.75rem;
}

.auth-inline-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

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

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

.dose-form-actions .primary-button,
.dose-form-actions .secondary-button {
  flex: 1 1 180px;
}

.primary-button {
  border: 0;
  border-radius: 14px;
  padding: 0.9rem 1rem;
  font-weight: 700;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  cursor: pointer;
}

.primary-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.profile-actions {
  display: grid;
  gap: 0.75rem;
}

.profile-panel {
  padding: 1rem;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.profile-panel h2 {
  margin-top: 0;
  margin-bottom: 0.85rem;
}

.profile-list {
  display: grid;
  gap: 0.9rem;
}

.profile-card {
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  display: grid;
  gap: 0.6rem;
}

.profile-card.active {
  border-color: var(--line);
  box-shadow: 0 0 0 2px rgba(30, 142, 62, 0.12);
}

.profile-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.profile-card-header strong {
  display: block;
  font-size: 1rem;
}

.profile-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.result-row,
.selected-drug {
  display: grid;
  gap: 0.9rem;
  padding: 1rem 1.05rem;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
}

.result-row {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

.result-copy p,
.selected-drug-copy p {
  margin-bottom: 0;
  font-size: 0.94rem;
  line-height: 1.5;
}

.result-copy strong,
.selected-drug-copy strong {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 1rem;
  line-height: 1.3;
}

.pill-button,
.remove-button {
  border: 0;
  border-radius: 14px;
  padding: 0.8rem 1rem;
  font-weight: 600;
  cursor: pointer;
}

.pill-button {
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  justify-self: start;
  min-width: 88px;
}

.secondary-button {
  border: 1px solid var(--accent-strong);
  background: var(--accent);
  color: white;
}

.pill-button:disabled {
  opacity: 0.55;
  cursor: default;
}

.remove-button {
  background: rgba(191, 79, 41, 0.12);
  color: var(--danger);
}

.selected-drug-meta {
  display: grid;
  grid-template-columns: minmax(160px, 220px) auto auto;
  gap: 0.9rem;
  align-items: end;
}

.medication-row {
  gap: 1rem;
}

.medication-row-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.color-swatch {
  width: 12px;
  height: 12px;
  border-radius: 999px;
  display: inline-block;
  box-shadow: inset 0 0 0 1px rgba(33, 49, 58, 0.12);
}

.legend-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.88rem;
}

.graph-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.add-drug-panel {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.74);
  padding: 16px;
}

.add-drug-panel-results {
  margin-top: 10px;
}

.table-action {
  border: 1px solid rgba(191, 79, 41, 0.11);
  background: rgba(191, 79, 41, 0.08);
  color: var(--danger);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}

.table-action.secondary {
  border-color: rgba(15, 90, 45, 0.16);
  background: rgba(15, 90, 45, 0.08);
  color: var(--accent);
}

.table-swatch {
  vertical-align: middle;
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.timeline-badge.current {
  background: rgba(30, 142, 62, 0.12);
  color: #137333;
}

.timeline-badge.historic {
  background: rgba(191, 79, 41, 0.12);
  color: var(--danger);
}

.timeline-badge.planned {
  background: rgba(41, 86, 191, 0.12);
  color: #2956bf;
}

.small-label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--ink);
}

.small-label input {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
}

.tooltip-card {
  min-width: 240px;
  max-width: 320px;
  padding: 0.9rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.12);
}

.tooltip-list {
  display: grid;
  gap: 0.45rem;
  margin-top: 0.75rem;
}

.tooltip-row {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
  font-size: 0.86rem;
}

.tooltip-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.tooltip-name,
.tooltip-value,
.tooltip-more {
  color: var(--ink);
}

.tooltip-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tooltip-value {
  font-variant-numeric: tabular-nums;
}

.tooltip-more {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
}

.print-report-header {
  margin-bottom: 1rem;
}

.print-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.compact-button {
  padding: 0.5rem 0.7rem;
  min-width: auto;
  font-size: 0.85rem;
}

.hidden-input {
  display: none;
}

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

  .metrics,
  .insights,
  .print-summary-grid {
    grid-template-columns: 1fr;
  }

  .result-row,
  .selected-drug,
  .selected-drug-meta,
  .entry-grid {
    grid-template-columns: 1fr;
  }

  .search-results {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .auth-inline-actions,
  .auth-inline-status {
    flex-direction: column;
    align-items: stretch;
  }

  .account-data-grid {
    grid-template-columns: 1fr;
  }

  .tall-chart {
    height: 460px;
  }
}

@media print {
  body {
    background: white;
  }

  .shell {
    width: 100%;
    padding: 0;
  }

  .topbar,
  .selector-panel,
  .insights,
  .table-actions,
  .remove-button,
  .pill-button,
  .home-link,
  .badge {
    display: none !important;
  }

  .hero,
  .layout,
  .metrics,
  .print-summary-grid {
    grid-template-columns: 1fr;
  }

  .hero-panel,
  .panel {
    box-shadow: none;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: white;
    break-inside: avoid;
  }

  .chart-panel,
  .tall-chart {
    height: 360px;
  }

  .table-wrap {
    overflow: visible;
  }
}

/* Auth styles */
.auth-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 2rem;
}

.auth-form {
  background: var(--panel);
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  width: 100%;
  max-width: 400px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-inline-form {
  width: 100%;
  max-width: none;
  padding: 1rem;
  border-radius: 18px;
  box-shadow: none;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.82);
}

.auth-inline-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-preflight-hint {
  margin: 0;
}

.auth-form input {
  padding: 0.75rem;
  border: 1px solid var(--border);
  border-radius: 4px;
}

.auth-form button {
  padding: 0.75rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.auth-form button:hover {
  background: var(--accent-strong);
}

.auth-form button:disabled {
  background: var(--muted);
  cursor: not-allowed;
}

.auth-form .secondary-button {
  background: rgba(33, 49, 58, 0.1);
  color: var(--ink);
}

.auth-form .error {
  color: var(--danger);
  font-size: 0.9rem;
}

.user-info {
  font-size: 0.9rem;
  color: var(--muted);
}

/* Random Profile Generator Styles */
.random-profile-container {
  margin-top: 1rem;
}

.random-profile-meta {
  margin-bottom: 1rem;
  padding: 0.75rem;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.random-profile-meta p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.random-profile-chart {
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.random-profile-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1rem;
}

.generator-drug-card {
  padding: 1rem;
  background: var(--panel);
  border-radius: 8px;
  border: 1px solid var(--border);
}

.generator-drug-card .card-label {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0.5rem;
}

.generator-drug-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.1rem;
  color: var(--ink);
}

.generator-drug-card p {
  margin: 0 0 0.75rem 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.generator-regimen {
  border-top: 1px solid var(--border);
  padding-top: 0.75rem;
}

.generator-regimen p {
  margin: 0.25rem 0;
  font-size: 0.85rem;
  line-height: 1.3;
}

.generator-regimen strong {
  color: var(--line);
}

/* Static mold alignment overrides */
.app-shell {
  width: min(1400px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 48px;
  position: relative;
  z-index: 1;
}

.hero {
  display: grid;
  grid-template-columns: 1.6fr 0.8fr;
  gap: 24px;
  align-items: stretch;
  margin-bottom: 24px;
}

.hero-copy,
.hero-card,
.panel,
.workspace-panel,
.profile-panel {
  border-radius: 28px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 1px 2px rgba(60, 64, 67, 0.18), 0 1px 3px rgba(60, 64, 67, 0.12);
}

.hero-copy,
.hero-card {
  padding: 32px;
}

.hero-copy h1,
.hero-copy p,
.hero-card p,
.panel h2,
.panel p,
.workspace-panel h2,
.workspace-panel p,
.profile-panel h2,
.profile-panel p {
  margin-top: 0;
}

.eyebrow {
  margin: 0 0 12px;
  font-size: 0.83rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 1.02;
  margin-bottom: 16px;
  max-width: 12ch;
}

.hero-text,
.workspace-heading-copy,
.helper,
.metric-label,
.hero-card .card-caption,
.workspace-detail {
  color: var(--muted);
}

.hero-text {
  max-width: 62ch;
  font-size: 1.05rem;
  line-height: 1.6;
}

.hero-card {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background:
    linear-gradient(135deg, rgba(30, 142, 62, 0.11), rgba(255, 255, 255, 0.97)),
    #ffffff;
}

.hero-card-note {
  margin-top: 14px;
}

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

.workspace-heading-copy {
  margin-bottom: 0;
  max-width: 62ch;
  line-height: 1.55;
}

.workspace-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.workspace-card {
  min-height: 132px;
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.workspace-card strong {
  display: block;
  font-size: 1.15rem;
  margin-bottom: 6px;
}

.card-label {
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.76rem;
  color: var(--muted);
}

.card-value {
  margin: 8px 0 10px;
  font-size: clamp(2.6rem, 4.8vw, 4.8rem);
  font-weight: 700;
  line-height: 1;
}

.card-caption {
  margin-bottom: 0;
}

.layout {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 24px;
}

.panel,
.workspace-panel,
.profile-panel {
  padding: 24px;
}

.panel-header {
  margin-bottom: 18px;
}

.panel-header.compact {
  margin-top: 22px;
}

.section-kicker {
  margin: 0 0 6px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.primary-button {
  border: none;
  border-radius: 16px;
  padding: 14px 16px;
  font-weight: 600;
  color: white;
  background: linear-gradient(135deg, #0f5a2d, #0a4723);
  box-shadow: 0 10px 20px rgba(10, 71, 35, 0.24);
}

.primary-button:hover {
  transform: translateY(-1px);
}

.secondary-button,
.pill-button {
  border: 1px solid #0a4723;
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: white;
  background: #0f5a2d;
}

.pill-button.secondary-button {
  background: #0f5a2d;
  color: white;
}

.remove-button {
  border: 1px solid rgba(180, 35, 24, 0.18);
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
}

.search-results,
.selected-drug-list,
.workspace-panel,
.profile-panel {
  display: grid;
  gap: 14px;
}

.helper {
  line-height: 1.5;
}

.empty,
.small-empty {
  padding: 18px;
  border: 1px dashed rgba(95, 99, 104, 0.35);
  border-radius: 18px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
}

.timeline-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}

.timeline-badge.current {
  background: rgba(30, 142, 62, 0.12);
  color: var(--accent);
}

.timeline-badge.historic,
.timeline-badge.planned {
  background: rgba(15, 90, 45, 0.09);
  color: var(--accent-strong);
}

.color-swatch {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

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

.compact-button {
  padding: 8px 10px;
  border-radius: 10px;
}

.print-summary-grid,
.insights {
  display: grid;
  gap: 14px;
}

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

.insights {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

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

.insight-card strong {
  display: block;
  margin-top: 0.35rem;
  font-size: 1.4rem;
}

@media (max-width: 1100px) {
  .hero,
  .workspace-strip,
  .layout,
  .print-summary-grid,
  .insights {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 720px) {
  .app-shell {
    width: min(100vw - 20px, 100%);
    padding-top: 16px;
  }

  .hero-copy,
  .hero-card,
  .panel,
  .workspace-panel,
  .profile-panel {
    border-radius: 22px;
    padding: 18px;
  }

  h1 {
    max-width: none;
  }
}
