/* ============================================================================
   RTP Calendar — Styles
   ============================================================================ */

/* ── Page wrapper (adds breathing room from edges) ── */
.rtp-page {
    --rtp-status-red: #e74c3c;
    --rtp-status-green: #2ecc71;
    --rtp-phase-cyan: #8ce0ee;
    --rtp-test-yellow: #f1c40f;
    --rtp-marker-plan: #73d99f;
    --rtp-marker-gps: #58a6d8;
    --rtp-marker-test: #f0a35c;
    --rtp-tl-red: #ff8a7e;
    --rtp-tl-green: #7ee0a3;
    --rtp-tl-yellow: #f4ce62;
    --rtp-tl-blue: #9fd3ff;
    --rtp-danger-short: #ee5555;
    --rtp-radius-5: 5px;
    --rtp-radius-12: 12px;
    --rtp-radius-20: 20px;

    padding: 0;
}
.rtp-page > *:not(.rtp-toolbar) {
    margin-left: 24px;
    margin-right: 24px;
}

/* ── Top Toolbar ── */
/* toolbar and title styles inherited from styles.css shared rules */

.rtp-player-count {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.rtp-count-active {
    color: var(--danger);
}

.rtp-count-returned {
    color: var(--success);
}

.rtp-list-filters {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 12px;
}

.rtp-toggle-returned {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    cursor: pointer;
}

.rtp-toggle-returned input[type="checkbox"] {
    accent-color: var(--accent);
}

/* .rtp-toolbar select inherits from .hub-select (styles.css) */
.rtp-toolbar select {
    min-width: 180px;
}

.rtp-back-btn {
    background: transparent;
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-pill);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.8rem;
    padding: 6px 14px;
    min-height: 32px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.rtp-back-btn:hover {
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--accent);
}

.rtp-toolbar .month-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtp-toolbar .month-nav button {
    background: transparent;
    border: 1px solid var(--ink-line-strong);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
}

.rtp-toolbar .month-nav button:hover {
    background: rgba(var(--accent-rgb), 0.15);
    border-color: var(--accent);
}

.rtp-toolbar .month-label {
    font-size: 1rem;
    font-weight: 600;
    min-width: 140px;
    text-align: center;
}


/* ═══════════════════════════════════════
   PLAYER LIST (Landing Page)
   ═══════════════════════════════════════ */

.rtp-player-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}

/* .rtp-player-card base + hover inherited from .hub-player-card (styles.css) */

.rtp-player-card.returned {
    opacity: 0.65;
}

.rtp-player-card.returned:hover {
    opacity: 1;
}

/* Row 1: Photo + Name + Status badge */
.rtp-card-row1 {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Photo enhancement: dark circle behind to mask bad bg removal */
.rtp-card-photo-wrap {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-circle);
    background: var(--ink-line-strong);
    flex-shrink: 0;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--ink-line);
}

.rtp-card-photo {
    width: 100%;
    height: 100%;
    border-radius: var(--radius-circle);
    object-fit: cover;
    filter: brightness(1.05) contrast(1.05);
}

.rtp-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-circle);
    background: var(--accent);
    color: var(--surface-chrome);
    font-weight: 700;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.rtp-card-info {
    flex: 1;
    min-width: 0;
}

