header.theme-maternal {
    --header: #5c1346;
}

.start-panel.maternal {
    border-left-color: #5c1346;
}

.status-badge.active {
    background: #f3e5f5;
    color: #5c1346;
}

.cycle-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-top: 16px;
}

.cycle-box {
    padding: 14px;
    border-radius: 12px;
    background: var(--surface2);
    text-align: center;
}

.cycle-box strong {
    display: block;
    font-family: monospace;
    font-size: 28px;
    line-height: 1.1;
}

.cycle-box span {
    color: var(--muted);
    font-size: 12px;
}

.cycle-box.alert {
    background: var(--orange-light);
}

.cycle-box.danger {
    background: var(--red-light);
}

.shock-panel {
    text-align: center;
}

.shock-count {
    font-family: monospace;
    font-size: clamp(48px, 8vw, 84px);
    font-weight: 800;
    letter-spacing: -3px;
    color: #5c1346;
}

.shock-hint {
    min-height: 42px;
    margin: 8px 0 16px;
    color: var(--muted);
    font-size: 14px;
}

.shock-hint.ready {
    color: var(--orange);
    font-weight: 700;
}

.rhythm-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.rhythm-grid button.active-shockable {
    background: var(--red);
    color: white;
    border-color: var(--red);
}

.rhythm-grid button.active-asystole {
    background: #263238;
    color: white;
    border-color: #263238;
}

.rhythm-grid button.active-rosc {
    background: var(--green);
    color: white;
    border-color: var(--green);
}

.ecmo-banner {
    display: none;
    background: var(--red-light);
    border: 1px solid #ef9a9a;
    color: var(--red);
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-weight: 700;
}

.ecmo-banner.visible {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.extraction-banner {
    background: #fce4ec;
    border-color: #f48fb1;
    color: #880e4f;
}

.med-card.adrenaline {
    background: #fff3e0;
    border-color: #ffcc80;
}

.med-card.adrenaline .med-time {
    color: var(--orange);
}

.med-card.amio {
    background: #f3e5f5;
    border-color: #ce93d8;
}

.med-card.amio .med-time {
    color: #5c1346;
}

.care-team-header,
.care-team-row {
    grid-template-columns: minmax(140px, 200px) minmax(0, 1fr) auto auto;
}

.care-team-role {
    font-size: 13px;
    line-height: 1.3;
    padding-right: 8px;
}

.care-team-row .role-input {
    width: 100%;
    min-height: 42px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: #fafbfc;
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    padding: 8px 10px;
}

.care-team-row .role-input:focus {
    outline: none;
    border-color: var(--blue);
    background: white;
    box-shadow: 0 0 0 3px rgba(21, 101, 192, .10);
}

.care-team-remove {
    padding: 6px 8px;
    font-size: 12px;
    color: var(--red);
    background: var(--red-light);
    border-color: #ef9a9a;
}

.kit-box {
    margin-top: 14px;
    padding: 12px 14px;
    background: var(--surface2);
    border-radius: 10px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.kit-box strong {
    display: block;
    margin-bottom: 4px;
    color: var(--text);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.etiology-table-wrapper {
    overflow-x: auto;
}

.etiology-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.etiology-table th,
.etiology-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}

.etiology-table th {
    color: var(--muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.etiology-table td:first-child {
    font-weight: 800;
    white-space: nowrap;
}

.timeline.timeline-board {
    border-left: 0;
    padding-left: 0;
    overflow-x: auto;
    overflow-y: visible;
    min-height: 420px;
    overflow-anchor: none;
}

.timeline-lanes {
    min-height: 378px;
}

.timeline-axis-row,
.timeline-lane {
    display: grid;
    grid-template-columns: 168px 1fr;
    align-items: stretch;
    min-width: 640px;
}

.timeline-label-spacer,
.timeline-lane-label {
    padding: 8px 10px 8px 0;
    font-size: 11px;
    font-weight: 800;
    line-height: 1.3;
    color: var(--muted);
}

.timeline-lane-label {
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border);
}

.timeline-lane-track {
    position: relative;
    min-height: 42px;
    padding: 6px 0 2px;
    border-bottom: 1px solid var(--border);
    background: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, .02) 50%);
}

.timeline-lane-track .timeline-event-row {
    position: relative;
    margin: 0 0 8px;
    height: 32px;
}

.journal-card:not(.is-open) .card-title {
    margin-bottom: 0;
}

button.journal-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    background: none;
    border: 0;
    text-align: left;
    font-weight: inherit;
}

button.journal-toggle:hover {
    opacity: 1;
}

button.journal-toggle:active {
    transform: none;
}

.journal-toggle-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.journal-toggle-title {
    font-size: 17px;
    font-weight: 700;
}

.journal-chevron {
    width: 22px;
    height: 22px;
    flex: 0 0 22px;
    border-radius: 6px;
    background: var(--surface2);
    border: 1px solid var(--border);
    position: relative;
}

.journal-chevron::before {
    content: "";
    position: absolute;
    top: 6px;
    left: 8px;
    width: 6px;
    height: 6px;
    border-right: 2px solid var(--muted);
    border-bottom: 2px solid var(--muted);
    transform: rotate(-45deg);
}

.journal-card.is-open .journal-chevron::before {
    top: 5px;
    left: 7px;
    transform: rotate(45deg);
}

@media (max-width: 850px) {
    .rhythm-grid {
        grid-template-columns: 1fr;
    }

    .cycle-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .etiology-table td:first-child {
        white-space: normal;
    }
}

@media (max-width: 600px) {
    .cycle-grid {
        gap: 8px;
    }

    .cycle-box {
        padding: 10px 6px;
    }

    .cycle-box strong {
        font-size: 22px;
    }

    .cycle-box span {
        font-size: 11px;
    }

    .ecmo-banner.visible {
        flex-direction: column;
        align-items: stretch;
    }

    .ecmo-banner button {
        width: 100%;
    }

    .care-team-header,
    .care-team-row {
        grid-template-columns: minmax(88px, 120px) minmax(0, 1fr) auto auto;
    }

    .care-team-header > div,
    .care-team-row > div,
    .care-team-row > input {
        padding: 8px;
    }

    .care-team-role,
    .care-team-row .role-input {
        font-size: 12px;
    }

    .timeline.timeline-board {
        min-height: 320px;
    }

    .timeline-axis-row,
    .timeline-lane {
        grid-template-columns: 88px 1fr;
        min-width: 420px;
    }

    .timeline-lane-label {
        font-size: 10px;
        padding-right: 6px;
    }

    button.journal-toggle {
        min-width: 0;
        flex: 1;
    }
}
