/* Full-page coach — fixed viewport shell, scrollable middle, pinned composer */
body.coach-fullpage
{
    background-color: #121212;
    height: 100dvh;
    min-height: 0;
    overflow: hidden;
}

body.coach-fullpage .main-wrap
{
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    height: 100dvh;
    overflow: hidden;
    padding-bottom: 0 !important;
}

body.coach-fullpage .coach-page-full
{
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: stretch;
}

.coach-layout
{
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    width: 100%;
}

body.coach-fullpage .coach-chat
{
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: auto;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: #141414;
}

body.coach-fullpage .coach-chat-body
{
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    display: flex;
    flex-direction: column;
}

body.coach-fullpage .coach-thread
{
    flex: 1 0 auto;
    min-height: 12rem;
    overflow: visible;
    max-height: none;
}

body.coach-fullpage .coach-composer
{
    flex-shrink: 0;
    background: rgba(10, 10, 10, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

body.coach-fullpage .coach-chat-toolbar
{
    padding-top: max(0.85rem, env(safe-area-inset-top, 0px));
}

.coach-chat-toolbar--desktop
{
    display: none;
}

.coach-context-panel
{
    display: none;
}

.coach-briefing-mount--mobile
{
    padding: 0.65rem 0.85rem 0.35rem;
}

.coach-briefing-summary
{
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 0, 0.18);
    background: rgba(255, 140, 0, 0.05);
    padding: 0.85rem 0.9rem;
}

.coach-briefing-heading
{
    margin: 0 0 0.45rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.coach-briefing-paragraph
{
    margin: 0;
    font-size: 0.86rem;
    line-height: 1.58;
    color: rgba(255, 255, 255, 0.9);
}

.coach-briefing-link
{
    display: inline-block;
    margin-top: 0.6rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #ffb347;
    text-decoration: none;
}

.coach-briefing-link:hover
{
    text-decoration: underline;
}

.coach-chat-mark,
.coach-context-mark
{
    width: 42px;
    height: 42px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    color: #ffb347;
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.28), rgba(180, 60, 0, 0.35));
    border: 2px solid rgba(255, 140, 0, 0.45);
}

.coach-context-mark
{
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
}

.coach-chat-toolbar-title
{
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.55);
}

@media (min-width: 769px)
{
    body.coach-fullpage .coach-page-full
    {
        padding: 1rem 1.25rem;
    }

    .coach-layout
    {
        flex-direction: row;
        gap: 1rem;
        max-width: 1140px;
        margin: 0 auto;
        width: 100%;
    }

    .coach-context-panel
    {
        display: flex;
        flex-direction: column;
        gap: 1rem;
        flex: 0 0 min(300px, 30vw);
        min-height: 0;
        padding: 1.15rem;
        border-radius: 16px;
        background: rgba(255, 255, 255, 0.03);
        border: 1px solid rgba(100, 100, 100, 0.42);
        overflow-y: auto;
    }

    .coach-context-hero
    {
        display: flex;
        align-items: center;
        gap: 0.75rem;
    }

    .coach-context-name
    {
        margin: 0;
        font-size: 1.15rem;
        font-weight: 800;
        line-height: 1.15;
    }

    .coach-context-tagline
    {
        margin: 0.15rem 0 0;
        font-size: 0.8rem;
        color: rgba(255, 255, 255, 0.55);
    }

    .coach-context-nav
    {
        display: flex;
        flex-direction: column;
        gap: 0.35rem;
        margin-top: auto;
        padding-top: 0.5rem;
    }

    .coach-context-nav-link
    {
        font-size: 0.8rem;
        font-weight: 600;
        padding: 0.55rem 0.75rem;
        border-radius: 10px;
        color: rgba(255, 255, 255, 0.82);
        text-decoration: none;
        border: 1px solid rgba(100, 100, 100, 0.45);
        background: rgba(0, 0, 0, 0.2);
    }

    .coach-context-nav-link:hover
    {
        border-color: rgba(255, 140, 0, 0.35);
        color: #ffb347;
    }

    .coach-briefing-mount
    {
        padding: 0;
    }

    .coach-briefing-mount--mobile
    {
        display: none !important;
    }

    body.coach-fullpage .coach-chat
    {
        flex: 1;
        min-width: 0;
        border-radius: 16px;
        border: 1px solid rgba(100, 100, 100, 0.42);
        background: #141414;
    }

    .coach-chat-toolbar--mobile
    {
        display: none;
    }

    .coach-chat-toolbar--desktop
    {
        display: flex;
    }
}

