/* Shared shell, task enrolment and researcher workspace. */
.record-status { pointer-events: none; }
.record-status button { pointer-events: auto; }
.record-status button[hidden] { display: none; }
:root {
  --ink: #152f33;
  --muted: #4e6265;
  --green: #095c59;
  --green-dark: #064c4a;
  --line: #d7e1df;
  --soft: #e6f1ed;
  --canvas: #f5f7f5;
  --paper: #fff;
  --radius: 16px;
  --shadow: 0 3px 12px rgb(17 51 49 / 4%);
  --page-width: 1240px;
  --gutter: clamp(16px, 4vw, 64px);
}
body {
  font-family: "Segoe UI", "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--canvas);
}
:focus-visible { outline: 3px solid #128174; outline-offset: 3px; }
.skip-link {
  position: absolute; left: 16px; top: 6px; z-index: 20; padding: 8px 16px;
  color: #fff; background: var(--green-dark); transform: translateY(-160%);
}
.skip-link:focus { transform: none; }
.site-header {
  min-height: 73px;
  padding: 12px max(var(--gutter), calc((100% - var(--page-width)) / 2));
  background: #fff; border-color: var(--line);
}
.wordmark { gap: 11px; color: #183c3c; font-size: 21px; font-weight: 680; white-space: nowrap; }
.brand-mark {
  position: relative; width: 35px; height: 35px; background: var(--green);
  border-radius: 10px; flex: 0 0 auto;
}
.brand-mark::before, .brand-mark::after {
  content: ""; position: absolute; inset: 0; margin: auto; width: 18px; height: 6px;
  background: #fff; border-radius: 1px;
}
.brand-mark::after { transform: rotate(90deg); }
.site-header nav { gap: 3px; }
.site-header .nav-button { color: var(--muted); border-radius: 8px; font-size: 15px; font-weight: 500; }
.site-header .nav-button:hover { background: #f0f4f2; }
.site-header .nav-button.active { background: var(--soft); color: var(--green-dark); font-weight: 650; }
main, .site-footer {
  width: min(var(--page-width), calc(100% - var(--gutter) * 2)); max-width: none;
  margin-inline: auto;
}
main { min-height: calc(100vh - 150px); padding: clamp(22px, 2.8vw, 40px) 0; }
.site-footer { padding: 15px 0 20px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }
h1 { font-size: clamp(30px, 3.4vw, 46px); font-weight: 660; }
h2 { font-size: clamp(21px, 2vw, 26px); }
.card, .stat-card { border-color: var(--line); box-shadow: var(--shadow); }
.button { border-radius: 9px; font-weight: 600; }
.button.secondary { color: #254346; }
.button:hover:not(:disabled) { background: var(--green-dark); }
.button.secondary:hover:not(:disabled), .button.quiet:hover:not(:disabled) { background: #eaf2ef; }
.button.danger:hover:not(:disabled) { background: #77332f; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible { outline-color: #168275; }
.eyebrow { color: var(--green); }
.page-heading { align-items: center; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading .muted { max-width: 49em; font-size: 16px; }
.welcome-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; max-width: none; padding: 0; }
.welcome-copy {
  display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start;
  min-height: clamp(300px, 29vw, 389px); overflow: hidden;
  border-radius: 20px; margin: 0;
  padding: clamp(30px, 4vw, 58px);
  color: #fff;
  background: #183f3d linear-gradient(90deg, #173f3be8, #173f3b00);
  background-image: linear-gradient(90deg, rgb(8 37 37 / 66%) 0%, rgb(8 37 37 / 46%) 36%, transparent 68%),
                    url("/static/media/consult-room-cover.webp");
  background-position: center, center 55%; background-size: cover;
}
.welcome-hero-text { max-width: 510px; }
.welcome-copy .eyebrow { color: #d2e8df; font-size: 15px; font-weight: 550; margin: 0 0 14px; letter-spacing: .08em; }
.welcome-copy h1 { color: #fff; font-size: clamp(38px, 4.2vw, 63px); font-weight: 650; line-height: 1.22; margin: 0 0 15px; }
.welcome-copy .lead { color: #e2ece8; font-size: clamp(17px, 1.5vw, 21px); max-width: 24em; margin: 0; line-height: 1.7; }
.welcome-stages {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px 14px; margin: 30px 0 0;
  padding: 0; list-style: none; font-size: 14px; font-weight: 500; color: #fff;
}
.welcome-stages li { display: inline-flex; align-items: center; gap: 14px; }
.welcome-stages li + li::before { content: ""; width: 6px; height: 6px; border: solid #d5e7df; border-width: 1px 1px 0 0; transform: rotate(45deg); }
.welcome-card {
  display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(280px, .85fr);
  gap: clamp(26px, 5vw, 80px); align-items: center;
  padding: clamp(22px, 2.9vw, 40px);
}
.welcome-notice h2 { margin: 0 0 12px; }
.welcome-notice p, .welcome-actions .check-row { font-size: 16px; line-height: 1.7; }
.welcome-notice p { margin: 0 0 6px; }
.welcome-notice p:last-child { margin-bottom: 0; }
.welcome-actions { border-inline-start: 1px solid var(--line); padding-inline-start: clamp(24px, 3vw, 44px); }
.welcome-actions .check-row { color: var(--ink); margin: 0 0 16px; }
.welcome-actions input { width: 19px; height: 19px; }
.welcome-actions .button { min-height: 46px; }
.welcome-actions .button:disabled { background: #e5edeb; border-color: #d5dfdc; color: #526360; opacity: 1; }
.profile-card { max-width: none; padding: clamp(22px, 3.1vw, 42px); }
.profile-grid { gap: 10px clamp(24px, 4vw, 68px); }
.profile-card form > .small { border-top: 1px solid var(--line); padding: 18px 0 0; }
.stat-grid { gap: 12px; }
.stat-card { border-radius: var(--radius); }
.stat-number, .record-metrics dd { font-variant-numeric: tabular-nums; }
.workspace-links { flex-wrap: wrap; gap: 8px; margin: 0 0 20px; }
[data-view="admin"] [tabindex="-1"], #dialogue-preview { scroll-margin-top: 18px; }
[data-view="admin"] details.card { margin-bottom: 20px; }
[data-view="admin"] details.card > summary { cursor: pointer; font-weight: 600; }
.record-overview .card-header { margin-bottom: 20px; }
.record-metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line); padding-top: 19px; gap: 12px; }
.record-metrics > div { display: flex; flex-direction: column; align-items: flex-start; padding-inline-start: clamp(12px, 2vw, 32px); border-inline-start: 1px solid var(--line); }
.record-metrics > div:first-child { padding-inline-start: 0; border: 0; }
.record-metrics dt { color: var(--muted); font-size: 15px; }
.record-metrics dd { order: -1; margin: 0 0 3px; color: var(--green-dark); font-size: clamp(26px, 3vw, 38px); line-height: 1.2; font-weight: 610; }
.session-list-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.session-list-head h2 { margin: 0; }
input.session-filter { width: min(100%, 240px); font-size: 16px; min-height: 44px; }
.table-wrap { max-width: 100%; overflow-x: auto; }
.table-section thead th { background: #edf3f0; color: #355153; }
.table-section td, .table-section th { border-color: var(--line); }
.table-section td > .small { margin: 4px 0 0; }
.table-section tbody tr:hover { background-color: #f6f9f7; }
.table-section tr[hidden] { display: none; }
.site-header .wordmark, .site-header .nav-button { white-space: nowrap; }
@media (max-width: 850px) {
  .welcome-copy { min-height: 300px; }
  .welcome-card { grid-template-columns: minmax(0, 1.1fr) minmax(225px, .9fr); gap: 20px; }
}
@media (max-width: 680px) {
  .welcome-layout { gap: 14px; }
  .welcome-copy { min-height: 255px; padding: 24px; border-radius: 14px;
    background-image: linear-gradient(90deg, rgb(7 35 34 / 87%), rgb(7 35 34 / 58%) 54%, rgb(7 35 34 / 16%)), url("/static/media/consult-room-cover.webp");
    background-position: center, 57% center; }
  .welcome-copy .lead { max-width: 17em; }
  .welcome-stages, .welcome-stages li { gap: 7px; }
  .welcome-stages { font-size: 13px; }
  .welcome-card { grid-template-columns: minmax(0, 1fr); padding: 22px; }
  .welcome-actions { border-inline-start: 0; padding-inline-start: 0; border-top: 1px solid var(--line); padding-top: 17px; }
  .welcome-card .button { width: 100%; }
  .record-overview .card-header, .table-section .card-header { flex-wrap: wrap; }
  .record-metrics { grid-template-columns: 1fr 1fr; gap: 20px 12px; }
  .record-metrics > div:nth-child(odd) { padding-inline-start: 0; border: 0; }
  .stat-grid { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .stat-grid .stat-card { padding: 10px; }
  .stat-grid .stat-label { font-size: 13px; }
  .site-header { min-height: 62px; gap: 5px; padding: 9px var(--gutter); }
  .wordmark { font-size: 17px; gap: 6px; }
  .brand-mark { width: 28px; height: 28px; border-radius: 8px; }
  .site-header nav { gap: 0; }
  .site-header .nav-button { padding: 7px; font-size: 14px; }
  .profile-grid { grid-template-columns: 1fr; gap: 2px; }
  .site-footer { flex-wrap: wrap; }
}
@media (max-width: 400px) {
  .site-header { justify-content: flex-start; flex-wrap: wrap; }
  .site-header nav { margin-inline-start: auto; }
  .site-header .nav-button { font-size: 13px; padding-inline: 5px; }
  .site-header #admin-nav span { display: none; }
  .welcome-copy { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