.rtp-card-name {
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.rtp-card-pos {
    font-size: 0.72rem;
    color: var(--text-secondary);
    margin-top: 1px;
}

.rtp-card-status {
    font-size: 0.6rem;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: var(--rtp-radius-12);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

.rtp-card-status.active {
    background: rgba(231, 76, 60, 0.15);
    color: var(--rtp-status-red);
}

.rtp-card-status.resolved {
    background: rgba(46, 204, 113, 0.12);
    color: var(--rtp-status-green);
}

/* Row 2: Diagnosis */
.rtp-card-row2 {
    padding-left: 62px;
}

.rtp-card-diag {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.3;
}

/* Row 3: Date + Phase + Days — always aligned across cards */
.rtp-card-row3 {
    display: flex;
    align-items: center;
    gap: 8px;
    padding-left: 62px;
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.rtp-card-date {
    flex-shrink: 0;
}

.rtp-card-phase {
    font-size: 0.58rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: var(--radius-4);
    white-space: nowrap;
}

.rtp-card-inj-count {
    font-size: 0.62rem;
    color: var(--text-secondary);
    background: var(--ink-wash);
    padding: 1px 6px;
    border-radius: var(--radius-4);
    white-space: nowrap;
}

.rtp-card-days {
    margin-left: auto;
    font-weight: 600;
    font-size: 0.72rem;
    color: var(--text-primary);
    white-space: nowrap;
}



/* ═══════════════════════════════════════
   RTP CALENDAR HEADER
   ═══════════════════════════════════════ */

.rtp-hero {
    background: var(--surface-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 12px;
}

.rtp-id {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid var(--ink-line);
}

.rtp-hero-photo,
.rtp-hero-avatar {
    width: 54px;
    height: 54px;
    border-radius: var(--radius-pill);
    flex-shrink: 0;
    background: var(--surface-raised);
    border: 1px solid var(--ink-line);
}

.rtp-hero-photo {
    object-fit: cover;
    filter: brightness(1.05) contrast(1.05);
}

.rtp-hero-avatar {
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent);
}

.rtp-who {
    min-width: 0;
}

.rtp-name {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0;
    line-height: 1.15;
}

.rtp-subline {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
}

.rtp-pos {
    color: var(--text-tertiary);
    font-size: 0.72rem;
    letter-spacing: 0;
}

.rtp-hero-status {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-pill);
    padding: 2px 8px;
    color: var(--status-injured);
    background: color-mix(in srgb, var(--status-injured) 14%, transparent);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-hero-status.avail {
    color: var(--success);
    background: color-mix(in srgb, var(--success) 14%, transparent);
}

.rtp-hero-status .dot {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: currentColor;
}

.rtp-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
    margin-top: 8px;
}

.rtp-meta .m {
    min-width: 86px;
}

.rtp-meta .k {
    margin-bottom: 2px;
    color: var(--text-tertiary);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rtp-meta .v {
    color: var(--text-primary);
    font-size: 0.82rem;
}

.rtp-meta .v.tnum,
.rtp-kpi-num,
.rtp-step-date,
.rtp-cal-cell .day-code {
    font-variant-numeric: tabular-nums;
}

.rtp-meta .v.dim {
    color: var(--text-tertiary);
}

.rtp-cluster {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.rtp-kpi {
    min-width: 76px;
    background: var(--surface-recess);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.rtp-kpi.rtp-kpi-day {
    min-width: 104px;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 9px;
    background: color-mix(in srgb, var(--accent) 4%, var(--surface-recess));
    border-color: var(--ink-line);
}

.rtp-kpi.crit {
    min-width: 150px;
}

.rtp-kpi-num {
    color: var(--text-primary);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}

.rtp-kpi.rtp-kpi-day .rtp-kpi-num {
    min-width: 28px;
    text-align: right;
}

.rtp-kpi-num .den {
    color: var(--text-tertiary);
    font-size: 1rem;
}

.rtp-kpi-label {
    margin-top: 5px;
    color: var(--text-tertiary);
    font-size: 0.56rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.rtp-kpi.rtp-kpi-day .rtp-kpi-label {
    margin-top: 0;
    line-height: 1.15;
}

.rtp-kpi-meter {
    display: flex;
    gap: 3px;
    margin: 5px 0;
}

.rtp-kpi-meter i {
    flex: 1;
    height: 3px;
    border-radius: var(--radius-pill);
    background: var(--ink-line);
}

.rtp-kpi-meter i.on {
    background: var(--crit-met);
}

.rtp-kpi-sub {
    color: var(--crit-pending);
    font-size: 0.68rem;
    line-height: 1.3;
}

.rtp-hero-actions {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
}

.rtp-hero-actions .rtp-btn {
    justify-content: center;
    min-height: 30px;
    white-space: nowrap;
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 5px 10px;
}

.rtp-hero-actions .rtp-btn-primary {
    color: var(--text-inverse);
}

.rtp-hero-timeline {
    padding: 10px 18px 14px;
}

.rtp-hero-timeline-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.rtp-hero-timeline-title {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.rtp-hero-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.rtp-hero-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: var(--text-tertiary);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-hero-legend i {
    width: 7px;
    height: 7px;
    border-radius: var(--radius-pill);
    background: var(--text-tertiary);
}

.rtp-hero-legend i.reached {
    background: var(--phase-reached);
}

.rtp-hero-legend i.met {
    background: var(--crit-met);
}

.rtp-stepper {
    display: flex;
    align-items: flex-start;
}

.rtp-step-node {
    width: 70px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.rtp-step-circle {
    width: 34px;
    height: 34px;
    border-radius: var(--radius-pill);
    border: 1px solid var(--ink-line);
    background: var(--surface-recess);
    color: var(--text-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
}

.rtp-step-node.s-injury .rtp-step-circle {
    border-color: var(--text-secondary);
    background: var(--surface-raised);
    color: var(--text-secondary);
}

.rtp-step-node.s-reached .rtp-step-circle {
    border-color: var(--phase-reached);
    background: var(--accent-soft);
    color: var(--phase-reached);
}

.rtp-step-node.s-met .rtp-step-circle {
    border-color: var(--crit-met);
    background: color-mix(in srgb, var(--crit-met) 15%, transparent);
    color: var(--crit-met);
}

.rtp-step-node.s-current .rtp-step-circle {
    border-color: var(--phase-current);
    background: var(--phase-current);
    color: var(--text-inverse);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.rtp-step-node.s-future .rtp-step-circle {
    border-style: dashed;
}

.rtp-step-connector {
    flex: 1;
    min-width: 20px;
    height: 2px;
    margin-top: 16px;
    background: var(--ink-line);
}

.rtp-step-connector.fill {
    background: var(--phase-reached);
}

.rtp-step-connector.dashed {
    background:
        repeating-linear-gradient(
            90deg,
            var(--phase-reached) 0 20px,
            transparent 20px 28px
        ),
        linear-gradient(
            90deg,
            color-mix(in srgb, var(--ink-line) 65%, transparent),
            color-mix(in srgb, var(--ink-line) 65%, transparent)
        );
}

.rtp-step-label {
    margin-top: 6px;
    color: var(--text-primary);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0;
}

.rtp-step-node.s-future .rtp-step-label {
    color: var(--text-tertiary);
}

.rtp-step-date {
    margin-top: 1px;
    color: var(--text-tertiary);
    font-size: 0.64rem;
}

.rtp-step-crit {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 5px;
    padding: 2px 7px;
    border-radius: var(--radius-pill);
    color: var(--crit-pending);
    background: var(--accent-soft);
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.rtp-step-crit.met {
    color: var(--crit-met);
    background: color-mix(in srgb, var(--crit-met) 15%, transparent);
}

.rtp-step-crit .dot {
    width: 4px;
    height: 4px;
    border-radius: var(--radius-pill);
    background: currentColor;
}

/* ═══════════════════════════════════════
   CALENDAR GRID
   ═══════════════════════════════════════ */

.rtp-calendar-surface {
    background: var(--surface-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-lg);
    overflow: hidden;
    margin-bottom: 8px;
}

.rtp-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.rtp-cal-header {
    text-align: center;
    background: var(--surface-raised);
    border-bottom: 1px solid var(--ink-line);
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 8px 0;
}

.rtp-cal-cell {
    min-height: 92px;
    padding: 8px 9px;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-raised);
    border-right: 1px solid var(--ink-line);
    border-bottom: 1px solid var(--ink-line);
}

.rtp-cal-header:nth-child(7n),
.rtp-cal-cell:nth-child(7n) {
    border-right: none;
}

.rtp-cal-cell:hover {
    background: color-mix(in srgb, var(--accent) 4%, var(--surface-raised));
}

.rtp-cal-cell.selected {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.rtp-cal-cell.empty {
    background: var(--surface-recess);
    cursor: default;
}

.rtp-cal-cell.empty:hover {
    background: var(--surface-recess);
}

.rtp-cal-cell.injury-day {
    box-shadow: inset 0 0 0 2px var(--phase-injury);
}

.rtp-cal-cell.is-today {
    box-shadow: inset 0 0 0 2px var(--accent);
}

.rtp-cal-cell.injury-day.is-today {
    box-shadow: inset 0 0 0 2px var(--phase-injury);
}

.rtp-cal-cell.selected.injury-day {
    box-shadow: inset 0 0 0 2px var(--phase-injury), inset 0 0 0 4px var(--accent-soft);
}

.rtp-cal-cell.selected.is-today {
    box-shadow: inset 0 0 0 2px var(--accent), inset 0 0 0 4px var(--accent-soft);
}

.rtp-cal-cell.selected.injury-day.is-today {
    box-shadow: inset 0 0 0 2px var(--phase-injury), inset 0 0 0 4px var(--accent-soft);
}

.rtp-cal-cell .day-num {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
}

.rtp-cal-cell .day-num > span:first-child {
    color: var(--text-primary);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1;
}

.rtp-cal-cell.injury-day .day-num > span:first-child {
    color: var(--phase-injury);
}

.rtp-cal-cell.is-today .day-num > span:first-child {
    color: var(--accent);
}

.rtp-cal-cell.injury-day.is-today .day-num > span:first-child {
    color: var(--phase-injury);
}

.rtp-cal-cell .day-code {
    color: var(--text-tertiary);
    font-family: ui-monospace, Menlo, monospace;
    font-size: 0.6rem;
    letter-spacing: 0.04em;
}

.rtp-cal-cell .loading-val {
    color: var(--text-secondary);
    font-size: 0.66rem;
}

.indicator-dots {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
}

.ind-dot {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-pill);
    display: inline-block;
}

.ind-gps { background: var(--info); }
.ind-fb { background: var(--accent-teal); }
.ind-test { background: var(--warning); }
.ind-plan { background: var(--success); }
.ind-exit-criteria { background: var(--crit-pending); }

.rtp-dot-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.65rem;
    color: var(--text-secondary);
    padding: 6px 0 12px;
}

.rtp-dot-legend span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.rtp-cal-cell .day-type-label {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-top: auto;
    text-align: center;
    text-transform: uppercase;
}

.rtp-cal-cell.day-off {
    background: var(--surface-recess);
}

.rtp-cal-chip {
    margin-top: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border-radius: var(--radius-pill);
    padding: 3px 8px;
    color: var(--crit-pending);
    background: var(--accent-soft);
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.rtp-cal-chip .d {
    width: 5px;
    height: 5px;
    border-radius: var(--radius-pill);
    background: currentColor;
}

.rtp-cal-chip.chip-injury {
    color: var(--phase-injury);
    background: color-mix(in srgb, var(--phase-injury) 16%, transparent);
}

.rtp-cal-chip.chip-current {
    color: var(--text-inverse);
    background: var(--phase-current);
}

.rtp-cal-chip.chip-current .d {
    background: currentColor;
}


/* ═══════════════════════════════════════
   DAY DETAIL PANEL
   ═══════════════════════════════════════ */

.rtp-day-panel {
    background: var(--surface-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
    overflow: hidden;
    animation: slideUp 0.25s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.rtp-day-panel .panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid var(--ink-line);
    background: rgba(var(--accent-rgb), 0.05);
}

.rtp-day-panel .panel-header h3 {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 600;
}

.rtp-day-panel .panel-header .close-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 4px;
    transition: color 0.2s;
}

.rtp-day-panel .panel-header .close-btn:hover {
    color: var(--accent);
}

.rtp-day-panel .panel-header .edit-info {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
}

.rtp-day-panel .panel-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

@media (max-width: 900px) {
    .rtp-day-panel .panel-body {
        grid-template-columns: 1fr;
    }
}

.rtp-day-panel .plan-col {
    padding: 16px 20px;
    border-right: 1px solid var(--ink-line);
}

.rtp-day-panel .auto-col {
    padding: 16px 20px;
}

.rtp-day-panel .section-title {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin: 12px 0 8px;
}

.rtp-day-panel .section-title:first-child {
    margin-top: 0;
}

.rtp-exercise-row {
    margin-bottom: 10px;
}

.rtp-exercise-row label {
    display: block;
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.rtp-exercise-row textarea {
    width: 100%;
    background: var(--ink-wash);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 6px 10px;
    resize: vertical;
    min-height: 28px;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.rtp-exercise-row textarea:focus {
    border-color: var(--accent);
    outline: none;
    background: rgba(var(--accent-rgb), 0.04);
}

.rtp-exercise-row textarea:read-only {
    cursor: default;
    opacity: 0.7;
}

.rtp-exercise-row textarea.has-content {
    border-color: var(--accent);
}

.day-type-select {
    background: var(--ink-wash);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    padding: 6px 10px;
    width: 100%;
    box-sizing: border-box;
}

.rtp-gps-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.rtp-gps-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 0.8rem;
    padding: 3px 0;
}

.rtp-gps-item .metric-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.rtp-gps-item .metric-val {
    font-weight: 600;
}

.rtp-gps-item .metric-pct {
    font-size: 0.7rem;
    color: var(--accent);
    margin-left: 4px;
}

.rtp-no-data {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-style: italic;
    padding: 8px 0;
}

.rtp-tests-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.75rem;
}

.rtp-tests-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 6px;
    border-bottom: 1px solid var(--ink-line);
}

.rtp-tests-table td {
    padding: 4px 6px;
    border-bottom: 1px solid var(--ink-line);
}

.rtp-day-panel .panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-top: 1px solid var(--ink-line);
    gap: 8px;
}

/* ── Day Panel Tabs ── */

.dp-tabs {
    display: flex;
    border-bottom: 1px solid var(--ink-line-strong);
    background: var(--ink-zebra);
}

.dp-tab {
    flex: 1;
    padding: 10px 16px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.dp-tab:hover {
    color: var(--text-primary);
}

.dp-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

.dp-tab-content {
    padding: 16px 20px;
}

/* ── Summary Bar ── */

.dp-summary-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.dp-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: var(--rtp-radius-20);
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.dp-tag-daytype {
    background: var(--ink-wash-strong);
    color: var(--text-primary);
}

.dp-tag-phase {
    font-size: 0.68rem;
}

/* ── Sections ── */

.dp-section {
    margin-bottom: 20px;
}

.dp-section:last-child {
    margin-bottom: 0;
}

.dp-section-header {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.dp-section-icon {
    font-size: 0.85rem;
}

/* ── GPS Metrics Grid ── */

.dp-metrics-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

@media (max-width: 900px) {
    .dp-metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.dp-metric-card {
    background: var(--ink-wash);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-8);
    padding: 10px 12px;
    transition: background 0.2s;
}

.dp-metric-card:hover {
    background: var(--ink-wash);
}

.dp-metric-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.dp-metric-value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.dp-metric-pct {
    font-size: 0.62rem;
    font-weight: 500;
    color: var(--accent);
    opacity: 0.85;
}

/* ── Clinical Tests ── */

.dp-tests-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.dp-test-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--ink-zebra);
    border-radius: var(--radius-sm);
}

.dp-test-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dp-test-source {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
}

.dp-test-name {
    font-size: 0.78rem;
    color: var(--text-primary);
}

.dp-test-values {
    text-align: right;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dp-test-val {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

.dp-test-baseline {
    font-size: 0.65rem;
    font-weight: 600;
}

/* ── Plan View (read-only) ── */

.dp-plan-view {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dp-plan-item {
    padding: 8px 12px;
    background: var(--ink-zebra);
    border-radius: var(--radius-4);
}

.dp-plan-label {
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--text-secondary);
    margin-bottom: 3px;
}

.dp-plan-text {
    font-size: 0.82rem;
    color: var(--text-primary);
    white-space: pre-wrap;
    line-height: 1.4;
}

.dp-edit-info {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 8px;
}

/* ── Empty State ── */

.dp-empty {
    color: var(--text-secondary);
    font-size: 0.78rem;
    font-style: italic;
    padding: 12px 0;
}

.rtp-ec-empty {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px 0;
}

.rtp-ec-empty-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rtp-ec-empty-text {
    max-width: 720px;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.5;
}

.rtp-ec-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.rtp-ec-category-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 10px;
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-pill);
    background: var(--ink-wash);
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 600;
}

.rtp-ec-template-tools {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.rtp-ec-template-actions,
.rtp-ec-template-manage {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.rtp-ec-template-status {
    display: none;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 700;
}

.rtp-ec-template-status.active {
    display: block;
}

.rtp-ec-template-status.error {
    color: var(--danger);
}

.rtp-ec-template-select {
    min-width: 260px;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 7px 10px;
}

.rtp-ec-template-builder {
    border: 1px solid color-mix(in srgb, var(--accent) 52%, var(--ink-line));
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 7%, var(--surface-chrome));
    overflow: hidden;
}

.rtp-ec-template-builder summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    list-style: none;
    gap: 14px;
    padding: 12px 14px 12px 16px;
}

.rtp-ec-template-builder summary::-webkit-details-marker {
    display: none;
}

.rtp-ec-template-builder summary span,
.rtp-ec-template-builder summary strong,
.rtp-ec-template-builder summary em {
    display: block;
}

.rtp-ec-template-builder summary strong {
    color: var(--text-primary);
    font-size: 0.8rem;
    font-weight: 800;
}

.rtp-ec-template-builder summary em {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-style: normal;
}

.rtp-ec-template-builder summary b {
    flex-shrink: 0;
    border: 1px solid color-mix(in srgb, var(--accent) 58%, var(--ink-line));
    border-radius: var(--radius-pill);
    background: var(--accent-soft);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 6px 10px;
}

.rtp-ec-template-builder-body {
    border-top: 1px solid var(--ink-line);
    padding: 12px;
}

.rtp-ec-template-form,
.rtp-ec-template-add-form {
    display: grid;
    grid-template-columns: minmax(160px, 0.8fr) minmax(140px, 0.7fr) minmax(220px, 1.5fr);
    gap: 8px;
    margin-top: 10px;
}

.rtp-ec-template-add-form {
    grid-template-columns: 100px minmax(160px, 0.9fr) minmax(220px, 1.2fr) 150px 150px auto;
    align-items: end;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    padding: 10px;
}

.rtp-ec-template-form label,
.rtp-ec-template-add-form label {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.rtp-ec-template-form span,
.rtp-ec-template-add-form span {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-ec-template-form input,
.rtp-ec-template-add-form input,
.rtp-ec-template-add-form select {
    width: 100%;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 8px 10px;
}

.rtp-exit-criteria-modal input[type="number"],
.rtp-exit-criteria-panel input[type="number"] {
    appearance: textfield;
    -moz-appearance: textfield;
}

.rtp-exit-criteria-modal input[type="number"]::-webkit-inner-spin-button,
.rtp-exit-criteria-modal input[type="number"]::-webkit-outer-spin-button,
.rtp-exit-criteria-panel input[type="number"]::-webkit-inner-spin-button,
.rtp-exit-criteria-panel input[type="number"]::-webkit-outer-spin-button {
    margin: 0;
    appearance: none;
    -webkit-appearance: none;
}

.rtp-ec-template-body-store {
    display: none;
}

.rtp-ec-template-builder-list {
    margin-top: 10px;
}

.rtp-ec-template-empty-builder {
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-field) 72%, transparent);
    padding: 12px;
}

.rtp-ec-template-empty-builder strong,
.rtp-ec-template-empty-builder span {
    display: block;
}

.rtp-ec-template-empty-builder strong {
    color: var(--text-primary);
    font-size: 0.8rem;
}

.rtp-ec-template-empty-builder span {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.rtp-ec-template-card-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rtp-ec-template-phase-column {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--surface-field) 74%, transparent);
    padding: 9px;
}

.rtp-ec-template-phase-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 8px;
}

.rtp-ec-template-phase-head strong {
    color: var(--text-primary);
    font-size: 0.72rem;
}

.rtp-ec-template-phase-head span {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
}

.rtp-ec-template-phase-cards {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.rtp-ec-template-criterion-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 8px;
}

.rtp-ec-template-criterion-card span,
.rtp-ec-template-criterion-card strong,
.rtp-ec-template-criterion-card em,
.rtp-ec-template-criterion-card small {
    display: block;
}

.rtp-ec-template-criterion-card span {
    color: var(--accent);
    font-size: 0.58rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-ec-template-criterion-card strong {
    margin-top: 3px;
    color: var(--text-primary);
    font-size: 0.72rem;
    line-height: 1.25;
}

.rtp-ec-template-criterion-card em,
.rtp-ec-template-criterion-card small,
.rtp-ec-template-phase-empty {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-style: normal;
    line-height: 1.3;
}

.rtp-ec-template-builder-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.rtp-ec-setup-phases {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
    gap: 8px;
}

.rtp-ec-setup-grid {
    display: grid;
    grid-template-columns: minmax(220px, 0.72fr) minmax(360px, 1.28fr);
    gap: 14px;
    align-items: start;
}

.rtp-ec-setup-grid.single {
    grid-template-columns: minmax(220px, 520px);
}

.rtp-ec-setup-section {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    padding: 12px;
}

.rtp-ec-setup-section > .rtp-btn {
    margin-top: 10px;
}

.rtp-ec-setup-label {
    margin-bottom: 9px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rtp-ec-setup-phase {
    display: flex;
    flex-direction: column;
    gap: 3px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 9px 10px;
}

.rtp-ec-setup-phase span {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rtp-ec-setup-phase strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.rtp-ec-setup-phase em {
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-style: normal;
}

.rtp-ec-template-previews {
    width: 100%;
}

.rtp-ec-template-preview {
    display: none;
}

.rtp-ec-template-preview.active {
    display: block;
}

.rtp-ec-template-preview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.rtp-ec-template-name {
    color: var(--text-primary);
    font-size: 0.82rem;
    font-weight: 800;
}

.rtp-ec-template-desc {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.72rem;
    line-height: 1.35;
}

.rtp-ec-template-preview-head span {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
}

.rtp-ec-template-phase-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rtp-ec-template-phase {
    min-height: 76px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 8px;
}

.rtp-ec-template-phase.empty {
    opacity: 0.72;
}

.rtp-ec-template-phase span,
.rtp-ec-template-phase strong,
.rtp-ec-template-phase em {
    display: block;
}

.rtp-ec-template-phase span {
    color: var(--text-secondary);
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.4px;
    text-transform: uppercase;
}

.rtp-ec-template-phase strong {
    margin-top: 4px;
    color: var(--text-primary);
    font-size: 0.76rem;
}

.rtp-ec-template-phase em {
    margin-top: 5px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-style: normal;
    line-height: 1.3;
}

.rtp-ec-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.rtp-ec-summary,
.rtp-ec-phase-head,
.rtp-ec-group-main,
.rtp-ec-check,
.rtp-ec-evidence-row,
.rtp-ec-confirm-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rtp-ec-summary {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--ink-line);
}

.rtp-ec-phase-tabs {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.rtp-ec-phase-tab {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 3px;
    border: 1px solid var(--ink-line-strong);
    background: var(--surface-chrome);
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    padding: 9px 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
}

.rtp-ec-phase-tab span {
    color: var(--text-primary);
}

.rtp-ec-phase-tab small {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 700;
}

.rtp-ec-phase-tab.active {
    background: var(--accent-soft);
    color: var(--accent);
    border-color: var(--accent);
}

.rtp-ec-phase-tab.locked {
    border-style: dashed;
}

.rtp-ec-phase-tab.locked span,
.rtp-ec-phase-tab.locked small {
    color: var(--text-tertiary);
}

.rtp-ec-phase-block {
    display: none;
}

.rtp-ec-phase-block.active {
    display: block;
}

.rtp-ec-phase-head {
    align-items: flex-start;
    margin-bottom: 10px;
}

.rtp-ec-phase-title {
    font-size: 0.82rem;
    font-weight: 800;
    color: var(--text-primary);
}

.rtp-ec-phase-sub,
.rtp-ec-muted {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.rtp-ec-group-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rtp-ec-template-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 5%, var(--surface-recess));
    padding: 10px 12px;
    margin-bottom: 10px;
}

.rtp-ec-template-strip strong,
.rtp-ec-template-strip span {
    display: block;
}

.rtp-ec-template-strip strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.rtp-ec-template-strip span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.rtp-ec-template-inline {
    display: flex;
    align-items: center;
    gap: 8px;
}

.rtp-ec-category-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rtp-ec-add-strip {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
    gap: 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    padding: 10px;
    margin-bottom: 10px;
}

.rtp-ec-add-strip label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rtp-ec-add-strip span {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-ec-add-category {
    width: 100%;
    min-height: 38px;
    background: var(--surface-field);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    padding: 7px 9px;
}

.rtp-ec-add-strip .rtp-btn {
    align-self: end;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
}

.rtp-ec-empty-phase {
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.76rem;
    padding: 12px;
}

.rtp-ec-category-panel {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-recess);
    overflow: hidden;
}

.rtp-ec-category-panel summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
    padding: 9px 10px;
    list-style: none;
}

.rtp-ec-category-panel summary::-webkit-details-marker {
    display: none;
}

.rtp-ec-category-panel summary span,
.rtp-ec-category-panel summary strong,
.rtp-ec-category-panel summary em {
    display: block;
}

.rtp-ec-category-panel summary strong {
    color: var(--text-primary);
    font-size: 0.78rem;
}

.rtp-ec-category-panel summary em {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-style: normal;
}

.rtp-ec-category-body {
    border-top: 1px solid var(--ink-line);
    padding: 10px;
}

.rtp-ec-locked {
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.45;
    padding: 14px;
}

.rtp-ec-list-title {
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 800;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.rtp-ec-optional-section {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px dashed var(--ink-line);
}

.rtp-ec-group {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    padding: 10px;
}

.rtp-ec-group.confirmed {
    border-color: rgba(var(--success-rgb), 0.55);
}

.rtp-ec-group.optional {
    background: var(--surface-chrome);
}

.rtp-ec-group-controls {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 6px;
}

.rtp-ec-group-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.rtp-ec-group-category {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.62rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.rtp-ec-gate-label {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    padding: 1px 6px;
    color: var(--text-secondary);
    font-size: 0.56rem;
    font-weight: 800;
}

.rtp-ec-group-title {
    font-size: 0.86rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rtp-ec-status {
    flex-shrink: 0;
    border-radius: var(--radius-pill);
    border: 1px solid var(--ink-line);
    padding: 4px 9px;
    color: var(--text-secondary);
    font-size: 0.64rem;
    font-weight: 800;
}

.rtp-ec-status.met {
    border-color: rgba(var(--success-rgb), 0.5);
    color: var(--success);
    background: rgba(var(--success-rgb), 0.12);
}

.rtp-ec-status.pending {
    background: color-mix(in srgb, var(--text-primary) 4%, transparent);
}

.rtp-ec-checks,
.rtp-ec-evidence,
.rtp-ec-confirm,
.rtp-ec-evidence-library {
    margin-top: 10px;
}

.rtp-ec-check,
.rtp-ec-evidence-row {
    padding: 6px 0;
    border-top: 1px solid var(--ink-line);
    font-size: 0.76rem;
}

.rtp-ec-inline-confirm {
    display: grid;
    grid-template-columns: minmax(180px, 0.8fr) minmax(320px, 1.2fr);
    align-items: end;
    gap: 10px;
    border-top: 1px solid var(--ink-line);
    margin-top: 10px;
    padding-top: 10px;
}

.rtp-ec-inline-confirm strong,
.rtp-ec-inline-confirm span {
    display: block;
}

.rtp-ec-inline-confirm strong {
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 800;
}

.rtp-ec-inline-confirm span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 700;
}

.rtp-ec-inline-confirm-fields {
    display: grid;
    grid-template-columns: minmax(72px, 0.35fr) auto minmax(150px, 1fr) auto;
    align-items: center;
    gap: 8px;
}

.rtp-ec-inline-confirm-fields input {
    min-height: 34px;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.76rem;
    padding: 7px 9px;
}

.rtp-ec-editor {
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--accent) 8%, var(--surface-recess));
    padding: 12px;
    margin-bottom: 10px;
}

.rtp-ec-editor-head,
.rtp-ec-editor-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.rtp-ec-editor-head {
    margin-bottom: 10px;
}

.rtp-ec-editor-head strong,
.rtp-ec-editor-head span {
    display: block;
}

.rtp-ec-editor-head strong {
    color: var(--text-primary);
    font-size: 0.84rem;
}

.rtp-ec-editor-head span {
    margin-top: 2px;
    color: var(--text-secondary);
    font-size: 0.68rem;
}

.rtp-ec-editor-grid {
    display: grid;
    grid-template-columns: 1.4fr 0.8fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.rtp-ec-pain-builder,
.rtp-ec-rom-builder,
.rtp-ec-provider-builder,
.rtp-ec-running-builder,
.rtp-ec-speed-builder,
.rtp-ec-internal-builder,
.rtp-ec-clinical-builder {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    padding: 10px;
    margin-bottom: 10px;
}

.rtp-ec-pain-builder.is-hidden,
.rtp-ec-rom-builder.is-hidden,
.rtp-ec-provider-builder.is-hidden,
.rtp-ec-running-builder.is-hidden,
.rtp-ec-speed-builder.is-hidden,
.rtp-ec-internal-builder.is-hidden,
.rtp-ec-clinical-builder.is-hidden,
.rtp-ec-running-manual.is-hidden,
.rtp-ec-editor-free-text.is-hidden {
    display: none;
}

.rtp-ec-provider-steps {
    display: grid;
    grid-template-columns: 1fr 0.85fr 1.1fr 0.9fr 0.95fr 1.05fr;
    gap: 8px;
}

.rtp-ec-pain-steps {
    grid-template-columns: 0.8fr 1fr 1.2fr;
}

.rtp-ec-rom-steps {
    grid-template-columns: 1fr 1fr 1.2fr;
}

.rtp-ec-clinical-steps {
    grid-template-columns: 1fr 1.2fr;
}

.rtp-ec-running-steps {
    grid-template-columns: 1fr 1fr 1.25fr 0.75fr;
}

.rtp-ec-speed-steps {
    grid-template-columns: 1fr 1fr 1.25fr 0.75fr;
}

.rtp-ec-internal-steps {
    grid-template-columns: 1.2fr 1.25fr 0.75fr;
}

.rtp-ec-provider-target {
    display: grid;
    grid-template-columns: minmax(78px, 1fr) minmax(70px, 0.9fr) auto;
    align-items: center;
    gap: 6px;
}

.rtp-ec-provider-unit,
.rtp-ec-running-unit,
.rtp-ec-running-manual-unit,
.rtp-ec-speed-unit,
.rtp-ec-internal-unit,
.rtp-ec-clinical-unit,
.rtp-ec-rom-unit,
.rtp-ec-pain-unit {
    color: var(--text-secondary);
    font-size: 0.68rem;
    font-weight: 800;
    white-space: nowrap;
}

.rtp-ec-provider-reference {
    margin-top: 8px;
    color: var(--text-secondary);
    font-size: 0.68rem;
    line-height: 1.35;
}

.rtp-ec-running-manual {
    margin-top: 8px;
}

.rtp-ec-editor label {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.rtp-ec-editor label span {
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.rtp-ec-editor input,
.rtp-ec-editor select {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.78rem;
    padding: 7px 9px;
}

.rtp-ec-editor input:focus,
.rtp-ec-editor select:focus {
    outline: none;
    border-color: var(--accent);
}

.rtp-ec-editor-field {
    margin-bottom: 8px;
}

.rtp-ec-editor-actions {
    justify-content: flex-end;
}

.rtp-ec-side-label {
    color: var(--text-secondary);
    font-style: normal;
    font-size: 0.68rem;
    margin-left: 6px;
}

.rtp-ec-evidence-row strong {
    color: var(--text-primary);
    font-weight: 700;
}

.rtp-ec-evidence-row em {
    color: var(--text-secondary);
    font-style: normal;
}

.rtp-ec-confirm {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.rtp-ec-confirm input,
.rtp-ec-confirm textarea,
.rtp-ec-confirm select,
.rtp-ec-evidence-form input,
.rtp-ec-evidence-form textarea,
.rtp-ec-evidence-form select {
    width: 100%;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
    padding: 7px 10px;
    box-sizing: border-box;
}

.rtp-ec-confirm input:focus,
.rtp-ec-confirm textarea:focus,
.rtp-ec-confirm select:focus,
.rtp-ec-evidence-form input:focus,
.rtp-ec-evidence-form textarea:focus,
.rtp-ec-evidence-form select:focus {
    outline: none;
    border-color: var(--accent);
}

.rtp-ec-evidence-library {
    border-top: 1px solid var(--ink-line);
    padding-top: 12px;
}

.rtp-ec-evidence-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

.rtp-ec-evidence-card {
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 10px;
}

.rtp-ec-evidence-card.voided {
    opacity: 0.68;
}

.rtp-ec-evidence-main,
.rtp-ec-evidence-actions {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.rtp-ec-evidence-actions {
    justify-content: flex-end;
    margin-top: 8px;
}

.rtp-ec-evidence-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-raised);
    padding: 10px;
}

.rtp-ec-history {
    border-top: 1px solid var(--ink-line);
    padding-top: 12px;
}

.rtp-ec-history-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.rtp-ec-history-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 8px 10px;
}

.rtp-ec-history-title {
    color: var(--text-primary);
    font-size: 0.76rem;
    font-weight: 700;
}

.rtp-ec-history-meta {
    flex-shrink: 0;
    color: var(--text-secondary);
    font-size: 0.68rem;
    text-align: right;
}

#rtp-day-panel-area:not(:empty) {
    margin-top: 20px;
}


/* ═══════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════ */

.rtp-btn {
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    border: none;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.rtp-btn:active {
    transform: scale(0.97);
}

.rtp-btn-sm {
    padding: 6px 12px;
    font-size: 0.72rem;
}

.rtp-btn-primary {
    background: var(--accent);
    color: var(--text-inverse);
}

.rtp-btn-primary:hover {
    background: var(--accent-hover);
}

.rtp-btn-secondary {
    background: var(--ink-wash-strong);
    color: var(--text-primary);
    border: 1px solid var(--ink-line-strong);
}

.rtp-btn-secondary:hover {
    background: var(--ink-wash);
}

.rtp-btn-danger {
    background: color-mix(in srgb, var(--status-injured) 14%, transparent);
    color: var(--status-injured);
    border: 1px solid color-mix(in srgb, var(--status-injured) 30%, transparent);
}

.rtp-btn-danger:hover {
    background: color-mix(in srgb, var(--status-injured) 22%, transparent);
}

.rtp-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}


/* ═══════════════════════════════════════
   PHASE MODAL
   ═══════════════════════════════════════ */

.rtp-phase-modal {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.15s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.rtp-phase-modal .modal-content {
    background: var(--surface-chrome);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-md);
    padding: 24px;
    min-width: 320px;
    max-width: 400px;
}

.rtp-phase-modal h3 {
    margin: 0 0 16px;
    font-size: 1rem;
}

.rtp-phase-modal label {
    display: block;
    font-size: 0.8rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.rtp-phase-modal input,
.rtp-phase-modal select {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
    padding: 8px 10px;
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
}

.rtp-phase-optional-label {
    color: var(--text-tertiary);
    font-weight: 500;
}

.rtp-phase-note {
    font-size: 0.7rem;
    color: var(--text-secondary);
    font-style: italic;
    margin: -8px 0 12px;
}

.rtp-phase-modal .modal-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.rtp-phase-ranges {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 2px 0 12px;
}

.rtp-phase-range-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: var(--surface-chrome);
    padding: 5px;
}

.rtp-phase-range-row.active {
    border-color: color-mix(in srgb, var(--accent) 45%, transparent);
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.rtp-phase-row-main {
    display: grid;
    grid-template-columns: 70px minmax(0, 1fr) auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 32px;
    padding: 3px 4px;
    border: 0;
    background: transparent;
    color: inherit;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
}

.rtp-phase-row-main:hover strong {
    color: var(--accent);
}

.rtp-phase-row-main:disabled {
    cursor: default;
}

.rtp-phase-row-main:disabled:hover strong {
    color: var(--text-primary);
}

.rtp-phase-row-main span {
    color: var(--text-secondary);
    font-size: 0.66rem;
    font-weight: 800;
}

.rtp-phase-row-main strong {
    color: var(--text-primary);
    font-size: 0.72rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rtp-phase-row-main em {
    color: var(--text-tertiary);
    font-size: 0.62rem;
    font-style: normal;
}

.rtp-phase-row-actions {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.rtp-phase-row-action {
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
}

.rtp-phase-row-action:hover {
    border-color: color-mix(in srgb, var(--text-primary) 22%, var(--ink-line));
    color: var(--text-primary);
}

.rtp-phase-row-action.danger:hover {
    border-color: color-mix(in srgb, var(--status-injured) 42%, var(--ink-line));
    background: color-mix(in srgb, var(--status-injured) 9%, transparent);
    color: var(--status-injured);
}

.rtp-phase-validation {
    display: none;
    margin: -4px 0 10px;
    color: var(--danger);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.35;
}

.rtp-phase-validation.active {
    display: block;
}

.rtp-phase-modal .hub-date-control {
    width: 100%;
    margin-bottom: 12px;
}

.rtp-phase-modal .hub-date-trigger,
.rtp-injury-field .hub-date-trigger {
    width: 100%;
    min-height: 36px;
    box-sizing: border-box;
    background: var(--surface-chrome);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 7px 10px;
    font-family: inherit;
    font-size: 0.8rem;
}

.rtp-phase-modal .hub-date-trigger:hover,
.rtp-injury-field .hub-date-trigger:hover {
    border-color: var(--text-tertiary);
}


/* ═══════════════════════════════════════
   VIEW TOGGLE
   ═══════════════════════════════════════ */


/* ═══════════════════════════════════════
   TIMELINE VIEW
   ═══════════════════════════════════════ */

/* ── Timeline Table (redesigned to match readiness table) ── */

.rtp-timeline-wrap {
    overflow-x: auto;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-8);
    background: var(--surface-chrome);
}

.rtp-timeline {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.78rem;
    font-family: 'Inter', sans-serif;
}

/* ── Sticky label column ── */
.rtp-timeline .tl-label {
    position: sticky;
    left: 0;
    z-index: 2;
    background: var(--surface-chrome);
    font-weight: 600;
    font-size: 0.68rem;
    white-space: nowrap;
    padding: 7px 14px;
    border-right: 2px solid var(--ink-line);
    color: var(--text-secondary);
    min-width: 180px;
    max-width: 180px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

/* ── Week header row ── */
.tl-week-row .tl-label {
    background: var(--surface-chrome);
    border-bottom: 1px solid var(--ink-line);
}

.tl-week-header {
    text-align: center;
    font-weight: 700;
    font-size: 0.72rem;
    padding: 8px 4px;
    color: var(--accent);
    border-bottom: 1px solid var(--ink-line);
    background: var(--surface-chrome);
}

/* ── Day header cells ── */
.tl-day-header {
    text-align: center;
    font-weight: 600;
    font-size: 0.62rem;
    padding: 6px 2px;
    min-width: 62px;
    max-width: 62px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid var(--ink-line);
    background: var(--surface-chrome);
    line-height: 1.3;
}

/* ── Data rows ── */
.rtp-timeline tbody tr {
    transition: background 0.15s;
}

.rtp-timeline tbody tr:nth-child(even) {
    background: var(--ink-zebra);
}

.rtp-timeline tbody tr:nth-child(odd) {
    background: var(--ink-zebra);
}

.rtp-timeline tbody tr:hover {
    background: var(--ink-wash);
}

.rtp-timeline tbody tr:hover .tl-label {
    background: var(--ink-wash);
}

/* ── Data cells ── */
.tl-cell {
    text-align: center;
    padding: 6px 4px;
    border-bottom: 1px solid var(--ink-line);
    border-right: 1px solid var(--ink-line);
    min-width: 90px;
    max-width: 110px;
    font-variant-numeric: tabular-nums;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.76rem;
}

.tl-empty {
    color: var(--text-tertiary);
}

/* ── Status cells ── */
.tl-status-unavail {
    background: rgba(231, 76, 60, 0.15);
    color: var(--rtp-status-red);
    font-weight: 600;
    font-size: 0.62rem;
}

.tl-status-avail {
    background: rgba(46, 204, 113, 0.1);
    color: var(--rtp-status-green);
    font-weight: 600;
    font-size: 0.62rem;
}

/* ── Spacer rows ── */
.tl-spacer td {
    height: 8px;
    border-bottom: 2px solid var(--ink-line);
    background: transparent !important;
}

/* ── Phase cells (Palermo palette) ── */
.tl-phase {
    font-weight: 700;
    font-size: 0.62rem;
}

.tl-phase-1 {
    background: rgba(var(--brand-rosa-palermo-rgb), 0.45);
    color: var(--white);
    font-weight: 600;
}

.tl-phase-2 {
    background: rgba(var(--brand-rosa-ton-rgb), 0.5);
    color: var(--white);
    font-weight: 600;
}

.tl-phase-3 {
    background: rgba(var(--brand-rosa-ton-rgb), 0.72);
    color: var(--white);
    font-weight: 600;
}

.tl-phase-4 {
    background: rgba(3, 100, 115, 0.6);
    color: var(--rtp-phase-cyan);
    font-weight: 600;
}

.tl-plan {
    cursor: pointer;
    background: rgba(var(--accent-rgb), 0.08);
    color: var(--text-primary);
    font-size: 0.6rem;
    max-width: 62px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tl-plan:hover {
    background: rgba(var(--accent-rgb), 0.2);
}

.tl-plan-empty {
    cursor: pointer;
    color: var(--accent);
    font-size: 0.7rem;
    font-weight: 600;
    opacity: 0.4;
}

.tl-plan-empty:hover {
    opacity: 1;
    background: rgba(var(--accent-rgb), 0.08);
}

.tl-return-near {
    color: var(--rtp-status-green);
    font-weight: 700;
}

.tl-test-green {
    background: rgba(46, 204, 113, 0.2);
    color: var(--rtp-status-green);
    font-weight: 600;
}

.tl-test-yellow {
    background: rgba(241, 196, 15, 0.2);
    color: var(--rtp-test-yellow);
    font-weight: 600;
}

.tl-test-red {
    background: rgba(231, 76, 60, 0.2);
    color: var(--rtp-status-red);
    font-weight: 600;
}

.tl-gps {
    color: var(--text-primary);
}

.tl-spacer td {
    height: 6px;
    padding: 0;
    border: none;
    background: var(--ink-zebra);
}

.tl-placeholder-row .tl-label {
    color: var(--text-secondary);
    font-style: italic;
}

.tl-placeholder-row .tl-empty {
    color: var(--text-secondary);
    font-size: 0.6rem;
}

.rtp-timeline-wrap::-webkit-scrollbar {
    height: 6px;
}

.rtp-timeline-wrap::-webkit-scrollbar-track {
    background: var(--ink-zebra);
}

.rtp-timeline-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.25);
    border-radius: var(--radius-3);
}

.rtp-timeline-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-rgb), 0.4);
}

/* ── Timeline Board (RTP planning board renderer) ── */

.rtp-timeline-board-wrap {
    overflow: auto;
    max-width: 100%;
    max-height: calc(100vh - 190px);
    border-color: var(--ink-line);
    background: var(--surface-chrome);
}

.rtp-timeline-empty {
    padding: 28px;
    color: var(--text-secondary);
    text-align: center;
}

.rtp-timeline-board {
    --rtp-tl-label-width: 160px;
    --rtp-tl-day-width: 136px;
    min-width: 100%;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
}

.rtp-tl-grid {
    display: grid;
    min-width: calc(var(--rtp-tl-label-width) + (var(--rtp-tl-day-count) * var(--rtp-tl-day-width)));
    grid-template-columns: var(--rtp-tl-label-width) repeat(var(--rtp-tl-day-count), minmax(var(--rtp-tl-day-width), 1fr));
}

.rtp-tl-corner,
.rtp-tl-row-label {
    position: sticky;
    left: 0;
    z-index: 3;
    border-right: 2px solid var(--ink-line);
    background: var(--surface-chrome);
}

.rtp-tl-date-row {
    position: sticky;
    top: 0;
    z-index: 7;
}

.rtp-tl-corner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 56px;
    padding: 8px 12px;
    border-bottom: 2px solid var(--ink-line);
}

.rtp-tl-corner span {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rtp-tl-corner small {
    margin-top: 3px;
    font-size: 0.66rem;
    color: var(--text-secondary);
}

.rtp-tl-date-cell {
    min-height: 56px;
    padding: 7px 8px 5px;
    border-right: 1px solid var(--ink-line);
    border-bottom: 2px solid var(--ink-line);
    background: var(--surface-chrome);
    cursor: pointer;
}

.rtp-tl-date-cell:hover,
.rtp-tl-date-cell.is-selected {
    background: rgba(var(--accent-rgb), 0.11);
}

.rtp-tl-date-cell.is-selected {
    box-shadow: inset 0 -2px 0 var(--accent);
}

.rtp-tl-date-top {
    display: flex;
    align-items: center;
    gap: 6px;
}

.rtp-tl-date-main {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
}

.rtp-tl-phase-badge {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 5px;
    border-radius: var(--radius-pill);
    line-height: 1.3;
    white-space: nowrap;
    color: var(--crit-pending);
    background: var(--accent-soft);
}

.rtp-tl-phase-badge.phase-4 {
    color: var(--accent-teal);
    background: color-mix(in srgb, var(--accent-teal) 14%, transparent);
}

.rtp-tl-date-sub,
.rtp-tl-date-meta {
    margin-top: 1px;
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.rtp-tl-markers {
    display: flex;
    gap: 4px;
    margin-top: 4px;
}

.rtp-tl-marker {
    width: 6px;
    height: 6px;
    border-radius: var(--radius-circle);
    display: inline-block;
}

.rtp-tl-marker.plan { background: var(--rtp-marker-plan); }
.rtp-tl-marker.gps { background: var(--rtp-marker-gps); }
.rtp-tl-marker.fb { background: var(--rtp-phase-cyan); }
.rtp-tl-marker.test { background: var(--rtp-marker-test); }
.rtp-tl-marker.exit-criteria { background: var(--accent); }

.rtp-tl-row-label {
    display: flex;
    align-items: center;
    min-height: 34px;
    padding: 6px 12px;
    font-size: 0.64rem;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.rtp-tl-phase-row {
    position: relative;
    z-index: 4;
    min-height: 36px;
}

.rtp-tl-phase-cell {
    min-height: 24px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 5px 0;
    border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--ink-line));
    background: color-mix(in srgb, var(--accent) 9%, var(--surface-recess));
    color: var(--crit-pending);
    font-size: 0.6rem;
    font-weight: 700;
}

.rtp-tl-phase-cell.phase-4 {
    border-color: color-mix(in srgb, var(--accent-teal) 28%, var(--ink-line));
    background: color-mix(in srgb, var(--accent-teal) 9%, var(--surface-recess));
    color: var(--accent-teal);
}

.rtp-tl-phase-cell small {
    display: block;
    font-size: 0.54rem;
    font-weight: 700;
    color: var(--text-tertiary);
    opacity: 1;
}

.rtp-tl-phase-cell.is-empty {
    margin: 0;
    border-color: var(--ink-line);
    background: color-mix(in srgb, var(--text-primary) 2%, transparent);
}

.rtp-tl-phase-cell.phase-start {
    margin-left: 8px;
    border-top-left-radius: var(--radius-pill);
    border-bottom-left-radius: var(--radius-pill);
}

.rtp-tl-phase-cell.phase-end {
    margin-right: 8px;
    border-top-right-radius: var(--radius-pill);
    border-bottom-right-radius: var(--radius-pill);
}

.rtp-tl-phase-cell.continues-left {
    border-left-color: transparent;
}

.rtp-tl-phase-cell.continues-right {
    border-right-color: transparent;
}

.rtp-tl-section-header {
    position: relative;
    z-index: 2;
    min-height: 36px;
    border-top: 1px solid var(--ink-line);
    border-bottom: 1px solid var(--ink-line);
    background: var(--surface-chrome);
}

.rtp-tl-section-toggle {
    position: sticky;
    left: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    gap: 6px;
    width: var(--rtp-tl-label-width);
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-right: 2px solid var(--ink-line-strong);
    background: var(--surface-chrome);
    color: var(--accent);
    font-family: 'Inter', sans-serif;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
}

.rtp-tl-section-toggle:hover {
    background: var(--ink-wash);
}

.rtp-tl-section-caret {
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.18s ease;
}

.rtp-tl-section-header.is-collapsed .rtp-tl-section-caret {
    transform: rotate(-45deg);
}

.rtp-tl-section-subtitle,
.rtp-tl-subheader-fill {
    grid-column: 2 / -1;
    display: flex;
    align-items: center;
    padding: 0 14px;
    color: var(--text-secondary);
    font-size: 0.68rem;
    background: var(--surface-chrome);
}

.rtp-tl-row {
    border-bottom: 1px solid var(--ink-line);
}

.rtp-tl-row:nth-of-type(even) .rtp-tl-cell,
.rtp-tl-row:nth-of-type(even) .rtp-tl-row-label {
    background-color: var(--ink-zebra);
}

.rtp-tl-cell {
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px 6px;
    border-right: 1px solid var(--ink-line);
    color: var(--text-primary);
    font-size: 0.72rem;
    font-variant-numeric: tabular-nums;
    line-height: 1.25;
    overflow: hidden;
}

.rtp-tl-cell.is-empty {
    background: transparent;
    color: var(--text-tertiary);
}

.rtp-tl-plan-cell {
    position: relative;
    align-items: flex-start;
    justify-content: flex-start;
    min-height: 48px;
    max-height: 80px;
    padding: 5px 7px;
    text-align: left;
    white-space: normal;
    overflow: hidden;
    cursor: default;
}

.rtp-tl-plan-cell.has-content {
    cursor: pointer;
}

.rtp-tl-plan-cell.has-content::after {
    display: none;
}

.rtp-tl-plan-cell.has-content:hover {
    filter: brightness(1.08);
}

.rtp-tl-plan-cell.is-empty[role="button"] {
    cursor: pointer;
}

.rtp-tl-add-hint {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-size: 1rem;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.rtp-tl-plan-cell.is-empty[role="button"]:hover .rtp-tl-add-hint,
.rtp-tl-plan-cell.is-empty[role="button"]:focus .rtp-tl-add-hint {
    opacity: 0.85;
    background: rgba(var(--accent-rgb), 0.06);
}

.rtp-tl-plan-item + .rtp-tl-plan-item {
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid var(--ink-line);
}

.rtp-tl-plan-cat {
    display: inline-flex;
    max-width: 100%;
    margin-bottom: 2px;
    padding: 1px 5px;
    border-radius: var(--radius-3);
    background: var(--ink-wash);
    color: var(--text-secondary);
    font-size: 0.54rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

.rtp-tl-plan-text {
    display: block;
    color: var(--text-primary);
    font-size: 0.68rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.rtp-tl-daytype {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 3px 8px;
    border-radius: var(--rtp-radius-5);
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    font-weight: 800;
    font-size: 0.68rem;
}

.rtp-tl-status-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: var(--radius-4);
    font-size: 0.6rem;
    font-weight: 700;
}

.rtp-tl-status-pill.status-unavailable {
    color: var(--rtp-tl-red);
    background: rgba(231, 76, 60, 0.15);
}

.rtp-tl-status-pill.status-available {
    color: var(--rtp-tl-green);
    background: rgba(46, 204, 113, 0.12);
}

.rtp-tl-value-cell {
    gap: 6px;
}

.rtp-tl-value-cell.external {
    color: var(--text-primary);
}

.rtp-tl-value-cell.internal {
    color: var(--text-primary);
}

.rtp-tl-value {
    font-weight: 600;
}

.rtp-tl-value.band-easy,
.rtp-tl-value.band-moderate,
.rtp-tl-value.band-hard {
    padding: 2px 6px;
    border-radius: var(--radius-4);
    font-weight: 700;
}

.rtp-tl-value.band-easy {
    background: rgba(82, 183, 136, 0.15);
    color: var(--rtp-tl-green);
}

.rtp-tl-value.band-moderate {
    background: rgba(241, 196, 15, 0.15);
    color: var(--rtp-tl-yellow);
}

.rtp-tl-value.band-hard {
    background: rgba(231, 76, 60, 0.17);
    color: var(--rtp-tl-red);
}

.rtp-tl-subheader-row {
    min-height: 34px;
    border-top: 1px solid var(--ink-line);
    border-bottom: 1px solid var(--ink-line);
}

.rtp-tl-subheader-row .rtp-tl-row-label {
    color: var(--text-secondary);
    background: var(--surface-chrome);
}

.rtp-tl-subheader-fill {
    min-height: 34px;
    background: var(--surface-chrome);
}

.rtp-tl-acwr {
    font-size: 0.6rem;
    font-weight: 600;
    margin-left: 2px;
}

.rtp-tl-acwr.low { color: var(--rtp-tl-blue); }
.rtp-tl-acwr.ok { color: var(--rtp-tl-green); }
.rtp-tl-acwr.moderate { color: var(--rtp-tl-yellow); }
.rtp-tl-acwr.high { color: var(--rtp-tl-red); }

.rtp-tl-test-cell {
    flex-direction: column;
    gap: 2px;
    font-weight: 800;
}

.rtp-tl-value.test-green,
.rtp-tl-value.test-yellow,
.rtp-tl-value.test-red {
    padding: 2px 6px;
    border-radius: var(--radius-4);
    font-weight: 700;
}

.rtp-tl-value.test-green {
    background: rgba(46, 204, 113, 0.15);
    color: var(--rtp-tl-green);
}

.rtp-tl-value.test-yellow {
    background: rgba(241, 196, 15, 0.15);
    color: var(--rtp-tl-yellow);
}

.rtp-tl-value.test-red {
    background: rgba(231, 76, 60, 0.15);
    color: var(--rtp-tl-red);
}

.rtp-tl-change {
    font-size: 0.6rem;
    color: var(--text-secondary);
}

.rtp-tl-row.is-collapsed-row,
.rtp-tl-subheader-row.is-collapsed-row {
    display: none;
}

.rtp-timeline-board-wrap::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.rtp-timeline-board-wrap::-webkit-scrollbar-track {
    background: var(--ink-wash);
}

.rtp-timeline-board-wrap::-webkit-scrollbar-thumb {
    background: rgba(var(--accent-rgb), 0.26);
    border-radius: var(--radius-4);
}

.rtp-timeline-board-wrap::-webkit-scrollbar-thumb:hover {
    background: rgba(var(--accent-rgb), 0.44);
}

@media (max-width: 900px) {
    .rtp-ec-template-form,
    .rtp-ec-template-add-form,
    .rtp-ec-template-card-grid {
        grid-template-columns: 1fr;
    }

    .rtp-ec-template-builder summary {
        align-items: flex-start;
        flex-direction: column;
    }

    .rtp-ec-inline-confirm,
    .rtp-ec-inline-confirm-fields {
        grid-template-columns: 1fr;
        justify-items: stretch;
    }

    .rtp-timeline-board {
        --rtp-tl-label-width: 140px;
        --rtp-tl-day-width: 120px;
    }

    .rtp-tl-section-toggle {
        width: var(--rtp-tl-label-width);
        font-size: 0.62rem;
    }
}


/* ═══════════════════════════════════════
   UPLOAD INJURY — Button & Modal
   ═══════════════════════════════════════ */

.rtp-upload-injury-btn {
    background: transparent;
    border: 1px solid var(--ink-line-strong);
    color: var(--text-secondary);
    padding: 6px 14px;
    border-radius: var(--radius-pill);
    cursor: pointer;
    font-size: 0.75rem;
    font-family: inherit;
    font-weight: 700;
    transition: all 0.2s;
}

.rtp-upload-injury-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

/* Modal overlay */
.rtp-injury-upload-modal {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: rtp-modal-fade 0.2s;
}

/* Modal inner container */
.rtp-injury-modal-inner {
    background: var(--surface-chrome);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-md);
    width: 90%;
    max-width: 640px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: var(--shadow-modal);
}

/* Modal header */
.rtp-injury-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--ink-line-strong);
}

.rtp-injury-modal-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.rtp-injury-modal-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.3rem;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.rtp-injury-modal-close:hover {
    color: var(--text-primary);
}

.rtp-exit-criteria-modal {
    align-items: flex-start;
    padding: 28px 18px;
    overflow-y: auto;
}

.rtp-exit-criteria-modal-inner {
    max-width: min(980px, 96vw);
    max-height: none;
}

.rtp-exit-criteria-modal-body {
    padding: 20px 24px 24px;
}

.ec-overlay.rtp-exit-criteria-modal {
    position: fixed;
    inset: 0;
    z-index: 1200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    overflow: hidden;
    background: color-mix(in srgb, var(--surface-recess) 66%, transparent);
    backdrop-filter: blur(3px);
}

.ec-dialog {
    width: min(1060px, 96vw);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    font-family: 'Inter', sans-serif;
    background: var(--surface-raised);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-modal);
}

.ec-dialog button,
.ec-dialog input,
.ec-dialog select {
    font-family: inherit;
}

.ec-head {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    padding: 22px 26px 20px;
    border-bottom: 1px solid var(--ink-line);
}

.ec-head .htitle {
    flex: 1;
    min-width: 0;
}

.ec-eyebrow,
.ec-head h2,
.ec-overall .lab,
.ec-rail-lab,
.ec-pchip .pname,
.ec-pchip .pstate,
.ec-phasehead .pt,
.ec-ring .rl,
.ec-cat-head .cn,
.ec-tag,
.ec-confirm,
.ec-confirmed,
.ec-addrow,
.ec-empty .et,
.ec-btn,
.ec-template-title {
    font-weight: 700;
    text-transform: uppercase;
}

.ec-eyebrow {
    color: var(--text-tertiary);
    font-size: 0.68rem;
    letter-spacing: 0.18em;
}

.ec-head h2 {
    margin: 5px 0 0;
    color: var(--text-primary);
    font-size: 1.45rem;
    line-height: 1.05;
    letter-spacing: 0.08em;
}

.ec-head .hsub {
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 0.78rem;
}

.ec-headright {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ec-overall {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 15px;
    background: var(--surface-recess);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
}

.ec-overall .num,
.ec-ring .rt {
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    line-height: 1;
}

.ec-overall .num {
    font-size: 1.45rem;
}

.ec-overall .num .den,
.ec-ring .rt .den {
    color: var(--text-tertiary);
    font-weight: 600;
}

.ec-overall .num .den {
    font-size: 1rem;
}

.ec-overall .lab {
    color: var(--text-tertiary);
    font-size: 0.6rem;
    line-height: 1.3;
    letter-spacing: 0.12em;
}

.ec-overall .lab b {
    display: block;
    color: var(--accent);
    font-weight: 400;
}

.ec-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
}

.ec-close:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.ec-close svg {
    width: 16px;
    height: 16px;
}

.ec-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.ec-rail {
    width: 236px;
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px;
    overflow-y: auto;
    background: var(--surface-recess);
    border-right: 1px solid var(--ink-line);
}

.ec-rail-lab {
    padding: 4px 6px 6px;
    color: var(--text-tertiary);
    font-size: 0.62rem;
    letter-spacing: 0.14em;
}

.ec-pchip {
    display: flex;
    flex-direction: column;
    gap: 9px;
    padding: 12px 13px;
    text-align: left;
    background: var(--surface-raised);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-md);
}

.ec-pchip:hover:not(:disabled) {
    border-color: var(--text-secondary);
}

.ec-pchip.on {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.ec-pchip:disabled {
    cursor: default;
}

.ec-pchip.locked {
    opacity: 0.5;
}

.ec-pchip-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.ec-pchip .pname {
    color: var(--text-primary);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.ec-pchip.locked .pname {
    color: var(--text-tertiary);
}

.ec-pchip .pstate {
    padding: 3px 8px;
    color: var(--text-tertiary);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-pill);
    font-size: 0.56rem;
    letter-spacing: 0.1em;
}

.ec-pchip.on .pstate.active,
.ec-pchip.on .pstate.empty {
    color: var(--accent);
    border-color: var(--accent);
}

.ec-pchip .pstate.met {
    color: var(--success);
    border-color: color-mix(in srgb, var(--success) 52%, var(--ink-line-strong));
}

.ec-pchip .pmeta,
.ec-pchip .pempty {
    color: var(--text-secondary);
    font-size: 0.7rem;
}

.ec-pchip .pmeta {
    font-variant-numeric: tabular-nums;
}

.ec-pchip .pempty {
    color: var(--text-tertiary);
    font-style: italic;
}

.ec-pbar {
    height: 4px;
    overflow: hidden;
    background: var(--ink-line);
    border-radius: var(--radius-pill);
}

.ec-pbar i {
    display: block;
    height: 100%;
    background: var(--accent);
    border-radius: var(--radius-pill);
}

.ec-pbar i.full {
    background: var(--success);
}

.ec-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ec-phasehead {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 20px 26px 16px;
    border-bottom: 1px solid var(--ink-line);
}

.ec-phasehead .pt {
    color: var(--text-primary);
    font-size: 1.15rem;
    letter-spacing: 0.08em;
}

.ec-phasehead .pm {
    margin-top: 4px;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
}

.ec-phasehead .pm b {
    color: var(--accent);
    font-weight: 600;
}

.ec-ring {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ec-ring .rt {
    font-size: 1.25rem;
}

.ec-ring .rt .den {
    font-size: 0.88rem;
}

.ec-ring .rl {
    color: var(--text-tertiary);
    font-size: 0.56rem;
    line-height: 1.3;
    letter-spacing: 0.12em;
}

.ec-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 26px 8px;
}

.ec-cat {
    margin-bottom: 22px;
}

.ec-cat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.ec-cat-head .cn {
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.ec-cat-head .cc {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
}

.ec-cat-head .line {
    flex: 1;
    height: 1px;
    background: var(--ink-line);
}

.ec-crit {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    margin-bottom: 8px;
    background: var(--surface-recess);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-md);
}

.ec-crit.met {
    background: rgba(var(--success-rgb), 0.06);
    border-color: rgba(var(--success-rgb), 0.42);
}

.ec-check {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 1px;
    color: transparent;
    border: 2px solid var(--ink-line);
    border-radius: var(--radius-pill);
}

.ec-crit.met .ec-check {
    color: var(--text-inverse);
    background: var(--success);
    border-color: var(--success);
}

.ec-check svg {
    width: 13px;
    height: 13px;
}

.ec-crit-body {
    flex: 1;
    min-width: 0;
}

.ec-crit-text {
    color: var(--text-primary);
    font-size: 0.88rem;
    line-height: 1.35;
}

.ec-crit.met .ec-crit-text {
    color: var(--text-secondary);
}

.ec-crit-note {
    margin-top: 3px;
    color: var(--text-tertiary);
    font-size: 0.75rem;
    line-height: 1.4;
}

.ec-crit-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 9px;
}

.ec-tag {
    padding: 3px 9px;
    color: var(--text-tertiary);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    font-size: 0.6rem;
    letter-spacing: 0.07em;
}

.ec-tag.req {
    color: var(--accent);
    border-color: color-mix(in srgb, var(--accent) 42%, var(--ink-line));
}

.ec-tag.status {
    color: var(--text-secondary);
}

.ec-crit-action {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    margin-top: 1px;
}

.ec-confirm {
    min-height: 34px;
    padding: 8px 16px;
    color: var(--accent);
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--accent);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
}

.ec-confirm:hover:not(:disabled) {
    color: var(--text-inverse);
    background: var(--accent);
}

.ec-confirm:disabled {
    color: var(--text-disabled);
    border-color: var(--ink-line);
    cursor: not-allowed;
}

.ec-confirmed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 0.62rem;
    letter-spacing: 0.06em;
}

.ec-confirmed svg {
    width: 13px;
    height: 13px;
}

.ec-row-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 5px;
}

.ec-row-tool {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 28px;
    padding: 5px 9px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.07em;
    line-height: 1;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.ec-row-tool:hover {
    border-color: color-mix(in srgb, var(--text-primary) 22%, var(--ink-line));
    background: color-mix(in srgb, var(--text-primary) 6%, transparent);
    color: var(--text-primary);
}

.ec-row-tool.danger {
    color: var(--text-tertiary);
}

.ec-row-tool.danger:hover {
    border-color: color-mix(in srgb, var(--status-injured) 42%, var(--ink-line));
    background: color-mix(in srgb, var(--status-injured) 9%, transparent);
    color: var(--status-injured);
}

.ec-row-tool svg {
    width: 13px;
    height: 13px;
    flex: 0 0 auto;
}

.ec-undo {
    color: var(--text-tertiary);
    font-size: 0.7rem;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.ec-undo:hover {
    color: var(--text-secondary);
}

.ec-addrow {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    color: var(--text-tertiary);
    background: transparent;
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-md);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
}

.ec-addrow:hover {
    color: var(--accent);
    border-color: var(--accent);
}

.ec-addrow svg {
    width: 14px;
    height: 14px;
}

.ec-form {
    padding: 16px;
    margin-bottom: 8px;
    background: var(--accent-soft);
    border: 1px solid var(--accent);
    border-radius: var(--radius-md);
}

.ec-form .rtp-ec-editor {
    margin: 0;
    padding: 0;
    background: transparent;
    border: 0;
    border-radius: initial;
}

.ec-empty {
    padding: 48px 20px;
    color: var(--text-tertiary);
    text-align: center;
}

.ec-empty .et {
    color: var(--text-secondary);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
}

.ec-empty .es {
    margin-top: 6px;
    color: var(--text-tertiary);
    font-size: 0.78rem;
}

.ec-empty .ec-btn {
    margin-top: 18px;
}

.ec-locked-note {
    margin-bottom: 12px;
    padding: 10px 12px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-weight: 600;
    line-height: 1.4;
}

.ec-template-dock {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 14px;
    padding: 10px;
    background: var(--surface-recess);
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
}

.ec-template-dock[hidden] {
    display: none;
}

.ec-template-card {
    display: grid;
    grid-template-columns: minmax(190px, 0.74fr) minmax(0, 1.26fr);
    gap: 12px;
    align-items: start;
    min-width: 0;
    padding: 12px 14px;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-sm);
    background: color-mix(in srgb, var(--text-primary) 3%, transparent);
}

.ec-template-title {
    color: var(--text-primary);
    font-size: 0.78rem;
    letter-spacing: 0.1em;
}

.ec-template-sub {
    margin-top: 3px;
    color: var(--text-secondary);
    font-size: 0.72rem;
}

.ec-template-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(150px, 0.42fr) auto;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    min-width: 0;
}