@media (max-width: 768px)
{
    body.coach-fullpage .coach-chat
    {
        max-width: none;
        border-left: none;
        border-right: none;
    }

    body.coach-fullpage .coach-composer
    {
        padding-bottom: calc(0.85rem + 52px + 1.65rem + env(safe-area-inset-bottom, 0px));
    }

    .coach-chat-toolbar
    {
        flex-wrap: wrap;
        gap: 0.5rem;
        padding: 0.7rem 0.85rem;
    }

    .coach-toolbar-actions
    {
        width: 100%;
        justify-content: flex-end;
        flex-wrap: wrap;
        gap: 0.3rem;
    }

    .coach-chat-identity
    {
        flex: 1;
        min-width: 0;
    }

    .coach-chat-status
    {
        font-size: 0.7rem;
    }
}

@media (max-width: 380px)
{
    .coach-toolbar-link
    {
        font-size: 0.68rem;
        padding: 0.32rem 0.5rem;
    }
}

.coach-toolbar-actions
{
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
}

.coach-toolbar-link
{
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.6rem;
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
    border: 1px solid rgba(100, 100, 100, 0.5);
}

.coach-toolbar-link:hover
{
    color: #ffb347;
    border-color: rgba(255, 140, 0, 0.35);
}

.coach-page-main
{
    max-width: 680px;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 4rem);
    padding-bottom: 1rem;
}

.coach-header
{
    margin-bottom: 1rem;
}

.coach-header-meta
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 0.65rem;
}

.coach-chat .coach-header-meta
{
    padding: 0.45rem 0.85rem 0.15rem;
    margin-top: 0;
    justify-content: flex-start;
}

.coach-briefing-mount
{
    padding: 0 0.75rem 0.35rem;
}

.coach-briefing
{
    border-radius: 12px;
    border: 1px solid rgba(255, 140, 0, 0.22);
    background: rgba(255, 140, 0, 0.06);
    overflow: hidden;
}

.coach-briefing-toggle
{
    list-style: none;
    cursor: pointer;
    padding: 0.65rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.coach-briefing-toggle::-webkit-details-marker
{
    display: none;
}

.coach-briefing-title
{
    font-size: 0.82rem;
    font-weight: 700;
    color: #ffb347;
}

.coach-briefing-hint
{
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.55);
}

.coach-briefing-body
{
    padding: 0 0.75rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.coach-brief-section-title
{
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
}

.coach-brief-row
{
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.8rem;
    padding: 0.28rem 0;
    border-bottom: 1px solid rgba(100, 100, 100, 0.35);
}

.coach-brief-label
{
    color: rgba(255, 255, 255, 0.58);
    flex-shrink: 0;
}

.coach-brief-value
{
    text-align: right;
    color: rgba(255, 255, 255, 0.92);
    line-height: 1.4;
}

.coach-brief-tracking,
.coach-brief-focus
{
    margin: 0;
    padding-left: 1rem;
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
}

.coach-brief-tracking li,
.coach-brief-focus li
{
    margin-bottom: 0.35rem;
}

.coach-brief-tracking-detail
{
    display: block;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.55);
    margin-top: 0.1rem;
}

.coach-brief-empty
{
    margin: 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.58);
}

.coach-brief-section--muted
{
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.15);
}

.coach-workout-ex-name
{
    display: inline-flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.2rem;
    font-weight: 600;
}

.coach-workout-ex-name .info-tip-popup
{
    max-width: min(18rem, 85vw);
}

