/* Medtack Research: application stylesheet. lsm 09/25/26
   Rebuilt from scratch (no WordPress/Divi CSS). Sections 1-6 are the
   imaging.medtack.net stylesheet (palette on #000928 / #4294E5, Outfit +
   Fira Sans headings (lsm 09/28/26, was Fraunces), navbar, cards, study cards, buttons, tables, auth, switches,
   studies toolbar and list view) so both portals look and behave the same.
   Section 7 onward is research-specific, built only from the same tokens.
   ============================================================ */

/* ---- 1. Tokens ---- */
:root {
    --mt-navy: #000928;
    --mt-blue: #4294E5;
    --mt-navy-700: #0a1e44;
    --mt-navy-600: #143361;
    --mt-blue-700: #1e487d;
    --mt-blue-600: #285c99;
    --mt-blue-500: #3271b6;
    --mt-blue-450: #3b86d2;
    --mt-blue-400: #63a9ea;
    --mt-blue-300: #8cc0f0;
    --mt-blue-200: #b9d9f6;
    --mt-blue-100: #e3effb;
    --mt-ink: #000928;
    --mt-slate: #143361;
    --mt-mist: #e9f1fb;
    --mt-paper: #f5f9fd;
    --mt-line: #d5e2f0;
    --mt-muted: #64758c;
    --mt-muted-soft: #8496ad;
    --mt-amber: #d9842b;
    --mt-danger: #c0392b;
    --mt-danger-100: #fbe9e7;
    --mt-shadow: 0 1px 2px rgba(0,9,40,.06), 0 8px 24px -12px rgba(0,9,40,.22);
}

* { -webkit-font-smoothing: antialiased; }