.ec-template-actions .rtp-ec-template-select {
    min-width: 0;
    width: 100%;
}

.ec-template-actions .ec-template-target {
    min-width: 0;
}

.ec-template-actions .ec-btn {
    min-width: 86px;
    padding-left: 13px;
    padding-right: 13px;
}

.ec-template-card .rtp-ec-template-status,
.ec-template-card .rtp-ec-template-previews {
    grid-column: 1 / -1;
}

.ec-template-emptyline {
    min-width: 0;
    padding: 9px 10px;
    color: var(--text-secondary);
    background: var(--surface-field);
    border: 1px dashed var(--ink-line);
    border-radius: var(--radius-sm);
    font-size: 0.74rem;
    line-height: 1.35;
}

.ec-template-save-form {
    display: grid;
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr) auto;
    gap: 8px;
    align-items: end;
    min-width: 0;
}

.ec-template-save-form label,
.ec-template-save-form label span {
    display: block;
}

.ec-template-save-form label span {
    margin-bottom: 5px;
    color: var(--text-secondary);
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.ec-template-save-form input {
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    min-height: 38px;
    padding: 8px 10px;
    color: var(--text-primary);
    background: var(--surface-field);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    font-family: 'Inter', sans-serif;
    font-size: 0.78rem;
}

.ec-template-save-form input:disabled {
    color: var(--text-disabled);
}

.ec-template-save-form .ec-btn {
    min-width: 90px;
    padding-left: 13px;
    padding-right: 13px;
}

.ec-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    padding: 15px 26px;
    background: var(--surface-recess);
    border-top: 1px solid var(--ink-line);
}

