/* ── Public design tokens ────────────────────── */
:root {
    --tp-cream:    #ECEEF5;   /* Azul BIO claro (derivado Pantone 642) */
    --tp-ivory:    #F6F7FB;   /* Blanco con matiz BIO (ligeramente más claro) */
    --tp-navy:     #282182;   /* Azul Osakidetza (Pantone 273) */
    --tp-navy-mid: #3D35A0;   /* Azul Osakidetza intermedio */
    --tp-brick:    #DC4A3B;
    --tp-brick-dk: #B03128;
    --tp-sage:     #2D9461;
    --tp-amber:    #D97706;
    --tp-muted:    #6B7E8F;
    --tp-border:   #DADEE9;   /* Azul BIO (Pantone 642) como color de borde */
    --tp-text-on-light: #282182; /* Texto sobre fondo claro/blanco — independiente de Navy */
    --tp-text-on-dark:  #FFFFFF; /* Texto sobre fondo de color (p.ej. banda azul) */
    --tp-serif:    'Fraunces', Georgia, serif;
    --tp-sans:     'DM Sans', ui-sans-serif, system-ui, sans-serif;
}

/* ── Base ────────────────────────────────────── */
.tp-shell {
    font-family: var(--tp-sans);
    background: var(--tp-cream);
    color: var(--tp-text-on-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: clip; /* evita scroll horizontal por desbordamiento de cabecera en móvil */
}

/* Suppress the browser focus ring on headings focused programmatically
   by FocusOnNavigate. Headings are not interactive so no focus ring needed. */
h1:focus, h2:focus { outline: none; }

/* ── Header ──────────────────────────────────── */
.tp-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--tp-cream) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--tp-border);
}

.tp-header-inner {
    max-width: 72rem;
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 4.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tp-logo {
    font-family: var(--tp-serif);
    font-size: 1.1875rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    letter-spacing: -0.01em;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.625rem;
}

.tp-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.625rem;
    height: 1.625rem;
    background: var(--tp-navy);
    color: white;
    font-family: var(--tp-sans);
    font-size: 0.5625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    border-radius: 3px;
    flex-shrink: 0;
}

.tp-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.tp-nav a {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tp-muted);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.15s;
}

.tp-nav a:hover { color: var(--tp-text-on-light); }

.tp-nav-admin {
    color: var(--tp-text-on-light) !important;
    border: 1.5px solid currentColor;
    padding: 0.3125rem 0.875rem;
    border-radius: 999px;
    transition: background 0.15s, color 0.15s !important;
}

.tp-nav-admin:hover {
    background: var(--tp-navy) !important;
    color: white !important;
}

.tp-nav-user {
    display: flex;
    align-items: center;
    gap: 0.875rem;
}

/* Language switcher. A form rather than a menu: the portal renders with Static SSR, so the
   choice travels as a POST and the page comes back rendered in the new language. */
.tp-lang {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* A select rather than one link/button per language: the switcher stays one
   control regardless of how many languages the multitenant API reports,
   instead of the header filling up with a row of two-letter codes. */
.tp-lang-select {
    background: none;
    border: 1px solid var(--tp-border);
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    font: inherit;
    font-size: 0.6875rem;
    letter-spacing: 0.02em;
    color: var(--tp-text-on-light);
    cursor: pointer;
}

.tp-lang-submit {
    background: none;
    border: none;
    padding: 0.25rem 0.375rem;
    border-radius: 4px;
    font: inherit;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    color: var(--tp-muted);
    cursor: pointer;
    transition: color 0.15s, background 0.15s;
}

.tp-lang-submit:hover {
    color: var(--tp-text-on-light);
    background: var(--tp-border);
}

/* Hidden once language-switcher.js wires the select to auto-submit; kept in the markup
   (not display:none in server-rendered HTML) for a visitor without scripting. */
html.tp-js .tp-lang-submit { display: none; }

.tp-nav-user-email {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--tp-muted);
    letter-spacing: 0.04em;
}

.tp-nav-logout {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tp-muted);
    text-decoration: none;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}

.tp-nav-logout:hover { color: var(--tp-text-on-light); }

/* ── Main / Footer ───────────────────────────── */
.tp-main { flex: 1; }

