/* Clinical record layout. Kept separate from search/account surfaces. */
.trial-detail-page {
  --detail-bg: #f7f8f5;
  --detail-border: #dfe7e5;
  background: var(--detail-bg);
  color: #22384e;
  overflow-wrap: anywhere;
}
.trial-detail-page .shell { width: min(1180px, calc(100% - 48px)); }
.trial-detail-page .narrow-detail { max-width: 1180px; }
.trial-detail-page .site-header { position: sticky; top: 0; background: #fff; }
.trial-detail-page .detail-head {
  padding: 36px 0 40px;
  background: linear-gradient(115deg, #0b2742, #103848);
  color: #fff;
  border: 0;
}
.detail-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, .9fr);
  align-items: center;
  gap: 54px;
}
.detail-intro { min-width: 0; }
.trial-detail-page .breadcrumbs { color: #b3c7d2; margin-bottom: 20px; flex-wrap: wrap; }
.trial-detail-page .breadcrumbs a { color: #d4e8e7; }
.trial-detail-page .detail-meta { margin-bottom: 17px; gap: 9px; font-size: 12px; }
.trial-detail-page .trial-id { color: #fff; font-size: 13px; }
.trial-detail-page .status-pill {
  color: #edf5f4;
  background: #2b485a;
  border: 1px solid #506b7a;
  border-radius: 6px;
  padding: 4px 9px;
}
.meta-chip { color: #bde2dd; padding: 3px 9px; border: 1px solid #547982; border-radius: 6px; }
.trial-detail-page .detail-head h1 {
  font-size: clamp(30px, 3.15vw, 42px);
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.025em;
  color: #fff;
  margin: 0 0 24px;
  max-width: none;
}
.hero-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 0; }
.hero-facts > div { min-width: 0; padding-left: 13px; border-left: 2px solid #70bdb2; }
.hero-facts dt { font-size: 12px; color: #bacfd8; margin-bottom: 4px; }
.hero-facts dd { color: #f4f8f8; font-weight: 650; font-size: 15px; margin: 0; line-height: 1.6; white-space: normal; }
.hero-facts dd a { color: #c4f0e7; text-decoration: underline; text-underline-offset: 4px; }
.trial-detail-page details[id] { scroll-margin-top: 96px; }
.detail-illustration { margin: 0; border-radius: 20px; overflow: hidden; border: 7px solid #ffffff14; background: #ffffff14; }
.detail-illustration img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 13px; }
.trial-detail-page .snapshot-warning {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 13px;
  margin-top: 22px;
  padding: 13px 17px;
  background: #fff8e9;
  border-color: #ead8aa;
  border-radius: 12px;
}
.warning-mark { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: #efb85a; color: #533700; font-weight: 800; }
.trial-detail-page .snapshot-warning strong { font-size: 14px; color: #72500e; }
.trial-detail-page .snapshot-warning p { font-size: 13px; color: #725a31; }
.trial-detail-page .snapshot-warning a { color: #78541a; font-size: 12px; font-weight: 700; white-space: nowrap; }
.trial-detail-page .detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; padding-top: 26px; align-items: start; }
.detail-content { min-width: 0; }
.content-section { padding: 26px; margin-bottom: 20px; border: 1px solid var(--detail-border); border-radius: 16px; background: #fff; box-shadow: 0 5px 18px #0b274205; }
.section-heading { margin-bottom: 19px; }
.trial-detail-page .section-heading h2 { font-size: 24px; padding: 0; margin: 0; border: 0; line-height: 1.4; }
.trial-detail-page .fact-grid { border: 0; background: transparent; margin: 0; }
.trial-detail-page .fact-grid > div { min-width: 0; padding: 13px 16px; border-bottom: 1px solid #e5ebe9; }
.trial-detail-page .fact-grid > div:nth-child(odd) { border-right: 1px solid #e5ebe9; }
.trial-detail-page .fact-grid dt { font-size: 12px; color: #657b8b; }
.trial-detail-page .fact-grid dd { font-size: 15px; line-height: 1.65; margin-top: 4px; font-weight: 600; }
.overview-section .fact-grid { grid-template-columns: 1fr; }
.trial-detail-page .overview-section .fact-grid > div { display: grid; grid-template-columns: 105px 1fr; gap: 16px; padding: 12px 0; border-right: 0; align-items: baseline; }
.overview-section .fact-grid dd { margin: 0; }
.trial-detail-page .prose { font-size: 15px; line-height: 1.9; color: #344d61; overflow-wrap: anywhere; }
.trial-detail-page .lead-prose { font-size: 16px; }
.section-intro { color: #637789; font-size: 14px; margin: -5px 0 16px; }
.date-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; margin: 0 0 17px; }
.date-grid > div { padding: 14px 16px; border: 1px solid #dfe7e5; border-radius: 10px; background: #f8fbfa; }
.date-grid dt { color: #657b8b; font-size: 12px; }
.date-grid dd { margin: 4px 0 0; color: #17384f; font-size: 14px; font-weight: 650; line-height: 1.65; }
.enrollment-grid { margin-top: 8px !important; }
.source-status { margin: 18px 0 0; padding: 12px 15px; border-radius: 9px; background: #fff8e9; color: #725a31; font-size: 13px; }
.location-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 18px; }
.location-chips span { padding: 5px 10px; border: 1px solid #cfe0dd; border-radius: 999px; background: #f1f8f6; color: #25675f; font-size: 12px; }
.site-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; list-style: none; padding: 0; margin: 0; }
.site-list li { display: flex; flex-direction: column; min-width: 0; padding: 12px 14px; border: 1px solid #e0e8e6; border-radius: 9px; background: #fafcfb; }
.site-list strong { color: #17384f; font-size: 14px; line-height: 1.55; }
.site-list span { color: #6b7f8e; font-size: 12px; margin-top: 3px; }
.list-limit { margin: 14px 0 0; color: #677d8b; font-size: 12px; }
.trial-detail-page details { border: 1px solid #dfe7e5; border-radius: 10px; margin: 10px 0 0; overflow: hidden; background: #fff; }
.trial-detail-page summary { display: flex; align-items: center; justify-content: space-between; gap: 20px; list-style: none; padding: 15px 17px; background: #f7faf8; min-height: 54px; }
.trial-detail-page summary::-webkit-details-marker { display: none; }
.trial-detail-page summary > span { display: flex; flex-direction: column; }
.trial-detail-page summary strong { font-size: 15px; font-weight: 650; }
.trial-detail-page summary small { color: #677d8b; font-size: 12px; font-weight: 400; }
.disclosure-chevron { width: 18px; height: 18px; flex: 0 0 18px; color: #39756f; transition: transform 150ms ease; }
details[open] > summary .disclosure-chevron { transform: rotate(180deg); }
.trial-detail-page details[open] > summary { border-bottom: 1px solid #dfe7e5; }
.trial-detail-page details .prose { padding: 19px; }
.trial-detail-page .full-title { margin-top: 18px; }
.item-grid { display: grid; gap: 12px; }
.trial-detail-page .item-block { margin: 0; padding: 15px 17px; border: 1px solid #e0e8e6; border-left: 3px solid #278d81; border-radius: 10px; background: #fafcfb; }
.trial-detail-page .item-block h3 { font-size: 16px; font-weight: 650; line-height: 1.7; white-space: pre-line; }
.trial-detail-page .endpoint-list { margin: 0; padding: 12px 22px 18px 43px; }
.trial-detail-page .endpoint-list li { font-size: 15px; }
.trial-detail-page .detail-aside { display: block; min-width: 0; align-self: stretch; position: relative; }
.aside-stack { position: sticky; top: 96px; display: grid; gap: 14px; }
.aside-illustration { margin: 0; border-radius: 16px; overflow: hidden; border: 1px solid #dbe5e2; }
.aside-illustration img { display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover; object-position: center 52%; }
.trial-detail-page .aside-card { position: static; margin: 0; padding: 22px; border: 1px solid var(--detail-border); border-radius: 16px; background: #fff; }
.trial-detail-page .aside-card h2 { font-size: 22px; margin: 0 0 14px; line-height: 1.4; }
.quota-badge { display: flex; align-items: baseline; gap: 8px; color: #5b7474; margin: 4px 0 18px; }
.quota-badge strong { color: #087c75; font-size: 32px; line-height: 1; }
.quota-badge span { font-size: 12px; }
.trial-detail-page .aside-card .button { width: 100%; font-size: 14px; border-radius: 9px; box-shadow: none; }
.trial-detail-page .boundary-card { border-color: #ebdbb8; background: #fffaef; }
.trial-detail-page .boundary-card h2 { color: #835713; font-size: 19px; margin-bottom: 10px; }
.trial-detail-page .boundary-card p { color: #725f43; font-size: 13px; margin: 0 0 12px; }
.boundary-card .text-link { font-size: 13px; color: #80591e; }
.trial-detail-page :focus-visible { outline: 3px solid #c27c19; outline-offset: 4px; }
@media (max-width: 1000px) {
  .detail-hero-grid { gap: 30px; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
  .trial-detail-page .detail-layout { grid-template-columns: minmax(0, 1fr) 260px; gap: 24px; }
  .content-section { padding: 22px; }
}
@media (max-width: 850px) {
  .trial-detail-page .site-header { position: relative; }
  .detail-hero-grid { grid-template-columns: 1fr; gap: 26px; }
  .detail-illustration { width: min(100%, 520px); justify-self: center; }
  .detail-illustration img { aspect-ratio: 3 / 2; }
  .trial-detail-page .detail-layout { grid-template-columns: 1fr; gap: 6px; }
  .aside-stack { position: static; grid-template-columns: 1fr 1fr; align-items: start; }
  .aside-illustration { display: none; }
  .trial-detail-page .snapshot-warning p { display: block; margin: 3px 0 0; }
}
@media (max-width: 560px) {
  .trial-detail-page .shell { width: calc(100% - 32px); }
  .trial-detail-page .site-header nav > a[href="/login"] { display: inline; font-size: 13px; }
  .trial-detail-page .detail-head { padding: 25px 0 28px; }
  .trial-detail-page .detail-head h1 { font-size: 28px; line-height: 1.5; margin-bottom: 22px; }
  .trial-detail-page .breadcrumbs { font-size: 11px; gap: 6px; margin-bottom: 17px; }
  .trial-detail-page .detail-meta { gap: 8px; font-size: 11px; }
  .hero-facts { gap: 17px 14px; }
  .hero-facts > div { padding-left: 9px; }
  .hero-facts dt { font-size: 11px; }
  .hero-facts dd { font-size: 14px; }
  .detail-illustration { border-width: 4px; border-radius: 16px; }
  .trial-detail-page .snapshot-warning { grid-template-columns: auto 1fr; gap: 10px; padding: 12px; margin-top: 16px; }
  .trial-detail-page .snapshot-warning a { grid-column: 2; }
  .trial-detail-page .detail-layout { padding-top: 18px; }
  .content-section { padding: 20px 17px; margin-bottom: 16px; border-radius: 13px; }
  .trial-detail-page .section-heading h2 { font-size: 22px; }
  .trial-detail-page .fact-grid { grid-template-columns: 1fr; }
  .trial-detail-page .fact-grid > div { padding: 12px 0; }
  .trial-detail-page .fact-grid > div:nth-child(odd) { border-right: 0; }
  .trial-detail-page .overview-section .fact-grid > div { grid-template-columns: 68px 1fr; gap: 10px; }
  .trial-detail-page .prose, .trial-detail-page .lead-prose { font-size: 15px; }
  .date-grid,.site-list { grid-template-columns: 1fr; }
  .aside-stack { grid-template-columns: 1fr; }
}
@media (min-width: 851px) and (max-height: 680px) { .aside-stack { position: static; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .disclosure-chevron { transition: none; }
}

.patient-path { display: flex; align-items: center; gap: 24px; margin-top: 18px; padding: 17px 21px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.patient-path > strong { flex: 0 0 auto; color: var(--navy); font-size: 13px; }
.patient-path ol { display: flex; align-items: center; gap: 24px; list-style: none; margin: 0; padding: 0; color: var(--muted); font-size: 13px; }
.patient-path li { display: flex; align-items: center; gap: 8px; }
.patient-path li + li::before { content: "→"; margin-right: 16px; color: #9aabb5; }
.patient-path li span { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); color: var(--teal); font-size: 11px; font-weight: 850; }
@media (max-width: 700px) {
  .patient-path { align-items: flex-start; flex-direction: column; gap: 12px; }
  .patient-path ol { align-items: flex-start; flex-direction: column; gap: 9px; }
  .patient-path li + li::before { display: none; }
}