.ec-btn {
    min-height: 38px;
    padding: 9px 17px;
    color: var(--text-secondary);
    white-space: nowrap;
    background: transparent;
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-pill);
    font-size: 0.7rem;
    letter-spacing: 0.07em;
}

.ec-btn:hover:not(:disabled),
.ec-btn.active {
    color: var(--accent);
    border-color: var(--accent);
}

.ec-btn:disabled {
    color: var(--text-disabled);
    border-color: var(--ink-line);
    cursor: not-allowed;
}

.ec-btn.primary {
    color: var(--text-inverse);
    background: var(--accent);
    border-color: var(--accent);
}

.ec-btn.primary:hover {
    color: var(--text-inverse);
    background: var(--accent-hover);
}

.ec-btn.ghost {
    border-style: dashed;
}

.ec-dialog .rtp-ec-inline-confirm {
    grid-template-columns: minmax(150px, 0.8fr) minmax(260px, 1.2fr);
}

@media (max-width: 820px) {
    .ec-overlay.rtp-exit-criteria-modal {
        align-items: flex-start;
        padding: 18px;
        overflow-y: auto;
    }

    .ec-dialog {
        max-height: none;
    }

    .ec-head,
    .ec-body,
    .ec-phasehead,
    .ec-foot {
        flex-direction: column;
    }

    .ec-template-card,
    .ec-template-save-form {
        grid-template-columns: 1fr;
    }

    .ec-template-actions {
        grid-template-columns: 1fr;
    }

    .ec-body {
        display: block;
    }

    .ec-rail {
        width: auto;
        max-height: 260px;
        border-right: 0;
        border-bottom: 1px solid var(--ink-line);
    }

    .ec-headright,
    .ec-foot,
    .ec-template-actions,
    .ec-template-save-form .ec-btn {
        width: 100%;
        align-items: stretch;
    }

    .ec-btn,
    .ec-template-actions .rtp-ec-template-select {
        width: 100%;
    }

    .rtp-ec-setup-grid,
    .rtp-ec-template-phase-grid,
    .rtp-ec-editor-grid,
    .rtp-ec-provider-steps {
        grid-template-columns: 1fr;
    }

    .rtp-ec-provider-target {
        grid-template-columns: 1fr 1fr auto;
    }
}