.tp-footer {
    border-top: 1px solid var(--tp-border);
    padding: 1.25rem 1.5rem;
}

.tp-footer-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.6875rem;
    color: var(--tp-muted);
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.tp-footer a {
    color: var(--tp-muted);
    text-decoration: none;
    transition: color 0.15s;
}

.tp-footer a:hover { color: var(--tp-text-on-light); }

/* ── Hero ────────────────────────────────────── */
.tp-hero {
    position: relative;
    overflow: hidden;
    padding: 5rem 1.5rem 4.5rem;
    background: var(--tp-ivory);
    border-bottom: 1px solid var(--tp-border);
}

.tp-container {
    max-width: 72rem;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    width: 100%;
}

@media (max-width: 640px) {
    .tp-hero { padding: 3rem 1rem 2.5rem; }
}

.tp-eyebrow {
    display: inline-block;
    padding-left: 0.75rem;
    border-left: 2px solid var(--tp-navy);
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tp-text-on-light);
    margin-bottom: 1.25rem;
}

.tp-headline {
    font-family: var(--tp-serif);
    font-size: clamp(2.75rem, 6.5vw, 5.25rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.025em;
    color: var(--tp-text-on-light);
    margin-bottom: 1.5rem;
    max-width: 20ch;
}

.tp-headline em {
    font-style: normal;
    color: inherit;
}

.tp-hero-sub {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--tp-muted);
    white-space: pre-line;
    max-width: 760px;
    width: 100%;
    margin-bottom: 2.5rem;
}

.tp-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    background: var(--tp-navy);
    color: white;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.875rem 1.875rem;
    border-radius: 2px;
    transition: background 0.2s, transform 0.15s;
}

.tp-cta:hover {
    background: var(--tp-navy-mid);
    transform: translateY(-1px);
}

.tp-cta svg { transition: transform 0.2s; }
.tp-cta:hover svg { transform: translateX(4px); }

/* ── Feature grid ────────────────────────────── */
.tp-features {
    padding: 0;
    background: var(--tp-cream);
}

.tp-features-grid {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-left: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
}

@media (max-width: 640px) {
    .tp-features-grid { grid-template-columns: 1fr; }
}

.tp-feature {
    padding: 2.25rem 2rem 2.5rem;
    border-right: 1px solid var(--tp-border);
    border-top: 1px solid var(--tp-border);
    position: relative;
    transition: background 0.2s;
}

.tp-feature::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 0.2s;
}

.tp-feature:hover::after { background: var(--tp-navy); }
.tp-feature:hover { background: var(--tp-ivory); }

.tp-feature-icon {
    width: 2.5rem;
    height: 2.5rem;
    color: var(--tp-text-on-light);
    margin-bottom: 1rem;
    opacity: 0.85;
}

.tp-feature-icon svg {
    width: 100%;
    height: 100%;
}

.tp-feature-title {
    font-family: var(--tp-serif);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    margin-bottom: 0.625rem;
    letter-spacing: -0.015em;
}

.tp-feature-desc {
    font-size: 0.875rem;
    line-height: 1.7;
    color: var(--tp-muted);
}

.tp-feature:first-child {
    padding: 2.75rem 2.5rem 3rem;
}

.tp-feature:first-child .tp-feature-icon {
    width: 3rem;
    height: 3rem;
}

.tp-feature:first-child .tp-feature-title {
    font-size: 1.5rem;
}

/* ── Band ────────────────────────────────────── */
.tp-band {
    background: var(--tp-navy);
    padding: 3.5rem 1.5rem;
}

.tp-band-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.tp-band-title {
    font-family: var(--tp-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 600;
    color: var(--tp-text-on-dark);
    letter-spacing: -0.02em;
}

.tp-band-sub {
    font-size: 0.875rem;
    color: rgba(255,255,255,0.5);
    margin-top: 0.25rem;
}

.tp-cta-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: white;
    border: 1.5px solid rgba(255,255,255,0.25);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.875rem 1.5rem;
    border-radius: 2px;
    transition: border-color 0.2s, background 0.2s;
}

.tp-cta-ghost:hover {
    border-color: rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.07);
}

/* ── Trial Listing ───────────────────────────── */
.tp-listing-hd {
    background: var(--tp-ivory);
    border-bottom: 1px solid var(--tp-border);
    padding: 3rem 1.5rem 2.25rem;
}