.coach-meta-chip
{
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    font-size: 0.74rem;
    font-weight: 600;
    padding: 0.3rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 100, 100, 0.5);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.88);
}

.coach-meta-chip .info-tip
{
    margin-left: 0.15rem;
}

.coach-meta-chip .info-tip-icon
{
    width: 0.85rem;
    height: 0.85rem;
    font-size: 0.55rem;
}

/* Chat shell */
.coach-chat
{
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: min(72vh, 640px);
    border-radius: 20px;
    border: 1px solid rgba(100, 100, 100, 0.45);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04) 0%, rgba(0, 0, 0, 0.2) 100%);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.coach-chat-toolbar
{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid rgba(100, 100, 100, 0.42);
    background: rgba(0, 0, 0, 0.22);
    flex-shrink: 0;
}

.coach-chat-identity
{
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-width: 0;
}

.coach-chat-avatar
{
    width: 42px;
    height: 42px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 140, 0, 0.45);
    background: #111;
    flex-shrink: 0;
}

.coach-chat-name
{
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.2;
}

.coach-chat-status
{
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin: 0.1rem 0 0;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.58);
}

.coach-chat-status-dot
{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #4ade80;
    box-shadow: 0 0 0 2px rgba(74, 222, 128, 0.25);
}

.coach-chat-clear
{
    flex-shrink: 0;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.35rem 0.65rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 100, 100, 0.55);
    background: transparent;
    color: rgba(255, 255, 255, 0.72);
    cursor: pointer;
}

.coach-chat-clear:hover
{
    border-color: rgba(255, 140, 0, 0.4);
    color: #fff;
}

/* Message thread */
.coach-thread
{
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.85rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    min-height: 280px;
    scroll-behavior: smooth;
}

.coach-chat-row
{
    display: flex;
    align-items: flex-end;
    gap: 0.55rem;
    max-width: 100%;
    width: 100%;
}

.coach-chat-row--user
{
    flex-direction: row;
    justify-content: flex-end;
    align-self: flex-end;
}

.coach-chat-row--assistant
{
    flex-direction: row;
    justify-content: flex-start;
    align-self: flex-start;
}

.coach-chat-avatar
{
    flex-shrink: 0;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 800;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
}

.coach-chat-avatar--rocky
{
    background: linear-gradient(145deg, rgba(255, 140, 0, 0.28), rgba(180, 60, 0, 0.35));
    border: 1px solid rgba(255, 140, 0, 0.4);
    color: #ffb347;
}

.coach-chat-avatar--user
{
    background: linear-gradient(135deg, #ff8c00, #e86a00);
    color: #111;
    box-shadow: 0 2px 8px rgba(255, 120, 0, 0.25);
}

.coach-chat-notices
{
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem 0;
    box-sizing: border-box;
}

.coach-chat-notices .dash-rocky-setup-alert,
.coach-chat-notices .coach-chat-privacy
{
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.coach-chat-privacy
{
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--border-mid, rgba(100, 100, 100, 0.52));
    background: rgba(255, 255, 255, 0.03);
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.75rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.62);
}

.coach-chat-privacy-icon
{
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1.45;
}

.coach-chat-row-body
{
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    max-width: min(92%, 540px);
    min-width: 0;
}

.coach-chat-row--user .coach-chat-row-body
{
    max-width: min(88%, 480px);
}

.coach-chat-row-name
{
    font-size: 0.68rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.45);
    padding: 0 0.35rem;
}

.coach-chat-row--user .coach-chat-row-name
{
    text-align: right;
}

.coach-msg
{
    padding: 0.7rem 0.85rem;
    border-radius: 18px;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.92rem;
    line-height: 1.5;
    word-break: break-word;
}

