.trial-finder { --trial-ink: #19333f; --trial-accent: #006b72; --trial-line: #c9d9dc; --trial-tint: #edf6f5; }
.trial-finder [hidden] { display: none !important; }
.trial-finder .organisation-intro { padding-bottom: 1.5rem; }
.trial-finder .trial-preview { color: #49616b; font-size: .94rem; margin: .85rem 0 0; }
.trial-search { padding: clamp(1rem, 3vw, 2rem); background: var(--trial-tint); border: 1px solid var(--trial-line); border-radius: .65rem; }
.trial-search h2 { margin: 0 0 1rem; }
.trial-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; max-width: 54rem; }
.trial-fields label, .trial-actions label { display: block; color: var(--trial-ink); font-weight: 650; min-width: 0; }
.trial-fields label span { color: #49616b; font-weight: 400; }
.trial-fields input, .trial-fields select, .trial-actions select {
  display: block; width: 100%; min-height: 46px; padding: .5rem .75rem; margin-top: .35rem;
  border: 1px solid #829fa5; border-radius: .35rem; background: white; color: var(--trial-ink); font: inherit;
}
.trial-actions { display: flex; flex-wrap: wrap; align-items: start; gap: .45rem 1.25rem; margin-top: .55rem; }
.trial-actions details { max-width: 100%; }
.trial-actions summary, .trial-disclosure summary { cursor: pointer; color: var(--trial-accent); font-weight: 650; padding: .65rem 0; }
.trial-actions details > label:first-of-type { margin-top: .35rem; }
.trial-change { text-decoration: underline; margin-left: .3rem; }
.trial-actions .trial-check { display: flex; align-items: start; gap: .5rem; font-weight: 400; padding: .65rem 0; }
.trial-check input { margin-top: .35em; accent-color: var(--trial-accent); }
.trial-finder button { cursor: pointer; color: var(--trial-accent); background: white; border: 1px solid #829fa5; border-radius: .35rem; font: inherit; padding: .55rem .9rem; min-height: 44px; }
.trial-finder #trial-clear { background: transparent; border-color: transparent; text-decoration: underline; }
.trial-finder :is(a, button, input, select, summary):focus-visible { outline: 3px solid var(--trial-accent); outline-offset: 3px; }
.trial-note { margin: 1rem 0; padding: .8rem 1rem; border-left: 3px solid var(--trial-accent); background: #f4f8f8; }
.trial-note p { margin: 0 0 .3rem; }
.trial-note a, .trial-links a { font-weight: 650; }
.trial-results-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; column-gap: 1rem; margin-top: 2rem; }
.trial-results-head h2 { margin: 0; }
.trial-role { max-width: 70ch; }
#trial-status, .trial-muted, .trial-source { color: #49616b; }
.trial-muted, .trial-source { font-size: .94rem; }
.trial-card { padding: clamp(1rem, 2.5vw, 1.6rem); border: 1px solid var(--trial-line); border-radius: .65rem; margin-bottom: 1rem; overflow-wrap: anywhere; }
.trial-card h3 { margin: .25rem 0 .35rem; font-size: clamp(1.25rem, 2.4vw, 1.6rem); }
.trial-card h4 { margin: .9rem 0 .4rem; }
.trial-category { margin: 0; color: var(--trial-accent); font-weight: 700; font-size: .9rem; }
.trial-card .trial-muted { margin: .25rem 0; }
.trial-hospitals, .trial-contacts { list-style: none; padding: 0; margin: 0; }
.trial-hospitals { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr)); }
.trial-hospital { background: #f4f8f8; padding: .75rem; border-radius: .35rem; }
.trial-place { display: block; color: #49616b; }
.trial-badge { display: inline-block; margin: .35rem 0; padding: .18rem .45rem; border-radius: .25rem; background: #dceee8; color: #1c5145; font-size: .9rem; }
.trial-badge-upcoming { background: #f6eaca; color: #624914; }
.trial-contact-label { margin: .25rem 0; font-size: .92rem; font-weight: 650; }
.trial-contacts li { display: flex; flex-wrap: wrap; column-gap: .8rem; }
.trial-links { margin: .85rem 0 .15rem; }
.trial-central { margin-top: .65rem; }
.trial-disclosure { border-top: 1px solid var(--trial-line); margin-top: .5rem; }
.trial-disclosure .trial-hospitals { margin-bottom: .5rem; }
.trial-registry-copy { white-space: pre-line; }
.trial-guide { padding-top: 2rem; padding-bottom: 2.5rem; scroll-margin-top: 11rem; }
.trial-guide ol { max-width: 75ch; padding-left: 1.4rem; }
.trial-guide li + li { margin-top: .65rem; }
@media (max-width: 560px) {
  .trial-fields { grid-template-columns: 1fr; gap: .65rem; }
  .trial-results-head { margin-top: 1.4rem; }
}

.trial-finder .organisation-intro h1 { margin-bottom: .55rem; }
.trial-finder .organisation-intro .lead { margin-bottom: .5rem; }
.trial-finder .organisation-intro .trial-preview { margin-top: .35rem; }
.trial-finder #trial-ctri { margin-bottom: .7rem; }
@media (max-width: 560px) {
  .trial-finder .organisation-intro { padding-bottom: .5rem; }
  .trial-finder .organisation-intro .lead { font-size: 1.03rem; }
  .trial-search h2 { font-size: 1.28rem; margin-bottom: .6rem; }
  .trial-actions { margin-top: .35rem; }
  .trial-finder .trial-results-head { margin-top: .8rem; }
  .trial-finder .trial-role { margin: .4rem 0; }
}
.trial-context { margin: .8rem 0 .2rem; }
#trial-wider-search { margin: .75rem 0; }
.trial-card-actions, .trial-share .guide-trial-actions { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1rem; }
#trial-save-status:empty { display: none; }
/* Keep the shared CTI share menu inside the trial card at narrow widths. */
:is(.trial-card-actions, .guide-trial-actions):has(> .trial-share) { position: relative; }
.trial-share.reading-share { position: static; }
.trial-share .reading-share-panel { left: 0; right: auto; max-width: 100%; }
.trial-share svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.trial-share .reading-share-panel a { display: inline-block; margin-top: .6rem; }
.trial-empty-next { padding: .65rem .85rem; border-left: 3px solid #006b72; background: #f4f8f8; }
.trial-empty-next a { font-weight: 650; }

.trial-card-heading { display: flex; flex-direction: column; gap: .25rem .85rem; margin-bottom: .35rem; }
.trial-top-actions { gap: .25rem; flex: none; }
.trial-top-actions :is(summary, a)[data-tip] {
  display: inline-flex; align-items: center; justify-content: center; gap: .3rem;
  min-width: 44px; min-height: 44px; padding: .25rem .4rem;
  border: 1px solid transparent; border-radius: .4rem; background: transparent;
  color: #006b72; font: inherit; font-size: .87rem; font-weight: 650; text-decoration: none;
}
.trial-top-actions [data-tip]:is(:hover, :focus-visible) { background: #edf6f5; }
.trial-top-actions svg { flex: none; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
@media (min-width: 900px) {
  .trial-card > .trial-card-heading { flex-direction: row; justify-content: space-between; align-items: start; }
  .trial-card .trial-top-actions .trial-action-label { display: none; }
  .trial-card .trial-top-actions [data-tip] { position: relative; }
  .trial-card .trial-top-actions .trial-share .reading-share-panel { left: auto; right: 0; max-width: calc(100vw - 48px); }
  .trial-card .trial-top-actions [data-tip]:is(:hover,:focus-visible)::after {
    content: attr(data-tip); position: absolute; right: 0; top: 100%; z-index: 20;
    padding: .25rem .5rem; white-space: nowrap; border-radius: .3rem;
    background: #19333f; color: #fff; pointer-events: none;
  }
  .trial-card .trial-top-actions .trial-share[open] summary::after { display: none; }
}