.tp-listing-title {
    font-family: var(--tp-serif);
    font-size: clamp(2rem, 4.5vw, 3.25rem);
    font-weight: 600;
    color: var(--tp-text-on-light);
    letter-spacing: -0.025em;
    margin-bottom: 1.5rem;
}

.tp-search-wrap {
    position: relative;
    max-width: 34rem;
}

.tp-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--tp-muted);
    pointer-events: none;
}

.tp-search {
    width: 100%;
    padding: 0.8125rem 1rem 0.8125rem 2.875rem;
    border: 1.5px solid var(--tp-border);
    border-radius: 2px;
    background: white;
    font-family: var(--tp-sans);
    font-size: 0.9375rem;
    color: var(--tp-text-on-light);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.tp-search:focus {
    outline: none;
    border-color: var(--tp-navy);
    box-shadow: 0 0 0 3px rgba(40,33,130,0.10);
}

.tp-search::placeholder { color: var(--tp-muted); }

/* ── Filter bar ──────────────────────────────── */
.tp-filterbar {
    padding: 0.75rem 1.5rem;
    border-bottom: 1px solid var(--tp-border);
    background: var(--tp-cream);
}

.tp-filterbar-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tp-filter-lbl {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tp-muted);
    margin-right: 0.125rem;
}

.tp-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.3125rem 0.875rem;
    font-family: var(--tp-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    border: 1.5px solid var(--tp-border);
    border-radius: 9999px;
    background: transparent;
    color: var(--tp-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    align-self: center;
}
.tp-chip:hover { border-color: var(--tp-navy-mid); color: var(--tp-navy-mid); }
.tp-chip--active {
    border-color: var(--tp-sage);
    background: var(--tp-sage);
    color: white;
}

.tp-chip-rare {
    color: var(--tp-sage);
    border-color: rgba(61,122,90,0.3);
}

.tp-chip-rare:hover,
.tp-chip-rare.is-active {
    border-color: var(--tp-sage);
    background: var(--tp-sage);
    color: white;
}

/* ── Results / Table ─────────────────────────── */
.tp-results {
    padding: 2rem 1.5rem;
}

.tp-results-inner {
    max-width: 72rem;
    margin: 0 auto;
}

.tp-results-meta {
    font-size: 0.75rem;
    color: var(--tp-muted);
    letter-spacing: 0.04em;
    margin-bottom: 1.25rem;
}

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

.tp-table thead th {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tp-muted);
    padding: 0 1rem 0.75rem;
    text-align: left;
    border-bottom: 2px solid var(--tp-border);
}

.tp-table thead th:first-child { padding-left: 0; }

.tp-table tbody td {
    padding: 1.125rem 1rem;
    vertical-align: top;
    border-bottom: 1px solid var(--tp-border);
    font-size: 0.875rem;
}

.tp-table tbody td:first-child { padding-left: 0; }

.tp-table tbody tr { transition: background 0.1s; }
.tp-table tbody tr:hover td { background: rgba(255,255,255,0.55); }

.tp-trial-name {
    font-family: var(--tp-serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    line-height: 1.3;
    margin-bottom: 0.3125rem;
}

.tp-trial-id {
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tp-muted);
}

.tp-phase-badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.625rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border: 1.5px solid var(--tp-navy);
    color: var(--tp-text-on-light);
    border-radius: 2px;
}

.tp-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--tp-muted);
}

.tp-status-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--tp-muted);
    flex-shrink: 0;
}

.tp-status-dot.ongoing    { background: var(--tp-sage); }
.tp-status-dot.pending    { background: var(--tp-amber); }
.tp-status-dot.terminated { background: var(--tp-brick-dk); }

.tp-rare-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5625rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    background: rgba(45,148,97,0.10);
    color: var(--tp-sage);
    border-radius: 2px;
}

/* ── Empty state ─────────────────────────────── */
.tp-empty {
    padding: 5rem 0 4.5rem;
    text-align: center;
}

.tp-empty-icon {
    width: 3.5rem;
    height: 3.5rem;
    color: var(--tp-border);
    margin: 0 auto 1.75rem;
}

.tp-empty-title {
    font-family: var(--tp-serif);
    font-size: 1.625rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    margin-bottom: 0.5rem;
}