.coach-msg--user
{
    background: linear-gradient(135deg, #ff8c00, #e86a00);
    color: #111;
    border-bottom-right-radius: 6px;
    border-top-right-radius: 6px;
    box-shadow: 0 4px 14px rgba(255, 120, 0, 0.22);
}

.coach-msg--assistant
{
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(100, 100, 100, 0.44);
    color: rgba(255, 255, 255, 0.94);
    border-bottom-left-radius: 6px;
    border-top-left-radius: 6px;
}

.coach-msg--welcome
{
    background: rgba(255, 140, 0, 0.1);
    border-color: rgba(255, 140, 0, 0.22);
}

.coach-msg--loading
{
    padding: 0.65rem 0.85rem;
}

.coach-typing
{
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    min-height: 1.1rem;
}

.coach-typing-dot
{
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: rgba(255, 180, 80, 0.85);
    animation: coach-typing-bounce 1.2s ease-in-out infinite;
}

.coach-typing-dot:nth-child(2)
{
    animation-delay: 0.15s;
}

.coach-typing-dot:nth-child(3)
{
    animation-delay: 0.3s;
}

@keyframes coach-typing-bounce
{
    0%, 60%, 100%
    {
        transform: translateY(0);
        opacity: 0.45;
    }
    30%
    {
        transform: translateY(-4px);
        opacity: 1;
    }
}

/* Composer */
.coach-composer
{
    border-top: 1px solid rgba(100, 100, 100, 0.42);
    padding: 0.75rem 0.85rem 0.85rem;
    background: rgba(0, 0, 0, 0.28);
}

.coach-composer-mode
{
    display: flex;
    gap: 0.35rem;
    margin-bottom: 0.65rem;
}

.coach-routine-toggle
{
    display: inline-flex;
    margin-bottom: 0.65rem;
    cursor: pointer;
    user-select: none;
}

.coach-routine-toggle-input
{
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}

.coach-routine-toggle-face
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2.15rem;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 140, 0, 0.35);
    background: rgba(255, 140, 0, 0.08);
    color: rgba(255, 180, 100, 0.92);
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.coach-routine-toggle:hover .coach-routine-toggle-face
{
    border-color: rgba(255, 140, 0, 0.55);
    background: rgba(255, 140, 0, 0.14);
}

.coach-routine-toggle-input:checked + .coach-routine-toggle-face
{
    color: #141414;
    border-color: rgba(255, 140, 0, 0.75);
    background: linear-gradient(135deg, #ff8c00, #ff6a00);
    box-shadow: 0 4px 14px rgba(255, 120, 0, 0.28);
}

.coach-routine-toggle-input:focus-visible + .coach-routine-toggle-face
{
    outline: 2px solid rgba(255, 140, 0, 0.55);
    outline-offset: 2px;
}

.coach-routine-toggle-input:disabled + .coach-routine-toggle-face
{
    opacity: 0.45;
    cursor: not-allowed;
}

.coach-rocky-setup-alert
{
    margin: 0;
}

.coach-chat-notices .dash-rocky-setup-alert
{
    padding: 0.85rem 1rem;
    gap: 0.65rem;
}

.coach-chips
{
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    margin-bottom: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
}

.coach-chip
{
    flex-shrink: 0;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.38rem 0.72rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 100, 100, 0.5);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    white-space: nowrap;
}

.coach-chip:hover
{
    border-color: rgba(255, 140, 0, 0.45);
    background: rgba(255, 140, 0, 0.12);
}

.coach-input-row
{
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
    padding: 0.35rem 0.35rem 0.35rem 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(100, 100, 100, 0.55);
    background: rgba(0, 0, 0, 0.35);
}

.coach-input
{
    flex: 1;
    min-height: 2.25rem;
    max-height: 6.5rem;
    resize: none;
    padding: 0.45rem 0;
    border: none;
    background: transparent;
    color: #fff;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.92rem;
    line-height: 1.45;
    outline: none;
}

.coach-input::placeholder
{
    color: rgba(255, 255, 255, 0.42);
}

