:root {
    --ink: #202928;
    --muted: #606c69;
    --line: #dce3df;
    --paper: #ffffff;
    --wash: #f5f7f6;
    --accent: #13675b;
    --accent-dark: #0c5147;
}
body { letter-spacing: 0; }
:focus-visible { outline: 3px solid #208b7c; outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 16px; padding: 12px 20px; z-index: 100; background: var(--ink); color: white; border-radius: 4px; }
.skip-link:focus { top: 12px; }
.app-shell { background: var(--wash); color: var(--ink); }
.app-sidebar { flex-shrink: 0; position: sticky; top: 0; align-self: flex-start; height: 100dvh; overflow-y: auto; width: 236px; }
.app-sidebar h1, .app-mobile-header h1 { color: var(--accent); }
.app-sidebar nav a { min-height: 44px; }
.app-sidebar nav a[aria-current="page"], .app-mobile-nav a[aria-current="page"] { background: #e8f2ed; color: var(--accent-dark); box-shadow: inset 3px 0 var(--accent); }
.app-sidebar nav a svg { flex-shrink: 0; }
.app-sidebar > div:last-child { margin-top: auto; }
.app-mobile-nav { flex-wrap: nowrap; overflow-x: auto; padding: 4px 2px 8px; scrollbar-width: thin; }
.app-mobile-nav a { min-height: 42px; display: inline-flex; align-items: center; flex-shrink: 0; font-size: 14px; background: transparent; }
.app-mobile-header > div > a { font-size: 14px; padding: 8px 0 8px 8px; white-space: nowrap; }
.workspace-page { max-width: 1180px; margin: 0 auto; padding: 8px 0 0; }
.page-heading { display: flex; justify-content: space-between; align-items: center; gap: 20px; padding-bottom: 28px; }
.eyebrow { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.page-heading h1 { font-size: 28px; line-height: 1.3; font-weight: 600; overflow-wrap: anywhere; }
.action-primary, .action-secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 18px; font-size: 14px; line-height: 1.4; font-weight: 600; border: 1px solid transparent; border-radius: 6px; text-align: center; transition: background .15s; }
.action-primary { background: var(--accent); color: white; }
.action-primary:hover { background: var(--accent-dark); }
.action-secondary { border-color: #bac9c2; color: var(--ink); background: white; }
.action-secondary:hover { background: #edf3ef; }
.page-heading > a { flex-shrink: 0; }
.muted, .section-note { color: var(--muted); font-size: 14px; line-height: 1.7; }
.section-note { margin: 12px 0 24px; }
.overview-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 24px 0; margin: 4px 0 30px; }
.overview-metrics > div { padding: 0 24px; border-left: 1px solid var(--line); }
.overview-metrics > div:first-child { padding-left: 0; border-left: 0; }
.overview-metrics dt { color: var(--muted); font-size: 14px; margin-bottom: 10px; }
.overview-metrics dd { font-size: 30px; font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.overview-metrics dd span { font-size: 14px; font-weight: 400; color: var(--muted); }
.overview-metrics .metric-date { font-size: 22px; padding-top: 5px; }
.workspace-section { min-width: 0; margin-bottom: 32px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 16px; }
.section-heading h2 { font-size: 17px; line-height: 1.5; font-weight: 600; }
.text-link { color: var(--accent-dark); font-size: 14px; font-weight: 500; text-decoration: none; }
.text-link:hover { text-decoration: underline; }
.text-link span { margin-left: 6px; }
.report-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.report-tile { display: flex; flex-direction: column; min-height: 264px; border: 1px solid var(--line); border-top: 3px solid #45817a; border-radius: 6px; padding: 22px; background: var(--paper); transition: border-color .15s, box-shadow .15s; }
.report-tile:hover { border-color: #99b8ad; box-shadow: 0 4px 14px #203c2d0a; }
.report-tile-disease { border-top-color: #cb7f6e; }
.report-tile-protocol { border-top-color: #5f86af; }
.tile-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 28px; }
.report-number { font-size: 18px; color: #7a8780; font-variant-numeric: tabular-nums; }
.report-tile .eyebrow { margin-bottom: 6px; }
.report-tile h3 { font-size: 20px; line-height: 1.4; font-weight: 600; margin-bottom: 8px; }
.report-tile .muted { flex: 1; }
.tile-action { display: flex; justify-content: space-between; align-items: center; padding-top: 22px; font-size: 14px; font-weight: 600; color: var(--accent-dark); }
.tile-action span { font-size: 20px; }
.status-label { display: inline-flex; align-items: center; justify-content: center; padding: 4px 8px; font-size: 12px; line-height: 1.4; font-weight: 500; border-radius: 4px; background: #edf0ee; color: #53625a; text-align: center; }
.status-completed { background: #edf5ee; color: #2b6841; }
.status-failed { background: #fbeeea; color: #9b4335; }
.status-pending, .status-processing { background: #edf2fa; color: #365d8d; }
.overview-columns { display: grid; grid-template-columns: 1.15fr 1fr; gap: 36px; }
.activity-list { padding: 0; margin: 0; list-style: none; border-top: 1px solid var(--line); }
.activity-list li { border-bottom: 1px solid var(--line); }
.activity-list li > a, .upload-history-entry { display: flex; align-items: center; gap: 14px; padding: 17px 0; min-height: 66px; }
.activity-list li > a:hover .activity-title { color: var(--accent); }
.activity-title { font-size: 14px; font-weight: 500; flex: 1; overflow-wrap: anywhere; min-width: 0; }
.activity-list time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.upload-history-entry { justify-content: space-between; }
.upload-history-entry .status-label { flex-shrink: 0; max-width: 120px; }
.empty-row { padding: 22px 0; color: var(--muted); font-size: 14px; }
.empty-row p { margin-bottom: 12px; }
.workspace-footer { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; padding: 22px 0; border-top: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.first-analysis { padding: 36px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 32px; }
.analysis-mark { color: var(--accent); margin-bottom: 20px; }
.first-analysis h2 { font-size: 24px; font-weight: 600; line-height: 1.4; margin-bottom: 10px; }
.first-analysis .action-primary { margin-top: 20px; }
.journey { list-style: none; padding: 0; display: flex; gap: 28px; margin-top: 32px; }
.journey li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.journey span { display: inline-flex; justify-content: center; align-items: center; width: 26px; height: 26px; flex-shrink: 0; border: 1px solid var(--line); border-radius: 50%; font-size: 12px; }
.journey .is-current { color: var(--accent-dark); }
.journey .is-current span { background: var(--accent); border-color: var(--accent); color: white; }
.notice { padding: 16px 20px; background: #eef3f7; border-left: 3px solid #658bac; color: #344e61; font-size: 14px; line-height: 1.6; margin-bottom: 20px; overflow-wrap: anywhere; }
.notice-success { background: #edf5ee; border-color: #458363; color: #2b6841; }
.notice-error { background: #fff1ed; border-color: #bd5b43; color: #8b3c2b; }
.upload-page { max-width: 800px; }
.settings-page { max-width: 900px; }
.settings-section { padding: 28px 0; border-top: 1px solid var(--line); }
.settings-section > h2 { color: var(--ink); font-size: 17px; }
.settings-section a.text-indigo-600, .settings-section button.text-indigo-600 { color: var(--accent-dark); }
.settings-action-row { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.settings-action-row > a { flex-shrink: 0; }
.upload-page .page-heading { border-bottom: 1px solid var(--line); margin-bottom: 28px; }
.upload-surface { padding: 0; }
.file-drop { width: 100%; display: block; border: 1.5px dashed #a6bdb1; border-radius: 6px; padding: 38px 20px; text-align: center; background: #fff; cursor: pointer; transition: background .15s, border-color .15s; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--accent); background: #edf5f0; }
.file-drop:disabled { cursor: wait; opacity: .65; }
.file-drop svg { display: block; margin: 0 auto 16px; color: var(--accent); }
.file-drop strong { display: block; font-size: 18px; margin-bottom: 6px; font-weight: 600; }
.file-drop span { display: block; color: var(--muted); font-size: 14px; }
.file-selection { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.file-selection #file-name { overflow-wrap: anywhere; min-width: 0; }
.file-selection #file-size { color: var(--muted); white-space: nowrap; font-size: 12px; }
.upload-controls { display: flex; align-items: center; gap: 18px; margin: 20px 0; }
.upload-controls button:disabled { cursor: not-allowed; opacity: .55; }
.upload-controls p { color: var(--muted); font-size: 12px; }
.upload-progress { margin: 20px 0; }
.upload-progress progress { width: 100%; height: 8px; accent-color: var(--accent); }
.upload-progress p { color: var(--muted); font-size: 14px; margin-top: 8px; }
.upload-help { border-top: 1px solid var(--line); padding: 24px 0; margin-top: 28px; }
.upload-help h2 { font-size: 16px; font-weight: 600; margin-bottom: 12px; }
.provider-list { display: flex; flex-wrap: wrap; gap: 8px 20px; color: var(--muted); font-size: 14px; margin-bottom: 20px; }
.upload-help summary { font-size: 14px; font-weight: 500; cursor: pointer; padding: 12px 0; }
.upload-help ol { padding-left: 22px; color: var(--muted); font-size: 14px; line-height: 1.8; list-style: decimal; }
.analysis-status { padding: 24px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 24px; }
.analysis-status-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.analysis-status h2 { font-size: 18px; font-weight: 600; }
.analysis-status p { font-size: 14px; color: var(--muted); line-height: 1.7; }
.analysis-status .action-primary, .analysis-status .action-secondary { margin-top: 18px; }
.analysis-status .journey { margin: 22px 0 0; }
.status-spinner { width: 20px; height: 20px; flex-shrink: 0; border: 2px solid #c4dbcf; border-top-color: var(--accent); border-radius: 50%; animation: status-spin 1s linear infinite; }
@keyframes status-spin { to { transform: rotate(360deg); } }
[hidden] { display: none !important; }
@media (max-width: 1100px) {
    .report-grid { gap: 12px; }
    .report-tile { padding: 18px; }
    .overview-columns { gap: 24px; }
}
@media (max-width: 700px) {
    .page-heading { align-items: flex-start; flex-direction: column; gap: 16px; padding-bottom: 24px; }
    .page-heading h1 { font-size: 24px; }
    .overview-metrics { grid-template-columns: 1fr 1fr; gap: 20px 0; padding: 20px 0; }
    .overview-metrics > div { padding: 0 0 0 20px; }
    .overview-metrics > div:last-child { grid-column: 1 / -1; border: 0; border-top: 1px solid var(--line); padding: 18px 0 0; }
    .overview-metrics dd { font-size: 26px; }
    .overview-metrics .metric-date { font-size: 20px; padding: 0; }
    .report-grid, .overview-columns { grid-template-columns: 1fr; }
    .report-tile { min-height: 240px; padding: 22px; }
    .tile-top { margin-bottom: 20px; }
    .overview-columns { gap: 0; }
    .journey { gap: 18px; flex-wrap: wrap; }
    .section-heading { flex-wrap: wrap; gap: 10px; }
    .upload-controls { align-items: flex-start; flex-direction: column; gap: 10px; }
    .upload-controls button { width: 100%; }
    .settings-action-row { align-items: flex-start; flex-direction: column; gap: 14px; }
}
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