.tp-empty-sub {
    font-size: 0.875rem;
    color: var(--tp-muted);
    max-width: 34ch;
    margin: 0 auto;
    line-height: 1.65;
}

/* ── Filter panel ────────────────────────────── */
.tp-filter-panel {
    background: var(--tp-ivory);
    border-bottom: 1px solid var(--tp-border);
    padding: 0.875rem 1.5rem;
}

.tp-filter-panel-inner {
    max-width: 72rem;
    margin: 0 auto;
    display: flex;
    align-items: flex-end;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.tp-filter-group {
    display: flex;
    flex-direction: column;
    gap: 0.3125rem;
    flex: 1;
    min-width: 8rem;
    max-width: 13rem;
}

.tp-filter-group-wide {
    min-width: 11rem;
    max-width: 16rem;
}

.tp-filter-lbl-sm {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4b5563;
    white-space: nowrap;
}

.tp-select,
.tp-filter-input {
    appearance: none;
    padding: 0.5625rem 0.75rem;
    border: 1.5px solid var(--tp-border);
    border-radius: 2px;
    background: white;
    font-family: var(--tp-sans);
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    transition: border-color 0.15s, box-shadow 0.15s;
    width: 100%;
    cursor: pointer;
}

.tp-select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B7E8F' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.625rem center;
}

.tp-filter-input { cursor: text; }

.tp-select:focus,
.tp-filter-input:focus {
    outline: none;
    border-color: var(--tp-navy);
    box-shadow: 0 0 0 3px rgba(40,33,130,0.10);
}

.tp-select::placeholder,
.tp-filter-input::placeholder { color: var(--tp-muted); }

.tp-select.is-filtered,
.tp-filter-input.is-filtered {
    border-color: var(--tp-navy-mid);
    background-color: rgba(40,33,130,0.04);
}

.tp-filter-reset {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.5625rem 0.875rem;
    background: none;
    border: 1.5px solid transparent;
    border-radius: 2px;
    font-family: var(--tp-sans);
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--tp-muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
    align-self: flex-end;
}

.tp-filter-reset:hover {
    color: var(--tp-text-on-light);
    border-color: var(--tp-navy);
}

html.tp-js .tp-filter-submit { display: none; }

.tp-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.tp-chip:has(.tp-visually-hidden:focus-visible) {
    outline: 2px solid var(--tp-navy);
    outline-offset: 2px;
}

/* ── MultiSelect Dropdown ────────────────────── */
.tp-multiselect {
    position: relative;
    width: 100%;
}

.tp-multiselect-trigger {
    appearance: none;
    width: 100%;
    padding: 0.5625rem 0.75rem;
    border: 1.5px solid var(--tp-border);
    border-radius: 2px;
    background: white;
    font-family: var(--tp-sans);
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    position: relative;
}

.tp-multiselect-trigger:focus {
    outline: none;
    border-color: var(--tp-navy);
    box-shadow: 0 0 0 3px rgba(40,33,130,0.10);
}

.tp-multiselect.is-filtered .tp-multiselect-trigger {
    border-color: var(--tp-navy-mid);
    background-color: rgba(40,33,130,0.04);
}

.tp-multiselect-label {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #4b5563;
}

.tp-multiselect-value {
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    padding-right: 1rem;
}

.tp-multiselect:not(.is-filtered) .tp-multiselect-value {
    color: var(--tp-muted);
}

.tp-multiselect-chevron {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--tp-muted);
    transition: transform 0.2s;
    pointer-events: none;
}

.tp-multiselect-chevron.is-open {
    transform: translateY(-50%) rotate(180deg);
}

.tp-multiselect-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    background: transparent;
}

.tp-multiselect-panel {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 0.25rem;
    background: white;
    border: 1.5px solid var(--tp-border);
    border-radius: 2px;
    box-shadow: 0 4px 12px rgba(40,33,130,0.12);
    max-height: 16rem;
    overflow-y: auto;
    z-index: 50;
    padding: 0.5rem;
}

.tp-multiselect-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.625rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--tp-text-on-light);
    border-radius: 2px;
    user-select: none;
    transition: background 0.1s;
}

.tp-multiselect-option:hover {
    background: var(--tp-ivory);
}