/* Modal body */
.rtp-injury-modal-body {
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* Form rows */
.rtp-injury-row {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: flex-end;
}

/* Form fields */
.rtp-injury-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 140px;
}

.rtp-injury-field label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-tertiary);
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.rtp-injury-field input,
.rtp-injury-field select {
    background: var(--surface-chrome);
    border: 1px solid var(--ink-line-strong);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    padding: 7px 10px;
    font-size: 0.8rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}

.rtp-injury-field input:focus,
.rtp-injury-field select:focus {
    border-color: var(--accent);
}

.rtp-injury-field input[type="date"] {
    cursor: pointer;
}

/* Optional fields toggle */
.rtp-injury-toggle-optional {
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 0.72rem;
    cursor: pointer;
    text-align: left;
    padding: 4px 0;
    font-family: inherit;
    transition: color 0.2s;
}

.rtp-injury-toggle-optional:hover {
    color: var(--text-primary);
}

/* Optional fields container */
.rtp-injury-optional {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding-top: 4px;
    border-top: 1px solid var(--ink-line);
}

/* Modal footer */
.rtp-injury-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 10px;
    border-top: 1px solid var(--ink-line);
}

#rtp-inj-status {
    font-size: 0.75rem;
    flex: 1;
}

/* Submit button */
.rtp-injury-submit-btn {
    padding: 8px 20px;
    font-size: 0.8rem;
    font-weight: 600;
    font-family: inherit;
    background: var(--accent);
    color: var(--surface-field);
    border: 1px solid var(--accent);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.rtp-injury-submit-btn:hover {
    background: var(--accent-hover);
}

.rtp-injury-submit-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* APP badge on player cards */
.rtp-card-app-badge {
    font-size: 0.55rem;
    font-weight: 700;
    padding: 1px 6px;
    border-radius: var(--radius-3);
    background: rgba(var(--accent-rgb), 0.15);
    color: var(--accent);
    letter-spacing: 0.5px;
    margin-left: 6px;
}

/* Edit / Resolve / Delete buttons in injury bar for app injuries */
.rtp-injury-action-btn {
    background: transparent;
    border: 1px solid var(--ink-line-strong);
    color: var(--text-tertiary);
    padding: 4px 12px;
    border-radius: var(--rtp-radius-5);
    cursor: pointer;
    font-size: 0.7rem;
    font-family: inherit;
    transition: all 0.2s;
    margin-left: 8px;
}

.rtp-injury-action-btn:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

.rtp-injury-action-btn.danger:hover {
    border-color: var(--rtp-danger-short);
    color: var(--rtp-danger-short);
}

/* Manage Injuries modal */
.rtp-manage-modal {
    position: fixed;
    inset: 0;
    background: var(--scrim);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: rtp-modal-fade 0.2s;
}

.rtp-manage-body {
    padding: 12px 20px 20px;
    max-height: 60vh;
    overflow-y: auto;
}

.rtp-manage-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--ink-line);
    font-size: 0.8rem;
}