.coach-send-btn
{
    flex-shrink: 0;
    width: 2.35rem;
    height: 2.35rem;
    padding: 0;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    background: linear-gradient(135deg, #ff8c00, #ff6a00);
    color: #111;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.coach-send-btn svg
{
    display: block;
}

.coach-send-btn:disabled
{
    opacity: 0.45;
    cursor: not-allowed;
}

.coach-routine-btn
{
    flex-shrink: 0;
    min-height: 2.65rem;
    padding: 0 0.85rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 140, 0, 0.45);
    background: rgba(255, 140, 0, 0.12);
    color: #ff9f40;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}

.coach-routine-btn:hover:not(:disabled)
{
    background: rgba(255, 140, 0, 0.22);
    border-color: rgba(255, 140, 0, 0.65);
}

.coach-routine-btn:disabled
{
    opacity: 0.45;
    cursor: not-allowed;
}

.coach-routine-card
{
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.85rem 0;
}

.coach-routine-card-title
{
    margin: 0;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.95rem;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.92);
}

.coach-routine-save
{
    align-self: flex-start;
}

.coach-routine-edit
{
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.82rem;
    font-weight: 600;
    color: #ff9f40;
    text-decoration: none;
}

.coach-routine-edit:hover
{
    text-decoration: underline;
}

.coach-error
{
    margin-top: 0.45rem;
    font-size: 0.82rem;
}

.coach-quota
{
    margin-top: 0.35rem;
    font-size: 0.74rem;
    color: rgba(255, 255, 255, 0.48);
    text-align: center;
}

/* Cards inside assistant bubbles */
.coach-advice-card
{
    width: 100%;
}

.coach-advice-title
{
    margin: 0 0 0.5rem;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1.3;
    color: #ffb347;
}

.coach-advice-summary
{
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.92);
}

.coach-advice-warnings
{
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-bottom: 0.75rem;
}

.coach-advice-warning
{
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    padding: 0.65rem 0.75rem;
    border-radius: 12px;
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    font-size: 0.84rem;
    font-weight: 600;
    line-height: 1.45;
}

.coach-advice-warning-icon
{
    flex-shrink: 0;
    width: 1.15rem;
    height: 1.15rem;
    border-radius: 50%;
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.15rem;
    text-align: center;
    color: #fff;
    background: #dc2626;
    margin-top: 0.05rem;
}

.coach-advice-warning-text
{
    flex: 1;
    min-width: 0;
}

.coach-advice-points
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.15rem;
}

.coach-advice-point
{
    padding: 0.5rem 0.8rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    max-width: 100%;
}

.coach-advice-point--action
{
    background: rgba(255, 140, 0, 0.16);
    border: 1px solid rgba(255, 140, 0, 0.38);
    color: rgba(255, 255, 255, 0.96);
}

.coach-advice-point--tip
{
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(100, 100, 100, 0.55);
    color: rgba(255, 255, 255, 0.86);
    border-radius: 12px;
    font-weight: 500;
}

.coach-advice-point--highlight
{
    width: 100%;
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 140, 0, 0.08);
    border: 1px solid rgba(255, 140, 0, 0.22);
    border-left: 3px solid #ff8c00;
    color: rgba(255, 220, 170, 0.95);
    font-style: italic;
    font-weight: 600;
}

.coach-advice-closing
{
    margin: 0.75rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px solid rgba(100, 100, 100, 0.42);
    font-size: 0.86rem;
    font-weight: 600;
    line-height: 1.45;
    color: rgba(255, 180, 90, 0.92);
}

.coach-advice-card--plain .coach-advice-point
{
    margin-top: 0.35rem;
}

.coach-advice-card--plain .coach-advice-point:first-of-type
{
    margin-top: 0;
}

/* Legacy bullet list — kept for old cached messages */
.coach-advice-bullets
{
    margin: 0;
    padding-left: 1.15rem;
    line-height: 1.55;
}

.coach-advice-bullets li
{
    margin-bottom: 0.35rem;
}

/* Expandable info cards */
.coach-expand-card
{
    width: 100%;
    max-width: 100%;
    border-radius: 12px;
    overflow: hidden;
}

.coach-expand-card > summary
{
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.5rem 0.8rem;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.4;
    user-select: none;
}