.tp-multiselect-option input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1.5px solid var(--tp-border);
    cursor: pointer;
    flex-shrink: 0;
}

.tp-multiselect-option input[type="checkbox"]:checked {
    background-color: var(--tp-navy);
    border-color: var(--tp-navy);
}

.tp-multiselect-option input[type="checkbox"]:focus {
    outline: 2px solid var(--tp-navy);
    outline-offset: 2px;
}

.tp-multiselect-option span {
    flex: 1;
}

.tp-multiselect-option--hidden {
    display: none;
}

.tp-multiselect-search {
    padding: 0.375rem 0.5rem 0.5rem;
    border-bottom: 1px solid var(--tp-border);
    margin-bottom: 0.25rem;
}

.tp-multiselect-search input {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--tp-border);
    border-radius: 2px;
    font-family: var(--tp-sans);
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    background: var(--tp-ivory);
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.tp-multiselect-search input:focus {
    border-color: var(--tp-navy-mid);
}

.tp-multiselect-empty {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--tp-muted);
    font-style: italic;
    margin: 0;
}

/* ── Cards grid ──────────────────────────────── */
.tp-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(22rem, 1fr));
    gap: 1.5rem;
    margin-top: 1.25rem;
}

@media (max-width: 500px) {
    .tp-cards-grid { grid-template-columns: 1fr; }
}

.tp-card {
    background: white;
    border: 1px solid var(--tp-border);
    border-radius: 3px;
    padding: 1.375rem 1.5rem 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    position: relative;
    transition: box-shadow 0.2s, transform 0.2s;
    overflow: hidden;
}

.tp-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tp-navy);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.tp-card:hover::before { transform: scaleX(1); }

.tp-card:hover {
    box-shadow: 0 6px 24px rgba(40,33,130,0.08);
    transform: translateY(-2px);
}

.tp-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.tp-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5625rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    border-radius: 2px;
    white-space: nowrap;
}

.tp-badge-euct {
    background: rgba(55,82,109,0.07);
    color: var(--tp-text-on-light);
    font-family: monospace;
    font-size: 0.6875rem;
    letter-spacing: 0.04em;
    text-transform: none;
}

.tp-badge-phase {
    border: 1.5px solid var(--tp-navy);
    color: var(--tp-text-on-light);
    background: transparent;
}

.tp-badge-recruiting {
    background: rgba(45,148,97,0.10);
    color: #1D6B42; /* darkened from --tp-sage; WCAG AA 5.83:1 */
}

.tp-badge-rare {
    background: rgba(217,119,6,0.10);
    color: #7A4F00; /* darkened from --tp-amber; WCAG AA 6.03:1 */
}

.tp-badge-status.ongoing      { background: rgba(45,148,97,0.10);   color: #1D6B42; }       /* darkened from --tp-sage;  5.83:1 */

.tp-card-title {
    font-family: var(--tp-serif);
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    line-height: 1.35;
    letter-spacing: -0.015em;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tp-card-fields {
    display: grid;
    grid-template-columns: 6.5rem 1fr;
    gap: 0.4375rem 0.875rem;
}

.tp-field-lbl {
    color: #4b5563;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    padding-top: 0.125rem;
    line-height: 1.5;
}

.tp-field-val {
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    line-height: 1.5;
    word-break: break-word;
}

.tp-field-val-muted {
    color: var(--tp-muted);
    font-size: 0.75rem;
    font-family: monospace;
}

.tp-card-criteria {
    border-top: 1px solid var(--tp-border);
    padding-top: 0.875rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.tp-criteria-lbl {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tp-muted);
}

.tp-criteria-text {
    font-size: 0.8125rem;
    color: var(--tp-text-on-light);
    line-height: 1.65;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.tp-toggle-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-family: var(--tp-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--tp-text-on-light);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: color 0.15s;
    text-align: left;
}

.tp-toggle-btn:hover { color: var(--tp-navy-mid); }

.tp-card-footer {
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    border-top: 1px solid var(--tp-border);
    padding-top: 0.875rem;
}

.tp-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tp-text-on-light);
    text-decoration: none;
    transition: color 0.15s, gap 0.2s;
}

.tp-card-link:hover {
    color: var(--tp-navy-mid);
    gap: 0.625rem;
}