.rtp-manage-row:last-child {
    border-bottom: none;
}

.rtp-manage-player {
    font-weight: 600;
    color: var(--text-primary);
    min-width: 130px;
}

.rtp-manage-diag {
    color: var(--text-secondary);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.rtp-manage-date {
    color: var(--text-tertiary);
    font-size: 0.75rem;
    min-width: 80px;
}

.rtp-manage-status {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    min-width: 60px;
}

.rtp-manage-status.active {
    color: var(--rtp-status-red);
}

.rtp-manage-status.resolved {
    color: var(--rtp-status-green);
}

.rtp-manage-actions {
    display: flex;
    gap: 6px;
    margin-left: auto;
    flex-shrink: 0;
}

/* ═══════════════════════════════════════
   RTP DAILY REPORT — Full-page modal
   ═══════════════════════════════════════ */

.rtp-report-icon {
    display: inline-flex;
    align-items: center;
    cursor: pointer;
    border: 1px solid var(--ink-line);
    border-radius: var(--radius-pill);
    padding: 1px 6px;
    font-size: 0.58rem;
    font-weight: 800;
    color: var(--text-secondary);
    opacity: 0.82;
    transition: color 0.15s, border-color 0.15s, opacity 0.15s;
    margin-left: 3px;
    vertical-align: middle;
}
.rtp-report-icon:hover {
    opacity: 1;
    color: var(--accent);
    border-color: var(--accent);
}

.rtp-report-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: var(--scrim);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 32px 16px;
}
.rtp-report-modal {
    position: relative;
    width: 100%;
    max-width: 1100px;
    background: var(--surface-chrome);
    border: 1px solid rgba(150,150,150,0.15);
    border-radius: var(--radius-md);
    padding: 32px 36px;
    color: var(--text-primary);
}
.rtp-report-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: var(--text-tertiary);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
}
.rtp-report-close:hover { color: var(--white); }