.coach-expand-card > summary::-webkit-details-marker
{
    display: none;
}

.coach-expand-summary-text
{
    flex: 1;
    min-width: 0;
}

.coach-expand-hint
{
    flex-shrink: 0;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.38);
}

.coach-expand-chevron
{
    flex-shrink: 0;
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid rgba(255, 255, 255, 0.45);
    border-bottom: 2px solid rgba(255, 255, 255, 0.45);
    transform: rotate(45deg);
    margin-top: -0.15rem;
    transition: transform 0.2s ease;
}

.coach-expand-card[open] > summary .coach-expand-chevron
{
    transform: rotate(-135deg);
    margin-top: 0.1rem;
}

.coach-expand-card[open] > summary .coach-expand-hint
{
    color: rgba(255, 179, 71, 0.75);
}

.coach-expand-card--action > summary
{
    background: rgba(255, 140, 0, 0.16);
    border: 1px solid rgba(255, 140, 0, 0.38);
    color: rgba(255, 255, 255, 0.96);
    border-radius: 999px;
}

.coach-expand-card--tip > summary
{
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(100, 100, 100, 0.55);
    color: rgba(255, 255, 255, 0.86);
    font-weight: 500;
}

.coach-expand-card--highlight > summary,
.coach-expand-card--summary > summary,
.coach-expand-card--fyi > summary
{
    border-radius: 12px;
    padding: 0.65rem 0.8rem;
    background: rgba(255, 140, 0, 0.08);
    border: 1px solid rgba(255, 140, 0, 0.22);
    border-left: 3px solid #ff8c00;
    color: rgba(255, 220, 170, 0.95);
    font-style: italic;
}

.coach-expand-card--warning > summary
{
    background: rgba(239, 68, 68, 0.14);
    border: 1px solid rgba(248, 113, 113, 0.45);
    color: #fecaca;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
}

.coach-expand-card--exercise > summary
{
    flex-wrap: wrap;
    justify-content: space-between;
    padding: 0.55rem 0.65rem;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(100, 100, 100, 0.45);
    border-radius: 10px;
    font-weight: 600;
}

.coach-expand-card--note > summary
{
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(100, 100, 100, 0.45);
    border-radius: 10px;
    font-weight: 500;
}

.coach-expand-ex-main
{
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.35rem 0.75rem;
    flex: 1;
    min-width: 0;
}

.coach-expand-ex-name
{
    color: rgba(255, 255, 255, 0.95);
}

.coach-expand-ex-rx
{
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.coach-expand-body
{
    padding: 0.75rem 0.85rem 0.85rem;
    border-top: 1px solid rgba(100, 100, 100, 0.42);
    background: rgba(0, 0, 0, 0.22);
}

.coach-expand-card--action .coach-expand-body,
.coach-expand-card--tip .coach-expand-body,
.coach-expand-card--highlight .coach-expand-body,
.coach-expand-card--summary .coach-expand-body,
.coach-expand-card--fyi .coach-expand-body
{
    border: 1px solid rgba(100, 100, 100, 0.42);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.coach-expand-card--action[open] > summary
{
    border-radius: 999px 999px 0 0;
}

.coach-expand-card--warning .coach-expand-body
{
    border: 1px solid rgba(248, 113, 113, 0.25);
    border-top: none;
    border-radius: 0 0 12px 12px;
}

.coach-expand-card--exercise .coach-expand-body,
.coach-expand-card--note .coach-expand-body
{
    margin-top: 0.35rem;
    border-radius: 10px;
    border: 1px solid rgba(100, 100, 100, 0.42);
}

.coach-expand-subtitle
{
    margin: 0 0 0.65rem;
    font-size: 0.84rem;
    line-height: 1.5;
    color: rgba(255, 200, 130, 0.9);
    font-weight: 600;
}

.coach-expand-section-title
{
    margin: 0 0 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.48);
}

.coach-expand-overview
{
    margin: 0;
    font-size: 0.84rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.88);
}