body {
    font-family: 'Outfit', system-ui, sans-serif;
    background:
        radial-gradient(1200px 400px at 100% -10%, rgba(66,148,229,.10), transparent 60%),
        var(--mt-paper);
    color: var(--mt-ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* lsm 09/28/26 all headings: Fira Sans 500 (was Fraunces) */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .mt-display {
    font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-weight: 500;
    letter-spacing: 0;
}

/* ---- 2. Navbar ---- */
.mt-nav {
    background: rgba(0, 9, 40, .96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid rgba(255,255,255,.07);
}
.mt-nav .navbar-brand, .mt-nav .nav-link { color: var(--mt-blue-200); }
.mt-nav .nav-link:hover, .mt-nav .nav-link:focus { color: #fff; }
.mt-nav .nav-link.active { color: #fff; }
.mt-logo {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--mt-blue), var(--mt-blue-600));
    color: #fff; font-size: 1.05rem;
}
.mt-wordmark { font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 500; font-size: 1.2rem; color: #fff; }
.mt-wordmark-accent { color: var(--mt-blue); font-weight: 500; margin-left: 1px; }

.mt-userbtn { color: var(--mt-blue-200); border: 1px solid rgba(255,255,255,.14); border-radius: 999px; padding: .3rem .7rem; }
.mt-userbtn:hover, .mt-userbtn:focus, .mt-userbtn.show { color: #fff; background: rgba(255,255,255,.07); border-color: rgba(255,255,255,.22); }
.mt-avatar {
    display: inline-flex; align-items: center; justify-content: center;
    width: 26px; height: 26px; border-radius: 50%;
    background: var(--mt-blue); color: #fff; font-size: .8rem; font-weight: 600;
}
.mt-rolebadge { background: rgba(66,148,229,.20); color: var(--mt-blue); font-weight: 500; }
.mt-dropdown { border: 1px solid var(--mt-line); box-shadow: var(--mt-shadow); border-radius: 12px; }

.mt-nav .navbar-toggler { border-color: rgba(255, 255, 255, 0.55); }
.mt-nav .navbar-toggler:focus { box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.35); }
.mt-nav .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.95%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ---- 3. Page frame, cards, buttons, tables ---- */
.mt-main { flex: 1 0 auto; max-width: 1320px; width: 100%; margin: 0 auto; }
/* lsm 09/28/26 list pages use the full screen width (up to 1880px) so wide tables fit without scrolling */
body.mt-wide .mt-main, body.mt-wide .mt-nav-inner, body.mt-wide .mt-main-inner { max-width: 1880px; }
.mt-footer { color: var(--mt-muted-soft); }

.mt-pagehead { margin-bottom: 1.5rem; }
.mt-pagehead h1 { font-size: 1.9rem; margin: 0; }
.mt-pagehead .mt-sub { color: var(--mt-muted); margin-top: .15rem; }

.mt-card { background: #fff; border: 1px solid var(--mt-line); border-radius: 16px; box-shadow: var(--mt-shadow); }
.mt-card .card-body { padding: 1.4rem; }

.mt-study {
    background: #fff; border: 1px solid var(--mt-line); border-radius: 14px;
    overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    height: 100%; display: flex; flex-direction: column;
}
.mt-study:hover { transform: translateY(-3px); box-shadow: var(--mt-shadow); border-color: var(--mt-blue); }
.mt-study-banner {
    height: 84px; background: linear-gradient(120deg, var(--mt-navy), var(--mt-blue-700));
    position: relative; display: flex; align-items: center; padding: 0 1.1rem;
}
.mt-study-banner .bi { color: rgba(255,255,255,.85); font-size: 1.5rem; }
.mt-study-mod {
    position: absolute; top: 12px; right: 12px;
    background: rgba(255,255,255,.16); color: #fff; font-size: .7rem; font-weight: 600;
    padding: .2rem .55rem; border-radius: 6px; letter-spacing: .04em;
}
.mt-study-body { padding: 1.1rem; flex: 1; }
.mt-study-title { font-weight: 600; font-size: 1.02rem; margin-bottom: .2rem; }
.mt-study-meta { color: var(--mt-muted); font-size: .82rem; }
.mt-study-foot { padding: .8rem 1.1rem; border-top: 1px solid var(--mt-mist); display: flex; justify-content: space-between; align-items: center; }

.btn-mt {
    background: var(--mt-blue); color: #fff; border: none; border-radius: 9px;
    font-weight: 500; padding: .5rem 1.1rem; transition: background .15s ease;
}
.btn-mt:hover, .btn-mt:focus { background: var(--mt-blue-600); color: #fff; }
.btn-mt:active { background: var(--mt-blue-700); color: #fff; }
.btn-mt:focus-visible { outline: 2px solid var(--mt-blue-300); outline-offset: 2px; }
.btn-mt:disabled { background: var(--mt-blue-300); color: #fff; }
.btn-mt-outline {
    background: transparent; color: var(--mt-blue-600); border: 1px solid var(--mt-blue);
    border-radius: 9px; font-weight: 500; padding: .45rem 1rem; transition: background .15s ease, color .15s ease;
}
.btn-mt-outline:hover, .btn-mt-outline:focus { background: var(--mt-blue); color: #fff; }
.btn-mt-outline.btn-sm, .btn-mt.btn-sm { padding: .25rem .65rem; font-size: .85rem; }

.mt-table { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--mt-line); }
/* lsm 09/28/26 was overflow:hidden, which cut off the Actions column when the table was wider than the page.
   Tables now shrink and wrap to fit; a scrollbar can only appear on screens too narrow for the fixed columns. */
.mt-table:has(> .mt-list-table) { overflow-x: auto; overflow-y: hidden; }
.mt-table table { margin: 0; }
.mt-table thead th { background: var(--mt-mist); color: var(--mt-slate); font-weight: 600; font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; border: 0; padding: .85rem 1rem; vertical-align: top; }
.mt-table tbody td { padding: .8rem 1rem; vertical-align: middle; border-color: var(--mt-mist); }
/* lsm 09/28/26 header text aligned to the top of the cell, everywhere */
.table > thead, .table > thead > tr > th, .mt-table thead th { vertical-align: top !important; white-space: normal; }
.mt-list-table { font-size: .86rem; }
.mt-list-table thead th { padding: .6rem .45rem; font-size: .72rem; letter-spacing: .02em; }
.mt-list-table tbody td { padding: .6rem .45rem; }

.mt-pill { font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 999px; display: inline-block; white-space: nowrap; }
.mt-pill-active { background: var(--mt-blue-100); color: var(--mt-blue-700); }
.mt-pill-inactive { background: var(--mt-danger-100); color: var(--mt-danger); }
.mt-pill-admin { background: var(--mt-mist); color: var(--mt-navy-600); }
.mt-pill-client { background: var(--mt-mist); color: var(--mt-slate); }
.mt-pill-self { background: rgba(66,148,229,.16); color: var(--mt-blue-600); }
.mt-pill-warn { background: #fdf1e3; color: #9a5a17; }

.mt-row-self > td { background: rgba(66,148,229,.06); }
.mt-row-self > td:first-child { box-shadow: inset 3px 0 0 var(--mt-blue); }

/* ---- 4. Auth (login uses the full-bleed yacht photo, as imaging) ---- */
.mt-auth-wrap { min-height: 78vh; display: flex; align-items: center; justify-content: center; }
.mt-auth-card { width: 100%; max-width: 420px; }
.mt-auth-card-wide { max-width: 760px; }
.mt-auth-brand { text-align: center; margin-bottom: 1.6rem; }
.mt-auth-brand .mt-logo { width: 48px; height: 48px; font-size: 1.5rem; margin: 0 auto .6rem; }
.mt-auth-brand h1 { font-size: 1.5rem; }
.mt-auth-logo { width: 280px; max-width: 80%; height: auto; }

.form-control:focus, .form-select:focus { border-color: var(--mt-blue); box-shadow: 0 0 0 .2rem rgba(66,148,229,.18); }
.form-label { font-weight: 500; font-size: .88rem; color: var(--mt-slate); }

.mt-login-bg {
    position: fixed; inset: 0; z-index: -2;
    background: url('/assets/images/yacht.jpg') center center / cover no-repeat;
    filter: grayscale(100%) contrast(1.05);
}
.mt-login-veil {
    position: fixed; inset: 0; z-index: -1;
    background:
        radial-gradient(90% 70% at 50% 45%, rgba(0,9,40,.42), rgba(0,9,40,.80) 100%),
        linear-gradient(180deg, rgba(0,9,40,.55), rgba(0,9,40,.72));
}
body.mt-login { background: var(--mt-navy); }
.mt-auth-wrap-login { min-height: 100vh; padding: 3rem 0; }
.mt-auth-wrap-login .mt-card {
    background: rgba(255,255,255,.94);
    backdrop-filter: blur(10px);
    border-color: rgba(255,255,255,.35);
    box-shadow: 0 24px 60px -20px rgba(0,9,40,.75);
}
.mt-auth-wrap-login .mt-card .text-muted { color: var(--mt-muted) !important; }
.mt-auth-wrap-login .mt-auth-foot { color: rgba(255,255,255,.75) !important; text-shadow: 0 1px 2px rgba(0,9,40,.6); }
@media (max-width: 575.98px) { .mt-auth-wrap-login { padding: 2rem 0; } }

.mt-empty { text-align: center; padding: 4rem 1rem; color: var(--mt-muted); }
.mt-empty .bi { font-size: 3rem; color: var(--mt-blue-200); }

/* ---- 5. Switches, alerts, links ---- */
.mt-switch { position: relative; display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.mt-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.mt-switch-track {
    display: inline-block; width: 52px; height: 30px; border-radius: 999px;
    background: var(--mt-danger); transition: background .18s ease; position: relative; flex-shrink: 0;
}
.mt-switch-thumb {
    position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%;
    background: #fff; box-shadow: 0 1px 3px rgba(0,9,40,.35); transition: transform .18s ease;
}
.mt-switch input:checked + .mt-switch-track { background: var(--mt-blue); }
.mt-switch input:checked + .mt-switch-track .mt-switch-thumb { transform: translateX(22px); }
.mt-switch input:focus-visible + .mt-switch-track { outline: 2px solid var(--mt-blue-300); outline-offset: 2px; }

.text-success { color: var(--mt-blue-600) !important; }
.alert-success { --bs-alert-color: var(--mt-blue-700); --bs-alert-bg: var(--mt-blue-100); --bs-alert-border-color: var(--mt-blue-200); --bs-alert-link-color: var(--mt-blue-700); }
.alert-info { --bs-alert-color: var(--mt-navy-600); --bs-alert-bg: var(--mt-mist); --bs-alert-border-color: var(--mt-line); }
.mt-alert { border-radius: 12px; }
a { color: var(--mt-blue-600); }
a:hover { color: var(--mt-blue-700); }
.form-check-input:checked { background-color: var(--mt-blue); border-color: var(--mt-blue); }
.form-check-input:focus { border-color: var(--mt-blue); box-shadow: 0 0 0 .2rem rgba(66,148,229,.18); }

.mt-sfid {
    font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
    font-size: .82rem; letter-spacing: .01em; color: var(--mt-slate);
    background: var(--mt-mist); border: 1px solid var(--mt-line); border-radius: 6px; padding: .15rem .45rem;
}
input.mt-sfid { background: #fff; color: var(--mt-ink); padding: .375rem .75rem; }

/* ---- 6. Studies-page toolbar (search, sort, view toggle) ---- */
.mt-studies-tools { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.mt-search-wrap { position: relative; display: flex; align-items: center; }
.mt-search-wrap > .bi-search { position: absolute; left: .6rem; font-size: .8rem; color: var(--mt-muted); pointer-events: none; }
.mt-search-input {
    height: 2.125rem; width: 15rem; max-width: 42vw; padding: 0 1.75rem 0 1.9rem; font-size: .875rem; line-height: 1;
    color: var(--mt-ink); background: #fff; border: 1px solid var(--mt-line); border-radius: .5rem;
}
.mt-search-input:focus { outline: none; border-color: var(--mt-blue); box-shadow: 0 0 0 .18rem rgba(66, 148, 229, .18); }
.mt-search-input::-webkit-search-cancel-button { display: none; }
.mt-search-clear { position: absolute; right: .45rem; border: 0; background: none; font-size: 1.1rem; line-height: 1; color: var(--mt-muted); cursor: pointer; padding: 0 .2rem; }
.mt-search-clear:hover { color: var(--mt-ink); }
.mt-sort-select {
    height: 2.125rem; padding: 0 1.9rem 0 .7rem; font-size: .875rem; line-height: 1; color: var(--mt-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='%23627d98' d='M4.5 6.5 8 10l3.5-3.5z'/%3E%3C/svg%3E") no-repeat right .45rem center/1rem;
    border: 1px solid var(--mt-line); border-radius: .5rem; appearance: none; cursor: pointer; max-width: 15rem;
}
.mt-sort-select:focus { outline: none; border-color: var(--mt-blue); box-shadow: 0 0 0 .18rem rgba(66, 148, 229, .18); }
.mt-view-toggle { display: inline-flex; height: 2.125rem; border: 1px solid var(--mt-line); border-radius: .5rem; overflow: hidden; background: #fff; }
.mt-view-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.25rem; border: 0; background: none; color: var(--mt-muted); cursor: pointer; padding: 0; }
.mt-view-btn + .mt-view-btn { border-left: 1px solid var(--mt-line); }
.mt-view-btn:hover { color: var(--mt-blue); background: rgba(66, 148, 229, .07); }
.mt-view-btn.is-active { background: var(--mt-blue); color: #fff; }
.mt-tool-btn {
    display: inline-flex; align-items: center; gap: .35rem; height: 2.125rem; padding: 0 .7rem; font-size: .85rem;
    border: 1px solid var(--mt-line); border-radius: .5rem; background: #fff; color: var(--mt-slate);
}
.mt-tool-btn:hover { color: var(--mt-blue-600); border-color: var(--mt-blue-300); }

/* ============================================================
   7. Research portal additions (lsm 09/25/26)
   ============================================================ */
.mt-skip { position: absolute; left: 1rem; top: .5rem; z-index: 2000; background: #fff; padding: .4rem .8rem; border-radius: 8px; }
.mt-nav-inner { max-width: 1320px; margin: 0 auto; padding-left: 1rem; padding-right: 1rem; }
.mt-brand img { height: 38px; width: auto; display: block; }
.mt-nav .nav-link { font-weight: 500; }
.mt-nav .nav-link.active { box-shadow: inset 0 -2px 0 var(--mt-blue); }
.mt-trial-name { color: var(--mt-blue-200); font-size: .85rem; max-width: 18rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mt-trial-switch .form-select {
    background-color: rgba(255,255,255,.07); color: #fff; border-color: rgba(255,255,255,.18); max-width: 20rem;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23b9d9f6' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
}
.mt-trial-switch option { color: var(--mt-ink); }
.mt-footer { border-top: 1px solid var(--mt-line); font-size: .85rem; }
.mt-footer-info { color: var(--mt-muted); }
.mt-main-inner { max-width: 1320px; margin: 0 auto; }
.mt-section-title { font-size: 1.2rem; margin: 0 0 .9rem; }
.mt-loading { color: var(--mt-muted); font-style: italic; margin: 0; }
.mt-error-code { font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 500; font-size: 3.2rem; color: var(--mt-blue-300); line-height: 1; margin-bottom: .5rem; }
.mt-rich img { max-width: 100%; height: auto; }
.mt-rich table { width: 100%; }
body.mt-bare { background: #fff; display: block; min-height: 0; }

/* Candidate funnel tabs: the imaging filter-pill look. */
.mt-funnel-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.mt-funnel-tab {
    display: inline-flex; align-items: center; height: 2.125rem; padding: 0 1rem; border-radius: 999px;
    border: 1px solid var(--mt-line); background: #fff; color: var(--mt-slate); font-weight: 500; font-size: .9rem; text-decoration: none;
}
.mt-funnel-tab:hover { border-color: var(--mt-blue); color: var(--mt-blue-600); }
.mt-funnel-tab.is-active { background: var(--mt-navy); border-color: var(--mt-navy); color: #fff; }
.mt-funnel-tab.is-priority { border-color: #f0b4ab; color: var(--mt-danger); }
.mt-funnel-tab.is-priority.is-active { background: var(--mt-danger); border-color: var(--mt-danger); color: #fff; }

/* List component: toolbar + table (list) or compact cards. */
.mt-list-toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.mt-list-count { color: var(--mt-muted); font-size: .88rem; }
.mt-list-table { font-size: .9rem; }
.mt-list-table { width: 100%; table-layout: auto; }
.mt-sort-btn { border: 0; background: none; padding: 0; font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; text-align: left; display: inline; }
.mt-sort-btn .bi { margin-left: .2rem; }
.mt-sort-btn .bi { opacity: .35; font-size: .8em; }
.mt-sort-btn[aria-sort] .bi { opacity: 1; color: var(--mt-blue-600); }
.mt-list-table tbody tr:hover > td { background: var(--mt-paper); }
/* lsm 09/25/26 tables fit the page: no horizontal scrolling, long values wrap */
.mt-list-table td { white-space: normal; overflow-wrap: break-word; word-break: normal; }
.mt-list-table td.text-nowrap { overflow-wrap: normal; }
/* long unbreakable values (emails, phone numbers) may break anywhere, only when the column is too narrow */
.mt-list-table td.mt-cell-email, .mt-list-table td.mt-cell-phone { overflow-wrap: anywhere; }
@media (min-width: 1500px) {
    .mt-list-table td.mt-cell-phone { min-width: 7.2rem; }
    .mt-list-table td.mt-cell-email { min-width: 12rem; }
}
.mt-cell-html p:last-child, .mt-cell-html ul:last-child { margin-bottom: 0; }
.mt-cell-html ul, .mt-cell-html ol { padding-left: 1.1rem; margin-bottom: .25rem; }
.mt-list-table td.mt-cell-actions { text-align: right; }
.mt-list-actions { display: inline-flex; gap: .25rem; flex-wrap: wrap; justify-content: flex-end; }
/* Reference look for candidate actions: plain blue icons, wrapping in a narrow column */
.mt-list-actions.is-dash { gap: .35rem .4rem; width: 96px; justify-content: flex-start; align-items: center; }
.mt-list-actions.is-dash .mt-icon-btn { width: auto; height: auto; border: 0; background: none; padding: 0; color: #2356A0; border-radius: 6px; }
.mt-list-actions.is-dash .mt-icon-btn:hover, .mt-list-actions.is-dash .mt-icon-btn:focus-visible { background: var(--mt-blue-100); color: #2356A0; }
.mt-list-actions.is-dash .mt-icon-btn.is-danger { color: var(--mt-danger); }
.mt-action-img { width: 30px; height: 30px; display: block; }
.mt-action-img.is-big { width: 34px; height: 34px; } /* lsm 09/30/26 medical-record icons 34x34 (were 44) */
.mt-study-foot .mt-list-actions.is-dash { width: auto; }
.mt-icon-btn {
    display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border-radius: 8px;
    border: 1px solid var(--mt-line); background: #fff; color: var(--mt-blue-600); padding: 0; text-decoration: none;
}
.mt-icon-btn:hover, .mt-icon-btn:focus-visible { background: var(--mt-blue); border-color: var(--mt-blue); color: #fff; }
.mt-icon-btn.is-danger { color: var(--mt-danger); }
.mt-icon-btn.is-danger:hover { background: var(--mt-danger); border-color: var(--mt-danger); color: #fff; }
.mt-icon-btn .mt-badge-dot { position: absolute; }
.mt-list-more { text-align: center; padding: 1rem 0 0; }
.mt-row-priority > td { background: var(--mt-danger-100) !important; }
.mt-row-priority > td:first-child { box-shadow: inset 3px 0 0 var(--mt-danger); }
.mt-status { font-weight: 500; }
.mt-status.is-alert { color: var(--mt-danger); }
.mt-status.is-good { color: var(--mt-blue-600); }
.mt-request { color: var(--mt-navy-600); font-size: .85rem; white-space: normal; }
.mt-request-confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: .35rem; margin-top: .35rem; font-weight: 600; font-size: .82rem; }

/* Compact cards: the imaging study card at a smaller scale. */
.mt-study.mt-compact .mt-study-banner { height: auto; min-height: 56px; padding: .7rem 1rem; align-items: flex-start; flex-direction: column; justify-content: center; gap: .1rem; }
.mt-study.mt-compact .mt-study-banner-title { color: #fff; font-weight: 600; font-size: .98rem; padding-right: 5.5rem; line-height: 1.25; word-break: break-word; }
.mt-study.mt-compact .mt-study-banner-sub { color: var(--mt-blue-200); font-size: .78rem; }
.mt-study.mt-compact .mt-study-mod { top: 10px; right: 10px; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: .02em; }
.mt-study.mt-compact .mt-study-body { padding: .8rem 1rem; }
.mt-study.mt-compact.is-priority { border-color: #f0b4ab; }
.mt-study.mt-compact.is-priority .mt-study-banner { background: linear-gradient(120deg, #5c1410, var(--mt-danger)); }
.mt-card-meta { display: grid; grid-template-columns: auto 1fr; gap: .2rem .75rem; font-size: .82rem; margin: 0; }
.mt-card-meta dt { color: var(--mt-muted); font-weight: 500; }
.mt-card-meta dd { margin: 0; color: var(--mt-ink); overflow-wrap: anywhere; }
.mt-study.mt-compact .mt-study-foot { padding: .55rem .8rem; justify-content: flex-end; }

/* Home dashboard */
.mt-home-head { display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; }
.mt-home-logo, .mt-trial-logo { width: 150px; max-height: 110px; object-fit: contain; background: #fff; border: 1px solid var(--mt-line); border-radius: 12px; padding: .5rem; }
.mt-home-trial { font-size: 1.9rem; margin: 0; }
.mt-home-site { color: var(--mt-muted); font-size: 1.05rem; }
.mt-panel {
    display: flex; flex-direction: column; height: 100%; min-height: 26rem; text-decoration: none; color: var(--mt-ink);
    background: #fff; border: 1px solid var(--mt-line); border-radius: 16px; box-shadow: var(--mt-shadow); overflow: hidden;
    transition: border-color .15s ease, transform .15s ease;
}
.mt-panel:hover { border-color: var(--mt-blue); color: var(--mt-ink); transform: translateY(-2px); }
.mt-panel-head { background: linear-gradient(120deg, var(--mt-navy), var(--mt-blue-700)); color: #fff; font-weight: 600; padding: .9rem 1.1rem; display: flex; align-items: center; gap: .55rem; }
.mt-panel-head .bi { color: var(--mt-blue-200); }
.mt-panel-body { padding: 1rem 1.1rem; flex: 1; font-size: .88rem; overflow: hidden; }
.mt-panel-more { padding: .7rem 1.1rem; border-top: 1px solid var(--mt-mist); color: var(--mt-blue-600); font-size: .85rem; font-weight: 500; }
.mt-funnel-counts { display: grid; grid-template-columns: 1fr auto; gap: .35rem .75rem; margin: 0; padding: 1rem 1.1rem; font-size: .86rem; }
.mt-funnel-counts dt { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mt-funnel-counts dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--mt-blue-600); }
.mt-feed-item { padding-bottom: .65rem; margin-bottom: .65rem; border-bottom: 1px solid var(--mt-mist); }
.mt-feed-item:last-child { border-bottom: 0; }
.mt-feed-title { font-weight: 600; overflow-wrap: anywhere; }
.mt-feed-meta { color: var(--mt-muted); font-size: .8rem; }

/* Trial page news */
.mt-news-item { padding: .9rem 0; border-bottom: 1px solid var(--mt-mist); }
.mt-news-item:first-child { padding-top: 0; }
.mt-news-item:last-child { border-bottom: 0; }
.mt-news-date { color: var(--mt-muted); font-size: .82rem; }

/* Modals and forms */
.modal-content { border-radius: 16px; border: 1px solid var(--mt-line); box-shadow: 0 24px 60px -20px rgba(0,9,40,.45); }
.modal-header { border-bottom-color: var(--mt-mist); }
.modal-header .modal-title { font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 500; }
.modal-footer { border-top-color: var(--mt-mist); }
.mt-field-required .form-label::after { content: ' *'; color: var(--mt-danger); }
.mt-readonly { background: var(--mt-paper); border: 1px solid var(--mt-line); border-radius: .375rem; padding: .375rem .75rem; min-height: 2.35rem; }
.mt-criteria { max-height: 16rem; overflow: auto; border: 1px solid var(--mt-line); border-radius: .5rem; padding: .5rem .75rem; background: #fff; }
.mt-criteria .form-check { padding-top: .25rem; padding-bottom: .25rem; border-bottom: 1px solid var(--mt-mist); }
.mt-criteria .form-check:last-child { border-bottom: 0; }
.mt-criteria-type { font-size: .72rem; color: var(--mt-muted); text-transform: uppercase; letter-spacing: .04em; margin-left: .35rem; }
.mt-rte { border: 1px solid var(--mt-line); border-radius: .5rem; background: #fff; }
.mt-rte-bar { display: flex; gap: .25rem; padding: .35rem; border-bottom: 1px solid var(--mt-mist); background: var(--mt-paper); border-radius: .5rem .5rem 0 0; }
.mt-rte-bar button { border: 0; background: none; width: 2rem; height: 2rem; border-radius: 6px; color: var(--mt-slate); }
.mt-rte-bar button:hover { background: var(--mt-blue-100); color: var(--mt-blue-700); }
.mt-rte-area { min-height: 11rem; max-height: 22rem; overflow: auto; padding: .6rem .8rem; outline: none; }
.mt-rte-area:focus { box-shadow: inset 0 0 0 2px rgba(66,148,229,.25); }
.mt-note { border: 1px solid var(--mt-line); border-radius: 12px; padding: .9rem 1rem; margin-bottom: .75rem; background: #fff; }
.mt-note-head { display: flex; gap: .75rem; align-items: flex-start; margin-bottom: .4rem; }
.mt-note-title { font-weight: 600; }
.mt-note-meta { color: var(--mt-muted); font-size: .8rem; }
.mt-note-body { font-size: .9rem; overflow-wrap: anywhere; }
.mt-note-body p:last-child { margin-bottom: 0; }
.mt-candidate-box { background: var(--mt-mist); border-radius: 12px; padding: .75rem 1rem; margin-bottom: 1rem; font-size: .9rem; }
.mt-candidate-box .mt-request { display: block; margin-top: .35rem; max-height: 5rem; overflow: auto; }
.mt-iframe { width: 100%; border: 0; border-radius: 0 0 16px 16px; display: block; }
.mt-records-item { display: flex; align-items: center; gap: .5rem 1rem; padding: .5rem 0; border-bottom: 1px solid var(--mt-mist); flex-wrap: wrap; }
.mt-records-item:last-child { border-bottom: 0; }
.mt-records-open { display: inline-flex; align-items: center; gap: .75rem; border: 0; background: none; padding: .25rem; border-radius: 8px; color: var(--mt-ink); text-align: left; }
.mt-records-open:hover, .mt-records-open:focus-visible { background: var(--mt-mist); }
.mt-records-open img { width: 40px; height: 40px; }
.mt-records-open .mt-records-link { color: var(--mt-blue-600); text-decoration: underline; }

/* SMS conversation (twilio_/index.php in a modal) */
.mt-sms { padding: 1rem; }
.mt-sms-head { display: grid; grid-template-columns: 1fr auto; gap: .15rem 1rem; align-items: center; margin-bottom: .75rem; font-size: .9rem; }
.mt-sms-refresh { grid-row: 1 / span 2; grid-column: 2; }
.mt-sms-thread { height: 18rem; overflow-y: auto; border: 1px solid var(--mt-line); border-radius: 12px; padding: .75rem; background: var(--mt-paper); display: flex; flex-direction: column; gap: .15rem; }
.mt-bubble { max-width: 78%; padding: .45rem .75rem; border-radius: 14px; font-size: .92rem; line-height: 1.35; white-space: pre-wrap; overflow-wrap: anywhere; }
.mt-bubble.is-out { align-self: flex-end; background: var(--mt-blue); color: #fff; border-bottom-right-radius: 4px; }
.mt-bubble.is-in { align-self: flex-start; background: #fff; border: 1px solid var(--mt-line); border-bottom-left-radius: 4px; }
.mt-bubble-time { font-size: .7rem; color: var(--mt-muted); margin-bottom: .5rem; }
.mt-bubble-time.is-out { align-self: flex-end; }
.mt-sms-form { margin-top: .75rem; }
.mt-details { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1rem; margin: 0; }
.mt-details dt { color: var(--mt-muted); font-weight: 500; }
.mt-details dd { margin: 0; }

/* Scheduler (FullCalendar 6, themed with the same tokens) */
.mt-calendar {
    --fc-border-color: var(--mt-line);
    --fc-button-bg-color: #fff;
    --fc-button-border-color: var(--mt-line);
    --fc-button-text-color: var(--mt-slate);
    --fc-button-hover-bg-color: var(--mt-mist);
    --fc-button-hover-border-color: var(--mt-blue-300);
    --fc-button-active-bg-color: var(--mt-blue);
    --fc-button-active-border-color: var(--mt-blue);
    --fc-today-bg-color: rgba(66,148,229,.08);
    --fc-page-bg-color: #fff;
    --fc-neutral-bg-color: var(--mt-paper);
    font-size: .9rem;
}
.mt-calendar a { color: inherit; text-decoration: none; }
.mt-calendar a:hover { color: var(--mt-blue-600); }
.mt-calendar .fc-prev-button, .mt-calendar .fc-next-button { font-size: 1.25rem; line-height: 1; padding: .3rem .8rem; }
.mt-calendar .fc-toolbar-title { font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; font-weight: 500; font-size: 1.35rem; }
.mt-calendar .fc-button { border-radius: 8px !important; font-weight: 500; text-transform: none; }
.mt-calendar .fc-button-active, .mt-calendar .fc-button:active { color: #fff !important; }
.mt-calendar .fc-col-header-cell { background: var(--mt-mist); color: var(--mt-slate); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; }
.mt-calendar .fc-daygrid-day:hover { background: var(--mt-paper); cursor: pointer; }
.mt-calendar .mt-ev-event { background: var(--mt-blue-100); border-color: var(--mt-blue); color: var(--mt-navy); }
.mt-calendar .mt-ev-call { background: #fdf1e3; border-color: var(--mt-amber); color: #5a3408; }
.mt-calendar .fc-event { cursor: pointer; }
.mt-calendar .fc-event .fc-event-main { color: inherit; }
.mt-legend { display: flex; gap: 1rem; font-size: .85rem; color: var(--mt-muted); }
.mt-legend-item { display: inline-flex; align-items: center; gap: .4rem; }
.mt-dot { display: inline-block; width: .8rem; height: .8rem; border-radius: 3px; }
.mt-dot-event { background: var(--mt-blue-100); border: 1px solid var(--mt-blue); }
.mt-dot-call { background: #fdf1e3; border: 1px solid var(--mt-amber); }
.mt-segment { display: inline-flex; border: 1px solid var(--mt-line); border-radius: .5rem; overflow: hidden; }
.mt-segment button { border: 0; background: #fff; padding: .4rem .9rem; color: var(--mt-slate); font-weight: 500; }
.mt-segment button + button { border-left: 1px solid var(--mt-line); }
.mt-segment button.is-active { background: var(--mt-blue); color: #fff; }

/* Privacy, account, admin */
.mt-privacy-text { max-height: 24rem; overflow: auto; border: 1px solid var(--mt-line); border-radius: 12px; padding: 1rem; background: #fff; }
.mt-passkey { display: flex; align-items: center; gap: .9rem; padding: .7rem 0; border-bottom: 1px solid var(--mt-mist); }
.mt-passkey > .bi { font-size: 1.3rem; color: var(--mt-blue-600); }
.mt-check-result.is-ok { color: var(--mt-blue-600); font-weight: 500; }
.mt-check-result.is-fail { color: var(--mt-danger); font-weight: 500; }
.mt-formsite { min-height: 40rem; }
.toast-container { z-index: 2000; }

@media (max-width: 991.98px) {
    .mt-search-input { width: 11rem; }
    .mt-studies-tools { width: 100%; }
    .mt-panel { min-height: 0; }
}

@media print {
    .mt-nav, .mt-footer, .mt-list-toolbar, .mt-funnel-tabs, .mt-list-actions, .mt-list-more, .mt-skip, .btn { display: none !important; }
    body { background: #fff; }
    .mt-main { max-width: none; padding: 0 !important; }
    .mt-table { border: 0; }
    .mt-list-table td, .mt-list-table th { white-space: normal; font-size: 9pt; padding: .3rem !important; }
    .mt-row-priority > td { background: none !important; font-weight: 600; }
}
@media (prefers-reduced-motion: reduce) {
    .mt-study, .mt-panel, .mt-switch-track, .mt-switch-thumb { transition: none; }
    .mt-study:hover, .mt-panel:hover { transform: none; }
}
.mt-toast { background: var(--mt-navy); color: #fff; }
.mt-toast .btn-close { filter: invert(1) grayscale(1) brightness(2); }

/* ============================================================
   New welcome page (lsm 10/01/26): stage panels, toggle tiles, feeds
   ============================================================ */
.mt-stages { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .75rem; margin-bottom: 2.25rem; }
.mt-stages-msg { grid-column: 1 / -1; }
.mt-stage {
    display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: .3rem;
    min-height: 96px; padding: .75rem .5rem .7rem; border: 0; border-radius: 22px;
    background: var(--stage-bg, #000928); color: #fff; text-align: center;
    transition: opacity .2s ease, filter .2s ease, transform .15s ease, box-shadow .15s ease;
}
.mt-stage-label { display: block; width: 100%; text-align: center; font-size: .68rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; line-height: 1.15; }
.mt-stage-count { font-size: 2.35rem; font-weight: 700; line-height: 1; color: var(--stage-fg, #fff); font-variant-numeric: tabular-nums; }
.mt-stage-pct { font-size: .66rem; font-weight: 700; line-height: 1; }
.mt-stage:hover, .mt-tile:hover { transform: translateY(-2px); }
.mt-stage:focus-visible, .mt-tile:focus-visible { outline: 3px solid var(--mt-blue-300); outline-offset: 2px; }
.mt-stage.is-on, .mt-tile.is-on { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--mt-blue); }
.mt-stage.is-dim, .mt-tile.is-dim { opacity: .35; filter: grayscale(1); }
.mt-stage.is-dim:hover, .mt-tile.is-dim:hover { opacity: .6; }

.mt-home2 { display: grid; grid-template-columns: 160px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.mt-home2-tiles { display: flex; flex-direction: column; gap: 1.1rem; }
.mt-tile {
    display: flex; align-items: center; justify-content: center; height: 96px; border: 0; border-radius: 22px;
    background: #000928; color: #fff; font-size: 3.3rem; line-height: 1;
    transition: opacity .2s ease, filter .2s ease, transform .15s ease, box-shadow .15s ease;
}
.mt-home2-panel { min-height: 324px; }
.mt-feed-list { list-style: none; margin: 0; padding: 0; }
.mt-feed-row { display: flex; gap: 1rem; justify-content: space-between; align-items: flex-start; padding: .8rem 0; border-bottom: 1px solid var(--mt-mist); }
.mt-feed-row:first-child { padding-top: 0; }
.mt-feed-row:last-child { border-bottom: 0; }
.mt-feed-main { min-width: 0; flex: 1 1 auto; }
.mt-feed-row .mt-feed-title { font-weight: 600; }
.mt-feed-text { overflow-wrap: anywhere; }
.mt-feed-sub { color: var(--mt-muted); font-size: .85rem; overflow-wrap: anywhere; }
.mt-feed-row .mt-feed-meta { flex: 0 0 auto; text-align: right; color: var(--mt-muted); font-size: .8rem; white-space: nowrap; }
.mt-feed-more { display: flex; align-items: center; gap: .35rem; margin-top: 1rem; font-size: .9rem; font-weight: 500; }

@media (max-width: 767.98px) {
    .mt-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }
    .mt-stage { min-height: 84px; border-radius: 18px; }
    .mt-stage-count { font-size: 2rem; }
    .mt-home2 { grid-template-columns: 1fr; gap: 1rem; }
    .mt-home2-tiles { flex-direction: row; gap: .6rem; }
    .mt-tile { flex: 1 1 0; height: 68px; font-size: 2.2rem; border-radius: 18px; }
    .mt-feed-row { flex-direction: column; gap: .25rem; }
    .mt-feed-row .mt-feed-meta { text-align: left; white-space: normal; }
}
@media (min-width: 768px) and (max-width: 1199.98px) {
    .mt-stages { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { .mt-stage, .mt-tile { transition: none; } .mt-stage:hover, .mt-tile:hover { transform: none; } }

/* lsm 10/05/26 status changed in place from list tables */
.mt-inline-status { width: 100%; min-width: 7.5rem; font-size: .84rem; font-weight: 500; padding-top: .2rem; padding-bottom: .2rem; }
.mt-inline-status.is-alert { color: var(--mt-danger); }
.mt-inline-status.is-good { color: var(--mt-blue-600); }
.mt-inline-status:disabled { opacity: .6; }
