/* AI Coach route styles. */
.coach-page {
    min-height: 100vh;
    --coach-accent: var(--accent, #4DAB9A);
    --coach-accent-strong: #7ADFC9;
    --coach-accent-soft: rgba(77, 171, 154, 0.14);
    --coach-page-bg: var(--app-bg-page);
    --coach-section-bg: var(--app-surface-card, #0d0d0d);
    --coach-inner-bg: var(--app-bg-shell, #0b0b0b);
    --coach-control-bg: var(--app-surface-control, rgba(255,255,255,0.035));
    --coach-border: var(--app-border-soft, rgba(255,255,255,0.07));
    --coach-border-muted: var(--app-border-muted, rgba(255,255,255,0.055));
    --coach-border-hover: var(--app-border-hover, rgba(255,255,255,0.12));
    --coach-radius: var(--app-radius-card, 10px);
    --coach-radius-lg: var(--app-radius-section, 12px);
    --coach-fs-kicker: 12px;
    --coach-fs-meta: 13px;
    --coach-fs-body: 15px;
    --coach-fs-body-sm: 14px;
    background: var(--coach-page-bg);
    color: var(--text-primary);
    font-family: 'Instrument Sans', sans-serif;
    overflow-x: clip;
}

html.dark body.coach-page.tsb-brand-scene:not(.embed-mode),
html.light body.coach-page.tsb-brand-scene:not(.embed-mode) {
    background: var(--coach-page-bg);
}

html.dark body.coach-page.tsb-brand-scene:not(.embed-mode)::after,
html.light body.coach-page.tsb-brand-scene:not(.embed-mode)::after {
    display: none;
}

.coach-shell {
    min-height: calc(100vh - 80px);
}

.coach-page-header {
    align-items: flex-end;
    margin-bottom: 18px;
}

.coach-title-group {
    gap: 10px;
    max-width: min(760px, 54vw);
}

.coach-status-bar {
    width: 100%;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.coach-status-bar::-webkit-scrollbar {
    display: none;
}

.coach-status-bar .app-status-meta {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    max-width: none;
    white-space: nowrap;
}

.coach-status-bar .app-status-copy {
    flex-wrap: nowrap;
}

.coach-page-toolbar.app-toolbar {
    flex: 0 0 auto;
    margin-left: auto;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.coach-page-toolbar .app-action-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: var(--coach-radius);
    font-size: 14px;
    font-weight: 650;
}

.coach-page-toolbar .app-action-btn svg,
.coach-page-toolbar .app-action-btn i {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
}

.coach-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: 20px;
}

.coach-main, .coach-sidebar { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Section cards */
.coach-card {
    background: var(--coach-section-bg);
    border: 1px solid var(--coach-border);
    border-radius: var(--coach-radius);
    padding: 24px;
    position: relative;
    overflow: hidden;
    box-shadow: none;
}

.coach-card::before {
    display: none;
}

.coach-card-title {
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(214, 223, 232, 0.62);
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.coach-card-title i,
.coach-card-title svg {
    width: 15px;
    height: 15px;
    color: rgba(214, 223, 232, 0.68);
    stroke-width: 2;
}

/* Chat card — hero emphasis */
#chatCard {
    order: -1;
    background: var(--coach-section-bg);
    border-color: var(--coach-border);
    box-shadow: none;
    padding: 0;
}
#chatCard::before {
    display: none;
}

#chatCard > .coach-card-title {
    min-height: 54px;
    margin: 0;
    padding: 14px 24px;
    border-bottom: 1px solid var(--coach-border-muted);
}

.coach-card-title-meta {
    margin-left: auto;
    font-weight: 500;
    font-size: var(--coach-fs-kicker);
    letter-spacing: 0.08em;
    color: rgba(214, 223, 232, 0.34);
    text-align: right;
    white-space: nowrap;
}

#coachSyncBtn .spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Toast */
.coach-toast {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Instrument Sans', sans-serif;
    color: #fff;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    pointer-events: none;
}

.coach-toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.coach-toast.success {
    background: rgba(34, 197, 94, 0.9);
    border: 1px solid rgba(34, 197, 94, 0.5);
}

.coach-toast.error {
    background: rgba(239, 68, 68, 0.9);
    border: 1px solid rgba(239, 68, 68, 0.5);
}

/* ============================================
   AI Insights
   ============================================ */
#insightsCard,
#patternsCard,
#whatifCard {
    padding: 0;
}

#insightsCard .coach-card-title,
#patternsCard .coach-card-title,
#whatifCard .coach-card-title {
    min-height: 66px;
    margin: 0;
    padding: 18px 24px;
    border-bottom: 1px solid var(--coach-border-muted);
}

#insightsCard .insights-refresh {
    margin-left: auto;
}

.insights-list {
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: hidden;
}

.insight-card {
    position: relative;
    padding: 18px 24px;
    border: 0;
    border-radius: 0;
    background: transparent;
    margin-bottom: 0;
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    overflow: hidden;
}

.insight-card + .insight-card {
    border-top: 1px solid var(--coach-border-muted);
}

.insight-card::before {
    display: none;
}

.insight-card.is-featured {
    padding: 20px 24px 22px;
}

.insight-card:not(.is-featured) {
    padding: 18px 24px;
}

.insight-card.is-featured.is-success,
.insight-card.is-featured.is-warning,
.insight-card.is-featured.is-info {
    background: transparent;
}

.insight-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    color: var(--text-primary);
    border: 1px solid var(--coach-border-muted);
}

.insight-card.is-featured .insight-icon {
    width: 32px;
    height: 32px;
}

.insight-icon.success {
    background: rgba(34, 197, 94, 0.055);
    color: #22c55e;
}

.insight-icon.warning {
    background: rgba(245, 158, 11, 0.055);
    color: #f59e0b;
}

.insight-icon.info {
    background: rgba(255, 255, 255, 0.035);
    color: rgba(214, 223, 232, 0.72);
}

.insight-icon svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

.insight-card.is-featured .insight-icon svg {
    width: 16px;
    height: 16px;
}

.insight-signal {
    display: contents;
}

.insight-signal-copy {
    min-width: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 10px;
    padding-top: 1px;
}

.insight-copy {
    min-width: 0;
    grid-column: 2;
    padding: 0;
}

.insight-head {
    display: contents;
}

.insight-type {
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-primary);
    line-height: 1.35;
}

.insight-card.is-featured .insight-type {
    font-size: 15px;
    letter-spacing: 0.08em;
}

.insight-card.is-featured .insight-type.success { color: #22c55e; }
.insight-card.is-featured .insight-type.warning { color: #f59e0b; }
.insight-card.is-featured .insight-type.info { color: var(--text-primary); }

.insight-card:not(.is-featured) .insight-type {
    font-size: var(--coach-fs-kicker);
    letter-spacing: 0.12em;
}

.insight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 20px;
    padding: 0 7px;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.075);
    background: transparent;
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    white-space: nowrap;
    width: fit-content;
    max-width: 100%;
}

.insight-badge.live {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.08);
}

.insight-badge.primary {
    min-height: 20px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(214, 223, 232, 0.46);
    font-size: 11px;
    letter-spacing: 0.12em;
}

.insight-status {
    display: none;
}

.insight-text {
    font-size: 14px;
    line-height: 1.58;
    color: var(--text-secondary);
}

.insight-card.is-featured .insight-text {
    max-width: 1320px;
    font-size: 15px;
    line-height: 1.64;
}

.insight-text .hl-num,
.insight-text .hl-money {
    color: #22c55e;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}

.insight-text .hl-neg {
    color: #ef4444;
    font-weight: 600;
    font-family: 'DM Mono', monospace;
}

.insight-text .hl-entity {
    color: rgba(167, 235, 221, 0.94);
    font-weight: 680;
    letter-spacing: 0.01em;
}

.insight-text .hl-risk,
.insight-text .hl-rule,
.insight-text .hl-range {
    color: #f5c36b;
    font-weight: 680;
}

.insight-text .hl-action {
    color: rgba(239, 242, 246, 0.92);
    font-weight: 650;
}

.insights-refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 34px;
    padding: 0 12px;
    background: var(--coach-control-bg);
    border: 1px solid var(--coach-border);
    border-radius: var(--coach-radius);
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s var(--ease-out, ease);
    margin-left: auto;
    letter-spacing: 0;
}

.insights-refresh:hover {
    background: rgba(255,255,255,0.05);
    border-color: var(--coach-border-hover);
    color: var(--text-primary);
    transform: none;
}

.insights-refresh i {
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-right: 4px;
    vertical-align: -2px;
}

.insights-loading {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-size: 14px;
}

/* ============================================
   AI Chat
   ============================================ */
.coach-command-deck {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    min-width: 0;
    border-bottom: 1px solid var(--coach-border-muted);
    background: #0d0d0d;
}

.coach-command-read {
    min-width: 0;
    padding: 20px 24px 18px;
    border-right: 1px solid var(--coach-border-muted);
}

.coach-command-lead {
    display: grid;
    grid-template-columns: 62px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    min-width: 0;
}

.coach-command-core {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    width: 62px;
    height: 62px;
    padding: 9px;
    border: 1px solid rgba(91, 196, 176, 0.20);
    border-radius: var(--coach-radius);
    background: rgba(77, 171, 154, 0.035);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.022);
}

.coach-command-core span {
    display: block;
    border-radius: 999px;
    background: rgba(143, 241, 205, 0.94);
    opacity: 0.18;
    animation: coachCommandCore 1.6s ease-in-out infinite;
}

.coach-command-core span:nth-child(5n+1) { animation-delay: 0.05s; }
.coach-command-core span:nth-child(5n+2) { animation-delay: 0.14s; }
.coach-command-core span:nth-child(5n+3) { animation-delay: 0.23s; }
.coach-command-core span:nth-child(5n+4) { animation-delay: 0.32s; }
.coach-command-core span:nth-child(5n) { animation-delay: 0.41s; }

@keyframes coachCommandCore {
    0%,
    100% {
        opacity: 0.16;
    }
    45% {
        opacity: 0.86;
    }
}

.coach-command-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: var(--coach-accent-strong);
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-command-kicker i,
.coach-command-kicker svg {
    width: 15px;
    height: 15px;
    box-sizing: content-box;
    padding: 4px;
    border: 1px solid rgba(91, 196, 176, 0.30);
    border-radius: 8px;
    background:
        radial-gradient(circle at 68% 28%, rgba(191, 243, 232, 0.22), transparent 34%),
        linear-gradient(145deg, rgba(77, 171, 154, 0.22), rgba(12, 24, 22, 0.92));
    color: #a7ebdd;
    box-shadow:
        0 0 0 1px rgba(255,255,255,0.035) inset,
        0 0 18px rgba(77, 171, 154, 0.14);
}

.coach-command-title {
    margin: 0;
    max-width: 760px;
    color: var(--text-primary);
    font-size: clamp(22px, 1.48vw, 26px);
    font-weight: 720;
    letter-spacing: -0.04em;
    line-height: 1.04;
}

.coach-command-sub {
    max-width: 760px;
    margin-top: 8px;
    color: rgba(214, 223, 232, 0.58);
    font-size: 13.5px;
    line-height: 1.48;
}

.coach-command-proof {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 620px;
    margin-top: 12px;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
    overflow: hidden;
    background: rgba(255,255,255,0.014);
}

.coach-command-proof-item {
    min-width: 0;
    padding: 10px 12px;
}

.coach-command-proof-item:not(:last-child) {
    border-right: 1px solid var(--coach-border-muted);
}