.coach-expand-citation
{
    margin: 0.75rem 0 0;
    padding: 0.65rem 0.75rem;
    border-left: 3px solid rgba(255, 140, 0, 0.55);
    border-radius: 0 8px 8px 0;
    background: rgba(255, 140, 0, 0.06);
    font-size: 0.8rem;
    line-height: 1.5;
    color: rgba(255, 220, 170, 0.92);
}

.coach-expand-citation-label
{
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 179, 71, 0.85);
}

.coach-expand-disclaimer
{
    margin: 0.65rem 0 0;
    font-size: 0.68rem;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.42);
}

.coach-advice-points .coach-expand-card--highlight,
.coach-advice-points .coach-expand-card--action,
.coach-advice-points .coach-expand-card--tip
{
    flex: 1 1 auto;
}

.coach-advice-points .coach-expand-card--highlight
{
    flex-basis: 100%;
}

.coach-workout-ex--expand
{
    display: block;
    padding: 0;
    border-bottom: none;
}

.coach-workout-ex--expand .coach-expand-card
{
    width: 100%;
}

.coach-workout-notes-list
{
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.coach-workout-rocky .coach-expand-card--fyi
{
    margin-top: 0.35rem;
}

.coach-advice-card .coach-expand-card--summary
{
    margin-bottom: 0.65rem;
}

.coach-expand-card > summary:focus-visible
{
    outline: 2px solid rgba(255, 140, 0, 0.65);
    outline-offset: 2px;
}

.coach-workout-preview
{
    width: 100%;
}

.coach-workout-rocky
{
    margin-bottom: 0.85rem;
    padding: 0.85rem 0.9rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 140, 0, 0.28);
    background: linear-gradient(135deg, rgba(255, 140, 0, 0.12), rgba(255, 100, 0, 0.04));
}

.coach-workout-rocky-badge
{
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffb347;
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
}

.coach-workout-rocky-mark
{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: 50%;
    background: rgba(255, 140, 0, 0.22);
    border: 1px solid rgba(255, 140, 0, 0.45);
    font-size: 0.62rem;
    font-weight: 800;
    color: #ffb347;
}

.coach-workout-rocky-fyi
{
    margin: 0;
    font-size: 0.88rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.9);
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
}

.coach-workout-rocky-outro
{
    margin: 0.85rem 0 0;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(100, 100, 100, 0.42);
    font-size: 0.9rem;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.88);
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
}

.coach-workout-rocky-link
{
    color: #ffb347;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.15em;
    text-decoration-color: rgba(255, 179, 71, 0.45);
}

.coach-workout-rocky-link:hover
{
    color: #ffc870;
    text-decoration-color: rgba(255, 200, 112, 0.75);
}

.coach-workout-head
{
    margin-bottom: 0.75rem;
    scroll-margin-top: 0.75rem;
}

.coach-workout-head--highlight
{
    border-radius: 12px;
    box-shadow: 0 0 0 2px rgba(255, 140, 0, 0.45);
    animation: coach-workout-head-pulse 1.4s ease-out;
}

@keyframes coach-workout-head-pulse
{
    0% { background: rgba(255, 140, 0, 0.18); }
    100% { background: transparent; }
}

.coach-workout-title
{
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 700;
}

.coach-workout-meta
{
    margin: 0;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
}

.coach-workout-block
{
    margin-bottom: 0.75rem;
}

.coach-workout-block-name
{
    margin: 0 0 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: #ff9f40;
}

.coach-workout-ex-list
{
    list-style: none;
    margin: 0;
    padding: 0;
}

.coach-workout-ex
{
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.35rem 0.75rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(100, 100, 100, 0.38);
    font-size: 0.86rem;
}

.coach-workout-ex-rx
{
    color: rgba(255, 255, 255, 0.72);
    font-variant-numeric: tabular-nums;
}

.coach-workout-notes
{
    margin-top: 0.5rem;
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.72);
}