/* ── Trial detail (public) ───────────────────── */
.tp-detail-hd {
    background: var(--tp-ivory);
    border-bottom: 1px solid var(--tp-border);
    padding: 2.5rem 1.5rem 2rem;
}

.tp-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: var(--tp-muted);
    text-decoration: none;
    margin-bottom: 1.5rem;
    transition: color 0.15s;
}

.tp-detail-back:hover { color: var(--tp-text-on-light); }

.tp-detail-title {
    font-family: var(--tp-serif);
    font-size: clamp(1.5rem, 3vw, 2.5rem);
    font-weight: 600;
    color: var(--tp-text-on-light);
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-top: 1rem;
    max-width: 52ch;
}

.tp-detail-body {
    padding: 2rem 1.5rem;
}

.tp-detail-grid {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 20rem 1fr;
    gap: 3rem;
}

@media (max-width: 760px) {
    .tp-detail-grid { grid-template-columns: 1fr; gap: 2rem; }
}

.tp-detail-section-title {
    font-family: var(--tp-serif);
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    margin-bottom: 1rem;
    margin-top: 0;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--tp-border);
    letter-spacing: -0.015em;
}

.tp-detail-section-title + .tp-detail-section-title,
.tp-criteria-list + .tp-detail-section-title {
    margin-top: 2rem;
}

.tp-detail-fields {
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}

.tp-detail-field {
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}

.tp-detail-field-lbl {
    font-size: 0.5625rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--tp-muted);
}

.tp-detail-field-val {
    font-size: 0.9375rem;
    color: var(--tp-text-on-light);
    line-height: 1.55;
}

.tp-criteria-list {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.tp-criteria-list li {
    font-size: 0.9375rem;
    color: var(--tp-text-on-light);
    line-height: 1.65;
    padding-left: 1.375rem;
    position: relative;
}

.tp-criteria-list li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--tp-muted);
}

/* ── Hero search (HOM-01) ────────────────────── */
.tp-hero-search {
    display: flex;
    gap: 0.625rem;
    max-width: 36rem;
    margin-bottom: 1.75rem;
    align-items: stretch;
}

.tp-hero-search-wrap {
    flex: 1;
    position: relative;
}

.tp-hero-search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    width: 1rem;
    height: 1rem;
    color: var(--tp-muted);
    pointer-events: none;
}

.tp-hero-search-input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.875rem;
    border: 1.5px solid var(--tp-border);
    border-radius: 2px;
    background: white;
    font-family: var(--tp-sans);
    font-size: 0.9375rem;
    color: var(--tp-text-on-light);
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.tp-hero-search-input:focus {
    outline: none;
    border-color: var(--tp-navy);
    box-shadow: 0 0 0 3px rgba(40,33,130,0.10);
}

.tp-hero-search-input::placeholder { color: var(--tp-muted); }

.tp-hero-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--tp-navy);
    color: white;
    font-family: var(--tp-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    border: none;
    padding: 0.875rem 1.5rem;
    border-radius: 2px;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s;
}

.tp-hero-search-btn:hover { background: var(--tp-navy-mid); }

@media (max-width: 500px) {
    .tp-hero-search { flex-direction: column; }
    .tp-hero-search-btn { justify-content: center; }
}

/* ── Hero dual CTAs (HOM-02) ─────────────────── */
.tp-hero-ctas {
    display: flex;
    gap: 0.875rem;
    flex-wrap: wrap;
    align-items: center;
}

.tp-cta-outline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: transparent;
    color: var(--tp-text-on-light);
    border: 1.5px solid var(--tp-border);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    text-decoration: none;
    padding: 0.875rem 1.875rem;
    border-radius: 2px;
    transition: border-color 0.2s, background 0.15s;
}

.tp-cta-outline:hover {
    border-color: var(--tp-navy);
    background: rgba(40,33,130,0.05);
}

/* ── Info sections (HOM-04) ──────────────────── */
.tp-info-section {
    padding: 4rem 1.5rem;
    border-bottom: 1px solid var(--tp-border);
    background: var(--tp-ivory);
}

.tp-info-section--alt {
    background: var(--tp-cream);
}

