.login-threat-panel {
    display: grid;
    gap: 18px;
    border-color: rgba(255, 255, 255, 0.12);
}

.login-threat-panel.severity-danger {
    border-color: rgba(217, 45, 32, 0.38);
}

.login-threat-panel.severity-warning {
    border-color: rgba(240, 214, 91, 0.36);
}

.login-threat-status {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    color: #f7f3eb;
    font-weight: 850;
    background: rgba(255, 255, 255, 0.05);
}

.login-threat-summary-grid,
.login-threat-grid {
    display: grid;
    gap: 14px;
}

.login-threat-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

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

.login-threat-stat,
.login-threat-list,
.login-threat-row {
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.035);
    color: #f7f3eb;
}

.login-threat-stat {
    display: grid;
    align-content: start;
    gap: 8px;
    min-height: 132px;
    padding: 18px;
    border-radius: 22px;
}

.login-threat-stat span,
.login-threat-row span {
    color: rgba(247, 243, 235, 0.64);
    font-size: 0.76rem;
    font-weight: 850;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.login-threat-stat strong {
    color: #f7f3eb;
    font-size: clamp(1.55rem, 2.5vw, 2.1rem);
    line-height: 1;
    word-break: break-word;
}

.login-threat-stat small,
.login-threat-row small {
    color: rgba(247, 243, 235, 0.62);
    line-height: 1.35;
}

.login-threat-chart {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: end;
    gap: 8px;
    min-height: 190px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    background: rgba(0, 0, 0, 0.12);
}

.login-threat-bar-wrap {
    display: grid;
    grid-template-rows: minmax(92px, 1fr) auto auto;
    align-items: end;
    gap: 6px;
    min-width: 0;
    text-align: center;
}

.login-threat-bar {
    display: block;
    width: 100%;
    height: var(--bar-level, 4%);
    min-height: 4px;
    border-radius: 10px 10px 4px 4px;
    background: linear-gradient(180deg, rgba(217, 45, 32, 0.95), rgba(240, 214, 91, 0.72));
}

.login-threat-bar-wrap span,
.login-threat-bar-wrap strong {
    overflow: hidden;
    color: rgba(247, 243, 235, 0.62);
    font-size: 0.68rem;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-threat-bar-wrap strong {
    color: #f7f3eb;
}

.login-threat-list {
    display: grid;
    align-content: start;
    gap: 10px;
    padding: 16px;
    border-radius: 24px;
}

.login-threat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px;
    border-radius: 18px;
}

.login-threat-row div {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.login-threat-row strong,
.login-threat-row small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.login-threat-row em {
    flex: 0 0 auto;
    color: rgba(247, 243, 235, 0.7);
    font-size: 0.78rem;
    font-style: normal;
    font-weight: 850;
}

.login-threat-row.is-locked {
    border-color: rgba(217, 45, 32, 0.38);
    background: rgba(217, 45, 32, 0.12);
}

.workout-clean-shell:has(#client-custom-workout-form) > .minimal-action-row:first-child,
.workout-clean-shell:has([data-workout-draft-key="custom-running-workout"]) > .minimal-action-row:first-child {
    justify-content: flex-end !important;
}

.workout-clean-shell:has(#client-custom-workout-form) > .minimal-action-row:first-child .badge-row,
.workout-clean-shell:has([data-workout-draft-key="custom-running-workout"]) > .minimal-action-row:first-child .badge-row,
.workout-clean-shell:has(#client-custom-workout-form) > .minimal-action-row:first-child a[href$="/my-history"],
.workout-clean-shell:has([data-workout-draft-key="custom-running-workout"]) > .minimal-action-row:first-child a[href$="/my-history"] {
    display: none !important;
}

.running-summary-grid select,
.running-segment-fields select,
.running-summary-grid output.running-calculated-speed,
.running-segment-fields output.running-calculated-speed {
    min-height: 38px;
    width: 100%;
    border: 1px solid var(--border, rgba(255, 255, 255, 0.14));
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.2);
    color: #f7f3eb;
    font: inherit;
    font-weight: 750;
    line-height: 1.2;
}

.running-summary-grid select,
.running-segment-fields select {
    min-width: 0;
    padding: 8px 10px;
    appearance: auto;
}

.running-summary-grid output.running-calculated-speed,
.running-segment-fields output.running-calculated-speed {
    display: flex;
    align-items: center;
    padding: 8px 10px;
    color: rgba(247, 243, 235, 0.86);
}

.running-segment-fields [data-segment-name] {
    grid-column: span 2;
}

.running-workout-shell,
.running-workout-form {
    color: #f7f3eb;
}

.running-workout-form input,
.running-workout-form select,
.running-workout-form textarea,
.running-workout-form output.running-calculated-speed {
    color: #fffaf0 !important;
    caret-color: #fffaf0;
    font-weight: 650 !important;
    text-shadow: none;
}

.running-workout-form input::placeholder,
.running-workout-form textarea::placeholder {
    color: rgba(247, 243, 235, 0.62) !important;
    opacity: 1;
}

.running-workout-form select option {
    background: #121212;
    color: #fffaf0;
}

.running-workout-form input[type="date"] {
    color-scheme: dark;
}

.running-workout-form .running-summary-card > div strong,
.running-workout-form .running-segment-head strong,
.running-workout-form .running-segment-title strong,
.running-workout-form .running-title-card h2 {
    color: #fffaf0;
    font-weight: 760;
}

.running-workout-form .running-summary-card > div p,
.running-workout-form .running-segment-head span,
.running-workout-form .running-title-card p,
.running-workout-form .running-title-card span {
    color: rgba(247, 243, 235, 0.72);
    font-weight: 650;
}

.running-workout-form .running-summary-grid span,
.running-workout-form .running-feedback-grid span {
    color: rgba(247, 243, 235, 0.7);
    font-weight: 650;
}

.running-workout-form .running-segment-fields input,
.running-workout-form .running-segment-fields select,
.running-workout-form .running-segment-fields output.running-calculated-speed {
    min-height: 44px;
    background: rgba(0, 0, 0, 0.26);
}

.running-workout-form .workout-clean-bottom {
    margin-top: 24px;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.045);
}

.running-workout-form .running-bottom-nav {
    display: grid;
    grid-template-columns: minmax(52px, 74px) minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
}

.running-workout-form .running-bottom-nav .btn {
    min-height: 54px;
    font-size: 0.95rem;
}

.running-workout-form .workout-clean-finish-btn {
    width: 100%;
}

body.portal-role .client-dashboard-start-card {
    min-height: 0 !important;
    padding: 26px 24px !important;
    gap: 0;
}

body.portal-role .client-dashboard-start-card .hero-main-action {
    margin-top: 0;
    min-height: 58px;
    width: 100%;
}

.workout-summary-panel textarea[name="session_notes"],
.workout-summary-card textarea[name="session_notes"],
.workout-summary-feedback-grid textarea[name="session_notes"],
.workout-feedback-grid textarea[name="session_notes"],
.running-feedback-grid textarea[name="session_notes"] {
    scroll-margin-top: 120px;
    scroll-margin-bottom: calc(var(--keyboard-offset, 0px) + 190px);
}

@media (max-width: 760px) {
    .login-threat-summary-grid,
    .login-threat-grid {
        grid-template-columns: 1fr;
    }

    .login-threat-chart {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }

    .login-threat-row {
        align-items: flex-start;
        flex-direction: column;
    }

    .running-segment-fields [data-segment-name] {
        grid-column: auto;
    }

    .running-workout-form .workout-clean-bottom {
        padding: 14px;
        border-radius: 20px;
    }

    .running-workout-form .running-bottom-nav {
        grid-template-columns: 52px minmax(0, 1fr);
    }

    body.portal-role .client-dashboard-start-card {
        padding: 18px !important;
        border-radius: 24px;
    }

    body.has-workout-note-focus .app-shell {
        padding-bottom: calc(150px + var(--keyboard-offset, 0px));
    }

    .workout-summary-panel,
    .workout-summary-card,
    .running-feedback-grid,
    .workout-feedback-grid,
    .workout-summary-feedback-grid {
        scroll-margin-bottom: calc(var(--keyboard-offset, 0px) + 180px);
    }

    .workout-summary-panel textarea[name="session_notes"],
    .workout-summary-card textarea[name="session_notes"],
    .workout-summary-feedback-grid textarea[name="session_notes"],
    .workout-feedback-grid textarea[name="session_notes"],
    .running-feedback-grid textarea[name="session_notes"] {
        min-height: 170px !important;
        width: 100%;
        padding: 14px 16px !important;
        border-radius: 18px !important;
        font-size: 16px !important;
        line-height: 1.45 !important;
        resize: vertical;
    }

    .workout-summary-panel textarea[name="session_notes"].is-mobile-note-active,
    .workout-summary-card textarea[name="session_notes"].is-mobile-note-active,
    .workout-summary-feedback-grid textarea[name="session_notes"].is-mobile-note-active,
    .workout-feedback-grid textarea[name="session_notes"].is-mobile-note-active,
    .running-feedback-grid textarea[name="session_notes"].is-mobile-note-active {
        min-height: min(46vh, 280px) !important;
        box-shadow: 0 0 0 2px rgba(247, 243, 235, 0.16);
    }

    body.is-keyboard-open.has-workout-note-focus .workout-clean-bottom,
    body.is-keyboard-open.has-workout-note-focus .running-bottom-nav {
        margin-bottom: calc(var(--keyboard-offset, 0px) + 18px);
    }
}