.coach-workout-notes-label
{
    margin: 0 0 0.25rem;
    font-weight: 600;
    font-size: 0.74rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.coach-workout-actions
{
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.85rem;
}

.coach-action-btn
{
    font-family: var(--font, "DM Sans", system-ui, sans-serif);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.48rem 0.8rem;
    border-radius: 999px;
    cursor: pointer;
    border: 1px solid transparent;
}

.coach-action-btn--primary
{
    background: linear-gradient(135deg, #ff8c00, #ff6a00);
    color: #111;
}

.coach-action-btn--ghost
{
    background: transparent;
    border-color: rgba(100, 100, 100, 0.62);
    color: rgba(255, 255, 255, 0.88);
}

.customize-sport-tip
{
    margin: 0.35rem 0 0.75rem;
    padding: 0.65rem 0.75rem;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.5;
    border: 1px solid rgba(255, 140, 0, 0.22);
    background: rgba(255, 140, 0, 0.08);
    color: rgba(255, 255, 255, 0.88);
}

.customize-sport-tip strong
{
    color: #ffb347;
}

.coach-slim-panel
{
    padding: 1rem 1.1rem;
    border-radius: 14px;
    border: 1px solid rgba(255, 140, 0, 0.25);
    background: rgba(255, 140, 0, 0.06);
    margin-bottom: 1rem;
}

.coach-slim-head .coach-hero-brand
{
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.coach-slim-title
{
    font-size: 1.15rem;
    margin: 0;
}

.coach-slim-lede
{
    margin: 0 0 0.85rem;
    font-size: 0.92rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.78);
}

.coach-slim-link
{
    display: inline-block;
    text-decoration: none;
    text-align: center;
}

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

.coach-action-btn--ghost:hover
{
    background: rgba(255, 255, 255, 0.1);
}

/* Cohesive rich assistant messages */
.coach-msg--rich
{
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.coach-msg--rich.coach-msg--assistant
{
    background: rgba(255, 255, 255, 0.06);
}

.coach-msg--rich .coach-advice-card,
.coach-msg--rich .coach-workout-preview
{
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.coach-msg--rich .coach-advice-title
{
    margin: 0;
}

.coach-msg--rich .coach-advice-summary
{
    margin: 0;
}

.coach-msg--rich .coach-advice-warnings,
.coach-msg--rich .coach-advice-points
{
    margin: 0;
    gap: 0.5rem;
}

.coach-msg--rich .coach-advice-closing
{
    margin: 0;
    padding-top: 0.55rem;
}

.coach-msg--rich .coach-workout-rocky
{
    margin: 0;
    padding: 0.65rem 0.7rem;
}

.coach-msg--rich .coach-workout-head,
.coach-msg--rich .coach-workout-block,
.coach-msg--rich .coach-workout-notes,
.coach-msg--rich .coach-workout-actions,
.coach-msg--rich .coach-workout-rocky-outro
{
    margin: 0;
}

.coach-msg--rich .coach-expand-card > summary
{
    padding: 0.55rem 0.7rem;
}

.coach-msg--rich .coach-expand-body
{
    padding: 0.65rem 0.7rem 0.75rem;
}

.coach-msg--rich .coach-expand-overview
{
    font-size: 0.8125rem;
    line-height: 1.6;
}

.coach-msg--rich .coach-workout-ex-list
{
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.coach-msg--rich .coach-workout-notes-list
{
    gap: 0.5rem;
}

@media (max-width: 640px)
{
    .coach-chat
    {
        min-height: min(68vh, 560px);
        border-radius: 16px;
    }

    .coach-chat-toolbar
    {
        padding: 0.7rem 0.75rem;
    }

    .coach-thread
    {
        padding: 0.75rem 0.65rem 0.35rem;
    }

    .coach-msg--rich
    {
        padding: 0.55rem;
        gap: 0.5rem;
    }

    .coach-msg--rich .coach-expand-card > summary
    {
        padding: 0.5rem 0.6rem;
        font-size: 0.8rem;
    }

    .coach-expand-hint
    {
        display: none;
    }

    .coach-chat-row-body
    {
        max-width: 90%;
    }
}