/* Header */
.rtp-rpt-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(150,150,150,0.2);
}
.rtp-rpt-title {
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.rtp-rpt-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* Metric Cards Grid */
.rtp-rpt-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.rtp-rpt-card {
    background: var(--surface-raised);
    border: 1px solid rgba(150,150,150,0.15);
    border-radius: var(--radius-md);
    padding: 12px 14px;
}
.rtp-rpt-card-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}
.rtp-rpt-card-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 8px;
}
.rtp-rpt-card-val {
    font-size: 1.4rem;
    font-weight: 700;
}
.rtp-rpt-pct {
    font-size: 0.75rem;
    font-weight: 600;
}
.rtp-rpt-spark {
    height: 45px;
}
.rtp-rpt-spark canvas {
    width: 100% !important;
    height: 100% !important;
}

/* Sections */
.rtp-rpt-section {
    margin-bottom: 24px;
}
.rtp-rpt-section-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(150,150,150,0.2);
}

/* Timeline table */
.rtp-rpt-table th {
    font-size: 0.7rem;
}
.rtp-rpt-table td {
    font-size: 0.78rem;
}

/* Exercise Plan */
.rtp-rpt-plan {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.rtp-rpt-plan-row {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 12px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(150,150,150,0.12);
}
.rtp-rpt-plan-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
}
.rtp-rpt-plan-val {
    font-size: 0.78rem;
    color: var(--text-primary);
    line-height: 1.4;
}