.coach-command-proof-item span {
    display: block;
    margin-bottom: 4px;
    color: rgba(214, 223, 232, 0.42);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-command-proof-item strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-command-metrics {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 620px;
    margin-top: 10px;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
    overflow: hidden;
    background: rgba(255,255,255,0.014);
}

.coach-command-metric {
    min-width: 0;
    padding: 10px 12px;
}

.coach-command-metric:not(:last-child) {
    border-right: 1px solid var(--coach-border-muted);
}

.coach-command-metric span {
    display: block;
    margin-bottom: 5px;
    color: rgba(214, 223, 232, 0.42);
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.13em;
    text-transform: uppercase;
}

.coach-command-metric strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-command-line {
    max-width: 620px;
    margin-top: 12px;
    color: rgba(214, 223, 232, 0.56);
    font-size: 13px;
    font-weight: 620;
    line-height: 1.42;
}

.coach-command-line strong {
    color: rgba(191, 243, 232, 0.88);
    font-weight: 760;
}

.coach-command-agent-strip {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    max-width: 100%;
    margin-top: 14px;
}

.coach-command-agent-strip span {
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: var(--coach-radius);
    background: rgba(255, 255, 255, 0.018);
}

.coach-command-agent-strip em,
.coach-command-agent-strip strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-command-agent-strip em {
    margin-bottom: 5px;
    color: rgba(214, 223, 232, 0.40);
    font-size: 9.5px;
    font-style: normal;
    font-weight: 820;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-command-agent-strip strong {
    color: rgba(244, 247, 248, 0.88);
    font-size: 12px;
    font-weight: 740;
    line-height: 1.18;
}

.coach-command-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-width: 0;
    align-content: center;
    padding: 16px 18px;
    background: #0f0f12;
}

.coach-command-actions-head {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
    margin-bottom: 2px;
}

.coach-command-actions-title {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.coach-command-actions-kicker {
    color: rgba(143, 241, 205, 0.76);
    font-size: 10px;
    font-weight: 780;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-command-actions-note {
    color: rgba(214, 223, 232, 0.42);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    text-align: right;
}

.coach-command-actions-toggle {
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.64);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 680;
    line-height: 1;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.coach-command-actions-toggle:hover {
    border-color: rgba(91, 196, 176, 0.20);
    background: rgba(77, 171, 154, 0.06);
    color: rgba(248, 250, 252, 0.9);
}

.coach-command-actions-toggle i,
.coach-command-actions-toggle svg {
    width: 14px;
    height: 14px;
    transition: transform 0.16s ease;
}

.coach-command-actions-grid {
    display: contents;
}

.coach-command-actions.is-collapsed .coach-command-actions-grid {
    display: none;
}

.coach-command-actions.is-collapsed .coach-command-actions-toggle i,
.coach-command-actions.is-collapsed .coach-command-actions-toggle svg {
    transform: rotate(180deg);
}

.coach-command-btn {
    display: grid;
    grid-template-columns: 28px minmax(0, 1fr);
    gap: 9px;
    min-height: 50px;
    padding: 9px;
    border: 1px solid rgba(91, 196, 176, 0.20);
    border-radius: var(--coach-radius);
    background: rgba(77, 171, 154, 0.045);
    color: var(--text-primary);
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.coach-command-btn--primary {
    grid-column: 1 / -1;
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 60px;
    padding: 11px;
    border-color: rgba(91, 196, 176, 0.36);
    background: rgba(77, 171, 154, 0.105);
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.025), 0 0 22px rgba(77, 171, 154, 0.08);
}

.coach-command-btn--primary::after {
    display: none;
}

.coach-command-btn:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(77, 171, 154, 0.045);
}

.coach-command-icon {
    width: 22px;
    height: 22px;
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    background: transparent;
    color: currentColor;
}

.coach-command-btn--primary .coach-command-icon {
    width: 24px;
    height: 24px;
}

.coach-command-icon i,
.coach-command-icon svg {
    width: 16px;
    height: 16px;
}

.coach-command-copy {
    min-width: 0;
}

.coach-command-copy strong,
.coach-command-copy span {
    display: block;
}

.coach-command-copy strong {
    margin-bottom: 2px;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 720;
    line-height: 1.2;
}

.coach-command-copy span {
    color: rgba(214, 223, 232, 0.48);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.35;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-deck {
    grid-template-columns: 1fr;
    background: #090909;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
    gap: 22px;
    align-items: end;
    padding: 22px 24px 18px;
    border-right: 0;
    border-bottom: 1px solid var(--coach-border-muted);
    background: #0d0d0d;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-lead {
    grid-column: 1;
    grid-row: 1 / 3;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 16px;
    align-self: center;
    max-width: 780px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-core {
    width: 72px;
    height: 72px;
    gap: 5px;
    padding: 10px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-title {
    max-width: 760px;
    font-size: clamp(24px, 1.85vw, 32px);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub {
    max-width: 680px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics {
    grid-column: 2;
    grid-row: 1 / 4;
    align-self: center;
    width: 100%;
    max-width: none;
    margin-top: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-line {
    grid-column: 1;
    grid-row: 3;
    max-width: none;
    margin-top: 0;
    padding-top: 2px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-agent-strip {
    grid-column: 1 / -1;
    grid-row: 4;
    margin-top: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    align-content: start;
    padding: 16px 24px 22px;
    border-top: 1px solid var(--coach-border-muted);
    border-bottom: 1px solid var(--coach-border);
    background: #0d0d0d;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-head {
    margin-bottom: 2px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-kicker {
    color: rgba(143, 241, 205, 0.82);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    grid-column: auto;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    border-color: rgba(91, 196, 176, 0.20);
    border-radius: var(--coach-radius);
    background: rgba(77, 171, 154, 0.055);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.018),
        0 14px 26px rgba(0, 0, 0, 0.12);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(91, 196, 176, 0.38);
    background: rgba(77, 171, 154, 0.12);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(77, 171, 154, 0.055);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary .coach-command-icon {
    width: 24px;
    height: 24px;
    color: currentColor;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong {
    font-size: 13px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
    overflow: hidden;
    font-size: 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.coach-page:not(.coach-page--embed-drawer) .quick-insights {
    display: none;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-shell {
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-messages {
    height: clamp(420px, 52vh, 680px);
    min-height: 420px;
    padding: 28px 28px 26px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-input-row {
    padding: 14px 16px 16px;
    border-top: 1px solid var(--coach-border-muted);
    background: #0d0d0d;
}

.coach-ai-readout {
    display: grid;
    grid-template-columns: minmax(170px, 0.85fr) repeat(3, minmax(0, 1fr));
    margin: 16px 24px 16px;
    border: 1px solid var(--coach-border);
    border-radius: var(--coach-radius);
    background: rgba(255,255,255,0.012);
    overflow: hidden;
}

.coach-ai-readout-head,
.coach-ai-readout-item {
    min-width: 0;
    padding: 12px 14px;
}

.coach-ai-readout-head {
    border-right: 1px solid var(--coach-border-muted);
    background: rgba(191, 243, 232, 0.025);
}

.coach-ai-readout-kicker,
.coach-ai-readout-item span {
    display: block;
    margin-bottom: 5px;
    color: rgba(214, 223, 232, 0.42);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-ai-readout-title {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    color: var(--text-primary);
    font-size: 13.5px;
    font-weight: 760;
    line-height: 1.25;
}

.coach-ai-readout-title i,
.coach-ai-readout-title svg {
    width: 14px;
    height: 14px;
    flex: 0 0 auto;
    color: rgba(191, 243, 232, 0.74);
}

.coach-ai-readout-item {
    border-right: 1px solid var(--coach-border-muted);
}

.coach-ai-readout-item:last-child {
    border-right: 0;
}

.coach-ai-readout-item strong {
    display: block;
    overflow: hidden;
    color: var(--text-primary);
    font-size: 13px;
    font-weight: 740;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-ai-readout-item.is-stop strong {
    color: rgba(255, 132, 140, 0.92);
}

.coach-ai-readout-item.is-press strong {
    color: rgba(191, 243, 232, 0.90);
}

.coach-ai-readout-item.is-test strong {
    color: rgba(214, 203, 255, 0.92);
}

.chat-suggestions {
    display: none;
}

.chat-suggestions-label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 9px;
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(214, 223, 232, 0.46);
}

.chat-suggestions-label::before {
    display: none;
}

.chat-shell {
    position: relative;
    padding: 0;
    margin: 14px 24px 24px;
    border-radius: var(--coach-radius);
    background: var(--coach-inner-bg);
    border: 1px solid var(--coach-border);
    box-shadow: none;
    overflow: hidden;
}

.chat-shell::before {
    display: none;
}

.chat-shell-head {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--coach-border-muted);
}

.chat-shell-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border-radius: 999px;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    white-space: nowrap;
}

.chat-shell-badge i {
    width: 14px;
    height: 14px;
    color: rgba(214, 223, 232, 0.62);
}

.chat-shell-note {
    font-size: var(--coach-fs-meta);
    line-height: 1.5;
    color: rgba(214, 223, 232, 0.48);
    text-align: right;
    max-width: 44ch;
}

.coach-console-commands {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--coach-border-muted);
    background: rgba(255,255,255,0.008);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-console-commands {
    display: none;
}

.coach-console-command {
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 9px;
    min-height: 38px;
    padding: 8px 10px;
    border: 1px solid rgba(255,255,255,0.055);
    border-radius: 10px;
    background: rgba(255,255,255,0.014);
    color: rgba(240, 244, 247, 0.82);
    cursor: pointer;
    text-align: left;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    position: relative;
}

.coach-console-command:last-child {
    border-right: 1px solid rgba(255,255,255,0.055);
}

.coach-console-command:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.035);
    color: var(--text-primary);
}

.coach-console-command i,
.coach-console-command svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.coach-console-command span {
    min-width: 0;
    overflow: hidden;
    font-size: 12.5px;
    font-weight: 680;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-shell-status {
    display: none;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-bottom: 1px solid var(--coach-border-muted);
}

.chat-shell-status-item {
    display: grid;
    gap: 4px;
    min-width: 0;
    padding: 13px 16px;
}

.chat-shell-status-item:not(:last-child) {
    border-right: 1px solid var(--coach-border-muted);
}

.chat-shell-status-label {
    color: rgba(214, 223, 232, 0.46);
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    letter-spacing: 0.12em;
    line-height: 1.2;
    text-transform: uppercase;
}

.chat-shell-status-value {
    color: var(--text-primary);
    font-size: var(--coach-fs-body-sm);
    font-weight: 650;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-context-banner {
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 14px 16px 0;
    padding: 12px 14px;
    border-radius: var(--coach-radius);
    border: 1px solid rgba(77, 171, 154, 0.18);
    background: rgba(77,171,154,0.045);
}

.chat-context-banner.visible {
    display: none;
}

.chat-context-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-context-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(77,171,154,0.86);
}

.chat-context-label {
    color: var(--text-primary);
    font-size: 13px;
    line-height: 1.45;
}

.chat-context-clear {
    flex-shrink: 0;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.03);
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 600;
}

.chat-context-entry {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 0 0 12px;
    padding: 14px;
    border-radius: var(--coach-radius);
    border: 1px solid rgba(77, 171, 154, 0.16);
    background: rgba(77, 171, 154, 0.04);
}

.chat-context-entry-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.chat-context-entry-kicker {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(77,171,154,0.86);
}

.chat-context-entry-title {
    font-size: 14px;
    line-height: 1.45;
    color: var(--text-primary);
    font-weight: 600;
}

.chat-context-facts {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-context-fact {
    font-size: 13px;
    line-height: 1.5;
    color: rgba(214, 223, 232, 0.72);
}

.chat-messages {
    height: clamp(460px, 56vh, 720px);
    min-height: 460px;
    max-height: 720px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 22px;
    margin-bottom: 0;
    padding: 26px 28px 24px;
    scrollbar-width: thin;
    scrollbar-color: var(--glass-border-hover) transparent;
}

.chat-messages.is-loading {
    justify-content: flex-start;
}

.chat-history-loader {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 46ch;
    padding-top: 0;
}

.chat-history-loader-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.chat-history-loader-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(77,171,154,0.84);
}

.chat-history-loader-pulse {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 0 0 0 rgba(77, 171, 154, 0.26);
    animation: coachHistoryPulse 1.45s ease-out infinite;
}

.chat-history-loader-title {
    font-size: 14px;
    line-height: 1.55;
    color: rgba(214, 223, 232, 0.78);
}

.chat-history-loader-lines {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.chat-history-loader-line {
    position: relative;
    display: block;
    height: 12px;
    width: 86%;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255,255,255,0.055);
}

.chat-history-loader-line::after {
    content: '';
    position: absolute;
    inset: 0;
    width: 42%;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.13), transparent);
    transform: translateX(-120%);
    animation: coachHistoryShimmer 1.35s ease-in-out infinite;
}

.chat-history-loader-line:nth-child(2)::after {
    animation-delay: 0.14s;
}

.chat-history-loader-line:nth-child(3)::after {
    animation-delay: 0.28s;
}

.chat-history-loader-line:nth-child(4)::after {
    animation-delay: 0.42s;
}

.chat-history-loader-line.is-wide {
    width: 96%;
}

.chat-history-loader-line.is-mid {
    width: 72%;
}

.chat-history-loader-line.is-short {
    width: 58%;
}

.chat-history-status {
    max-width: 44ch;
    padding-top: 8px;
    color: rgba(214, 223, 232, 0.54);
    font-size: 14px;
    line-height: 1.6;
}

.chat-messages:empty::before {
    content: 'Ask about your patterns, discipline, edge, or where your execution slips.';
    display: block;
    max-width: 44ch;
    padding-top: 0;
    color: rgba(214, 223, 232, 0.38);
    font-size: 14px;
    line-height: 1.6;
}

.coach-answer-v2 {
    display: grid;
    gap: 16px;
    width: 100%;
}

.coach-answer-v2-direct {
    color: var(--text-primary);
    font-size: 17px;
    font-weight: 650;
    line-height: 1.5;
}

.coach-answer-v2-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.coach-answer-v2-scope span {
    display: inline-flex;
    align-items: center;
    min-height: 25px;
    padding: 4px 8px;
    border: 1px solid rgba(77, 171, 154, 0.18);
    border-radius: 999px;
    color: rgba(214, 223, 232, 0.62);
    background: rgba(77, 171, 154, 0.045);
    font: 600 10px/1.2 'DM Mono', monospace;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.coach-answer-v2-evidence {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    overflow: hidden;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
}

.coach-answer-v2-proof {
    min-width: 0;
    padding: 12px 13px;
    border-right: 1px solid var(--coach-border-muted);
}

.coach-answer-v2-proof:last-child { border-right: 0; }
.coach-answer-v2-proof small,
.coach-answer-v2-limit small {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font: 650 9px/1.2 'DM Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.coach-answer-v2-proof strong {
    display: block;
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.4;
}
.coach-answer-v2-proof em {
    display: block;
    margin-top: 4px;
    color: var(--mint);
    font: 650 12px/1.35 'DM Mono', monospace;
    font-style: normal;
}

.coach-answer-v2-explanation,
.coach-answer-v2-limit,
.coach-answer-v2-next {
    color: rgba(214, 223, 232, 0.7);
    font-size: 14px;
    line-height: 1.6;
}

.coach-answer-v2-limit {
    padding-left: 12px;
    border-left: 2px solid rgba(245, 158, 11, 0.46);
}

.coach-answer-v2-next {
    padding-left: 12px;
    border-left: 2px solid rgba(77, 171, 154, 0.52);
}

.coach-answer-v2-next small {
    display: block;
    margin-bottom: 5px;
    color: var(--mint);
    font: 650 9px/1.2 'DM Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coach-answer-v2-action {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    width: fit-content;
    max-width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid rgba(77, 171, 154, 0.3);
    border-radius: var(--coach-radius);
    color: var(--mint);
    background: rgba(77, 171, 154, 0.06);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

/* Native Coach responses are assembled from server evidence, not model-authored layout. */
.chat-msg--native-response {
    width: min(100%, 940px);
    max-width: min(100%, 940px);
}

.chat-msg--native-response .chat-msg-body,
.chat-msg--native-response .chat-msg-bubble {
    width: 100%;
}

.coach-native-response {
    display: grid;
    gap: 18px;
    width: 100%;
    color: var(--text-primary);
}

.coach-setup-verdict-head {
    display: grid;
    gap: 7px;
}

.coach-setup-verdict-name,
.coach-setup-verdict-why > small,
.coach-setup-verdict-limit > small {
    color: var(--text-muted);
    font: 650 10px/1.2 'DM Mono', monospace;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coach-setup-verdict-head h3 {
    margin: 0;
    color: var(--mint);
    font-size: clamp(25px, 2.2vw, 34px);
    font-weight: 720;
    line-height: 1.05;
    letter-spacing: -0.035em;
}

.coach-setup-verdict--restrict .coach-setup-verdict-head h3 {
    color: #e7b45b;
}

.coach-setup-verdict--kill .coach-setup-verdict-head h3 {
    color: var(--loss, #ff6b74);
}

.coach-insufficient-evidence .coach-setup-verdict-head h3 {
    color: #e7b45b;
}

.coach-leak-response .coach-setup-verdict-head h3 {
    color: var(--loss, #ff6b74);
}

.coach-setup-verdict-head p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.coach-setup-verdict-evidence {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    padding: 13px 0;
    border-top: 1px solid var(--coach-border-muted);
    border-bottom: 1px solid var(--coach-border-muted);
}

.coach-setup-verdict-metric {
    display: inline-flex;
    align-items: baseline;
    gap: 4px;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

.coach-setup-verdict-metric strong {
    color: var(--text-primary);
    font-size: 15px;
    font-weight: 720;
}

.coach-setup-verdict-metric.is-positive strong { color: var(--mint); }
.coach-setup-verdict-metric.is-negative strong { color: var(--loss, #ff6b74); }

.coach-native-observation {
    display: inline-grid;
    gap: 3px;
    min-width: 0;
}

.coach-native-observation small {
    color: var(--text-muted);
    font-size: 10px;
    line-height: 1.25;
}

.coach-native-observation strong {
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.3;
}

.coach-setup-verdict-separator {
    width: 3px;
    height: 3px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.28);
}

.coach-setup-verdict-why,
.coach-setup-verdict-limit {
    display: grid;
    gap: 8px;
}

.coach-setup-verdict-why ul {
    display: grid;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.coach-setup-verdict-why li {
    position: relative;
    padding-left: 15px;
    color: rgba(226, 232, 240, 0.78);
    font-size: 14px;
    line-height: 1.55;
}

.coach-setup-verdict-why li::before {
    content: '';
    position: absolute;
    top: 0.7em;
    left: 1px;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--mint);
}

.coach-setup-verdict-limit {
    max-width: 76ch;
    padding-left: 12px;
    border-left: 2px solid rgba(245, 158, 11, 0.46);
}

.coach-setup-verdict-limit p {
    margin: 0;
    color: rgba(226, 232, 240, 0.62);
    font-size: 13px;
    line-height: 1.55;
}

.coach-setup-verdict-action {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: fit-content;
    max-width: 100%;
    min-height: 42px;
    padding: 10px 13px;
    border: 1px solid rgba(77, 171, 154, 0.30);
    border-radius: var(--coach-radius);
    color: var(--mint);
    background: rgba(77, 171, 154, 0.055);
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
}

.coach-setup-verdict-action:hover,
.coach-setup-verdict-action:focus-visible {
    border-color: rgba(77, 171, 154, 0.52);
    background: rgba(77, 171, 154, 0.09);
}

@media (max-width: 520px) {
    .coach-native-response { gap: 15px; }
    .coach-setup-verdict-head h3 { font-size: 25px; }
    .coach-setup-verdict-action { width: 100%; }
}

html.light .coach-answer-v2-scope span,
html[data-theme="light"] .coach-answer-v2-scope span { color: #5f6670; }
html.light .coach-answer-v2-explanation,
html.light .coach-answer-v2-limit,
html[data-theme="light"] .coach-answer-v2-explanation,
html[data-theme="light"] .coach-answer-v2-limit { color: #5f6670; }

/* Native response contracts need explicit light semantic colors; several dark
   translucent values otherwise disappear against the white Coach canvas. */
:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-head h3 {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict--restrict .coach-setup-verdict-head h3,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-insufficient-evidence .coach-setup-verdict-head h3 {
    color: #a16207;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict--kill .coach-setup-verdict-head h3,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-leak-response .coach-setup-verdict-head h3 {
    color: #b91c1c;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-why li,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-limit p {
    color: var(--text-secondary);
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-why li::before {
    background: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-separator {
    background: rgba(15, 23, 42, 0.24);
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-metric.is-positive strong {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-metric.is-negative strong {
    color: #b91c1c;
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-action,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-answer-v2-action {
    border-color: rgba(15, 118, 110, 0.28);
    color: #0f766e;
    background: rgba(15, 118, 110, 0.055);
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-action:hover,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-setup-verdict-action:focus-visible,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-answer-v2-action:hover,
:is(html.light, html[data-theme="light"]) body.coach-page .coach-answer-v2-action:focus-visible {
    border-color: rgba(15, 118, 110, 0.46);
    color: #115e59;
    background: rgba(15, 118, 110, 0.09);
}

:is(html.light, html[data-theme="light"]) body.coach-page .coach-answer-v2-proof em {
    color: #0f766e;
}

@media (max-width: 520px) {
    .coach-answer-v2 { gap: 13px; }
    .coach-answer-v2-direct { font-size: 16px; }
    .coach-answer-v2-evidence { grid-template-columns: 1fr; }
    .coach-answer-v2-proof { border-right: 0; border-bottom: 1px solid var(--coach-border-muted); }
    .coach-answer-v2-proof:last-child { border-bottom: 0; }
    .coach-answer-v2-action { width: 100%; }
}

.chat-msg {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    max-width: min(82%, 860px);
}

.chat-msg.user {
    flex-direction: row-reverse;
    align-items: flex-end;
    max-width: min(68%, 720px);
}

.chat-msg-avatar {
    width: 40px;
    height: 40px;
    margin-top: 25px;
    border-radius: 12px;
    border: 1px solid var(--coach-border-muted);
    background: rgba(255,255,255,0.03);
    color: rgba(214, 223, 232, 0.72);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 40px;
    overflow: hidden;
    font-size: 10px;
    font-weight: 750;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-msg-avatar::before,
.chat-msg-avatar::after {
    content: '';
    display: none;
}

.chat-msg-avatar img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.chat-msg-avatar--coach {
    position: relative;
    width: 40px;
    height: 40px;
    flex-basis: 40px;
    margin-top: 18px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(226, 232, 240, 0.88);
    box-shadow: none;
    overflow: visible;
}

.chat-msg-avatar--coach::before,
.chat-msg-avatar--coach::after {
    display: block;
    position: absolute;
    pointer-events: none;
}

.chat-msg-avatar--coach::before {
    inset: auto;
    border: 0;
    background: none;
    opacity: 0;
    transform: none;
}

.chat-msg-avatar--coach::after {
    display: none;
}

.chat-msg.typing .chat-msg-avatar--coach {
    border-color: transparent;
    box-shadow: none;
}

.chat-msg.typing .chat-msg-avatar--coach::before {
    opacity: 0.64;
}

.chat-msg-avatar-orb {
    position: relative;
    z-index: 1;
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    animation: coachAvatarOrbRotate 5.2s linear infinite;
    box-shadow:
        0 7px 13px 0 rgba(255, 255, 255, 0.70) inset,
        0 14px 17px 0 rgba(173, 95, 255, 0.66) inset,
        0 31px 31px 0 rgba(71, 30, 236, 0.62) inset,
        0 0 0 1px rgba(255, 255, 255, 0.05);
}

.chat-msg-avatar-orb::after {
    content: '';
    position: absolute;
    inset: 10px;
    border-radius: inherit;
    background: rgba(255, 255, 255, 0.44);
    filter: blur(2px);
    opacity: 0.52;
}

.chat-msg.typing .chat-msg-avatar-orb {
    animation-duration: 2.2s;
    box-shadow:
        0 7px 13px 0 rgba(255, 255, 255, 0.76) inset,
        0 13px 14px 0 rgba(214, 10, 71, 0.58) inset,
        0 29px 34px 0 rgba(49, 30, 128, 0.68) inset,
        0 0 0 1px rgba(202, 189, 255, 0.12);
}

@keyframes coachAvatarOrbRotate {
    0% {
        transform: rotate(90deg);
        box-shadow:
            0 7px 13px 0 rgba(255, 255, 255, 0.70) inset,
            0 14px 17px 0 rgba(173, 95, 255, 0.66) inset,
            0 31px 31px 0 rgba(71, 30, 236, 0.62) inset,
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    50% {
        transform: rotate(270deg);
        box-shadow:
            0 7px 13px 0 rgba(255, 255, 255, 0.72) inset,
            0 14px 8px 0 rgba(214, 10, 71, 0.54) inset,
            0 25px 31px 0 rgba(49, 30, 128, 0.66) inset,
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
    100% {
        transform: rotate(450deg);
        box-shadow:
            0 7px 13px 0 rgba(255, 255, 255, 0.70) inset,
            0 14px 17px 0 rgba(173, 95, 255, 0.66) inset,
            0 31px 31px 0 rgba(71, 30, 236, 0.62) inset,
            0 0 0 1px rgba(255, 255, 255, 0.05);
    }
}

.chat-msg-avatar--user {
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    flex-basis: 38px;
    margin-top: 24px;
    margin-bottom: 0;
    border-radius: 12px;
}

.chat-msg-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.chat-msg-meta {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(226, 232, 240, 0.42);
    padding: 0 4px;
}

.chat-msg-bubble {
    padding: 16px 18px;
    border-radius: 14px;
    font-size: 14.5px;
    line-height: 1.66;
    white-space: normal;
    word-break: break-word;
}

.chat-msg.user {
    align-self: flex-end;
}

.chat-msg.user .chat-msg-meta {
    color: rgba(143, 241, 205, 0.82);
    text-align: right;
}

.chat-msg.user .chat-msg-bubble {
    background: rgba(77, 171, 154, 0.08);
    border: 1px solid rgba(77, 171, 154, 0.18);
    color: var(--text-primary);
    border-bottom-right-radius: 5px;
}

.chat-msg-attachment {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    width: fit-content;
    margin: 6px 2px 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(226, 232, 240, 0.48);
    font-size: 11.5px;
    line-height: 1.2;
    text-align: left;
}

.chat-msg-attachment > i,
.chat-msg-attachment > svg {
    width: 13px;
    height: 13px;
    flex: 0 0 13px;
    color: rgba(143, 241, 205, 0.56);
}

.chat-msg-attachment-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.chat-msg-attachment-copy strong {
    overflow: hidden;
    max-width: min(420px, 54vw);
    color: rgba(226, 232, 240, 0.68);
    font-size: 11.5px;
    font-weight: 650;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-msg-attachment-copy small {
    color: rgba(226, 232, 240, 0.36);
    font-size: 10.5px;
    font-weight: 560;
    line-height: 1.15;
}

.chat-msg.assistant {
    color: var(--text-secondary);
    align-self: flex-start;
    display: flex;
    max-width: min(100%, 820px);
}

.chat-msg.assistant .chat-msg-body {
    flex: 1;
    width: auto;
}

.chat-msg.assistant .chat-msg-bubble {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-secondary);
}

.chat-coach-key {
    color: rgba(240, 244, 247, 0.94);
    font-weight: 760;
}

.chat-coach-number {
    color: rgba(226, 232, 240, 0.82);
    font-weight: 760;
    font-variant-numeric: tabular-nums;
}

.chat-coach-number.is-negative {
    color: rgba(255, 132, 140, 0.92);
}

.chat-coach-number.is-positive {
    color: rgba(226, 232, 240, 0.82);
}

.coach-answer-board {
    width: min(100%, 760px);
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.014);
    overflow: hidden;
}

.coach-answer-board-head {
    display: grid;
    gap: 7px;
    padding: 18px 20px 17px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(255, 255, 255, 0.012);
}

.coach-answer-kicker {
    color: rgba(143, 241, 205, 0.68);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.14em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-answer-title {
    margin: 0;
    color: rgba(248, 250, 252, 0.94);
    font-size: 18px;
    font-weight: 760;
    line-height: 1.18;
    letter-spacing: -0.02em;
}

.coach-answer-lead {
    margin: 0;
    max-width: 66ch;
    color: rgba(226, 232, 240, 0.72);
    font-size: 14.5px;
    line-height: 1.56;
}

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

.coach-answer-item {
    min-width: 0;
    padding: 15px 18px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

.coach-answer-item:nth-child(odd) {
    border-right: 1px solid rgba(255, 255, 255, 0.055);
}

.coach-answer-item:nth-last-child(-n + 2) {
    border-bottom: 0;
}

.coach-answer-item-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    color: rgba(226, 232, 240, 0.42);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
}

.coach-answer-item-label::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.30);
}

.coach-answer-item.is-action .coach-answer-item-label::before,
.coach-answer-item.is-focus .coach-answer-item-label::before {
    background: rgba(143, 241, 205, 0.76);
}

.coach-answer-item.is-risk .coach-answer-item-label::before,
.coach-answer-item.is-stop .coach-answer-item-label::before {
    background: rgba(255, 132, 140, 0.82);
}

.coach-answer-item.is-rule .coach-answer-item-label::before,
.coach-answer-item.is-test .coach-answer-item-label::before {
    background: rgba(122, 223, 201, 0.82);
}

.coach-answer-item-value {
    color: rgba(226, 232, 240, 0.74);
    font-size: 14px;
    line-height: 1.56;
}

.coach-answer-item-value strong {
    color: rgba(248, 250, 252, 0.92);
    font-weight: 730;
}

.coach-answer-footnote {
    padding: 14px 20px 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.055);
    color: rgba(226, 232, 240, 0.56);
    font-size: 13.5px;
    line-height: 1.58;
}

.coach-answer-text {
    max-width: 76ch;
    color: var(--text-secondary);
    font-size: 15px;
    line-height: 1.7;
}

@media (max-width: 760px) {
    .coach-answer-grid {
        grid-template-columns: 1fr;
    }

    .coach-answer-item,
    .coach-answer-item:nth-child(odd),
    .coach-answer-item:nth-last-child(-n + 2) {
        border-right: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    }

    .coach-answer-item:last-child {
        border-bottom: 0;
    }
}

.chat-msg.assistant .chat-msg-meta {
    color: rgba(226, 232, 240, 0.5);
}

.chat-msg-meta--coach {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.chat-msg-meta--coach i,
.chat-msg-meta--coach svg {
    width: 13px;
    height: 13px;
    color: var(--coach-accent-strong);
}

.chat-msg.typing {
    max-width: min(100%, 620px);
}

.chat-msg.typing .chat-msg-bubble {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: rgba(226, 232, 240, 0.6);
    font-style: normal;
}

.chat-typing-dots {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.chat-typing-dots span {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(77, 171, 154, 0.72);
    animation: chatTyping 1.1s infinite ease-in-out;
}

.chat-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing-dots span:nth-child(3) { animation-delay: 0.3s; }

@keyframes chatTyping {
    0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

@keyframes chatHistoryPulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes coachHistoryPulse {
    0% { box-shadow: 0 0 0 0 rgba(77, 171, 154, 0.24); opacity: 0.62; }
    55% { box-shadow: 0 0 0 7px rgba(77, 171, 154, 0); opacity: 1; }
    100% { box-shadow: 0 0 0 0 rgba(77, 171, 154, 0); opacity: 0.62; }
}

@keyframes coachHistoryShimmer {
    0% { transform: translateX(-130%); }
    100% { transform: translateX(260%); }
}

.chat-input-row {
    display: flex;
    align-items: stretch;
    gap: 10px;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--coach-border-muted);
    background: rgba(255,255,255,0.012);
}

.chat-input-wrap {
    display: flex;
    flex: 1;
    min-width: 0;
    align-items: center;
    gap: 10px;
}

.coach-file-input {
    display: none;
}

.chat-input {
    flex: 1;
    min-height: 46px;
    padding: 0 14px;
    background: transparent;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
    color: var(--text-primary);
    font-size: 14px;
    font-family: 'Instrument Sans', sans-serif;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.chat-input:focus {
    border-color: rgba(77, 171, 154, 0.32);
    box-shadow: none;
    background: rgba(255,255,255,0.018);
}

.chat-input::placeholder { color: rgba(214, 223, 232, 0.3); }

.chat-send {
    min-width: 104px;
    padding: 0 18px;
    background: rgba(77, 171, 154, 0.12);
    border: 1px solid rgba(77, 171, 154, 0.26);
    border-radius: var(--coach-radius);
    color: #bff3e8;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: none;
}

.chat-send:hover {
    background: rgba(77, 171, 154, 0.16);
    border-color: rgba(77, 171, 154, 0.34);
    color: #d6fff6;
}

.chat-send:disabled { opacity: 0.4; cursor: not-allowed; }

.chat-send i {
    width: 16px;
    height: 16px;
}

.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.chat-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 12px;
    background: transparent;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    color: rgba(214, 223, 232, 0.58);
    text-align: center;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.chat-chip:hover {
    border-color: rgba(77, 171, 154, 0.24);
    color: #c7efe5;
    background: rgba(77, 171, 154, 0.06);
    transform: none;
}

/* Quick Insight Buttons (Psychology Analysis) */
.quick-insights {
    display: none;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    margin: 16px 24px 18px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--coach-border-muted);
}

.quick-insight-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 58px;
    padding: 10px 12px;
    background: transparent;
    border: 1px solid var(--coach-border-muted);
    border-radius: var(--coach-radius);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease;
    min-width: 0;
    position: relative;
    overflow: hidden;
}

.quick-insight-btn:hover {
    background: rgba(255, 255, 255, 0.03);
    border-color: var(--coach-border-hover);
    transform: none;
    box-shadow: none;
}

.quick-insight-btn:active {
    transform: translateY(0);
}

.quick-insight-btn::before {
    display: none;
}

.quick-insight-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--coach-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.06);
    box-shadow: none;
}

.quick-insight-icon i {
    width: 17px !important;
    height: 17px !important;
}

#dayChartMini {
    min-height: 112px;
    box-sizing: border-box;
    padding: 8px 14px 18px;
    overflow: visible;
}

.coach-day-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 12px;
    min-height: 96px;
    padding: 0 2px;
}

.coach-day-bar {
    display: grid;
    grid-template-rows: 1fr auto;
    align-items: end;
    gap: 8px;
    min-width: 0;
    height: 96px;
}

.coach-day-bar-track {
    position: relative;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 68px;
    border-radius: 999px;
    background: transparent;
}

.coach-day-bar-fill {
    width: min(24px, 72%);
    min-height: 4px;
    border-radius: 5px;
    background: rgba(214, 223, 232, 0.12);
}

.coach-day-bar-fill.is-empty {
    width: 16px;
    min-height: 0;
    height: 2px !important;
    opacity: 0.32;
}

.coach-day-bar-fill.is-green {
    background: #22c55e;
}

.coach-day-bar-fill.is-red {
    background: #ef4444;
}

.coach-day-bar-label {
    overflow: hidden;
    color: rgba(214, 223, 232, 0.38);
    font-size: 12px;
    line-height: 1;
    text-align: center;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-day-bar-value {
    position: absolute;
    top: -16px;
    left: 50%;
    color: rgba(214, 223, 232, 0.42);
    font-family: 'DM Mono', monospace;
    font-size: 10px;
    line-height: 1;
    opacity: 0;
    transform: translateX(-50%);
    transition: opacity 0.18s ease;
    white-space: nowrap;
}

.coach-day-bar:hover .coach-day-bar-value {
    opacity: 1;
}

#sessionLabelTitle {
    display: none;
}

#scoreRows {
    margin-top: 10px;
}

.quick-insight-icon.psychology {
    background: rgba(77, 171, 154, 0.08);
    color: #7fe0c5;
}

.quick-insight-icon.leaks {
    background: rgba(239, 68, 68, 0.08);
    color: #fb7185;
}

.quick-insight-icon.revenge {
    background: rgba(245, 158, 11, 0.08);
    color: #fbbf24;
}

.quick-insight-icon.tilt {
    background: rgba(245, 158, 11, 0.08);
    color: #f59e0b;
}

.quick-insight-text {
    text-align: left;
    flex: 1;
    max-width: none;
    padding-right: 8px;
}

.quick-insight-title {
    font-size: 13px;
    font-weight: 650;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 3px;
    letter-spacing: 0;
}

.quick-insight-desc {
    font-size: 12px;
    color: rgba(214, 223, 232, 0.54);
    line-height: 1.4;
}

@media (max-width: 768px) {
    .insight-card {
        grid-template-columns: 30px minmax(0, 1fr);
    }
    #insightsCard .coach-card-title,
    #patternsCard .coach-card-title,
    #whatifCard .coach-card-title {
        padding: 16px 20px;
    }
    .insight-copy,
    .pattern-card,
    #whatifContent {
        padding-left: 0;
        padding-right: 0;
    }
    .insight-icon,
    .insight-card.is-featured .insight-icon {
        width: 30px;
        height: 30px;
    }
    .chat-shell {
        padding: 0;
        border-radius: var(--coach-radius);
    }
    .coach-command-deck {
        grid-template-columns: 1fr;
        width: 100%;
        overflow: hidden;
    }
    .coach-command-read {
        min-width: 0;
        padding: 18px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--coach-border-muted);
    }
    .coach-command-title {
        max-width: 100%;
        font-size: 22px;
        line-height: 1.08;
    }
    .coach-command-sub {
        margin-top: 9px;
        font-size: 13.5px;
        line-height: 1.48;
    }
    .coach-command-actions {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
        min-width: 0;
        padding: 12px 24px 16px;
    }
    .coach-command-actions-head {
        align-items: flex-start;
    }
    .coach-command-actions-note {
        display: none;
    }
    .coach-command-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: 16px;
        width: 100%;
    }
    .coach-command-metric:not(:last-child) {
        border-right: 1px solid var(--coach-border-muted);
        border-bottom: 0;
    }
    .coach-command-metric {
        padding: 10px;
    }
    .coach-command-metric span {
        font-size: 9px;
    }
    .coach-command-metric strong {
        font-size: 12px;
    }
    .coach-command-btn {
        grid-template-columns: 22px minmax(0, 1fr);
        min-height: 46px;
        gap: 8px;
        min-width: 0;
        padding: 8px 9px;
    }
    .coach-command-btn--primary {
        grid-template-columns: 22px minmax(0, 1fr);
    }
    .coach-command-btn--primary::after {
        display: none;
    }
    .coach-command-proof {
        grid-template-columns: 1fr;
    }
    .coach-command-proof-item:not(:last-child) {
        border-right: 0;
        border-bottom: 1px solid var(--coach-border-muted);
    }
    .coach-command-icon {
        width: 22px;
        height: 22px;
    }
    .coach-command-copy strong {
        margin-bottom: 1px;
        font-size: 12.5px;
        line-height: 1.15;
    }
    .coach-command-copy span {
        font-size: 10.5px;
        line-height: 1.2;
    }
    .coach-ai-readout {
        grid-template-columns: 1fr;
        margin: 16px 24px 16px;
    }
    .coach-ai-readout-head,
    .coach-ai-readout-item {
        padding: 13px 14px;
        border-right: 0;
        border-bottom: 1px solid var(--coach-border-muted);
    }
    .coach-ai-readout-item:last-child {
        border-bottom: 0;
    }
    .chat-shell-head {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .chat-shell-note {
        max-width: none;
        text-align: left;
    }
    .coach-console-commands {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }
    .coach-console-command,
    .coach-console-command:nth-child(2n),
    .coach-console-command:nth-child(n + 3) {
        border: 1px solid rgba(255,255,255,0.055);
    }
    .chat-shell-status {
        grid-template-columns: 1fr;
    }
    .chat-shell-status-item:not(:last-child) {
        border-right: 0;
        border-bottom: 1px solid var(--coach-border-muted);
    }
    .chat-messages {
        height: clamp(340px, 52dvh, 560px);
        min-height: 340px;
        max-height: 560px;
    }
    .chat-msg {
        max-width: 100%;
    }
    .chat-msg-avatar {
        width: 36px;
        height: 36px;
        flex-basis: 36px;
        margin-top: 23px;
    }
    .chat-msg-avatar--coach {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        margin-top: 18px;
    }
    .chat-msg-avatar--user {
        width: 34px;
        height: 34px;
        flex-basis: 34px;
    }
    .chat-input-row {
        flex-direction: column;
    }
    .chat-input-wrap {
        flex-direction: column;
        align-items: stretch;
    }
    .chat-remaining {
        align-self: flex-start;
        margin-left: 0;
    }
    .chat-send {
        min-width: 0;
        min-height: 50px;
    }
    .quick-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .quick-insight-btn {
        min-height: 82px;
        padding: 16px;
        gap: 14px;
    }
    .quick-insight-icon {
        width: 42px;
        height: 42px;
        border-radius: var(--coach-radius);
    }
    .quick-insight-icon i {
        width: 22px !important;
        height: 22px !important;
    }
    .quick-insight-title {
        font-size: 15px;
    }
    .quick-insight-desc {
        font-size: 14px;
    }
    .whatif-compare {
        grid-template-columns: 1fr;
    }
    .whatif-box + .whatif-box {
        border-left: 0;
        border-top: 1px solid var(--coach-border-muted);
    }
}

.chat-remaining {
    flex: 0 0 auto;
    align-self: center;
    min-width: max-content;
    margin-left: auto;
    color: rgba(214, 223, 232, 0.42);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1;
    text-align: right;
    text-transform: none;
    font-family: inherit;
}

/* ============================================
   Weekly Report
   ============================================ */
.weekly-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.weekly-nav-btn {
    min-height: 36px;
    padding: 0 14px;
    background: var(--coach-control-bg);
    border: 1px solid var(--coach-border);
    border-radius: var(--coach-radius);
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
}

.weekly-nav-btn:hover { background: rgba(255,255,255,0.05); border-color: var(--coach-border-hover); color: var(--text-primary); }

.weekly-nav-btn i {
    width: 14px;
    height: 14px;
    flex: 0 0 14px;
}

.weekly-period {
    font-family: 'DM Mono', monospace;
    font-size: 15px;
    color: var(--text-muted);
    text-align: center;
    min-width: 0;
}

.weekly-grade {
    width: 100%;
    min-height: 100%;
    border-radius: var(--coach-radius);
    display: flex; align-items: center; justify-content: center;
    font-family: 'DM Mono', monospace;
    font-size: 24px;
    font-weight: 700;
    align-self: stretch;
    margin: 0;
}

.weekly-grade.good { background: rgba(34, 197, 94, 0.12); color: #22c55e; border: 1px solid rgba(34, 197, 94, 0.2); }
.weekly-grade.mid { background: rgba(245, 158, 11, 0.12); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.2); }
.weekly-grade.bad { background: rgba(239, 68, 68, 0.12); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.2); }

.weekly-report-board {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: stretch;
    gap: 14px;
    margin-bottom: 16px;
}

.weekly-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    margin-bottom: 0;
    border-top: 1px solid var(--coach-border-muted);
    border-bottom: 1px solid var(--coach-border-muted);
}

.weekly-stat {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 14px 16px;
    text-align: left;
}

.weekly-stat:not(:last-child) {
    border-right: 1px solid var(--coach-border-muted);
}

.weekly-stat:nth-child(3n) {
    border-right: 0;
}

.weekly-stat:nth-child(n + 4) {
    border-top: 1px solid var(--coach-border-muted);
}

.weekly-stat-label {
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.weekly-stat-value {
    font-family: 'DM Mono', monospace;
    font-size: 18px;
    font-weight: 600;
}

.weekly-pattern-line {
    padding-top: 0;
    border-top: 0;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: 14px;
    line-height: 1.6;
}

.weekly-pattern-line strong {
    color: var(--text-primary);
    font-weight: 650;
}

.weekly-summary {
    font-size: 14px;
    line-height: 1.7;
    color: var(--text-secondary);
    white-space: pre-line;
}

.weekly-loading { text-align: center; padding: 40px; color: var(--text-muted); }

/* ============================================
   Sidebar: Pattern Detection
   ============================================ */
.pattern-card {
    background: transparent;
    border: 0;
    border-top: 1px solid var(--coach-border-muted);
    border-radius: 0;
    padding: 18px 24px 18px;
    margin-bottom: 0;
    box-shadow: none;
}

#patternsCard .coach-card-title + .pattern-card {
    border-top: 0;
}

#patternDay {
    padding-bottom: 18px;
}

.pattern-card:last-child { margin-bottom: 0; }

.coach-panel-empty {
    display: grid;
    gap: 8px;
    min-height: 54px;
    padding: 12px 0 2px;
    color: rgba(214, 223, 232, 0.42);
    font-size: 13px;
    line-height: 1.45;
}

.coach-panel-empty strong {
    color: rgba(240, 244, 247, 0.76);
    font-size: 14px;
    font-weight: 650;
}

.coach-panel-lines {
    display: grid;
    gap: 9px;
    padding: 4px 0;
}

.coach-panel-line {
    display: block;
    width: 100%;
    height: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(255,255,255,0.045), rgba(255,255,255,0.085), rgba(255,255,255,0.045));
    background-size: 180% 100%;
    animation: coachPanelPulse 1.4s ease-in-out infinite;
}

.coach-panel-line.is-short {
    width: 58%;
}

@keyframes coachPanelPulse {
    0% { background-position: 100% 0; }
    100% { background-position: -100% 0; }
}

.pattern-title {
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(214, 223, 232, 0.42);
    margin-bottom: 14px;
}

.pattern-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    font-size: 14px;
}

.pattern-row:not(:last-child) { border-bottom: 1px solid var(--coach-border-muted); }
.pattern-row .label {
    color: rgba(214, 223, 232, 0.5);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}
.pattern-row .value {
    font-family: 'DM Mono', monospace;
    font-weight: 600;
    color: rgba(240, 244, 247, 0.92);
    text-align: right;
}
.pattern-row .value.green { color: #22c55e; }
.pattern-row .value.red { color: #ef4444; }
.pattern-row .value.accent { color: var(--accent); }
.pattern-subtitle {
    margin: 10px 0 6px;
    color: rgba(214, 223, 232, 0.44);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pattern-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 24px;
    padding: 0 9px;
    border-radius: var(--coach-radius);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.pattern-badge.best {
    background: rgba(77, 171, 154, 0.1);
    border: 1px solid rgba(77, 171, 154, 0.18);
    color: var(--accent);
}

.score-bar {
    display: flex;
    height: 7px;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 10px;
    gap: 3px;
    background: rgba(255,255,255,0.045);
}

.score-bar-segment {
    height: 100%;
    border-radius: 999px;
    transition: width 0.3s;
}

.score-dot {
    display: inline-block;
    width: 9px;
    height: 9px;
    flex: 0 0 auto;
    margin-right: 10px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    vertical-align: 1px;
}

.score-label-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.streak-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 12px;
    border-radius: var(--coach-radius);
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 600;
}

.streak-indicator svg {
    width: 16px;
    height: 16px;
    stroke-width: 2px;
}

.streak-indicator.win {
    background: rgba(34, 197, 94, 0.065);
    border-color: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}
.streak-indicator.loss {
    background: rgba(239, 68, 68, 0.065);
    border-color: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}
.streak-indicator.neutral {
    background: rgba(255,255,255,0.03);
    border-color: rgba(255,255,255,0.06);
    color: var(--text-muted);
}

/* Sidebar: What-If */
#whatifContent {
    padding: 18px 24px 24px;
}

.whatif-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 14px;
    border-top: 1px solid var(--coach-border-muted);
    border-bottom: 1px solid var(--coach-border-muted);
}

.whatif-box {
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 14px 0 14px 16px;
    text-align: left;
    box-shadow: none;
}

 .whatif-box:first-child{
    padding-left: 0;
 }

.whatif-box + .whatif-box {
    border-left: 1px solid var(--coach-border-muted);
}

.whatif-box.adjusted {
    border-color: var(--coach-border-muted);
    background: transparent;
}

.whatif-label {
    font-size: var(--coach-fs-kicker);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: rgba(214, 223, 232, 0.4);
    margin-bottom: 8px;
}

.whatif-value {
    font-family: 'DM Mono', monospace;
    font-size: 22px;
    line-height: 1.08;
    font-weight: 700;
}

.whatif-period {
    text-align: left;
    font-size: var(--coach-fs-meta);
    color: rgba(214, 223, 232, 0.32);
    margin-bottom: 12px;
    font-family: 'DM Mono', monospace;
}

.whatif-delta {
    display: flex;
    justify-content: flex-start;
    font-family: 'DM Mono', monospace;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 14px;
}

.whatif-delta-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 11px;
    border-radius: var(--coach-radius);
    background: transparent;
    border: 1px solid var(--coach-border-muted);
}

.whatif-punchline {
    max-width: none;
    margin: 0;
    padding-top: 14px;
    border-top: 1px solid var(--coach-border-muted);
    font-size: 13px;
    line-height: 1.6;
    color: rgba(214, 223, 232, 0.42);
    text-align: left;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1320px) {
    .coach-grid {
        grid-template-columns: minmax(0, 1fr) 340px;
        gap: 20px;
    }
}

@media (max-width: 1280px) {
    .coach-page-header {
        align-items: stretch;
        flex-wrap: wrap;
        gap: 16px;
    }
    .coach-title-group {
        flex: 1 1 100%;
        max-width: none;
    }
    .coach-page-toolbar.app-toolbar {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 1024px) {
    .coach-grid { grid-template-columns: 1fr; }
    .weekly-report-board {
        grid-template-columns: 1fr;
    }
    .weekly-grade {
        width: 100%;
        min-height: 58px;
    }
    .weekly-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .weekly-stat:nth-child(3n) {
        border-right: 1px solid var(--coach-border-muted);
    }
    .weekly-stat:nth-child(2n) {
        border-right: 0;
    }
    .weekly-stat:nth-child(n + 3) {
        border-top: 1px solid var(--coach-border-muted);
    }
}

/* Coach app-shell adaptation: tablet first, then PWA/mobile. */
@media (max-width: 1390px) {
    .coach-page-header {
        align-items: stretch;
        flex-wrap: wrap;
        gap: 16px;
    }

    .coach-title-group {
        flex: 1 1 100%;
        width: 100%;
        max-width: none;
    }

    .coach-page-toolbar.app-toolbar {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }

    .coach-page-toolbar .app-action-btn {
        min-width: 180px;
        justify-content: center;
    }

    .coach-grid {
        grid-template-columns: 1fr;
    }

    .coach-sidebar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: start;
    }

    .coach-shell > .coach-grid {
        margin-top: 14px !important;
    }
}

@media (max-width: 767px) {
    html,
    body.coach-page {
        min-height: 100dvh;
        overflow-x: hidden;
        background: var(--coach-page-bg);
    }

    body.coach-page.has-sidebar main.coach-shell,
    body.coach-page main.coach-shell {
        width: 100%;
        max-width: none;
        min-height: 100dvh;
        min-width: 0;
        margin: 0;
        padding: calc(14px + env(safe-area-inset-top)) 10px calc(24px + env(safe-area-inset-bottom)) !important;
        overflow-x: hidden;
    }

    .coach-shell > * {
        min-width: 0;
        max-width: 100%;
    }

    .coach-page-header {
        flex-direction: column;
        gap: 9px;
        margin-bottom: 0;
        overflow: hidden;
    }

    .coach-title-group {
        box-sizing: border-box;
        width: 100%;
        min-height: 42px;
        justify-content: center;
        gap: 7px;
        padding-left: 0;
        margin-bottom: 0;
    }

    body.coach-page.has-sidebar .coach-title-group {
        padding-left: 54px;
    }

    .coach-page-header .app-page-title {
        max-width: none;
        font-size: clamp(23px, 6.5vw, 28px);
        line-height: 0.98;
        letter-spacing: -0.055em;
    }

    body.coach-page.has-sidebar .coach-page-header .app-page-title {
        margin-left: 0;
    }

    .coach-status-bar {
        --app-status-fade-size: 34px;
        width: 100%;
        max-width: 100%;
        margin: 2px 0 0;
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
        -webkit-mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - var(--app-status-fade-size)), transparent 100%);
        mask-image: linear-gradient(90deg, #000 0, #000 calc(100% - var(--app-status-fade-size)), transparent 100%);
    }

    .coach-status-bar .app-status-meta {
        display: flex;
        flex-wrap: nowrap !important;
        gap: 8px;
        width: max-content;
        min-width: 100%;
        max-width: none;
        overflow: visible;
        padding: 0 var(--app-status-fade-size) 1px 0;
        white-space: nowrap;
    }

    .coach-status-bar .app-status-copy {
        flex: 0 0 auto;
        flex-wrap: nowrap;
        width: max-content;
        max-width: none;
        gap: 6px;
    }

    .coach-status-bar .app-status-kicker {
        flex: 0 0 auto;
        font-size: 10px;
    }

    .coach-status-bar .app-status-chip {
        flex: 0 0 auto;
        max-width: 72vw;
        min-height: 23px;
        padding-inline: 8px;
        font-size: 10.5px;
    }

    .coach-page-toolbar.app-toolbar {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        padding: 0;
        overflow: visible;
    }

    .coach-page-toolbar .app-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 42px;
        padding-inline: 10px;
        justify-content: center;
        font-size: 12.5px;
    }

    .coach-grid,
    .coach-sidebar {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .coach-shell > .coach-grid {
        margin-top: 12px !important;
    }

    .coach-main {
        gap: 12px;
    }

    .coach-card {
        padding: 14px;
        border-radius: var(--coach-radius);
    }

    #insightsCard .coach-card-title,
    #patternsCard .coach-card-title,
    #whatifCard .coach-card-title {
        min-height: 52px;
        padding: 14px;
    }

    .insight-card,
    .insight-card.is-featured,
    .insight-card:not(.is-featured) {
        padding: 14px;
        gap: 10px;
    }

    .insight-signal {
        gap: 10px;
        padding: 0;
        border-bottom: 0;
    }

    .insight-copy {
        padding: 0;
    }

    .insight-card.is-featured .insight-type {
        font-size: 15px;
    }

    .insight-card.is-featured .insight-text,
    .insight-text {
        font-size: 13.5px;
        line-height: 1.55;
    }

    .insights-refresh {
        min-height: 32px;
        padding-inline: 10px;
        font-size: 12px;
    }

    .quick-insights {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .quick-insight-btn {
        min-height: 66px;
        padding: 10px;
        gap: 9px;
    }

    .quick-insight-icon {
        width: 32px;
        height: 32px;
    }

    .quick-insight-icon i {
        width: 17px !important;
        height: 17px !important;
    }

    .quick-insight-title {
        font-size: 12.5px;
        line-height: 1.22;
    }

    .quick-insight-desc {
        display: none;
    }

    .chat-suggestions {
        margin-bottom: 12px;
    }

    .chat-chips {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .chat-chip {
        width: 100%;
        min-width: 0;
        min-height: 36px;
        padding-inline: 9px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        font-size: 12px;
    }

    .chat-context-banner {
        align-items: flex-start;
        margin: 10px 0 0;
        padding: 10px;
    }

    .chat-context-clear {
        min-height: 34px;
    }

    .chat-shell-head {
        padding: 12px;
    }

    .chat-shell-status {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .chat-shell-status-item {
        padding: 10px;
    }

    .chat-shell-status-item:not(:last-child) {
        border-right: 1px solid var(--coach-border-muted);
        border-bottom: 0;
    }

    .chat-shell-status-label {
        font-size: 10px;
    }

    .chat-shell-status-value {
        font-size: 12px;
    }

    .chat-messages {
        height: clamp(340px, 54dvh, 560px);
        min-height: 340px;
        max-height: 560px;
        padding: 18px 14px;
        gap: 18px;
    }

    .chat-msg {
        max-width: 100%;
        gap: 8px;
    }

    .chat-msg-bubble {
        padding: 14px;
        font-size: 13.5px;
        line-height: 1.58;
    }

    .chat-input-row {
        flex-direction: row;
        gap: 8px;
        padding: 10px;
    }
    .chat-input-wrap {
        align-items: stretch;
    }
    .chat-remaining {
        display: none;
    }

    .chat-input {
        min-width: 0;
        min-height: 44px;
        padding-inline: 12px;
        font-size: 13px;
    }

    .chat-send {
        flex: 0 0 48px;
        min-width: 48px;
        min-height: 44px;
        padding: 0;
        gap: 0;
    }

    .chat-send span {
        display: none;
    }

    .weekly-nav {
        gap: 8px;
        margin-bottom: 14px;
    }

    .weekly-nav-btn {
        min-width: 0;
        min-height: 38px;
        padding-inline: 10px;
        font-size: 12.5px;
    }

    .weekly-period {
        font-size: 12px;
    }

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

    .weekly-stat {
        padding: 12px;
    }

    .weekly-stat:not(:last-child),
    .weekly-stat:nth-child(3n) {
        border-right: 0;
    }

    .weekly-stat:nth-child(odd) {
        border-right: 1px solid var(--coach-border-muted);
    }

    .weekly-stat:nth-child(n + 3) {
        border-top: 1px solid var(--coach-border-muted);
    }

    .pattern-card,
    #whatifContent {
        padding: 14px;
    }

    .whatif-value {
        font-size: 19px;
    }
}

@media (max-width: 420px) {
    body.coach-page.has-sidebar main.coach-shell,
    body.coach-page main.coach-shell {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }

    body.coach-page.has-sidebar .coach-title-group {
        padding-left: 52px;
    }

    .quick-insights,
    .chat-chips {
        grid-template-columns: 1fr;
    }
}

.coach-page--embed-drawer {
    background: transparent;
    --coach-section-bg: transparent;
    --coach-inner-bg: transparent;
}

.coach-page--embed-drawer main {
    max-width: none;
    margin: 0;
    padding: 0;
}

.coach-page--embed-drawer .coach-grid {
    grid-template-columns: 1fr;
    gap: 0;
}

.coach-page--embed-drawer .coach-main {
    gap: 0;
}

.coach-page--embed-drawer .coach-sidebar,
.coach-page--embed-drawer #insightsCard,
.coach-page--embed-drawer #weeklyCard {
    display: none;
}

.coach-page--embed-drawer #chatCard {
    min-height: 100dvh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
}

.coach-page--embed-drawer #chatCard::before {
    display: none;
}

.coach-page--embed-drawer .coach-card-title,
.coach-page--embed-drawer .coach-command-deck,
.coach-page--embed-drawer .coach-command-actions,
.coach-page--embed-drawer .quick-insights,
.coach-page--embed-drawer .chat-suggestions,
.coach-page--embed-drawer .chat-shell-head,
.coach-page--embed-drawer .coach-console-commands,
.coach-page--embed-drawer .chat-shell-status,
.coach-page--embed-drawer .chat-remaining {
    display: none;
}

.coach-page--embed-drawer .chat-shell {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    height: 100%;
    min-height: 100dvh;
    margin: 0;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

.coach-page--embed-drawer .chat-context-banner {
    display: none !important;
}

.coach-page--embed-drawer .chat-context-entry {
    display: none !important;
}

.coach-page--embed-drawer .chat-messages {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    margin-bottom: 0;
    padding: 24px 22px 26px;
}

.coach-page--embed-drawer .chat-input-row {
    margin-top: auto;
    padding: 16px 18px 18px;
    border-top-color: rgba(255, 255, 255, 0.055);
    background: #070707;
}

.coach-page--embed-drawer .chat-input {
    min-height: 44px;
    background: #090909;
}

.coach-page--embed-drawer .chat-send {
    min-height: 44px;
}

.coach-page--embed-drawer .chat-msg.assistant {
    width: min(100%, 760px);
    max-width: min(100%, 760px);
}

.coach-page--embed-drawer .chat-msg.assistant .chat-msg-body,
.coach-page--embed-drawer .chat-msg.assistant .chat-msg-bubble {
    width: 100%;
}

.coach-page--embed-drawer .chat-msg.assistant .chat-msg-bubble {
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
}

.coach-page--embed-drawer .coach-ai-readout {
    display: none;
}

html.light body.coach-page {
    --coach-page-bg: var(--app-bg-page);
    --coach-section-bg: #ffffff;
    --coach-inner-bg: #ffffff;
    --coach-control-bg: #f8fafc;
    --coach-border: rgba(15, 23, 42, 0.12);
    --coach-border-muted: rgba(15, 23, 42, 0.09);
    --coach-border-hover: rgba(15, 23, 42, 0.18);
    background: var(--coach-page-bg);
    color: #111827;
}

:is(html.light, html[data-theme="light"]) body.coach-page {
    --coach-accent: #0f766e;
    --coach-accent-strong: #0f766e;
    --coach-accent-soft: rgba(15, 118, 110, 0.10);
}

html.light body.coach-page--embed-drawer,
html.light .coach-page--embed-drawer main,
html.light .coach-page--embed-drawer .coach-grid,
html.light .coach-page--embed-drawer .coach-main,
html.light .coach-page--embed-drawer #chatCard,
html.light .coach-page--embed-drawer .chat-shell,
html.light .coach-page--embed-drawer .chat-messages {
    background: #ffffff;
}

html.light .coach-card,
html.light #chatCard {
    background: var(--coach-section-bg);
    border-color: var(--coach-border);
}

html.light .chat-shell {
    background: var(--coach-inner-bg);
    border-color: var(--coach-border);
}

html.light .chat-messages {
    scrollbar-color: rgba(15, 23, 42, 0.20) transparent;
}

html.light .chat-messages:empty::before {
    color: #7c838d;
}

html.light .chat-history-loader-title,
html.light .chat-history-status,
html.light .chat-context-fact {
    color: #5f6670;
}

html.light .chat-history-loader-kicker {
    color: #0f766e;
}

html.light .chat-history-loader-line {
    background: rgba(15, 23, 42, 0.065);
}

html.light .chat-history-loader-line::after {
    background: linear-gradient(90deg, transparent, rgba(15, 118, 110, 0.16), transparent);
}

html.light .coach-console-commands {
    border-bottom-color: rgba(15, 23, 42, 0.09);
    background: #f8fafc;
}

html.light .coach-console-command {
    border-color: rgba(15, 118, 110, 0.16);
    background: rgba(15, 118, 110, 0.055);
    color: #0f766e;
}

html.light .coach-console-command:last-child {
    border-right-color: rgba(15, 118, 110, 0.16);
}

html.light .coach-console-command:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #ffffff;
    color: #0f172a;
}

html.light .coach-console-command i,
html.light .coach-console-command svg {
    color: currentColor;
}

html.light .chat-shell-note,
html.light .chat-shell-status-label,
html.light .chat-msg-meta,
html.light .chat-msg.assistant .chat-msg-meta {
    color: #6b7280;
}

html.light .chat-msg.user .chat-msg-meta {
    color: #0f766e;
}

html.light .chat-msg.user .chat-msg-bubble {
    border-color: rgba(15, 118, 110, 0.16);
    background: #eefaf8;
    color: #123733;
}

html.light .chat-msg-attachment {
    border-color: transparent;
    background: transparent;
    color: #64748b;
}

html.light .chat-msg-attachment > i,
html.light .chat-msg-attachment > svg {
    color: #0f766e;
    opacity: 0.72;
}

html.light .chat-msg-attachment-copy strong {
    color: #475569;
}

html.light .chat-msg-attachment-copy small {
    color: #94a3b8;
}

html.light .chat-msg.assistant,
html.light .chat-msg.assistant .chat-msg-bubble {
    color: #374151;
}

html.light .chat-msg.assistant .chat-msg-bubble {
    border-color: transparent;
    background: transparent;
}

html.light .chat-coach-key {
    color: #111827;
}

html.light .chat-coach-number {
    color: #374151;
}

html.light .chat-coach-number.is-negative {
    color: #dc2626;
}

html.light .chat-coach-number.is-positive {
    color: #374151;
}

html.light .chat-msg.typing .chat-msg-bubble {
    color: #6b7280;
}

html.light .chat-msg-avatar {
    border-color: rgba(15, 23, 42, 0.10);
    background: #ffffff;
    color: #4b5563;
}

html.light .chat-msg-avatar--coach {
    border-color: transparent;
    background: transparent;
    color: #334155;
    box-shadow: none;
}

html.light .chat-msg.typing .chat-msg-avatar--coach {
    border-color: transparent;
    background: transparent;
    color: #0f766e;
}

html.light .chat-msg-avatar-orb {
    background: rgba(15, 23, 42, 0.04);
    box-shadow:
        0 7px 13px 0 rgba(255, 255, 255, 0.82) inset,
        0 14px 17px 0 rgba(150, 111, 255, 0.48) inset,
        0 31px 31px 0 rgba(37, 99, 235, 0.50) inset,
        0 0 0 1px rgba(15, 23, 42, 0.08);
}

html.light .chat-typing-dots span {
    background: rgba(15, 118, 110, 0.62);
}

html.light .chat-input-row {
    border-top-color: rgba(15, 23, 42, 0.10);
    background: #ffffff;
}

html.light .chat-input {
    border-color: rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    color: #111827;
}

html.light .chat-input:focus {
    border-color: rgba(24, 128, 111, 0.34);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(77, 171, 154, 0.10);
}

html.light .chat-input::placeholder {
    color: #737373;
}

html.light .chat-remaining {
    color: #64748b;
}

html.light .chat-send {
    border-color: rgba(24, 128, 111, 0.22);
    background: rgba(77, 171, 154, 0.10);
    color: #176e61;
}

html.light .chat-send:hover {
    border-color: rgba(24, 128, 111, 0.32);
    background: rgba(77, 171, 154, 0.15);
    color: #0f5f54;
}

html.light .coach-page--embed-drawer .chat-input-row {
    border-top-color: rgba(15, 23, 42, 0.10);
    background: #ffffff;
}

html.light .coach-page--embed-drawer .chat-input {
    background: #f8fafc;
}

@media (max-width: 640px) {
    .coach-page--embed-drawer #chatCard {
        padding: 0;
        gap: 0;
    }

    .coach-page--embed-drawer .chat-shell {
        min-height: 100dvh;
        padding: 0;
        border-radius: 0;
    }

    .coach-page--embed-drawer .chat-input-row {
        padding: 12px;
    }

    .coach-page--embed-drawer .chat-msg,
    .coach-page--embed-drawer .chat-msg.user,
    .coach-page--embed-drawer .chat-msg.assistant {
        max-width: 100%;
    }

}

/* Shared workspace header standardization. */
html:has(body.coach-page:not(.coach-page--embed-drawer)),
body.coach-page:not(.coach-page--embed-drawer) {
    overflow-x: clip;
}

.coach-page-header.app-page-header--workspace {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 20px;
    width: 100%;
    margin-bottom: 0;
    padding: 20px 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.coach-page-header.app-page-header--workspace .coach-title-group {
    flex: 1 1 auto;
    max-width: none;
    gap: 8px;
    min-width: 0;
    margin-bottom: 0;
}

.coach-page-header.app-page-header--workspace .app-page-title {
    max-width: none;
    font-size: clamp(24px, 1.45vw, 28px);
    font-weight: 650;
    line-height: 1;
    letter-spacing: -0.04em;
}

.coach-page-header.app-page-header--workspace .app-title-meta-line {
    width: auto;
    max-width: 100%;
    overflow: visible;
}

.coach-page-header.app-page-header--workspace .coach-page-toolbar.app-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
    width: auto;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    overflow: visible;
}

.coach-page-header.app-page-header--workspace .coach-page-toolbar .app-action-btn {
    width: auto;
    min-height: 46px;
    padding-inline: 16px;
}

.coach-page-header.app-page-header--workspace .coach-page-toolbar .creator-mode-toggle {
    width: 46px;
    min-width: 46px;
    padding-inline: 0;
}

@media (max-width: 1500px) {
    .coach-page-header.app-page-header--workspace {
        align-items: flex-start;
        flex-wrap: wrap;
        gap: 14px;
    }

    .coach-page-header.app-page-header--workspace .coach-title-group {
        flex: 1 1 100%;
        width: 100%;
    }

    .coach-page-header.app-page-header--workspace .coach-page-toolbar.app-toolbar {
        width: 100%;
        justify-content: flex-start;
        margin-left: 0;
    }
}

@media (max-width: 767px) {
    .coach-page-header.app-page-header--workspace {
        align-items: flex-start;
        gap: 9px;
        padding: 14px 0 13px;
        overflow: visible;
    }

    .coach-page-header.app-page-header--workspace .coach-title-group,
    body.coach-page.has-sidebar .coach-page-header.app-page-header--workspace .coach-title-group {
        width: 100%;
        min-height: 42px;
        padding-left: 54px;
        margin-bottom: 0;
        justify-content: flex-start;
        align-items: flex-start;
        gap: 7px;
    }

    .coach-page-header.app-page-header--workspace .app-page-title {
        font-size: 28px;
        line-height: 0.95;
        letter-spacing: -0.045em;
    }

    .coach-page-header.app-page-header--workspace .app-title-meta-line {
        width: 100%;
        flex-wrap: wrap;
        white-space: normal;
        justify-content: flex-start;
    }

    .coach-page-header.app-page-header--workspace .coach-page-toolbar.app-toolbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 46px;
        width: 100%;
        gap: 8px;
        margin-top: 0;
    }

    .coach-page-header.app-page-header--workspace .coach-page-toolbar .app-action-btn {
        width: 100%;
        min-width: 0;
        min-height: 44px;
        justify-content: center;
    }

    .coach-page-header.app-page-header--workspace .coach-page-toolbar .creator-mode-toggle {
        width: 46px;
        min-width: 46px;
    }
}

@media (max-width: 420px) {
    body.coach-page.has-sidebar .coach-page-header.app-page-header--workspace .coach-title-group {
        padding-left: 52px;
    }
}

@media (max-width: 767px) {
    body.coach-page:not(.coach-page--embed-drawer) {
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-shell,
    body.coach-page:not(.coach-page--embed-drawer) .coach-grid,
    body.coach-page:not(.coach-page--embed-drawer) .coach-main,
    body.coach-page:not(.coach-page--embed-drawer) .coach-card,
    body.coach-page:not(.coach-page--embed-drawer) #chatCard,
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-deck {
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .chat-shell {
        box-sizing: border-box;
        width: auto;
        max-width: none;
        min-width: 0;
        margin: 14px 14px 14px;
        padding-top: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
        align-items: start;
        padding: 18px 14px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-title,
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub {
        max-width: 100%;
        overflow-wrap: break-word;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-lead {
        grid-column: 1;
        grid-row: auto;
        grid-template-columns: 54px minmax(0, 1fr);
        gap: 12px;
        max-width: 100%;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-core {
        width: 54px;
        height: 54px;
        gap: 3.5px;
        padding: 8px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics,
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-line,
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-agent-strip {
        grid-column: 1;
        grid-row: auto;
        max-width: 100%;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        align-self: stretch;
        margin-top: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-line {
        margin-top: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-agent-strip {
        grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
        gap: 8px;
        margin-top: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 8px;
        padding: 12px 24px 16px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn {
        grid-template-columns: 22px minmax(0, 1fr);
        min-height: 46px;
        gap: 8px;
        padding: 8px 9px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon,
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary .coach-command-icon {
        width: 22px;
        height: 22px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong {
        margin-bottom: 1px;
        font-size: 12.5px;
        line-height: 1.15;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
        font-size: 10.5px;
        line-height: 1.2;
    }

    body.coach-page:not(.coach-page--embed-drawer) .chat-suggestions {
        margin-left: 14px;
        margin-right: 14px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .chat-chips {
        grid-template-columns: minmax(0, 1fr);
    }
}

/* Full-page Coach light pass. Keep after responsive rules so dark-first panels do not bleed into light mode. */
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) {
    --coach-page-bg: var(--app-bg-page);
    --coach-section-bg: #ffffff;
    --coach-inner-bg: #ffffff;
    --coach-control-bg: #f8fafc;
    --coach-border: rgba(15, 23, 42, 0.14);
    --coach-border-muted: rgba(15, 23, 42, 0.10);
    --coach-border-hover: rgba(15, 23, 42, 0.22);
    background: var(--coach-page-bg);
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-card,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #chatCard {
    background: var(--coach-section-bg);
    border-color: var(--coach-border);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-card-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-card-title-meta,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric span,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-proof-item span,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-kicker,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-note,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-shell-status-label,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-kicker,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-item span,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-stat-label,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-subtitle,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-label {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-card-title :is(i, svg),
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-shell-badge i {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .app-title-meta-text {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-deck,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-read,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-shell,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-messages,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input-row {
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-read,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input-row,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #chatCard > .coach-card-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card + .insight-card,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-card,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-row:not(:last-child),
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-compare,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-box + .whatif-box,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-punchline,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-stats-grid,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-stat:not(:last-child),
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-stat:nth-child(n + 4) {
    border-color: var(--coach-border-muted);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-proof-item strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-item strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-shell-status-value,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-pattern-line strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-row .value,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-panel-empty strong {
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-line,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-summary,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-pattern-line,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-row .label,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-punchline,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-loading,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insights-loading,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-panel-empty,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-panel-empty span {
    color: #475569;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-line strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-loading a,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insights-loading a,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-title :is(i, svg),
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-item.is-press strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-context-kicker,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-context-entry-kicker {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-proof,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-context-entry,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-delta-chip {
    border-color: var(--coach-border-muted);
    background: #f8fafc;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-head {
    border-color: var(--coach-border-muted);
    background: rgba(15, 118, 110, 0.06);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-item.is-stop strong {
    color: #dc2626;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout-item.is-test strong {
    color: #6d4edb;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(15, 23, 42, 0.16);
    background: #ffffff;
    color: #334155;
    box-shadow: none;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(15, 23, 42, 0.16);
    background: #ffffff;
    color: #334155;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #f8fafc;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #f8fafc;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary .coach-command-icon {
    color: currentColor;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input {
    border-color: rgba(15, 23, 42, 0.16);
    background: #f8fafc;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input:focus {
    border-color: rgba(15, 118, 110, 0.40);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.10);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input::placeholder,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-remaining,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-period,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .whatif-period {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-send {
    border-color: rgba(15, 118, 110, 0.30);
    background: rgba(15, 118, 110, 0.12);
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-send:hover {
    border-color: rgba(15, 118, 110, 0.42);
    background: rgba(15, 118, 110, 0.17);
    color: #0f5f54;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-badge {
    border-color: rgba(15, 23, 42, 0.14);
    color: #334155;
    background: #f8fafc;
    font-weight: 760;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-badge.primary {
    padding: 0 9px;
    border: 1px solid rgba(79, 70, 229, 0.22);
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.085);
    color: #4f46e5;
    font-weight: 800;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-badge.live {
    border-color: rgba(220, 38, 38, 0.22);
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card {
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card:not(.is-featured) {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card + .insight-card {
    border-top-color: rgba(15, 23, 42, 0.12);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured::before {
    display: block;
    position: absolute;
    inset: 18px auto 18px 0;
    width: 3px;
    border-radius: 999px;
    background: #4f46e5;
    opacity: 0.86;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-type,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card:not(.is-featured) .insight-type,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-type.info {
    color: #0f172a;
    font-weight: 820;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-type.warning {
    color: #b45309;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-type.success {
    color: #15803d;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-icon.info {
    border-color: rgba(79, 70, 229, 0.18);
    background: rgba(79, 70, 229, 0.07);
    color: #4f46e5;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-icon.success {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-icon.warning {
    border-color: rgba(180, 83, 9, 0.20);
    background: rgba(245, 158, 11, 0.10);
    color: #b45309;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-text {
    color: #334155;
    font-weight: 500;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text .hl-entity {
    color: #4f46e5;
    font-weight: 760;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text .hl-risk,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text .hl-rule,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text .hl-range {
    color: #b45309;
    font-weight: 760;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insight-text .hl-action {
    color: #0f172a;
    font-weight: 740;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-panel-line {
    background: linear-gradient(90deg, rgba(148, 163, 184, 0.14), rgba(148, 163, 184, 0.24), rgba(148, 163, 184, 0.14));
    background-size: 180% 100%;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .score-bar {
    height: 9px;
    padding: 1px;
    margin-top: 12px;
    background: #e2e8f0;
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .score-dot {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.035);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #scoreRows .pattern-row {
    min-height: 44px;
    padding-block: 12px;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #scoreRows .pattern-row .label {
    color: #334155;
    font-size: 14px;
    font-weight: 700;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #scoreRows .pattern-row .value {
    color: #0f172a;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #scoreRows .pattern-row .value.green {
    color: #15803d;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #scoreRows .pattern-row .value.red {
    color: #dc2626;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-day-bar-fill.is-empty {
    background: #cbd5e1;
    opacity: 0.9;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-day-bar-label,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-day-bar-value {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .pattern-badge.best {
    border-color: rgba(15, 118, 110, 0.22);
    background: rgba(15, 118, 110, 0.08);
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .streak-indicator.win {
    border-color: rgba(22, 163, 74, 0.18);
    background: rgba(22, 163, 74, 0.08);
    color: #15803d;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .streak-indicator.loss {
    border-color: rgba(220, 38, 38, 0.18);
    background: rgba(220, 38, 38, 0.08);
    color: #dc2626;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .streak-indicator.neutral {
    border-color: rgba(15, 23, 42, 0.12);
    background: #f8fafc;
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-nav-btn,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insights-refresh {
    border-color: rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #334155;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-nav-btn:hover,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .insights-refresh:hover {
    border-color: rgba(15, 23, 42, 0.24);
    background: #f8fafc;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .weekly-grade.good {
    border-color: rgba(22, 163, 74, 0.20);
    background: rgba(22, 163, 74, 0.10);
    color: #16a34a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .apexcharts-text,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .apexcharts-legend-text {
    fill: #64748b !important;
    color: #64748b !important;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-toast {
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.16);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-toast.success {
    border-color: rgba(15, 118, 110, 0.24);
    background: #ecfdf5;
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-toast.error {
    border-color: rgba(220, 38, 38, 0.24);
    background: #fef2f2;
    color: #dc2626;
}

/* Full-page command center cleanup: keep the page focused on presets + chat. */
body.coach-page:not(.coach-page--embed-drawer) #chatCard > .coach-card-title,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-core,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-line,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-agent-strip,
body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout,
body.coach-page:not(.coach-page--embed-drawer) .chat-context-entry {
    display: none !important;
}

body.coach-page:not(.coach-page--embed-drawer) #chatCard {
    background: #0b0b0c;
    border-color: rgba(255, 255, 255, 0.075);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-deck {
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    align-items: start;
    padding: 30px 28px 22px;
    border: 0;
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-lead {
    display: block;
    max-width: none;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-title {
    max-width: none;
    color: #f4f5f7;
    font-size: clamp(28px, 2.15vw, 38px);
    font-weight: 760;
    letter-spacing: 0;
    line-height: 1.02;
    text-wrap: pretty;
    white-space: nowrap;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub {
    max-width: 700px;
    margin-top: 10px;
    color: rgba(235, 240, 246, 0.58);
    font-size: 14px;
    line-height: 1.45;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    align-self: start;
    gap: 0;
    width: auto;
    max-width: 680px;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
    padding: 0 18px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric:first-child {
    padding-left: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric:last-child {
    padding-right: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric:not(:last-child) {
    border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric span {
    margin: 0;
    color: rgba(235, 240, 246, 0.42);
    font-size: 10px;
    font-weight: 760;
    letter-spacing: 0.08em;
    line-height: 1;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric strong {
    max-width: 150px;
    color: rgba(246, 248, 250, 0.92);
    font-size: 13px;
    font-weight: 720;
    line-height: 1.15;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
    padding: 16px 28px 24px;
    border: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-head {
    align-items: center;
    margin: 0 0 4px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed {
    padding-bottom: 16px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-kicker {
    color: rgba(235, 240, 246, 0.48);
    font-size: 11px;
    font-weight: 760;
    letter-spacing: 0.08em;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-note {
    display: none;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-toggle {
    margin-left: auto;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    grid-column: auto;
    grid-template-columns: 20px minmax(0, 1fr);
    gap: 10px;
    min-height: 54px;
    padding: 10px 12px;
    border-color: rgba(255, 255, 255, 0.075);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.018);
    box-shadow: none;
    color: rgba(244, 247, 248, 0.88);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(255, 255, 255, 0.105);
    background: rgba(255, 255, 255, 0.024);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.018);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary .coach-command-icon {
    width: 20px;
    height: 20px;
    color: currentColor;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon :is(i, svg) {
    width: 15px;
    height: 15px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong {
    margin-bottom: 2px;
    color: rgba(248, 250, 252, 0.94);
    font-size: 13.5px;
    font-weight: 740;
    line-height: 1.16;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
    overflow: visible;
    color: rgba(235, 240, 246, 0.46);
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.25;
    text-overflow: clip;
    white-space: normal;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-shell {
    margin: 0;
    border: 0;
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-messages {
    height: clamp(460px, 56vh, 740px);
    min-height: 460px;
    padding: 32px 28px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) #support-contact-fab {
    display: none;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) #chatCard {
    background: #ffffff;
    border-color: rgba(15, 23, 42, 0.12);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-deck {
    border-bottom-color: rgba(15, 23, 42, 0.10);
    background: transparent;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-read,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-shell {
    background: transparent;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-title,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric strong {
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric span,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-kicker {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-command-actions-toggle {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-command-actions-toggle:hover {
    border-color: rgba(15, 23, 42, 0.18);
    background: #ffffff;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric:not(:last-child) {
    border-right-color: rgba(15, 23, 42, 0.12);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(15, 23, 42, 0.12);
    background: #ffffff;
    color: #334155;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(15, 23, 42, 0.14);
    background: #ffffff;
    color: #334155;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #f8fafc;
}

@media (max-width: 980px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
        grid-template-columns: minmax(0, 1fr);
        align-items: start;
        padding: 24px 20px 18px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-metrics {
        justify-content: flex-start;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        padding: 14px 20px 20px;
    }
}

@media (max-width: 640px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-title {
        font-size: 27px;
        line-height: 1.05;
        white-space: normal;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-metric {
        padding: 0 12px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
        grid-template-columns: 1fr;
    }

    body.coach-page:not(.coach-page--embed-drawer) .chat-messages {
        height: clamp(420px, 58vh, 640px);
        min-height: 420px;
        padding: 24px 18px;
    }
}

/* AI Coach product pass: calmer command center, cleaner chat rhythm. */
body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
    padding: 34px 32px 24px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-title {
    max-width: 760px;
    letter-spacing: -0.035em;
    line-height: 1.04;
    text-wrap: balance;
    white-space: normal;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub {
    max-width: 780px;
    color: rgba(235, 240, 246, 0.62);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    gap: 8px;
    padding: 14px 32px 24px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-head {
    margin-bottom: 2px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    min-height: 50px;
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    background: transparent;
}

.chat-messages {
    gap: 24px;
}

.chat-msg {
    gap: 12px;
}

.chat-msg-avatar--coach {
    width: 20px;
    height: 20px;
    flex-basis: 20px;
    margin-top: 22px;
}

.chat-msg-avatar-orb {
    width: 18px;
    height: 18px;
    border-radius: 0;
    background:
        radial-gradient(circle, rgba(226, 232, 240, 0.58) 1.15px, transparent 1.45px) 0 0 / 6px 6px,
        radial-gradient(circle, rgba(122, 223, 201, 0.42) 1.15px, transparent 1.45px) 3px 3px / 6px 6px;
    box-shadow: none;
    animation: coachThinkingMatrix 2.6s ease-in-out infinite;
}

.chat-msg-avatar-orb::after {
    display: none;
}

.chat-msg.typing .chat-msg-avatar-orb {
    animation: coachThinkingPulse 1.15s ease-in-out infinite;
}

@keyframes coachThinkingMatrix {
    0%, 100% { opacity: 0.44; transform: translateY(0); }
    50% { opacity: 0.82; transform: translateY(-1px); }
}

@keyframes coachThinkingPulse {
    0%, 100% { opacity: 0.38; transform: scale(0.96); }
    50% { opacity: 0.9; transform: scale(1.05); }
}

.chat-msg-meta {
    padding: 0;
    color: rgba(226, 232, 240, 0.46);
    font-size: 10.5px;
    letter-spacing: 0.12em;
}

.chat-msg.assistant {
    max-width: min(100%, 820px);
}

.chat-msg.assistant .chat-msg-body {
    gap: 7px;
}

.chat-msg.assistant .chat-msg-bubble {
    font-size: 15px;
    line-height: 1.7;
}

.chat-msg.user .chat-msg-bubble {
    border-radius: 16px;
    border-bottom-right-radius: 6px;
    background: rgba(77, 171, 154, 0.075);
}

.chat-msg.typing {
    max-width: min(100%, 520px);
}

.chat-msg.typing .chat-msg-bubble {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding-top: 1px;
    color: rgba(226, 232, 240, 0.62);
    line-height: 1.3;
}

.chat-thinking-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: inherit;
    font-size: 14.5px;
}

.chat-thinking-mark {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    background:
        radial-gradient(circle, rgba(226, 232, 240, 0.64) 1.1px, transparent 1.45px) 0 0 / 6px 6px;
    animation: coachThinkingPulse 1.15s ease-in-out infinite;
}

.chat-thinking-seconds {
    color: rgba(226, 232, 240, 0.42);
}

.chat-typing-dots {
    display: none;
}

.coach-thinking-panel {
    width: min(100%, 680px);
    padding: 16px 18px;
    border: 1px solid rgba(255, 255, 255, 0.075);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.014);
}

.coach-thinking-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    min-width: 0;
    margin-bottom: 14px;
}

.coach-thinking-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: rgba(248, 250, 252, 0.92);
    font-size: 15px;
    font-weight: 680;
    line-height: 1.25;
}

.coach-thinking-spinner {
    width: 18px;
    height: 18px;
    border-radius: 999px;
    border: 2px dotted var(--coach-accent);
    animation: coachThinkingSpin 1.25s linear infinite;
    flex: 0 0 18px;
}

@keyframes coachThinkingSpin {
    to { transform: rotate(360deg); }
}

.coach-thinking-pill {
    display: inline-flex;
    align-items: center;
    min-height: 22px;
    padding: 0 8px;
    border-radius: 6px;
    border: 1px solid rgba(91, 196, 176, 0.16);
    background: var(--coach-accent-soft);
    color: var(--coach-accent-strong);
    font-size: 11px;
    font-weight: 650;
    line-height: 1;
    white-space: nowrap;
}

.coach-thinking-steps {
    display: grid;
    gap: 10px;
    padding-left: 9px;
    border-left: 1px dashed rgba(148, 163, 184, 0.22);
}

.coach-thinking-step {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: rgba(226, 232, 240, 0.70);
    font-size: 13px;
    line-height: 1.35;
}

.coach-thinking-step::before {
    content: '';
    width: 8px;
    height: 8px;
    margin-left: -14px;
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.62);
    background: #080808;
    flex: 0 0 8px;
}

.coach-thinking-step.is-active::before {
    border-color: rgba(91, 196, 176, 0.98);
    background: rgba(91, 196, 176, 0.22);
    box-shadow: 0 0 0 4px rgba(77, 171, 154, 0.09);
    animation: coachThinkingStepPulse 1.15s ease-in-out infinite;
}

.coach-thinking-step.is-complete::before {
    border-color: rgba(91, 196, 176, 0.96);
    background: rgba(91, 196, 176, 0.88);
    box-shadow: 0 0 0 3px rgba(77, 171, 154, 0.07);
}

.coach-thinking-step.is-next {
    color: rgba(226, 232, 240, 0.48);
}

.coach-thinking-step.is-next::before {
    border-color: rgba(148, 163, 184, 0.46);
    background: rgba(148, 163, 184, 0.05);
}

@keyframes coachThinkingStepPulse {
    0%, 100% { transform: scale(1); opacity: 0.72; }
    50% { transform: scale(1.25); opacity: 1; }
}

.chat-input-row {
    gap: 12px;
}

.chat-input {
    min-height: 48px;
    padding: 0 16px;
    border-radius: 13px;
    border-color: rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.012);
}

.chat-send {
    min-height: 48px;
    border-radius: 13px;
}

.coach-page--embed-drawer .chat-messages {
    padding: 22px 22px 26px;
}

.coach-page--embed-drawer .chat-input-row {
    padding: 14px 18px 16px;
    background: #050505;
}

.coach-page--embed-drawer .chat-input {
    min-height: 48px;
    background: #080808;
}

.coach-page--embed-drawer .chat-send {
    min-height: 48px;
}

:is(html.light, html[data-theme="light"]) .chat-msg-avatar-orb,
:is(html.light, html[data-theme="light"]) .chat-thinking-mark {
    background:
        radial-gradient(circle, rgba(30, 41, 59, 0.46) 1.1px, transparent 1.45px) 0 0 / 6px 6px,
        radial-gradient(circle, rgba(15, 118, 110, 0.34) 1.1px, transparent 1.45px) 3px 3px / 6px 6px;
}

:is(html.light, html[data-theme="light"]) .chat-thinking-status {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-thinking-seconds {
    color: #94a3b8;
}

:is(html.light, html[data-theme="light"]) .chat-input {
    border-color: rgba(15, 23, 42, 0.12);
    background: #f8fafc;
}

:is(html.light, html[data-theme="light"]) .chat-msg.user .chat-msg-bubble {
    border-color: rgba(15, 118, 110, 0.16);
    background: #eefaf8;
    color: #123733;
}

:is(html.light, html[data-theme="light"]) .coach-answer-board {
    border-color: rgba(15, 23, 42, 0.11);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .coach-answer-board-head {
    border-bottom-color: rgba(15, 23, 42, 0.085);
    background: #f8fafc;
}

:is(html.light, html[data-theme="light"]) .coach-answer-kicker {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) .coach-answer-title {
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .coach-answer-lead,
:is(html.light, html[data-theme="light"]) .coach-answer-item-value,
:is(html.light, html[data-theme="light"]) .coach-answer-text {
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .coach-answer-item {
    border-bottom-color: rgba(15, 23, 42, 0.085);
}

:is(html.light, html[data-theme="light"]) .coach-answer-item:nth-child(odd) {
    border-right-color: rgba(15, 23, 42, 0.085);
}

:is(html.light, html[data-theme="light"]) .coach-answer-item-label {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-answer-item-value strong {
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .coach-answer-footnote {
    border-top-color: rgba(15, 23, 42, 0.085);
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-panel {
    border-color: rgba(15, 23, 42, 0.11);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-panel-title {
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-pill {
    border-color: rgba(15, 118, 110, 0.18);
    background: rgba(15, 118, 110, 0.09);
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-steps {
    border-left-color: rgba(100, 116, 139, 0.24);
}

:is(html.light, html[data-theme="light"]) .coach-thinking-step {
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-step::before {
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .coach-thinking-step.is-next {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .chat-input-row,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .chat-input {
    background: #ffffff;
}

/* Composer pass: larger AI input with real tools and a cleaner dot mark. */
body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-note {
    display: block;
    max-width: 460px;
    color: rgba(226, 232, 240, 0.44);
    font-size: 11.5px;
    font-weight: 560;
    letter-spacing: 0;
    line-height: 1.35;
    text-transform: none;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-note {
    color: #64748b;
}

.chat-input-row,
body.coach-page:not(.coach-page--embed-drawer) .chat-input-row,
.coach-page--embed-drawer .chat-input-row {
    display: block;
    padding: 14px 18px 16px;
    border-top: 1px solid var(--coach-border-muted);
    background: #080808;
}

.chat-composer {
    --coach-composer-focus-border: rgba(91, 196, 176, 0.34);
    --coach-composer-active-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035), 0 0 0 1px rgba(77, 171, 154, 0.16), 0 0 32px rgba(77, 171, 154, 0.14);
    --coach-composer-sweep: conic-gradient(from var(--tsb-ai-composer-angle), transparent 0deg, transparent 42deg, rgba(255, 255, 255, 0.58) 58deg, rgba(122, 223, 201, 0.82) 76deg, transparent 112deg, transparent 360deg);
    position: relative;
    isolation: isolate;
    display: grid;
    gap: 12px;
    width: 100%;
    min-height: 118px;
    padding: 15px 14px 12px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.045);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
    transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chat-composer::before {
    content: "";
    position: absolute;
    inset: -1px;
    z-index: 1;
    padding: 1px;
    border-radius: inherit;
    background: var(--coach-composer-sweep);
    opacity: 0;
    pointer-events: none;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
    mask-composite: exclude;
    transition: opacity 0.18s ease;
}

.chat-composer.is-recording {
    border-color: rgba(143, 241, 205, 0.26);
    background: rgba(143, 241, 205, 0.035);
}

.chat-composer.is-transcribing {
    border-color: rgba(91, 196, 176, 0.22);
}

.chat-composer.is-tools-open {
    z-index: 13090;
}

.chat-composer:hover,
.chat-composer:focus-within,
.chat-composer.is-recording,
.chat-composer.is-transcribing,
.chat-composer.is-tools-open {
    border-color: var(--coach-composer-focus-border);
    box-shadow: var(--coach-composer-active-shadow);
}

.chat-composer:hover::before,
.chat-composer:focus-within::before,
.chat-composer.is-recording::before,
.chat-composer.is-transcribing::before,
.chat-composer.is-tools-open::before {
    opacity: 1;
    animation: tsbAiComposerSweep 3600ms linear infinite;
}

body.coach-page.coach-tools-open:not(.coach-page--embed-drawer)::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 13020;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.18);
    animation: coachToolsBackdropIn 0.18s ease-out both;
}

body.coach-tools-open .chat-input-row {
    position: relative;
    z-index: 13090;
}

.chat-composer-tools-shell {
    position: fixed;
    left: calc(var(--chat-tools-left, 0px) - 8px);
    top: calc(var(--chat-tools-shell-top, var(--chat-tools-menu-top, 0px)) - 8px);
    width: calc(var(--chat-tools-width, 100%) + 16px);
    height: calc(var(--chat-tools-shell-height, var(--chat-tools-menu-height, 420px)) + 16px);
    z-index: 13050;
    border: 1px solid rgba(255, 255, 255, 0.105);
    border-radius: 18px;
    background: transparent;
    box-shadow:
        0 22px 64px rgba(0, 0, 0, 0.48),
        inset 0 1px 0 rgba(255, 255, 255, 0.035);
    pointer-events: none;
}

.chat-composer-tools-shell[data-tools-placement="above"] {
    background: linear-gradient(
        to bottom,
        #080808 0 var(--chat-tools-menu-shell-bottom, 100%),
        transparent var(--chat-tools-menu-shell-bottom, 100%) 100%
    );
}

.chat-composer-tools-shell[data-tools-placement="below"] {
    background: linear-gradient(
        to bottom,
        transparent 0 var(--chat-tools-menu-shell-top, 0px),
        #080808 var(--chat-tools-menu-shell-top, 0px) 100%
    );
}

.chat-composer-tools-shell.is-opening {
    animation: coachLensShellIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-composer-tools-shell.is-measuring,
.chat-composer-menu.is-measuring {
    visibility: hidden;
    animation: none !important;
}

.chat-composer-tools-shell[hidden] {
    display: none;
}

.chat-composer.is-tools-open > :not(.chat-composer-menu) {
    position: relative;
    z-index: 2;
}

.chat-input,
.coach-page--embed-drawer .chat-input,
body.coach-page:not(.coach-page--embed-drawer) .chat-input {
    width: 100%;
    min-height: 50px;
    max-height: 130px;
    padding: 0 4px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text-primary);
    font-size: 15px;
    line-height: 1.5;
    resize: none;
    box-shadow: none;
}

.chat-input:focus,
html.light .chat-input:focus,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input:focus {
    border: 0;
    background: transparent;
    box-shadow: none;
}

.chat-input::placeholder {
    color: rgba(226, 232, 240, 0.46);
}

.chat-composer-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-width: 0;
}

.chat-composer-tools,
.chat-composer-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.coach-range-control {
    display: inline-flex;
    align-items: center;
    height: 34px;
    padding: 0 8px 0 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.62);
    background: rgba(255, 255, 255, 0.025);
}

.coach-range-control select {
    width: auto;
    min-width: 64px;
    padding: 0 15px 0 0;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    cursor: pointer;
    outline: none;
    color-scheme: dark;
}

.coach-range-control select option {
    background: #111313;
    color: #e2e8f0;
}

.chat-composer-actions {
    margin-left: auto;
}

.chat-composer-status {
    min-height: 22px;
    margin: -4px 0 0;
    color: rgba(226, 232, 240, 0.62);
    font-size: 12.5px;
    line-height: 1.35;
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.16s ease, transform 0.16s ease;
}

.chat-composer-status[hidden] {
    display: block;
    height: 0;
    min-height: 0;
    margin: 0;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-3px);
    pointer-events: none;
}

.chat-composer-status.is-warning {
    color: rgba(245, 158, 11, 0.92);
}

.chat-composer-status.is-success {
    color: rgba(143, 241, 205, 0.86);
}

.chat-file-chip {
    display: flex;
    align-items: center;
    gap: 8px;
    width: fit-content;
    max-width: 100%;
    min-height: 32px;
    padding: 5px 7px 5px 8px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.025);
    color: rgba(226, 232, 240, 0.78);
}

.chat-file-chip[hidden] {
    display: none;
}

.chat-file-chip > i,
.chat-file-chip > svg {
    width: 16px;
    height: 16px;
    flex: 0 0 16px;
    color: rgba(143, 241, 205, 0.76);
}

.chat-file-chip-copy {
    display: grid;
    gap: 0;
    min-width: 0;
}

.chat-file-chip-copy strong {
    overflow: hidden;
    color: rgba(248, 250, 252, 0.9);
    font-size: 12.5px;
    font-weight: 700;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-file-chip-copy small {
    color: rgba(226, 232, 240, 0.46);
    font-size: 11px;
    font-weight: 560;
    line-height: 1.2;
}

.chat-file-chip-remove {
    width: 26px;
    height: 26px;
    padding: 0;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: rgba(226, 232, 240, 0.56);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.chat-file-chip-remove:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(248, 250, 252, 0.92);
}

.chat-file-chip-remove i,
.chat-file-chip-remove svg {
    width: 15px;
    height: 15px;
}

.chat-voice-visualizer {
    display: grid;
    justify-items: center;
    gap: 5px;
    padding: 1px 0 2px;
    color: rgba(226, 232, 240, 0.6);
}

.chat-voice-visualizer[hidden] {
    display: none;
}

.chat-voice-time {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 12px;
    font-weight: 650;
    line-height: 1;
    letter-spacing: 0.02em;
    color: rgba(248, 250, 252, 0.78);
}

.chat-voice-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 24px;
    min-width: 170px;
}

.chat-voice-bars span {
    width: 2px;
    height: var(--voice-bar-height, 10px);
    border-radius: 999px;
    background: rgba(143, 241, 205, 0.54);
    opacity: 0.72;
    transform-origin: 50% 50%;
    animation: coachVoiceWave 1.08s ease-in-out infinite;
    animation-delay: var(--voice-bar-delay, 0ms);
}

.chat-voice-visualizer.is-transcribing .chat-voice-bars span {
    background: rgba(122, 223, 201, 0.62);
    animation-duration: 1.55s;
}

.chat-voice-label {
    color: rgba(226, 232, 240, 0.54);
    font-size: 12px;
    font-weight: 560;
    line-height: 1;
}

.chat-tool-btn,
.chat-send {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(226, 232, 240, 0.78);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font: inherit;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    box-shadow: none;
}

.chat-tool-btn:hover {
    background: rgba(255, 255, 255, 0.065);
    color: rgba(248, 250, 252, 0.94);
}

.chat-tool-btn--label {
    width: auto;
    min-width: 0;
    padding: 0 10px;
    border-radius: 999px;
    color: rgba(226, 232, 240, 0.82);
    font-size: 13px;
    font-weight: 650;
}

.chat-tool-btn--muted {
    cursor: default;
    opacity: 0.72;
}

.chat-tool-btn--muted:hover {
    background: transparent;
    color: rgba(226, 232, 240, 0.78);
}

.chat-voice-btn.is-unavailable,
.chat-voice-btn.is-unavailable:hover {
    opacity: 0.38;
    color: rgba(226, 232, 240, 0.46);
    background: transparent;
    cursor: help;
}

.chat-voice-btn.is-recording {
    background: rgba(143, 241, 205, 0.12);
    color: rgba(143, 241, 205, 0.95);
}

.chat-voice-btn.is-recording svg,
.chat-voice-btn.is-recording i {
    animation: coachMicPulse 0.95s ease-in-out infinite;
}

.chat-voice-btn.is-transcribing {
    color: rgba(143, 241, 205, 0.96);
    cursor: progress;
}

.chat-tool-btn svg,
.chat-tool-btn i,
.chat-send svg,
.chat-send i {
    width: 17px;
    height: 17px;
    flex: 0 0 17px;
}

.chat-send,
.chat-send:hover {
    border-color: transparent;
    background: rgba(226, 232, 240, 0.86);
    color: #080808;
}

.chat-send:hover {
    background: #ffffff;
    transform: translateY(-1px);
}

.chat-send:disabled {
    opacity: 0.38;
    transform: none;
    cursor: not-allowed;
}

.coach-page--embed-drawer .chat-send,
body.coach-page:not(.coach-page--embed-drawer) .chat-send {
    width: 34px;
    min-width: 34px;
    height: 34px;
    min-height: 34px;
}

.chat-composer-menu {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    position: fixed;
    left: var(--chat-tools-left, 0px);
    top: var(--chat-tools-menu-top, 0px);
    z-index: 13080;
    width: var(--chat-tools-width, 100%);
    height: var(--chat-tools-menu-height, min(54vh, 540px));
    max-height: var(--chat-tools-menu-height, min(54vh, 540px));
    overflow-x: hidden;
    overflow-y: auto;
    padding: 14px;
    border: 0;
    border-radius: 14px;
    background: #080808;
    box-shadow: none;
    overscroll-behavior: contain;
    isolation: isolate;
}

.chat-composer-menu > * {
    position: relative;
    z-index: 1;
}

.chat-composer-menu.is-opening {
    animation: coachLensMenuIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.chat-composer-menu.is-opening .chat-tool-lens {
    animation: coachLensCardIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1) both;
    animation-delay: var(--coach-lens-delay, 70ms);
}

.chat-composer-menu[data-tools-placement="above"] {
    border-radius: 14px 14px 10px 10px;
}

.chat-composer-menu[data-tools-placement="below"] {
    border-radius: 10px 10px 14px 14px;
}

.chat-composer-menu::after {
    display: none;
}

.chat-composer-menu[hidden] {
    display: none;
}

.chat-tools-panel-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    padding: 2px 2px 0;
}

.chat-tools-panel-title {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.chat-tools-panel-title strong {
    color: rgba(248, 250, 252, 0.92);
    font-size: 13.5px;
    font-weight: 760;
    line-height: 1.1;
}

.chat-tools-panel-title span {
    color: rgba(226, 232, 240, 0.48);
    font-size: 12px;
    line-height: 1.35;
}

.chat-tools-count {
    flex: 0 0 auto;
    color: rgba(226, 232, 240, 0.54);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.12em;
    line-height: 1;
    text-transform: uppercase;
}

.chat-tools-section {
    display: grid;
    gap: 8px;
}

.chat-tools-section[hidden] {
    display: none;
}

.chat-tools-section--popular {
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.chat-tools-section-label {
    color: rgba(226, 232, 240, 0.38);
    font-size: 10px;
    font-weight: 820;
    letter-spacing: 0.13em;
    line-height: 1;
    text-transform: uppercase;
}

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

.chat-composer-menu .chat-tool-lens {
    min-height: 56px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.76);
    display: grid;
    grid-template-columns: 18px minmax(0, 1fr);
    align-items: center;
    gap: 10px;
    text-align: left;
    cursor: pointer;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
    position: relative;
}

.chat-tool-lens::after,
.coach-console-command::after {
    content: '';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 5px;
    height: 5px;
    border-radius: 999px;
    background: transparent;
}

.chat-tool-lens.is-capability-supported::after,
.coach-console-command.is-capability-supported::after {
    background: rgba(94, 234, 212, 0.78);
}

.chat-tool-lens.is-capability-partial::after,
.coach-console-command.is-capability-partial::after {
    background: rgba(148, 163, 184, 0.58);
}

.chat-tool-lens.is-capability-insufficient,
.coach-console-command.is-capability-insufficient {
    border-style: dashed;
    color: rgba(226, 232, 240, 0.58);
}

.chat-tool-lens.is-capability-insufficient::after,
.coach-console-command.is-capability-insufficient::after {
    background: rgba(245, 158, 11, 0.74);
}

.chat-composer-menu .chat-tool-lens:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(248, 250, 252, 0.92);
    transform: translateY(-1px);
}

.chat-composer-menu .chat-tool-lens[hidden] {
    display: none;
}

.chat-composer-menu .chat-tool-lens.is-popular {
    border-color: rgba(255, 255, 255, 0.11);
    background: rgba(255, 255, 255, 0.045);
}

.chat-composer-menu .chat-tool-lens.is-popular:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.035);
}

.chat-tool-lens i,
.chat-tool-lens svg {
    width: 16px;
    height: 16px;
    color: currentColor;
}

.chat-tool-lens span {
    display: grid;
    min-width: 0;
    gap: 2px;
}

.chat-tool-lens strong {
    overflow: hidden;
    color: inherit;
    font-size: 12.5px;
    font-weight: 720;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-tool-lens small {
    overflow: hidden;
    color: rgba(226, 232, 240, 0.45);
    font-size: 11.5px;
    font-weight: 560;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.chat-msg {
    animation: coachMessageIn 0.2s ease-out both;
}

.chat-msg.assistant {
    gap: 0;
}

.chat-msg-avatar--coach {
    display: none !important;
}

@keyframes coachMessageIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes coachMenuIn {
    from { opacity: 0; transform: translateY(5px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes coachLensShellIn {
    from { opacity: 0; transform: scale(0.992); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes coachLensMenuIn {
    from { opacity: 0; transform: translateY(8px) scale(0.992); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes coachLensCardIn {
    from { opacity: 0; transform: translateY(8px) scale(0.985); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes coachToolsBackdropIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes coachMicPulse {
    0%, 100% { transform: scale(1); opacity: 0.76; }
    50% { transform: scale(1.12); opacity: 1; }
}

@keyframes coachVoiceWave {
    0%, 100% { transform: scaleY(0.62); opacity: 0.44; }
    50% { transform: scaleY(1.16); opacity: 0.9; }
}

@keyframes tsbAiComposerSweep {
    to {
        --tsb-ai-composer-angle: 360deg;
    }
}

:is(html.light, html[data-theme="light"]) .chat-composer {
    --coach-composer-focus-border: rgba(15, 118, 110, 0.28);
    --coach-composer-active-shadow: 0 0 0 1px rgba(15, 118, 110, 0.12), 0 18px 44px rgba(15, 118, 110, 0.10);
    --coach-composer-sweep: conic-gradient(from var(--tsb-ai-composer-angle), transparent 0deg, transparent 42deg, rgba(255, 255, 255, 0.9) 58deg, rgba(15, 118, 110, 0.58) 76deg, transparent 112deg, transparent 360deg);
    border-color: rgba(15, 23, 42, 0.11);
    background: #ffffff;
    box-shadow: 0 18px 44px rgba(15, 23, 42, 0.08);
}

:is(html.light, html[data-theme="light"]) .chat-composer.is-recording {
    border-color: rgba(15, 118, 110, 0.22);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .chat-composer.is-tools-open {
    border-color: rgba(15, 23, 42, 0.11);
}

:is(html.light, html[data-theme="light"]) body.coach-page.coach-tools-open:not(.coach-page--embed-drawer)::before {
    background: rgba(15, 23, 42, 0.10);
}

:is(html.light, html[data-theme="light"]) .chat-composer-tools-shell {
    border-color: rgba(15, 23, 42, 0.12);
    box-shadow:
        0 26px 70px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

:is(html.light, html[data-theme="light"]) .chat-composer-tools-shell[data-tools-placement="above"] {
    background: linear-gradient(
        to bottom,
        #ffffff 0 var(--chat-tools-menu-shell-bottom, 100%),
        transparent var(--chat-tools-menu-shell-bottom, 100%) 100%
    );
}

:is(html.light, html[data-theme="light"]) .chat-composer-tools-shell[data-tools-placement="below"] {
    background: linear-gradient(
        to bottom,
        transparent 0 var(--chat-tools-menu-shell-top, 0px),
        #ffffff var(--chat-tools-menu-shell-top, 0px) 100%
    );
}

:is(html.light, html[data-theme="light"]) .chat-input-row,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input-row,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .chat-input-row {
    border-top-color: rgba(15, 23, 42, 0.10);
    background: #f8fafc;
}

:is(html.light, html[data-theme="light"]) .chat-composer .chat-input,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer .chat-input,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .chat-composer .chat-input {
    background: transparent;
}

:is(html.light, html[data-theme="light"]) .chat-input::placeholder {
    color: #5f6f84;
    opacity: 1;
}

:is(html.light, html[data-theme="light"]) .chat-composer-status {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-composer-status.is-warning {
    color: #b45309;
}

:is(html.light, html[data-theme="light"]) .chat-composer-status.is-success {
    color: #047857;
}

:is(html.light, html[data-theme="light"]) .chat-file-chip {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .chat-file-chip-copy strong {
    color: #111827;
}

:is(html.light, html[data-theme="light"]) .chat-file-chip-copy small,
:is(html.light, html[data-theme="light"]) .chat-voice-label {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-file-chip-remove {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-file-chip-remove:hover {
    background: #e2e8f0;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .chat-voice-time {
    color: #334155;
}

:is(html.light, html[data-theme="light"]) .chat-voice-bars span {
    background: rgba(15, 118, 110, 0.48);
}

:is(html.light, html[data-theme="light"]) .chat-voice-visualizer.is-transcribing .chat-voice-bars span {
    background: rgba(15, 118, 110, 0.5);
}

:is(html.light, html[data-theme="light"]) .chat-tool-btn {
    color: #334155;
}

:is(html.light, html[data-theme="light"]) .chat-tool-btn--label span {
    color: #334155;
}

:is(html.light, html[data-theme="light"]) .chat-tool-btn:hover {
    background: #f1f5f9;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .coach-range-control {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .coach-range-control select {
    color-scheme: light;
}

:is(html.light, html[data-theme="light"]) .coach-range-control select option {
    background: #ffffff;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .chat-send,
:is(html.light, html[data-theme="light"]) .chat-send:hover {
    border-color: rgba(15, 118, 110, 0.18);
    background: #dff7f2;
    color: #0f766e;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.72);
}

:is(html.light, html[data-theme="light"]) .chat-send:hover {
    background: #cbf0e9;
    color: #0b5f58;
}

:is(html.light, html[data-theme="light"]) .chat-tools-panel-title strong {
    color: #111827;
}

:is(html.light, html[data-theme="light"]) .chat-tools-panel-title span,
:is(html.light, html[data-theme="light"]) .chat-tools-section-label {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-tools-count {
    color: #334155;
}

:is(html.light, html[data-theme="light"]) .chat-tools-section--popular {
    border-bottom-color: rgba(15, 23, 42, 0.09);
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu .chat-tool-lens {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu {
    border-color: transparent;
    background: #ffffff;
    box-shadow: none;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu[data-tools-placement="above"] {
    border-bottom-color: transparent;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu[data-tools-placement="below"] {
    border-top-color: transparent;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu .chat-tool-lens:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #ffffff;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu .chat-tool-lens.is-popular {
    border-color: rgba(15, 23, 42, 0.13);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .chat-composer-menu .chat-tool-lens.is-popular:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .chat-tool-lens small {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .chat-msg-meta--coach i,
:is(html.light, html[data-theme="light"]) .chat-msg-meta--coach svg {
    color: #0f766e;
}

/* Unify featured lenses and full library cards into one visual system. */
body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    align-items: stretch;
    position: relative;
    z-index: 1;
    box-shadow: 0 26px 42px -30px rgba(0, 0, 0, 0.92);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -42px;
    z-index: 2;
    height: 42px;
    pointer-events: none;
    background: linear-gradient(to bottom, rgba(13, 13, 13, 0.94), rgba(13, 13, 13, 0.62) 44%, rgba(13, 13, 13, 0));
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    grid-column: auto;
    grid-template-columns: 18px minmax(0, 1fr);
    gap: 10px;
    min-height: 56px;
    padding: 10px 11px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.76);
    box-shadow: none;
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(248, 250, 252, 0.92);
    transform: translateY(-1px);
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary .coach-command-icon {
    width: 18px;
    height: 18px;
    color: currentColor;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon i,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-icon svg {
    width: 16px;
    height: 16px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy strong {
    overflow: hidden;
    color: inherit;
    font-size: 12.5px;
    font-weight: 720;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
    overflow: hidden;
    color: rgba(226, 232, 240, 0.45);
    font-size: 11.5px;
    font-weight: 560;
    line-height: 1.25;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.coach-console-commands {
    gap: 8px;
    padding: 10px 18px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
    background: transparent;
}

.coach-console-command,
.coach-console-command:last-child {
    min-height: 38px;
    padding: 0 11px;
    border: 1px solid rgba(255, 255, 255, 0.085);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
    color: rgba(226, 232, 240, 0.76);
    transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.coach-console-command:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(255, 255, 255, 0.035);
    color: rgba(248, 250, 252, 0.92);
    transform: translateY(-1px);
}

.coach-console-command i,
.coach-console-command svg {
    color: currentColor;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #475569;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #ffffff;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-copy span {
    color: #64748b;
}

:is(html.light, html[data-theme="light"]) .coach-console-commands {
    border-bottom-color: rgba(15, 23, 42, 0.09);
    background: #ffffff;
}

:is(html.light, html[data-theme="light"]) .coach-console-command,
:is(html.light, html[data-theme="light"]) .coach-console-command:last-child {
    border-color: rgba(15, 23, 42, 0.11);
    background: #f8fafc;
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .coach-console-command:hover {
    border-color: rgba(15, 118, 110, 0.28);
    background: #ffffff;
    color: #0f172a;
}

:is(html.light, html[data-theme="light"]) .coach-console-command i,
:is(html.light, html[data-theme="light"]) .coach-console-command svg {
    color: currentColor;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-shell-head,
body.coach-page:not(.coach-page--embed-drawer) .chat-shell-status,
body.coach-page:not(.coach-page--embed-drawer) .coach-console-commands {
    display: none;
}

/* Make user messages read as one compact dialogue unit. */
.chat-msg.user {
    max-width: min(82%, 680px);
    gap: 8px;
}

.chat-msg.user .chat-msg-body {
    align-items: flex-end;
    gap: 6px;
}

.chat-msg.user .chat-msg-meta {
    display: none;
}

.chat-msg.user .chat-msg-bubble {
    max-width: min(560px, 100%);
    padding: 14px 17px;
    border-radius: 16px;
    border-bottom-right-radius: 5px;
    line-height: 1.5;
    box-shadow: none;
}

.chat-msg-avatar--user {
    width: 32px;
    height: 32px;
    flex-basis: 32px;
    margin: 0 0 2px;
    border-radius: 10px;
    font-size: 10.5px;
}

:is(html.light, html[data-theme="light"]) .chat-msg.user .chat-msg-bubble {
    border-color: rgba(15, 118, 110, 0.16);
    background: #eefaf8;
    color: #123733;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-input-row {
    padding: 0 28px 28px;
    border-top: 0;
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-composer {
    gap: 8px;
    min-height: 94px;
    padding: 13px 14px 11px;
    background: rgba(255, 255, 255, 0.028);
    box-shadow: none;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-composer:hover,
body.coach-page:not(.coach-page--embed-drawer) .chat-composer:focus-within,
body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-recording,
body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-transcribing,
body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-tools-open {
    border-color: var(--coach-composer-focus-border);
    box-shadow: var(--coach-composer-active-shadow);
}

body.coach-page:not(.coach-page--embed-drawer) .chat-input {
    min-height: 32px;
    max-height: 118px;
    line-height: 1.45;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip {
    width: 100%;
    min-height: 24px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip > i,
body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip > svg {
    color: rgba(143, 241, 205, 0.86);
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip-copy {
    display: flex;
    align-items: baseline;
    gap: 8px;
    min-width: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip-copy strong {
    max-width: min(520px, 72vw);
    font-size: 12px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip-copy small {
    flex: 0 0 auto;
    color: rgba(226, 232, 240, 0.42);
}

body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip-remove {
    width: 22px;
    height: 22px;
    margin-left: auto;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-input-row {
    border-top: 0;
    background: transparent;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer {
    background: #ffffff;
    box-shadow: none;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer:hover,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer:focus-within,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-recording,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-transcribing,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-composer.is-tools-open {
    border-color: var(--coach-composer-focus-border);
    box-shadow: var(--coach-composer-active-shadow);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    box-shadow: 0 28px 46px -26px rgba(255, 255, 255, 0.98), 0 20px 38px -30px rgba(15, 23, 42, 0.25);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions::after {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.82) 44%, rgba(255, 255, 255, 0));
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip {
    background: transparent;
    border-color: transparent;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip > i,
:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip > svg {
    color: #0f766e;
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-file-chip-copy small {
    color: #64748b;
}

/* Full-page Coach density pass. Keep workspace header untouched. */
body.coach-page:not(.coach-page--embed-drawer) .coach-grid {
    gap: 16px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-main,
body.coach-page:not(.coach-page--embed-drawer) .coach-sidebar {
    gap: 16px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-card {
    border-radius: 12px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-read {
    padding: 26px 28px 18px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-title {
    font-size: clamp(26px, 1.75vw, 31px);
    line-height: 1.02;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-sub {
    margin-top: 7px;
    font-size: 13px;
    line-height: 1.42;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-ai-readout {
    margin: 12px 24px 12px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    gap: 8px;
    padding: 13px 24px 18px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-note {
    font-size: 11px;
    line-height: 1.25;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    min-height: 48px;
    padding: 9px 11px;
    border-radius: 10px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-messages {
    height: clamp(340px, 38vh, 560px);
    min-height: 340px;
    max-height: 560px;
    gap: 20px;
    padding: 24px 24px 18px;
    transition: height 0.22s ease, min-height 0.22s ease, max-height 0.22s ease;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed ~ .chat-shell .chat-messages {
    height: clamp(500px, 54vh, 740px);
    min-height: 500px;
    max-height: 740px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed ~ .chat-shell {
    margin-top: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed {
    box-shadow: none;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed::after {
    display: none;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-msg.user {
    max-width: min(58%, 560px);
    gap: 7px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-msg.user .chat-msg-bubble {
    padding: 11px 14px;
    border-radius: 14px;
    border-bottom-right-radius: 5px;
    border-color: rgba(88, 207, 185, 0.24);
    background: linear-gradient(180deg, rgba(11, 57, 50, 0.92), rgba(7, 42, 38, 0.96));
    color: rgba(244, 255, 252, 0.96);
    line-height: 1.42;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

body.coach-page:not(.coach-page--embed-drawer) .chat-msg-avatar--user {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-input-row {
    padding: 0 24px 24px;
    border-radius: 12px;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-composer {
    min-height: 86px;
    border-radius: 12px;
}

body.coach-page:not(.coach-page--embed-drawer) #insightsCard .coach-card-title,
body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title,
body.coach-page:not(.coach-page--embed-drawer) #whatifCard .coach-card-title,
body.coach-page:not(.coach-page--embed-drawer) #coachEvidencePanel .coach-card-title,
body.coach-page:not(.coach-page--embed-drawer) #weeklyCard .coach-card-title {
    min-height: 54px;
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid var(--coach-border-muted);
}

body.coach-page:not(.coach-page--embed-drawer) #coachEvidencePanel,
body.coach-page:not(.coach-page--embed-drawer) #weeklyCard {
    padding: 0;
}

body.coach-page:not(.coach-page--embed-drawer) #weeklyCard .coach-card-title {
    margin-bottom: 0;
}

body.coach-page:not(.coach-page--embed-drawer) #weeklyCard .weekly-nav {
    margin: 0 0 14px;
    padding: 15px 20px 0;
}

body.coach-page:not(.coach-page--embed-drawer) #weeklyContent {
    padding: 0 20px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) .insight-card {
    grid-template-columns: 28px minmax(0, 1fr);
    column-gap: 12px;
    padding: 15px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured {
    padding: 17px 20px 18px;
}

body.coach-page:not(.coach-page--embed-drawer) .insight-icon,
body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-icon {
    width: 28px;
    height: 28px;
    border-radius: 8px;
}

body.coach-page:not(.coach-page--embed-drawer) .insight-text {
    font-size: 13.5px;
    line-height: 1.56;
}

body.coach-page:not(.coach-page--embed-drawer) .insight-card.is-featured .insight-text {
    font-size: 14px;
    line-height: 1.58;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-report-board {
    gap: 12px;
    margin-bottom: 13px;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-stat {
    padding: 12px 14px;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-pattern-line {
    margin-bottom: 10px;
    font-size: 13.5px;
    line-height: 1.5;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-summary {
    font-size: 13.5px;
    line-height: 1.58;
}

body.coach-page:not(.coach-page--embed-drawer) #weeklyCard .weekly-loading {
    padding: 24px 0 8px;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-period,
body.coach-page:not(.coach-page--embed-drawer) .weekly-loading,
body.coach-page:not(.coach-page--embed-drawer) .insights-loading {
    font-family: 'Instrument Sans', sans-serif;
    letter-spacing: 0;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-period {
    font-size: 13.5px;
    font-weight: 650;
}

body.coach-page:not(.coach-page--embed-drawer) .weekly-loading,
body.coach-page:not(.coach-page--embed-drawer) .insights-loading {
    font-size: 14px;
    font-weight: 560;
    line-height: 1.45;
}

body.coach-page:not(.coach-page--embed-drawer) .pattern-card {
    padding: 15px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) #patternDay {
    padding-bottom: 15px;
}

body.coach-page:not(.coach-page--embed-drawer) .pattern-title {
    margin-bottom: 11px;
}

body.coach-page:not(.coach-page--embed-drawer) .pattern-row {
    padding: 8px 0;
    font-size: 13.5px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-panel-empty {
    min-height: 48px;
    padding: 10px 0 0;
}

body.coach-page:not(.coach-page--embed-drawer) #whatifContent {
    padding: 15px 20px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) .whatif-compare {
    margin-bottom: 12px;
}

body.coach-page:not(.coach-page--embed-drawer) .whatif-box {
    padding-top: 12px;
    padding-bottom: 12px;
}

html.dark body.coach-page:not(.coach-page--embed-drawer) #chatCard {
    border-color: rgba(255, 255, 255, 0.055);
    background: #0b0b0b;
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions {
    border-bottom-color: rgba(255, 255, 255, 0.038);
    box-shadow: 0 22px 36px -30px rgba(0, 0, 0, 0.9);
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn,
html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(148, 163, 184, 0.115);
    background: rgba(20, 20, 21, 0.72);
    color: rgba(226, 232, 240, 0.72);
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary {
    border-color: rgba(148, 163, 184, 0.13);
    background: rgba(20, 20, 21, 0.78);
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn:hover,
html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-btn--primary:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(20, 20, 21, 0.72);
    color: rgba(248, 250, 252, 0.9);
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-toggle {
    border-color: rgba(148, 163, 184, 0.11);
    background: rgba(20, 20, 21, 0.78);
    color: rgba(226, 232, 240, 0.58);
}

html.dark body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions-toggle:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(28, 27, 32, 0.9);
    color: rgba(248, 250, 252, 0.82);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-msg.user .chat-msg-bubble {
    border-color: rgba(15, 118, 110, 0.16);
    background: linear-gradient(180deg, #eefaf8, #e6f5f1);
    color: #123733;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.78), 0 8px 18px rgba(15, 118, 110, 0.045);
}

:is(html.light, html[data-theme="light"]) body.coach-page:not(.coach-page--embed-drawer) .chat-msg-avatar--user {
    border-color: rgba(15, 118, 110, 0.14);
    background: #f8fafc;
    color: #0f766e;
}

@media (max-width: 760px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-command-actions.is-collapsed ~ .chat-shell .chat-messages {
        height: clamp(440px, 56vh, 640px);
        min-height: 440px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .chat-msg,
    .chat-composer-tools-shell,
    .chat-composer-menu,
    .chat-composer-menu .chat-tool-lens,
    .chat-voice-bars span,
    .chat-voice-btn.is-recording svg,
    .chat-voice-btn.is-recording i,
    body.coach-page.coach-tools-open::before {
        animation: none;
        opacity: 1;
        transform: none;
    }

    .chat-composer:hover::before,
    .chat-composer:focus-within::before,
    .chat-composer.is-recording::before,
    .chat-composer.is-transcribing::before,
    .chat-composer.is-tools-open::before {
        animation: none !important;
    }

}

@media (max-width: 1080px) {
    .chat-tools-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 820px) {
    .chat-tools-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .chat-composer {
        min-height: 108px;
        border-radius: 16px;
    }

    .chat-composer-menu {
        max-height: min(62vh, 460px);
        padding: 12px;
    }

    .chat-tools-grid {
        grid-template-columns: 1fr;
    }

    .chat-tool-btn--label span {
        display: none;
    }
}

.chat-msg--upgrade {
    width: min(100%, 860px);
    max-width: min(100%, 860px);
}

.chat-msg--upgrade .chat-msg-body {
    width: 100%;
}

.chat-msg--upgrade .chat-msg-bubble {
    width: 100%;
}

.chat-msg--upgrade .app-gate--coach-access {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 24px;
    min-height: 124px;
    padding: 20px 22px;
    border-color: color-mix(in srgb, var(--accent, #66d2c3) 18%, var(--app-border-soft, rgba(255, 255, 255, .08)));
    background: var(--app-surface-card, #0d0d0d);
    box-shadow: none;
}

.chat-msg--upgrade .app-gate--coach-access .app-gate__body {
    display: grid;
    align-content: center;
    gap: 0;
}

.chat-msg--upgrade .app-gate--coach-access .app-gate__eyebrow {
    margin-bottom: 7px;
    color: var(--accent, #66d2c3);
    font-size: 10px;
}

.chat-msg--upgrade .app-gate--coach-access h2 {
    max-width: 620px;
    font-size: clamp(18px, 2.3vw, 21px);
    font-weight: 680;
    line-height: 1.16;
}

.chat-msg--upgrade .app-gate--coach-access .app-gate__detail {
    max-width: 650px !important;
    margin-top: 7px;
    color: var(--text-secondary, #a1a1aa);
    font-size: 13.5px;
    line-height: 1.45;
}

.chat-msg--upgrade .app-gate--coach-access .app-gate__action {
    min-width: 188px;
}

.chat-msg--upgrade .app-gate--coach-access .app-action-btn {
    min-height: 44px;
    padding-inline: 18px;
}

@media (max-width: 720px) {
    .chat-msg--upgrade .app-gate--coach-access {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
        min-height: 0;
        padding: 18px;
    }

    .chat-msg--upgrade .app-gate--coach-access .app-gate__action {
        grid-column: auto;
    }
}

/* Stage 11 acceptance: foreground the grounded conversation, not AI-system complexity. */
body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace {
    min-height: 0;
    margin-bottom: 0;
    padding-top: 20px;
    padding-bottom: 20px;
}

@media (min-width: 768px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace {
        align-items: center;
        flex-wrap: nowrap;
        gap: 20px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace .coach-title-group {
        flex: 1 1 auto;
        width: auto;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace .coach-page-toolbar.app-toolbar {
        display: flex;
        flex-wrap: nowrap;
        justify-content: flex-end;
        width: auto;
        margin-left: auto;
        overflow: visible;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace .coach-page-toolbar .app-action-btn {
        width: auto;
        min-height: 46px;
        padding-inline: 16px;
    }
}

@media (max-width: 767px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace .app-page-title {
        transform: none;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace.coach-page-header--privacy-only {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 46px;
        align-items: center;
        gap: 8px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header--privacy-only .coach-title-group {
        grid-column: 1;
        width: auto;
        min-width: 0;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header--privacy-only .coach-page-toolbar.app-toolbar {
        display: flex;
        grid-column: 2;
        justify-content: flex-end;
        width: 46px;
        margin: 0;
        transform: translateY(-6px);
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header--privacy-only .coach-page-toolbar .creator-mode-toggle {
        width: 46px;
        min-width: 46px;
        padding-inline: 0;
    }
}

body.coach-page:not(.coach-page--embed-drawer) #chatCard > .coach-card-title {
    min-height: 48px;
    padding: 13px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) #chatCard .chat-shell {
    margin-top: 0;
}

body.coach-page:not(.coach-page--embed-drawer) #chatCard .chat-messages {
    height: clamp(440px, 58vh, 720px);
    min-height: 440px;
    max-height: 720px;
}

body.coach-page:not(.coach-page--embed-drawer) #chatCard.has-native-response .chat-messages {
    height: auto;
    min-height: 0;
    max-height: 720px;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions {
    gap: 10px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--coach-border-muted);
    box-shadow: none;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions::after {
    display: none;
}

body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions .coach-command-actions-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.coach-evidence-panel-body {
    display: grid;
    gap: 12px;
    padding: 15px 20px 20px;
}

body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title {
    display: grid;
    grid-template-columns: auto auto minmax(0, 1fr);
    column-gap: 8px;
}

body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title-label {
    white-space: nowrap;
}

body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title-meta {
    min-width: 0;
    margin-left: 0;
    justify-self: end;
    line-height: 1.3;
    white-space: normal;
}

@media (max-width: 520px) {
    body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title {
        grid-template-columns: auto minmax(0, 1fr);
        row-gap: 3px;
    }

    body.coach-page:not(.coach-page--embed-drawer) #patternsCard .coach-card-title-meta {
        grid-column: 2;
        justify-self: start;
        text-align: left;
    }
}

.coach-evidence-panel-head {
    display: grid;
    gap: 5px;
}

.coach-evidence-panel-head > span {
    color: var(--coach-accent-strong);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.coach-evidence-panel-head > strong {
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.3;
}

.coach-evidence-panel-scope {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.coach-evidence-panel-scope > span {
    padding: 5px 8px;
    border: 1px solid var(--coach-border-muted);
    border-radius: 999px;
    color: var(--text-secondary);
    font-size: 11px;
    line-height: 1;
}

.coach-evidence-panel-observations {
    display: grid;
}

.coach-evidence-panel-observations > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid var(--coach-border-muted);
}

.coach-evidence-panel-observations > div > span,
.coach-evidence-panel-observations > div.is-empty {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.4;
}

.coach-evidence-panel-observations > div > strong {
    flex: 0 0 auto;
    color: var(--text-primary);
    font-size: 12px;
    text-align: right;
}

.coach-evidence-panel-limit {
    display: grid;
    gap: 5px;
    padding: 11px 12px;
    border-left: 2px solid rgba(245, 158, 11, 0.7);
    background: rgba(245, 158, 11, 0.055);
}

.coach-evidence-panel-limit[hidden] {
    display: none;
}

.coach-evidence-panel-limit small {
    color: rgba(245, 190, 92, 0.9);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coach-evidence-panel-limit span {
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

.coach-evidence-panel-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--coach-accent-strong);
    font-size: 12px;
    font-weight: 700;
    text-decoration: none;
}

.coach-evidence-panel-link[hidden] {
    display: none;
}

.coach-evidence-panel.is-stale .coach-evidence-panel-head > span {
    color: rgba(245, 190, 92, 0.92);
}

.coach-evidence-panel.is-stale .coach-evidence-panel-scope::before {
    content: 'Previous scope';
    padding: 5px 8px;
    border: 1px solid rgba(245, 158, 11, 0.28);
    border-radius: 999px;
    color: rgba(245, 190, 92, 0.92);
    background: rgba(245, 158, 11, 0.06);
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.coach-insufficient-alternatives {
    display: grid;
    gap: 8px;
}

.coach-insufficient-alternatives > small {
    color: var(--text-muted);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.coach-insufficient-alternatives > div {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.coach-insufficient-alternatives button {
    min-height: 30px;
    padding: 5px 9px;
    border: 1px solid var(--coach-border-muted);
    border-radius: 999px;
    background: transparent;
    color: var(--coach-accent-strong);
    font: inherit;
    font-size: 11.5px;
    font-weight: 700;
    cursor: pointer;
}

.coach-insufficient-alternatives button:hover {
    border-color: rgba(91, 196, 176, 0.34);
    background: rgba(91, 196, 176, 0.06);
}

.coach-thinking-panel--honest {
    min-width: min(420px, 100%);
}

.coach-thinking-panel--honest p {
    margin: 9px 0 0;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.45;
}

@media (max-width: 640px) {
    .coach-range-control {
        padding-inline: 7px;
    }

    .coach-range-control select {
        min-width: 52px;
        max-width: 62px;
    }
}

/* Contextual answers must be immediately readable inside the narrower iframe. */
.coach-page--embed-drawer .coach-answer-v2-scope span {
    color: rgba(226, 232, 240, 0.76);
}

.coach-page--embed-drawer .coach-answer-v2-proof small,
.coach-page--embed-drawer .coach-answer-v2-limit small {
    color: rgba(203, 213, 225, 0.68);
}

.coach-page--embed-drawer .coach-answer-v2-proof strong {
    color: rgba(248, 250, 252, 0.94);
}

.coach-page--embed-drawer .coach-answer-v2-proof em {
    color: rgba(143, 241, 205, 0.90);
}

.coach-page--embed-drawer .coach-answer-v2-explanation,
.coach-page--embed-drawer .coach-answer-v2-limit {
    color: rgba(226, 232, 240, 0.76);
}

.coach-page--embed-drawer .coach-answer-v2-action {
    color: rgba(143, 241, 205, 0.94);
}

:is(html.light, html[data-theme="light"]) .coach-evidence-panel-limit {
    background: rgba(245, 158, 11, 0.07);
}

:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-scope span,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-proof small,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-limit small,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-explanation,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-limit {
    color: #475569;
}

:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-proof strong {
    color: #17201f;
}

:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-proof em,
:is(html.light, html[data-theme="light"]) .coach-page--embed-drawer .coach-answer-v2-action {
    color: #0f766e;
}

@media (max-width: 1120px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions .coach-command-actions-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    body.coach-page:not(.coach-page--embed-drawer) .coach-page-header.app-page-header--workspace {
        margin-bottom: 0;
        padding-top: 4px;
        padding-bottom: 13px;
    }

    body.coach-page:not(.coach-page--embed-drawer) #chatCard .chat-messages {
        height: clamp(390px, 56dvh, 620px);
        min-height: 390px;
        max-height: 620px;
        padding-bottom: calc(var(--coach-composer-reserve, 132px) + 20px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(var(--coach-composer-reserve, 132px) + 20px + env(safe-area-inset-bottom));
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions {
        padding: 12px 14px 16px;
    }

    body.coach-page:not(.coach-page--embed-drawer) .coach-context-suggestions .coach-command-actions-grid {
        grid-template-columns: 1fr;
    }

    .coach-page--embed-drawer .chat-messages {
        padding-bottom: calc(28px + env(safe-area-inset-bottom));
        scroll-padding-bottom: calc(118px + env(safe-area-inset-bottom));
    }

    .coach-page--embed-drawer .chat-input-row {
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
    }

    body.coach-page:not(.coach-page--embed-drawer) #chatCard.has-native-response .chat-messages {
        padding-bottom: 18px;
        scroll-padding-bottom: 18px;
    }
}

/* Calm product focus: preserve the teal boundary without the landing-style ring/glow. */
body.coach-page:not(.coach-page--embed-drawer) .chat-composer:hover:not(.is-recording):not(.is-transcribing):not(.is-tools-open),
body.coach-page:not(.coach-page--embed-drawer) .chat-composer:focus-within:not(.is-recording):not(.is-transcribing):not(.is-tools-open) {
    border-color: var(--coach-composer-focus-border);
    box-shadow: none;
}

body.coach-page:not(.coach-page--embed-drawer) .chat-composer:hover:not(.is-recording):not(.is-transcribing):not(.is-tools-open)::before,
body.coach-page:not(.coach-page--embed-drawer) .chat-composer:focus-within:not(.is-recording):not(.is-transcribing):not(.is-tools-open)::before {
    opacity: 0;
    animation: none;
}

/* Embedded Coach workspace: share the same quiet shell/control depth as App modals. */
.coach-page--embed-drawer {
    background: var(--app-bg-page);
}

.coach-page--embed-drawer #chatCard,
.coach-page--embed-drawer .chat-shell {
    background: var(--app-bg-page);
}

.coach-page--embed-drawer .chat-messages {
    padding: 20px 20px 22px;
    scroll-padding-top: 20px;
    overscroll-behavior: contain;
}

.coach-page--embed-drawer .chat-input-row {
    padding: 12px 16px 14px;
    border-top-color: var(--app-border-soft);
    background: var(--app-bg-shell);
}

.coach-page--embed-drawer .chat-composer {
    gap: 8px;
    min-height: 92px;
    padding: 12px 13px 10px;
    border-color: var(--app-border-default);
    border-radius: 12px;
    background: var(--app-surface-control);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.coach-page--embed-drawer .chat-composer .chat-input {
    min-height: 34px;
    max-height: 110px;
    line-height: 1.45;
}

.coach-page--embed-drawer .chat-composer:hover:not(.is-recording):not(.is-transcribing):not(.is-tools-open),
.coach-page--embed-drawer .chat-composer:focus-within:not(.is-recording):not(.is-transcribing):not(.is-tools-open) {
    border-color: var(--app-action-primary-border-hover);
    background: var(--app-surface-control);
    box-shadow: none;
}

.coach-page--embed-drawer .chat-composer:hover:not(.is-recording):not(.is-transcribing):not(.is-tools-open)::before,
.coach-page--embed-drawer .chat-composer:focus-within:not(.is-recording):not(.is-transcribing):not(.is-tools-open)::before {
    opacity: 0;
    animation: none;
}