.tp-info-title {
    font-family: var(--tp-serif);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 600;
    color: var(--tp-text-on-light);
    letter-spacing: -0.02em;
    margin-bottom: 1rem;
    margin-top: 0.75rem;
}

.tp-info-text {
    font-size: 1rem;
    line-height: 1.75;
    color: var(--tp-muted);
    max-width: 56ch;
}

/* ── Logo group (header) ─────────────────────── */
.tp-logo-group {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.tp-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.tp-logo-bio {
    height: 76px;
    width: auto;
    display: block;
}

.tp-logo-sep {
    width: 1px;
    height: 3rem;
    background: var(--tp-border);
    flex-shrink: 0;
}

.tp-logo-partners {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.tp-logo-partner {
    height: 52px;
    width: auto;
    display: block;
    opacity: 0.85;
}

/* Tablet (≤768px): reducir logos ligeramente; el número de logos es configurable por
   cliente (Logos), así que en vez de un tamaño fijo permitimos que la lista de partners
   haga scroll horizontal si no caben todos en una fila. */
@media (max-width: 768px) {
    .tp-logo-bio     { height: 60px; }
    .tp-logo-partner { height: 44px; flex-shrink: 0; }
    .tp-logo-partners {
        max-width: 12rem;
        overflow-x: auto;
        scrollbar-width: none; /* Firefox */
    }
    .tp-logo-partners::-webkit-scrollbar { display: none; } /* Chrome/Safari/Edge */
}

/* Móvil (≤640px): cabecera compacta; los logos de partners quedan en una franja con
   scroll horizontal (en vez de ocultarse por completo) para no perder marca configurada. */
@media (max-width: 640px) {
    .tp-header-inner           { height: 3.75rem; padding: 0 1rem; }
    .tp-logo-bio               { height: 40px; }
    .tp-logo-group             { gap: 0.5rem; }
    .tp-logo-partners          { max-width: 7rem; }
    .tp-nav                    { gap: 1rem; }
    .tp-nav-user-email         { display: none; }
}

/* Móvil pequeño (≤420px): reducción adicional */
@media (max-width: 420px) {
    .tp-logo-bio { height: 34px; }
    .tp-nav      { gap: 0.625rem; font-size: 0.8125rem; }
}

/* ── 3-col info grid (home features) ─────────── */
.tp-info-grid {
    max-width: 72rem;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-left: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
}

@media (max-width: 860px) {
    .tp-info-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 560px) {
    .tp-info-grid { grid-template-columns: 1fr; }
}

.tp-info-col {
    padding: 2.5rem 2.25rem 2.75rem;
    border-right: 1px solid var(--tp-border);
    border-top: 1px solid var(--tp-border);
    position: relative;
    display: flex;
    flex-direction: column;
}

.tp-info-col::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: transparent;
    transition: background 0.2s;
}

.tp-info-col:hover::after { background: var(--tp-navy); }
.tp-info-col:hover { background: var(--tp-ivory); }

.tp-info-col-title {
    font-family: var(--tp-serif);
    font-size: 1.375rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    margin-bottom: 0.75rem;
    margin-top: 0;
    letter-spacing: -0.015em;
}

.tp-info-col-desc {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--tp-muted);
    margin: 0;
    flex: 1; /* empuja el botón al fondo de la columna */
}

.tp-info-col-btn {
    align-self: flex-start;
    margin-top: 1.5rem;
}

/* ── BIOEF contact section (home) ────────────── */
.tp-home-contact {
    padding: 3rem 1.5rem;
    background: var(--tp-ivory);
    border-top: 1px solid var(--tp-border);
}

.tp-home-contact-card {
    max-width: 42rem;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
}

.tp-home-contact-title {
    font-family: var(--tp-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--tp-text-on-light);
    margin: 0;
    letter-spacing: -0.015em;
}

.tp-home-contact-body {
    font-size: 0.9375rem;
    color: var(--tp-muted);
    margin: 0;
    line-height: 1.65;
}

.tp-home-contact-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-family: var(--tp-sans);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    text-decoration: none;
    border-radius: 2px;
    color: var(--tp-text-on-light);
    border: 1.5px solid var(--tp-border);
    background: transparent;
    transition: border-color 0.2s, background 0.2s;
}

.tp-home-contact-btn:hover {
    border-color: var(--tp-navy);
    background: white;
}
