/* ── Plan Phase Accordion ── */
.plan-phase-section {
  margin-bottom: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.plan-phase-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  background: rgba(255,255,255,0.03);
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
}
.plan-phase-toggle .phase-arrow {
  font-size: 11px;
  color: var(--muted);
  flex-shrink: 0;
}
.plan-phase-toggle .phase-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.plan-phase-toggle[aria-expanded="true"] {
  border-bottom: 1px solid var(--line);
}
.plan-phase-body {
  padding: 10px 14px 14px;
}

/* ── Today's Workout Card ── */
.today-workout-card {
  background: rgba(255,107,0,0.06);
  border: 1px solid rgba(255,107,0,0.2);
  border-radius: 12px;
  padding: 12px 16px;
  margin-bottom: 12px;
}
.today-workout-card .today-label {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,107,0,0.7);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 4px;
}
.today-workout-card .today-workout {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.today-workout-card .today-rest {
  font-size: 14px;
  color: var(--muted);
}

/* ── Plan Detail stat pills ── */
.plan-stat-pill {
  background: rgba(148,163,184,0.08);
  border: 1px solid rgba(148,163,184,0.15);
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 13px;
  color: #94a3b8;
  white-space: nowrap;
}

/* ===============================
     Coach Chat — fixed-bar layout
     (input pinned above bottom nav)
================================ */

.coach-page {
    padding: 0;
    margin: 0;
}

#coachPlanPanel {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 10px;
}

#coachPlanPanel #planDayStrip,
#coachPlanPanel #planWeekHeader {
    margin-bottom: 0;
}

#coachPlanPanel.coach-plan-collapsed #planHero,
#coachPlanPanel.coach-plan-collapsed #planList,
#coachPlanPanel.coach-plan-collapsed #planActions,
#coachPlanPanel.coach-plan-collapsed #planDayStrip,
#coachPlanPanel.coach-plan-collapsed #planWeekHeader {
    display: none !important;
}

#coachPlanPanel.coach-plan-collapsed {
    gap: 4px;
}

#coachView {
    display: flex;
    flex-direction: column;
    height: calc(100dvh - 56px - 72px); /* viewport minus topnav and bottomnav */
    overflow: hidden;
}

.coach-chat-container {
    background: linear-gradient(180deg, var(--panel) 0%, var(--bg) 100%);
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    position: relative;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.06);
}

.coach-chat-container::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 14% 22%, rgba(255,255,255,0.04), transparent 28%),
        radial-gradient(circle at 84% 78%, rgba(255,255,255,0.03), transparent 32%);
    opacity: 0.7;
}

#aiCoachChatMessages {
    background: none !important;
    border: none !important;
    padding: 8px 18px 24px 18px !important;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

/* ---- Input bar (pinned at bottom of coach flex container) ---- */
#aiCoachChatForm {
    flex-shrink: 0;
    position: sticky;
    bottom: 0;
    display: flex !important;
    align-items: center;
    gap: 8px;
    flex-wrap: nowrap;
    padding: 10px 18px;
    margin: 0;
    background: var(--bg);
    border-top: 1px solid rgba(255,255,255,0.10);
    box-shadow: 0 -4px 20px rgba(0,0,0,0.4);
    z-index: 10;
}

#aiCoachChatForm::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    height: 80px;
    background: var(--bg);
    z-index: -1;
}

@media (max-width: 600px) {
    #aiCoachChatForm {
        flex-wrap: wrap;
        padding: 8px 12px 14px 12px;
    }
    #aiCoachChatForm textarea {
        flex: 1 1 100% !important;
        min-height: 42px;
        max-height: 80px;
        font-size: 14px !important;
    }
    #aiCoachChatForm button[type="submit"] {
        flex: 1 1 auto !important;
        width: auto !important;
        min-width: 60px !important;
        height: 40px;
    }
    #btnClearCoachChat {
        flex: 0 0 auto !important;
        height: 40px;
    }
}

.coach-msg {
    display: flex;
    flex-direction: row;
    align-items: flex-end;
    margin: 0 0 0 0;
}
.coach-msg.ai {
    justify-content: flex-start;
}
.coach-msg.user {
    justify-content: flex-end;
}

.coach-bubble {
    max-width: 86%;
    padding: 18px 22px;
    border-radius: 22px;
    font-size: 15px;
    line-height: 1.7;
    font-family: 'Fraunces', 'Georgia', serif;
    box-shadow: 0 2px 18px rgba(0,0,0,0.15);
    word-break: break-word;
    white-space: pre-line;
    transition: background 0.2s;
}

/* Make first greeting feel intentional and reduce dead space */
#aiCoachChatMessages .coach-msg.ai:first-child .coach-bubble {
    max-width: calc(100% - 20px);
    margin-right: 10px;
}
.coach-msg.ai .coach-bubble {
    background: linear-gradient(120deg, var(--card) 0%, var(--card2) 100%);
    color: var(--text);
    border-bottom-left-radius: 10px;
    border-top-left-radius: 10px;
    border-top-right-radius: 22px;
    border-bottom-right-radius: 22px;
    margin-left: 10px;
    margin-right: auto;
    border: 1.5px solid rgba(255,255,255,0.08);
    box-shadow: 0 2px 16px rgba(0,0,0,0.12);
}
.coach-msg.user .coach-bubble {
    background: linear-gradient(120deg, #333333 0%, #222222 100%);
    color: #ffffff;
    border-bottom-right-radius: 10px;
    border-top-right-radius: 10px;
    border-top-left-radius: 22px;
    border-bottom-left-radius: 22px;
    margin-right: 10px;
    margin-left: auto;
    border: 1.5px solid rgba(255,255,255,0.20);
    box-shadow: 0 2px 16px rgba(0,0,0,0.15);
}

.coach-bubble strong, .coach-bubble b {
    font-weight: 700;
}

.coach-bubble em, .coach-bubble i {
    font-style: italic;
}

/* --- Thinking indicator --- */
.coach-thinking-bubble {
    opacity: 0.85;
    font-style: italic;
    color: #cccccc !important;
}
.thinking-dots span {
    animation: thinkBounce 1.4s infinite ease-in-out both;
    font-weight: bold;
    font-size: 22px;
    color: #e8ff00;
}
.thinking-dots span:nth-child(1) { animation-delay: 0s; }
.thinking-dots span:nth-child(2) { animation-delay: 0.2s; }
.thinking-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes thinkBounce {
    0%, 80%, 100% { opacity: 0.2; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1.3); }
}
.cc-thinking-text {
    transition: opacity 0.3s ease;
}
.coach-stage-bubble {
    animation: stagePulse 2s ease-in-out infinite;
}
@keyframes stagePulse {
    0%, 100% { opacity: 0.65; }
    50% { opacity: 0.9; }
}

/* Pulse glow for inline Accept Plan button after plan review modal is dismissed */
@keyframes pulseHighlight {
  0%   { box-shadow: 0 0 0 0 rgba(232,255,0,.8); }
  50%  { box-shadow: 0 0 0 10px rgba(232,255,0,.2); }
  100% { box-shadow: 0 0 0 0 rgba(232,255,0,0); }
}
.pulse-highlight {
  animation: pulseHighlight 0.8s ease-out 3;
}

/* --- View Plan button --- */
.coach-plan-view-btn {
    display: inline-block;
    margin-top: 10px;
    padding: 10px 24px;
    border: none;
    border-radius: 20px;
    background: #ffffff;
    color: #000000;
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
}
.coach-plan-view-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 16px rgba(255, 255, 255, 0.15);
}

/* --- Coach Day Tip (Plan tab workout card) --- */
.coach-day-tip {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 10px;
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-left: 3px solid rgba(255, 255, 255, 0.25);
    font-size: 13px;
    line-height: 1.5;
    color: #94a3b8;
}
.coach-day-tip-icon {
    flex-shrink: 0;
    font-size: 14px;
    line-height: 1.5;
}

/* --- Plan Modal Overlay --- */
.coach-plan-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.coach-plan-modal {
    background: #111111;
    border: 1.5px solid #333333;
    border-radius: 20px;
    width: 90vw;
    max-width: 650px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
    animation: slideUp 0.3s ease;
}
@keyframes slideUp {
    from { transform: translateY(30px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.coach-plan-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}
.coach-plan-title {
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}
.coach-plan-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    opacity: 0.7;
    transition: opacity 0.15s;
}
.coach-plan-close:hover {
    opacity: 1;
}
.coach-plan-accept-inline {
    font-size: 13px;
    padding: 5px 14px;
    margin-right: 8px;
    border-radius: 20px;
}

.coach-plan-body {
    padding: 20px 24px 28px;
    overflow-y: auto;
    color: #e0e0e0;
    font-family: 'Fraunces', 'Georgia', serif;
    font-size: 15px;
    line-height: 1.7;
}
.coach-plan-body h1, .coach-plan-body h2, .coach-plan-body h3 {
    color: #ffffff;
    margin: 18px 0 8px;
    font-weight: 700;
}
.coach-plan-body h4 {
    color: #cccccc;
    margin: 16px 0 6px;
    font-weight: 700;
    font-size: 15px;
}
.coach-plan-body h1 { font-size: 22px; }
.coach-plan-body h2 { font-size: 19px; }
.coach-plan-body h3 { font-size: 16px; }
.coach-plan-body hr {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    margin: 16px 0;
}
.coach-plan-body ul {
    list-style: none;
    padding: 0;
    margin: 8px 0;
}
.coach-plan-body li {
    padding: 4px 0 4px 16px;
    position: relative;
}
.coach-plan-body li::before {
    content: "\2022";
    color: #ffffff;
    position: absolute;
    left: 0;
    font-weight: bold;
}
.coach-plan-body strong {
    color: #ffffff;
    font-weight: 700;
}

/* ── Collapsible workout detail rows ── */
.workout-day-row {
    margin: 4px 0;
}
.workout-day-toggle {
    display: flex;
    align-items: flex-start;
    gap: 6px;
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 8px 12px;
    color: #e0e0e0;
    font: inherit;
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.workout-day-toggle:hover {
    background: rgba(255, 255, 255, 0.10);
    border-color: rgba(255, 255, 255, 0.25);
}
.workout-day-toggle[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.25);
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.workout-day-arrow {
    display: inline-block;
    font-size: 10px;
    color: #ffffff;
    transition: transform 0.2s;
    margin-top: 3px;
    flex-shrink: 0;
}
.workout-day-toggle[aria-expanded="true"] .workout-day-arrow {
    transform: rotate(90deg);
}
.workout-day-toggle strong {
    color: #ffffff;
}
.workout-day-detail {
    background: rgba(10, 10, 10, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-top: none;
    border-radius: 0 0 8px 8px;
    padding: 6px 12px 10px 28px;
    margin-bottom: 2px;
    color: #c8d6e5;
}
.workout-day-detail ul {
    list-style: none;
    padding: 0;
    margin: 4px 0;
}
.workout-day-detail li {
    padding: 3px 0 3px 16px;
    position: relative;
    color: #c8d6e5;
    font-size: 13px;
    line-height: 1.6;
}
.workout-day-detail li::before {
    content: "\25B8";
    color: #ffffff;
    position: absolute;
    left: 0;
    font-size: 11px;
}
.workout-day-detail strong {
    color: #cccccc;
    font-weight: 600;
}
.workout-day-simple {
    padding: 6px 12px;
    color: #e0e0e0;
    font-size: 14px;
    line-height: 1.5;
    border-left: 3px solid rgba(255, 255, 255, 0.15);
    margin: 2px 0;
}
.workout-day-simple strong {
    color: #ffffff;
}

/* ── Plan tab: Runna-inspired layout ── */
#planView {
    padding: 0 0 140px 0;
    background: var(--bg);
}

/* Week strip — horizontal day selector pinned at top */
.pv-week-strip {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0;
    padding: 8px 6px 0;
    background: #161616;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}
.pv-day-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 10px 2px 12px;
    background: transparent;
    border: none;
    color: rgba(255,255,255,0.40);
    cursor: pointer;
    transition: all 0.15s;
    position: relative;
    font-family: 'Barlow', sans-serif;
}
.pv-day-cell:hover { color: rgba(255,255,255,0.7); }
.pv-day-name {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.pv-day-num {
    font-size: 16px;
    font-weight: 700;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.15s;
}
.pv-day-cell.is-today .pv-day-num {
    background: #ffffff;
    color: #000000;
}
.pv-day-cell.selected .pv-day-num {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
}
.pv-day-cell.is-today.selected .pv-day-num {
    outline: 2px solid rgba(255,255,255,0.5);
    outline-offset: 2px;
}
.pv-day-cell.has-workout { color: #e2e8f0; }
.pv-day-dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--cw-miles, #e8a020);
    opacity: 0;
    transition: opacity 0.15s;
}
.pv-day-cell.has-workout .pv-day-dot { opacity: 1; }

/* Week nav row */
.pv-week-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px 4px;
}
.pv-week-label {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: #94a3b8;
}
.pv-week-arrow {
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 18px;
    padding: 4px 8px;
    cursor: pointer;
    transition: color 0.15s;
}
.pv-week-arrow:hover:not(:disabled) { color: #ffffff; }
.pv-week-arrow:disabled { opacity: 0.2; cursor: default; }

/* Hero section */
.pv-hero {
    padding: 28px 18px 12px;
    text-align: center;
}
.pv-hero-badge {
    width: 72px;
    height: 72px;
    border-radius: 20px;
    margin: 0 auto 16px;
    display: block;
}
.pv-hero-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 24px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
    line-height: 1.2;
}
.pv-hero-sub {
    font-family: 'Barlow', sans-serif;
    font-size: 14px;
    color: #94a3b8;
    margin-top: 6px;
    line-height: 1.4;
}

/* Workout list */
.pv-workout-list {
    padding: 8px 14px;
}
.pv-date-label {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 4px 6px;
}

/* Workout card — Runna-inspired with left accent border */
.pv-workout-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-left: 3px solid var(--cw-miles, #e8a020);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
    overflow: hidden;
}
.pv-workout-card:hover {
    background: rgba(255,255,255,0.06);
}
.pv-workout-card.completed {
    opacity: 0.88;
    border-left-color: #22c55e;
    border-color: rgba(34, 197, 94, 0.2);
    box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.08), 0 0 12px rgba(34, 197, 94, 0.04);
}
.pv-workout-card.skipped {
    opacity: 0.5;
    border-left-color: #ef4444;
}
.pv-workout-card[data-sport="run"] { border-left-color: #3b82f6; }
.pv-workout-card[data-sport="bike"] { border-left-color: #f59e0b; }
.pv-workout-card[data-sport="swim"] { border-left-color: #06b6d4; }
.pv-workout-card[data-sport="strength"] { border-left-color: #a855f7; }
.pv-workout-card[data-sport="brick"] { border-left-color: var(--cw-apex, #e05555); }
.pv-workout-card[data-sport="hiit"] { border-left-color: #f97316; }
.pv-workout-card[data-sport="rest"] { border-left-color: rgba(255,255,255,0.15); }

.pv-wk-header {
    display: flex;
    align-items: center;
    gap: 12px;
}
.pv-wk-icon {
    font-size: 26px;
    line-height: 1;
    flex-shrink: 0;
}
.pv-wk-info { flex: 1; min-width: 0; }
.pv-wk-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 17px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.01em;
}
.pv-wk-meta {
    font-family: 'Barlow', sans-serif;
    font-size: 13px;
    color: #94a3b8;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.pv-wk-meta-dot::before { content: "\00B7"; margin: 0 2px; }
.pv-wk-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.pv-wk-badge.done {
    background: rgba(52,211,153,0.15);
    border: 1px solid rgba(52,211,153,0.35);
    color: #6ee7b7;
}
.pv-wk-badge.skip {
    background: rgba(239,68,68,0.12);
    border: 1px solid rgba(239,68,68,0.30);
    color: #fca5a5;
}
.pv-wk-steps {
    margin: 10px 0 0 38px;
    padding: 0;
    list-style: none;
}
.pv-wk-steps li {
    font-size: 13px;
    color: #94a3b8;
    padding: 3px 0;
    position: relative;
    padding-left: 14px;
}
.pv-wk-steps li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 10px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(255,255,255,0.20);
}
.pv-wk-tip {
    margin: 10px 0 0;
    padding: 8px 12px;
    background: rgba(255,255,255,0.03);
    border-radius: 8px;
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
}
.pv-wk-tip-icon {
    margin-right: 4px;
}

/* Start workout button */
.pv-start-btn {
    display: block;
    width: calc(100% - 28px);
    margin: 8px 14px 16px;
    padding: 14px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 12px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 16px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
    text-align: center;
}
.pv-start-btn:hover { opacity: 0.9; }
.pv-start-btn:active { opacity: 0.8; }

/* Action buttons row */
.pv-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 4px 14px 10px;
}
.pv-action-btn {
    font-family: 'Barlow', sans-serif;
    font-size: 12px;
    font-weight: 600;
    padding: 6px 14px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
    border: 1px solid var(--line);
    background: var(--panel);
    color: #94a3b8;
}
.pv-action-btn:hover { background: var(--card); color: #e2e8f0; }
.pv-action-danger { color: #ef4444; border-color: rgba(239,68,68,0.30); }
.pv-action-danger:hover { background: rgba(239,68,68,0.10); }

/* Rest day card */
.pv-rest-card {
    text-align: center;
    padding: 32px 18px;
    color: #64748b;
}
.pv-rest-icon { font-size: 40px; margin-bottom: 10px; }
.pv-rest-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 20px;
    font-weight: 700;
    color: #94a3b8;
}
.pv-rest-sub {
    font-size: 13px;
    margin-top: 4px;
    color: #64748b;
}

/* Weekly Progress Banner */
.pv-progress-banner {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    margin: 0 0 14px;
    background: rgba(34, 197, 94, 0.05);
    border: 1px solid rgba(34, 197, 94, 0.12);
    border-radius: 12px;
}
.pv-progress-ring {
    position: relative;
    width: 52px;
    height: 52px;
    flex-shrink: 0;
}
.pv-progress-ring svg { display: block; }
.pv-progress-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #22c55e;
}
.pv-progress-info { flex: 1; min-width: 0; }
.pv-progress-main {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}
.pv-progress-detail {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Coach feedback on completed cards */
.pv-wk-tip-done {
    color: rgba(110, 231, 183, 0.8);
    background: rgba(34, 197, 94, 0.06);
    border-left: 2px solid rgba(34, 197, 94, 0.25);
    padding-left: 8px;
}

/* Debrief button on completed plan cards */
.pv-card-debrief {
    margin: 10px 0 0;
    padding: 0 2px 2px;
}
.pv-card-debrief-chat {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 20px;
    border: none;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    font-family: 'Barlow Condensed', sans-serif;
    opacity: 0.9;
}
.pv-card-debrief-chat:hover { opacity: 1; }

/* No plan gate */
.pv-gate {
    text-align: center;
    padding: 60px 24px;
}
.pv-gate-badge {
    width: 80px;
    height: 80px;
    border-radius: 22px;
    margin: 0 auto 20px;
    display: block;
    opacity: 0.8;
}
.pv-gate-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 22px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.02em;
}
.pv-gate-sub {
    font-size: 14px;
    color: #94a3b8;
    margin-top: 8px;
    line-height: 1.4;
}
.pv-gate-btn {
    display: inline-block;
    margin-top: 20px;
    padding: 12px 28px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 10px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: opacity 0.15s;
}
.pv-gate-btn:hover { opacity: 0.9; }

@media (max-width: 600px) {
    .coach-plan-modal {
        width: 96vw;
        max-height: 90vh;
        border-radius: 14px;
    }
    .coach-plan-header { padding: 14px 16px; }
    .coach-plan-body { padding: 14px 16px 20px; font-size: 14px; }
}

@media (max-width: 600px) {
    /* ── Coach tab mobile: no horizontal overflow ── */
    #coachView,
    .coach-page,
    .coach-chat-container {
        width: 100% !important;
        max-width: 100vw !important;
        overflow-x: hidden !important;
        box-sizing: border-box !important;
    }
    .coach-chat-container {
        border-radius: 0;
        padding: 0;
    }

    /* Topbar: stack title + subtitle, no overflow */
    .coach-topbar {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 2px !important;
        padding: 10px 14px 8px !important;
    }
    .coach-topbar-title {
        font-size: 16px !important;
    }
    .coach-topbar-sub {
        font-size: 11px !important;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    /* Plan banner: compact single-row on mobile */
    .coach-plan-banner {
        flex-wrap: nowrap !important;
        padding: 8px 12px !important;
        gap: 8px !important;
    }
    .coach-plan-banner-right {
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 4px !important;
        flex-shrink: 0;
    }
    .coach-plan-banner-today {
        font-size: 11px !important;
        max-width: 140px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .coach-plan-banner-btn {
        font-size: 10px !important;
        padding: 4px 8px !important;
    }

    /* Message area: full width, no side bleed */
    #aiCoachChatMessages {
        padding: 8px 10px 16px 10px !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }
    .coach-msg {
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }
    .coach-bubble {
        font-size: 14px;
        padding: 12px 14px;
        max-width: 84% !important;
        box-sizing: border-box !important;
    }
    .coach-msg.ai .coach-bubble  { margin-left: 8px !important; }
    .coach-msg.user .coach-bubble { margin-right: 8px !important; }

    /* Quick chips: scrollable row, no wrap-overflow */
    .coach-quick-chips {
        padding: 6px 10px 4px !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .coach-quick-chips::-webkit-scrollbar { display: none; }
    .coach-chip {
        flex-shrink: 0 !important;
        font-size: 11px !important;
        padding: 6px 12px !important;
        white-space: nowrap !important;
    }

    /* Fixed input bar: full width, no overflow */
    #aiCoachChatForm {
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
        padding: 8px 10px 12px !important;
    }
}
/* ===============================
   Coach Wizard — v2 (prototype-aligned)
================================ */
:root {
    --cw-prime:   #c9a84c;
    --cw-miles:   #e8a020;
    --cw-cadence: #5b9cf6;
    --cw-apex:    #e05555;
}
#coachWizard {
    max-width: 600px;
    margin: 0 auto;
    padding: 0;
    font-family: 'Barlow', sans-serif;
    min-height: calc(100dvh - 60px);
    display: flex;
    flex-direction: column;
}
.cw-screen {
    display: none;
    flex-direction: column;
    padding-bottom: 16px;
    animation: cwFadeUp .28s ease;
    flex: 1;
    min-height: 0;
}
.cw-screen--active { display: flex; }
@keyframes cwFadeUp { from { opacity:0; transform:translateY(12px); } to { opacity:1; transform:translateY(0); } }

/* Progress bar */
.cw-progress-bar { display: flex; gap: 4px; padding: 14px 18px 0; flex-shrink: 0; }
.cw-pb-seg { height: 2px; flex: 1; border-radius: 2px; background: var(--line); transition: background .3s; }
.cw-pb-seg.on { background: var(--cw-miles); }
.cw-pb-seg.done { background: rgba(255,255,255,0.28); }

/* Progress step labels */
.cw-pb-labels { display: flex; padding: 4px 18px 0; flex-shrink: 0; }
.cw-pb-label { flex: 1; font-size: 9px; text-transform: uppercase; letter-spacing: 0.5px; font-weight: 600; color: rgba(255,255,255,0.18); text-align: center; }
.cw-pb-label.on { color: rgba(255,255,255,0.55); }
.cw-pb-label.done { color: rgba(255,255,255,0.3); }

/* Page header */
.cw-page-header { padding: 22px 18px 16px; text-align: center; }
.cw-page-title { font-family: 'Barlow Condensed', sans-serif; font-size: 38px; font-weight: 900; letter-spacing: .04em; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.cw-page-sub { font-size: 14px; color: var(--muted); font-weight: 300; letter-spacing: .04em; }

/* Coach grid (welcome) */
.cw-coach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; padding: 0 14px; margin-bottom: 14px; }
.cw-coach-card { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 14px 8px 12px; cursor: pointer; transition: all .2s ease; display: flex; flex-direction: column; align-items: center; gap: 7px; position: relative; overflow: hidden; -webkit-tap-highlight-color: transparent; }
.cw-coach-card::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; opacity: 0; transition: opacity .2s; }
.cw-coach-card[data-coach="miles"]::before   { background: var(--cw-miles); }
.cw-coach-card[data-coach="cadence"]::before { background: var(--cw-cadence); }
.cw-coach-card[data-coach="apex"]::before    { background: var(--cw-apex); }
.cw-coach-card.active::before { opacity: 1; }
.cw-coach-card.active { background: var(--card); }
.cw-coach-card[data-coach="miles"].active   { border-color: rgba(232,160,32,.28); }
.cw-coach-card[data-coach="cadence"].active { border-color: rgba(91,156,246,.28); }
.cw-coach-card[data-coach="apex"].active    { border-color: rgba(224,85,85,.28); }
.cw-coach-card:hover { background: var(--card); border-color: rgba(255,255,255,.13); }
.cw-coach-icon-wrap { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; transition: transform .2s; }
.cw-coach-card:hover .cw-coach-icon-wrap { transform: scale(1.08); }
.cw-coach-card[data-coach="miles"]   .cw-coach-icon-wrap { background: rgba(232,160,32,.1); }
.cw-coach-card[data-coach="cadence"] .cw-coach-icon-wrap { background: rgba(91,156,246,.1); }
.cw-coach-card[data-coach="apex"]    .cw-coach-icon-wrap { background: rgba(224,85,85,.1); }
.cw-coach-card-name { font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; text-align: center; }
.cw-coach-card[data-coach="miles"]   .cw-coach-card-name { color: var(--cw-miles); }
.cw-coach-card[data-coach="cadence"] .cw-coach-card-name { color: var(--cw-cadence); }
.cw-coach-card[data-coach="apex"]    .cw-coach-card-name { color: var(--cw-apex); }
.cw-coach-card-role { font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.28); text-align: center; line-height: 1.3; }
.cw-coach-card-tagline { font-size: 9px; color: var(--muted); text-align: center; line-height: 1.4; font-weight: 300; opacity: 0.7; margin-top: 2px; }
.cw-coach-card.active .cw-coach-card-tagline { opacity: 1; }

/* Bio panel */
.cw-bio-panel { margin: 0 14px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; display: none; animation: cwSlideDown .22s ease; }
.cw-bio-panel.vis { display: block; }
@keyframes cwSlideDown { from { opacity:0; transform:translateY(-6px); } to { opacity:1; transform:translateY(0); } }
.cw-bio-top { padding: 14px 16px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; }
.cw-bio-avatar { width: 44px; height: 44px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 22px; flex-shrink: 0; }
.cw-bio-panel[data-coach="miles"]   .cw-bio-avatar { background: rgba(232,160,32,.1); }
.cw-bio-panel[data-coach="cadence"] .cw-bio-avatar { background: rgba(91,156,246,.1); }
.cw-bio-panel[data-coach="apex"]    .cw-bio-avatar { background: rgba(224,85,85,.1); }
.cw-bio-label { font-family: 'Barlow Condensed', sans-serif; font-size: 17px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; line-height: 1; margin-bottom: 2px; }
.cw-bio-panel[data-coach="miles"]   .cw-bio-label { color: var(--cw-miles); }
.cw-bio-panel[data-coach="cadence"] .cw-bio-label { color: var(--cw-cadence); }
.cw-bio-panel[data-coach="apex"]    .cw-bio-label { color: var(--cw-apex); }
.cw-bio-role { font-size: 10px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.28); margin-bottom: 2px; }
.cw-bio-real { font-size: 11px; color: var(--muted); font-weight: 300; }
.cw-bio-body { padding: 13px 16px 14px; }
.cw-bio-text { font-size: 12px; line-height: 1.7; color: var(--muted); font-weight: 300; margin: 0; }
.cw-bio-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 10px; }
.cw-bio-tag { font-size: 9px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--line); }
.cw-bio-panel[data-coach="miles"]   .cw-bio-tag { color: rgba(232,160,32,.7); border-color: rgba(232,160,32,.18); }
.cw-bio-panel[data-coach="cadence"] .cw-bio-tag { color: rgba(91,156,246,.7); border-color: rgba(91,156,246,.18); }
.cw-bio-panel[data-coach="apex"]    .cw-bio-tag { color: rgba(224,85,85,.7); border-color: rgba(224,85,85,.18); }

/* Goal screen */
.cw-goal-header { padding: 22px 18px 6px; }
.cw-goal-title { font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.cw-goal-sub { font-size: 15px; color: var(--muted); font-weight: 300; line-height: 1.5; }
.cw-goal-body { padding: 16px 18px; flex: 1; display: flex; flex-direction: column; min-height: 0; overflow-y: auto; }
.cw-goal-textarea { width: 100%; min-height: 130px; padding: 15px 18px; font-family: 'Barlow', sans-serif; font-size: 16px; line-height: 1.6; background: var(--panel); border: 1px solid rgba(255,255,255,.13); border-radius: 10px; color: var(--text); resize: none; outline: none; transition: border-color .2s; margin-bottom: 14px; box-sizing: border-box; }
.cw-goal-textarea:focus { border-color: var(--cw-miles); }
.cw-goal-textarea::placeholder { color: rgba(255,255,255,.25); }
.cw-chips-label { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.28); margin-bottom: 8px; }
.cw-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 20px; }
.cw-chip { font-size: 13px; padding: 7px 14px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--muted); cursor: pointer; transition: all .15s; font-family: 'Barlow', sans-serif; }
.cw-chip:hover { border-color: var(--cw-miles); color: var(--cw-miles); }

/* Confirm screen */
.cw-confirm-header { padding: 22px 18px 10px; }
.cw-confirm-title { font-family: 'Barlow Condensed', sans-serif; font-size: 34px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; line-height: 1; margin-bottom: 6px; }
.cw-confirm-sub { font-size: 15px; color: var(--muted); font-weight: 300; }
.cw-goal-quote { margin: 0 18px 14px; padding: 11px 14px; background: var(--panel); border-left: 2px solid var(--cw-miles); border-radius: 0 8px 8px 0; font-size: 12px; color: var(--muted); font-style: italic; line-height: 1.5; }
.cw-recommendation { margin: 0 18px 14px; display: flex; flex-direction: column; gap: 8px; }
.cw-rec-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.cw-rec-row.miles  { border-left: 2px solid var(--cw-miles); }
.cw-rec-row.cadence { border-left: 2px solid var(--cw-cadence); }
.cw-rec-row.apex   { border-left: 2px solid var(--cw-apex); }
.cw-rec-icon { font-size: 16px; line-height: 1; margin-top: 1px; flex-shrink: 0; }
.cw-rec-text { font-size: 12px; line-height: 1.5; color: var(--muted); }
.cw-rec-text strong { color: #fff; font-weight: 600; }
.cw-ai-hint { font-size: 10px; color: rgba(255,255,255,.28); letter-spacing: .04em; padding: 0 18px; margin-bottom: 10px; }
.cw-confirm-cards { display: flex; flex-direction: column; gap: 7px; padding: 0 18px; margin-bottom: 14px; }
.cw-ccard { padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); display: flex; align-items: center; gap: 12px; cursor: pointer; transition: all .2s; -webkit-tap-highlight-color: transparent; }
.cw-ccard:hover { border-color: rgba(255,255,255,.13); }
.cw-ccard.sel { background: rgba(255,255,255,.06); }
.cw-ccard[data-c="miles"].sel   { border-color: rgba(232,160,32,.55); background: rgba(232,160,32,.08); }
.cw-ccard[data-c="cadence"].sel { border-color: rgba(91,156,246,.55); background: rgba(91,156,246,.08); }
.cw-ccard[data-c="apex"].sel    { border-color: rgba(224,85,85,.55); background: rgba(224,85,85,.08); }
.cw-ccard-icon { width: 38px; height: 38px; border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.cw-ccard[data-c="miles"]   .cw-ccard-icon { background: rgba(232,160,32,.1); }
.cw-ccard[data-c="cadence"] .cw-ccard-icon { background: rgba(91,156,246,.1); }
.cw-ccard[data-c="apex"]    .cw-ccard-icon { background: rgba(224,85,85,.1); }
.cw-ccard-body { flex: 1; }
.cw-ccard-name { font-family: 'Barlow Condensed', sans-serif; font-size: 14px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 2px; }
.cw-ccard[data-c="miles"]   .cw-ccard-name { color: var(--cw-miles); }
.cw-ccard[data-c="cadence"] .cw-ccard-name { color: var(--cw-cadence); }
.cw-ccard[data-c="apex"]    .cw-ccard-name { color: var(--cw-apex); }
.cw-ccard-desc { font-size: 11px; color: var(--muted); font-weight: 300; }
.cw-chk { width: 22px; height: 22px; border-radius: 50%; border: 2px solid rgba(255,255,255,.25); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s; }
.cw-ccard[data-c="miles"].sel .cw-chk   { background: var(--cw-miles); border-color: var(--cw-miles); }
.cw-ccard[data-c="cadence"].sel .cw-chk { background: var(--cw-cadence); border-color: var(--cw-cadence); }
.cw-ccard[data-c="apex"].sel .cw-chk    { background: var(--cw-apex); border-color: var(--cw-apex); }
.cw-chk-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--bg); opacity: 0; transition: opacity .2s; }
.cw-ccard.sel .cw-chk-dot { opacity: 1; }
.cw-panel-note { margin: 0 18px 14px; padding: 10px 13px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; font-size: 11px; color: var(--muted); line-height: 1.5; display: none; }
.cw-panel-note.vis { display: block; }
.cw-panel-note strong { color: var(--text); font-weight: 500; }

/* Suggested (optional) coach card state */
.cw-ccard.cw-suggested { opacity: .65; border-style: dashed; }
.cw-ccard.cw-suggested:hover { opacity: 1; }

/* Suggested recommendation row */
.cw-rec-row.cw-rec-suggested { opacity: .75; border-style: dashed; }
.cw-rec-optional-badge { display: inline-block; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; background: rgba(255,255,255,.1); border: 1px solid rgba(255,255,255,.2); border-radius: 4px; padding: 1px 5px; margin-right: 4px; color: var(--muted); vertical-align: middle; }
.cw-rec-tip { display: block; font-size: 10px; color: rgba(255,255,255,.35); margin-top: 3px; font-style: italic; }

/* Chat screen */
.cw-chat-inner { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.cw-chat-topbar { display: flex; align-items: center; gap: 10px; padding: 12px 16px 11px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.cw-chat-back { background: none; border: 1px solid var(--line); border-radius: 7px; width: 30px; height: 30px; cursor: pointer; color: var(--muted); font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cw-kebab-wrap { position: relative; margin-left: auto; flex-shrink: 0; }
.cw-kebab-btn { background: none; border: none; color: rgba(255,255,255,.35); font-size: 20px; cursor: pointer; padding: 2px 8px; line-height: 1; transition: color .2s; }
.cw-kebab-btn:hover { color: rgba(255,255,255,.7); }
.cw-kebab-menu { display: none; position: absolute; right: 0; top: calc(100% + 6px); background: #1e1e1e; border: 1px solid rgba(255,255,255,.1); border-radius: 10px; min-width: 150px; padding: 6px; z-index: 999; box-shadow: 0 8px 24px rgba(0,0,0,.5); }
.cw-kebab-menu.open { display: block; }
.cw-kebab-item { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: none; color: rgba(255,255,255,.75); font-size: 13px; padding: 9px 12px; border-radius: 7px; cursor: pointer; text-align: left; transition: background .15s; }
.cw-kebab-item:hover { background: rgba(255,255,255,.07); }
.cw-kebab-danger { color: rgba(255,100,100,.85); }
.cw-kebab-danger:hover { background: rgba(255,60,60,.1); }
.cw-chat-avatars { display: flex; }
.cw-avatar { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; border: 2px solid var(--bg); margin-right: -4px; }
.cw-c-av { width: 26px; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 13px; border: 2px solid var(--bg); margin-right: -4px; }
.cw-chat-info { margin-left: 8px; flex: 1; }
.cw-chat-info-title { font-size: 13px; font-weight: 500; color: var(--text); }
.cw-chat-info-sub { font-size: 10px; color: var(--muted); margin-top: 1px; }

/* Mode toggle */
.cw-mode-toggle { display: none; align-items: center; gap: 0; margin: 0 16px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; flex-shrink: 0; }
.cw-mode-toggle.vis { display: flex; }
.cw-mode-btn { flex: 1; padding: 8px 10px; font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.28); background: none; border: none; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 5px; }
.cw-mode-btn.active { background: var(--card); color: var(--text); }
.cw-mode-btn .cw-mode-icon { font-size: 12px; }
.cw-mode-divider { width: 1px; background: var(--line); align-self: stretch; flex-shrink: 0; }

/* Messages */
.cw-messages { flex: 1; overflow-y: auto; padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.cw-messages::-webkit-scrollbar { display: none; }
.cw-msg-row { display: flex; align-items: flex-start; gap: 8px; }
.cw-msg-row.user { justify-content: flex-end; }
.cw-msg-avatar { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 12px; border: 2px solid var(--bg); flex-shrink: 0; margin-top: 2px; }
.cw-msg-body { display: flex; flex-direction: column; max-width: 88%; }
.cw-msg-sender { font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 3px; }
.cw-msg-bubble { padding: 10px 13px; border-radius: 12px; font-size: 13px; line-height: 1.6; max-width: 88%; white-space: pre-wrap; word-break: break-word; }
.cw-msg-body .cw-msg-bubble { max-width: 100%; }
.cw-msg-bubble.coach { background: var(--panel); border: 1px solid var(--line); border-radius: 3px 12px 12px 12px; color: var(--text); }
.cw-msg-bubble.user { background: var(--text); color: var(--bg); border-radius: 12px 3px 12px 12px; align-self: flex-end; margin-left: auto; font-weight: 400; }

/* Thinking block */
.cw-thinking-block { margin-bottom: 4px; padding: 8px 11px; background: rgba(232,160,32,.05); border: 1px solid rgba(232,160,32,.15); border-radius: 8px; max-width: 88%; }
.cw-thinking-hdr { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.cw-thinking-lbl { font-size: 10px; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: rgba(232,160,32,.8); }
.cw-thinking-chev { font-size: 9px; color: rgba(232,160,32,.6); margin-left: auto; transition: transform .2s; }
.cw-thinking-chev.open { transform: rotate(180deg); }
.cw-thinking-body { font-size: 11px; color: rgba(232,160,32,.55); line-height: 1.6; margin-top: 6px; display: none; }
.cw-thinking-body.vis { display: block; }

/* Deliberation wrap */
.cw-delib-wrap { margin: 0 0 10px; display: flex; flex-direction: column; gap: 6px; }
.cw-delib-wrap.vis { display: flex; }
.cw-delib-header { display: flex; align-items: center; gap: 8px; padding: 10px 14px 8px; }
.cw-delib-title { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-miles); }
.cw-delib-subtitle { font-size: 10px; color: rgba(255,255,255,.28); margin-left: auto; }
.cw-delib-cards { display: flex; flex-direction: column; gap: 6px; padding: 0 0 6px; }
.cw-delib-card { margin: 0; padding: 10px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; position: relative; overflow: hidden; }
.cw-delib-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 2px; }
.cw-delib-card[data-c="miles"]::before   { background: var(--cw-miles); }
.cw-delib-card[data-c="cadence"]::before { background: var(--cw-cadence); }
.cw-delib-card[data-c="apex"]::before    { background: var(--cw-apex); }
.cw-delib-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cw-delib-coach-name { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.cw-delib-card[data-c="miles"]   .cw-delib-coach-name { color: var(--cw-miles); }
.cw-delib-card[data-c="cadence"] .cw-delib-coach-name { color: var(--cw-cadence); }
.cw-delib-card[data-c="apex"]    .cw-delib-coach-name { color: var(--cw-apex); }
.cw-delib-status { font-size: 9px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; margin-left: auto; display: flex; align-items: center; gap: 4px; }
.cw-delib-status.waiting { color: rgba(255,255,255,.28); }
.cw-delib-status.thinking { color: var(--cw-miles); }
.cw-delib-status.done { color: #4ade80; }
.cw-delib-dot { width: 6px; height: 6px; border-radius: 50%; }
.cw-delib-status.waiting .cw-delib-dot { background: rgba(255,255,255,.28); }
.cw-delib-status.thinking .cw-delib-dot { background: var(--cw-miles); animation: cwPulse .8s ease-in-out infinite; }
.cw-delib-status.done .cw-delib-dot { background: #4ade80; }
@keyframes cwPulse { 0%,100%{opacity:1} 50%{opacity:.3} }
.cw-delib-preview { font-size: 11px; color: var(--muted); line-height: 1.5; font-weight: 300; max-height: 0; overflow: hidden; transition: max-height .3s ease; }
.cw-delib-preview.vis { max-height: 200px; }
.cw-delib-spin { width: 10px; height: 10px; border: 1.5px solid rgba(232,160,32,.2); border-top-color: var(--cw-miles); border-radius: 50%; animation: cwSpin .7s linear infinite; display: inline-block; }

/* Moderator card */
.cw-moderator-card { margin: 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--line); border-top: 2px solid var(--cw-miles); border-radius: 10px; display: none; }
.cw-moderator-card.vis { display: block; }
.cw-mod-header { display: flex; align-items: center; gap: 7px; margin-bottom: 6px; }
.cw-mod-label { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-miles); }
.cw-mod-status { font-size: 10px; color: rgba(255,255,255,.28); margin-left: auto; }
.cw-mod-text { font-size: 11px; color: var(--muted); line-height: 1.5; font-weight: 300; }

/* Thinking spinner */
.cw-thinking-spinner { display: flex; align-items: center; gap: 7px; padding: 8px 12px; background: rgba(232,160,32,.05); border: 1px solid rgba(232,160,32,.15); border-radius: 8px; width: fit-content; }
.cw-spin { width: 11px; height: 11px; border: 1.5px solid rgba(232,160,32,.2); border-top-color: var(--cw-miles); border-radius: 50%; animation: cwSpin .7s linear infinite; }
@keyframes cwSpin { to { transform: rotate(360deg); } }
.cw-thinking-spinner span { font-size: 10px; color: rgba(232,160,32,.7); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; transition: opacity 0.3s ease; }

/* Briefing indicator (Coach Prime consulting specialists) */
.cw-briefing-row { display: flex; align-items: center; gap: 10px; padding: 10px 16px; }
.cw-briefing-indicator { display: flex; align-items: center; gap: 8px; padding: 9px 14px; background: rgba(201,168,76,.07); border: 1px solid rgba(201,168,76,.2); border-radius: 10px; font-size: 11px; color: rgba(201,168,76,.85); font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.cw-briefing-indicator .cw-spin { border-color: rgba(201,168,76,.2); border-top-color: var(--cw-prime); }
.cw-briefing-indicator .cw-spec-emoji { font-size: 14px; }

/* Error toast */
.cw-error-toast { margin: 0 16px 8px; padding: 9px 12px; background: rgba(224,85,85,.08); border: 1px solid rgba(224,85,85,.25); border-radius: 7px; font-size: 12px; color: rgba(224,85,85,.9); display: none; }
.cw-error-toast.vis { display: block; }

/* Chat input */
.cw-chat-input-area { padding: 8px 14px calc(14px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); background: var(--bg); flex-shrink: 0; }
.cw-suggestions { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 8px; }
.cw-sug-pill { font-size: 11px; padding: 4px 10px; border: 1px solid var(--line); border-radius: 20px; background: var(--panel); color: var(--muted); cursor: pointer; transition: all .15s; white-space: nowrap; font-family: 'Barlow', sans-serif; }
.cw-sug-pill:hover { border-color: var(--cw-miles); color: var(--cw-miles); }
.cw-sug-pill.plan-pill { border-color: rgba(232,160,32,.3); color: rgba(232,160,32,.8); background: rgba(232,160,32,.06); }
.cw-sug-pill.plan-pill:hover { border-color: var(--cw-miles); color: var(--cw-miles); background: rgba(232,160,32,.1); }
.cw-input-row { display: flex; gap: 8px; align-items: flex-end; }
.cw-chat-ta { flex: 1; min-height: 38px; max-height: 110px; padding: 9px 13px; font-family: 'Barlow', sans-serif; font-size: 13px; line-height: 1.5; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; background: var(--panel); color: var(--text); resize: none; outline: none; overflow-y: auto; transition: border-color .2s; }
.cw-chat-ta:focus { border-color: var(--cw-miles); }
.cw-chat-ta::placeholder { color: rgba(255,255,255,.25); }
.cw-send-btn { width: 36px; height: 36px; border-radius: 50%; background: var(--cw-miles); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: opacity .15s; }
.cw-send-btn:hover { opacity: .85; }
.cw-send-btn:disabled { opacity: .3; cursor: default; }
.cw-send-arrow { width: 0; height: 0; border-left: 5px solid transparent; border-right: 5px solid transparent; border-bottom: 8px solid var(--bg); transform: translateY(-1px); }

/* Plan screen */
.cw-plan-header { padding: 20px 18px 14px; }
.cw-plan-title { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 900; letter-spacing: .03em; text-transform: uppercase; margin-bottom: 3px; }
.cw-plan-sub { font-size: 12px; color: var(--muted); font-weight: 300; }
.cw-plan-tabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 18px 16px; }
.cw-plan-tab { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: rgba(255,255,255,.28); padding: 7px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; transition: all .15s; }
.cw-plan-tab.on { color: var(--cw-miles); border-bottom-color: var(--cw-miles); }
.cw-week-schedule { padding: 0 18px; display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.cw-day-row { display: flex; align-items: center; gap: 10px; }
.cw-day-lbl { font-family: 'Barlow Condensed', sans-serif; font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: rgba(255,255,255,.28); width: 28px; flex-shrink: 0; }
.cw-day-bar { flex: 1; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); display: flex; align-items: center; padding: 0 12px; gap: 8px; }
.cw-day-icon { font-size: 14px; }
.cw-day-text { font-size: 12px; color: var(--text); flex: 1; }
.cw-day-badge { font-family: 'Barlow Condensed', sans-serif; font-size: 9px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; padding: 3px 7px; border-radius: 3px; }
.cw-badge-run      { background: rgba(232,160,32,.12); color: rgba(232,160,32,.8); }
.cw-badge-strength { background: rgba(224,85,85,.12);  color: rgba(224,85,85,.8); }
.cw-badge-cycle    { background: rgba(91,156,246,.12); color: rgba(91,156,246,.8); }
.cw-badge-rest     { background: var(--card); color: rgba(255,255,255,.28); border: 1px solid var(--line); }
.cw-panel-callout { margin: 0 18px 16px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-left: 2px solid var(--cw-miles); border-radius: 0 8px 8px 0; display: none; }
.cw-panel-callout.vis { display: block; }
.cw-panel-callout-title { font-family: 'Barlow Condensed', sans-serif; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--cw-miles); margin-bottom: 4px; }
.cw-panel-callout-text { font-size: 11px; color: var(--muted); line-height: 1.55; font-weight: 300; }
.cw-chat-cta { margin: 0 18px 8px; padding: 13px; background: var(--panel); border: 1px solid rgba(255,255,255,.13); border-radius: 10px; display: flex; align-items: center; gap: 10px; cursor: pointer; transition: border-color .15s; }
.cw-chat-cta:hover { border-color: var(--cw-miles); }

/* ── Coach Hub ── */
.cw-hub-header { text-align: center; padding: 28px 18px 18px; }
.cw-hub-title { font-family: 'Barlow Condensed', sans-serif; font-size: 28px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; color: var(--text); }
.cw-hub-sub { font-size: 13px; color: var(--muted); font-weight: 300; margin-top: 4px; }

.cw-hub-coaches { display: flex; gap: 8px; padding: 0 18px; margin-bottom: 24px; }
.cw-hub-coach { flex: 1; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px 8px 10px; text-align: center; position: relative; overflow: hidden; pointer-events: none; }
.cw-hub-coach::before { content: ''; position: absolute; top: 0; left: 0; right: 0; height: 2px; }
.cw-hub-coach[data-coach="miles"]::before   { background: var(--cw-miles); }
.cw-hub-coach[data-coach="cadence"]::before { background: var(--cw-cadence); }
.cw-hub-coach[data-coach="apex"]::before    { background: var(--cw-apex); }
.cw-hub-coach-icon { font-size: 26px; margin-bottom: 6px; }
.cw-hub-coach-name { font-family: 'Barlow Condensed', sans-serif; font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; }
.cw-hub-coach[data-coach="miles"]   .cw-hub-coach-name { color: var(--cw-miles); }
.cw-hub-coach[data-coach="cadence"] .cw-hub-coach-name { color: var(--cw-cadence); }
.cw-hub-coach[data-coach="apex"]    .cw-hub-coach-name { color: var(--cw-apex); }
.cw-hub-coach-role { font-size: 10px; color: rgba(255,255,255,.28); text-transform: uppercase; letter-spacing: .05em; margin-top: 2px; }

.cw-hub-actions { display: flex; flex-direction: column; gap: 8px; padding: 0 18px; }
.cw-hub-card { padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; display: flex; align-items: center; gap: 12px; cursor: pointer; transition: border-color .15s; -webkit-tap-highlight-color: transparent; }
.cw-hub-card:hover { border-color: var(--cw-miles); }
.cw-hub-card-icon { font-size: 22px; width: 44px; height: 44px; border-radius: 10px; background: rgba(255,255,255,.05); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.cw-hub-card-body { flex: 1; min-width: 0; }
.cw-hub-card-title { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.cw-hub-card-desc { font-size: 12px; color: var(--muted); font-weight: 300; }
.cw-hub-card-arrow { font-size: 18px; color: var(--cw-miles); flex-shrink: 0; }
.cw-hub-card--disabled { opacity: .4; cursor: default; pointer-events: none; }

/* Shared wizard buttons */
.cw-btn-primary { width: 100%; padding: 16px; background: var(--text); color: var(--bg); border: none; border-radius: 10px; font-family: 'Barlow Condensed', sans-serif; font-size: 16px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; cursor: pointer; transition: opacity .15s; }
.cw-btn-primary:hover { opacity: .88; }
.cw-btn-primary:disabled { opacity: .3; cursor: default; }
.cw-btn-ghost { background: none; border: none; font-family: 'Barlow', sans-serif; font-size: 14px; color: var(--muted); cursor: pointer; padding: 10px 0; width: 100%; text-align: center; transition: color .15s; }
.cw-btn-ghost:hover { color: var(--text); }
.cw-btn-wrap { padding: 0 18px 6px; margin-top: auto; }

/* Coach label in chat header */
.coach-label-badge {
    display: inline-block;
    font-size: 10px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.06);
    padding: 3px 8px;
    border-radius: 4px;
    margin-left: 6px;
}

@media (max-width: 420px) {
    .cw-welcome-grid { gap: 6px; }
    .cw-welcome-card { padding: 14px 6px 12px; }
    .cw-welcome-icon-wrap { width: 36px; height: 36px; font-size: 18px; }
    .cw-welcome-name { font-size: 12px; }
    .cw-hero-title { font-size: 24px; }
    .cw-coach-card { padding: 12px; gap: 10px; }
    .cw-coach-card-emoji { width: 38px; height: 38px; font-size: 22px; }
    .cw-bio-panel { border-radius: 12px; }
}

/* ===============================
   Design Tokens
================================ */
:root {
    --bg: #000000;
    --panel: #111111;
    --card: #1a1a1a;
    --card2: #141414;

    --text: #ffffff;
    --muted: #999999;

    --line: rgba(255, 255, 255, 0.12);

    --accent: #ffffff;
    --accent2: #cccccc;

    --good: #34d399;
    --bad: #fb7185;

    --radius: 16px;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.55);

    --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
    --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

    /* notch spacing knobs */
    --topnav-offset: 18px;
    --loginbar-offset: 22px;
}

/* Light / Outdoor Mode */
:root[data-theme="light"] {
    --bg: #f5f5f5;
    --panel: #ffffff;
    --card: #ffffff;
    --card2: #f0f0f0;
    --text: #111111;
    --muted: #555555;
    --line: rgba(0, 0, 0, 0.12);
    --accent: #111111;
    --accent2: #333333;
    --good: #16a34a;
    --bad: #dc2626;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.1);
}
:root[data-theme="light"] body {
    background: var(--bg);
    color: var(--text);
}
:root[data-theme="light"] .card {
    background: var(--card);
    border-color: var(--line);
}
:root[data-theme="light"] .bottom-nav {
    background: var(--panel);
    border-top: 1px solid var(--line);
}
:root[data-theme="light"] .top-nav {
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}
:root[data-theme="light"] .input,
:root[data-theme="light"] .textarea {
    background: var(--card2);
    color: var(--text);
    border-color: var(--line);
}
:root[data-theme="light"] .btn {
    color: var(--text);
}
:root[data-theme="light"] #settingsModal,
:root[data-theme="light"] #statsModal {
    background: var(--bg);
}
/* Toggle switch styles for checked state */
#themeToggle:checked + span { background: #111 !important; }
#themeToggle:checked + span + span { transform: translateX(22px); }

/* Force dark select control */
select {
    background: var(--panel) !important;
    color: var(--text) !important;
    border: 1px solid var(--line);
    color-scheme: dark;
}

select option,
select optgroup {
    background: var(--panel) !important;
    color: var(--text) !important;
}

select option:checked,
select option:hover {
    background: var(--card) !important;
    color: var(--text) !important;
}

/* ===============================
   Reset & Base
================================ */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    background: #000000;
    color: var(--text);
    font-family: var(--sans);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    letter-spacing: 0.15px;
    line-height: 1.55;
}

/* ===============================
   Layout
================================ */
.shell {
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 16px 110px;
    /* extra bottom padding for bottom nav */
}

.tab-view {
    min-height: 100dvh;
    background: var(--bg);
}

/* ===============================
   Routes Tab
================================ */
.routes-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 18px 14px;
}
.routes-header-title {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    line-height: 1;
}
.routes-header-sub {
    font-size: 12px;
    color: var(--muted);
    margin-top: 3px;
    font-weight: 300;
}
.routes-new-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.06em;
    padding: 9px 16px;
    border-radius: 10px;
    flex-shrink: 0;
}
.routes-loading {
    text-align: center;
    color: rgba(255,255,255,0.3);
    padding: 60px 20px;
    font-size: 13px;
}

/* Route cards */
#routesTabList {
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-bottom: 100px;
}
.route-card {
    display: flex;
    align-items: center;
    gap: 13px;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 13px 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.route-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.12); }
.route-card:active { transform: scale(0.985); }
.route-card-icon {
    width: 42px;
    height: 42px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.route-card-body {
    flex: 1;
    min-width: 0;
}
.route-card-name {
    font-weight: 700;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}
.route-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    flex-wrap: wrap;
}
.route-card-sport {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.route-card-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}
.route-use-btn {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 7px 14px;
    border-radius: 8px;
    border: none;
    background: var(--accent);
    color: #000;
    cursor: pointer;
    transition: opacity 0.15s;
}
.route-use-btn:hover { opacity: 0.85; }
.route-del-btn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    border: 1px solid rgba(239,68,68,0.25);
    background: rgba(239,68,68,0.08);
    color: #ef4444;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.15s;
}
.route-del-btn:hover { background: rgba(239,68,68,0.18); }

/* Empty state */
.route-empty-state {
    text-align: center;
    padding: 60px 32px 40px;
}
.route-empty-icon { font-size: 42px; margin-bottom: 14px; opacity: 0.25; }
.route-empty-title { font-family: 'Barlow Condensed', sans-serif; font-size: 20px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px; color: rgba(255,255,255,0.5); }
.route-empty-sub { font-size: 13px; color: rgba(255,255,255,0.25); line-height: 1.6; }

.routes-footer-hint {
    text-align: center;
    font-size: 11px;
    color: rgba(255,255,255,0.15);
    padding: 16px 0 0;
    font-style: italic;
}

/* ===============================
   Navigation
================================ */
.topnav {
    position: sticky;
    top: 0;
    z-index: 9500;

    padding-top: calc(env(safe-area-inset-top, 0px) + var(--topnav-offset));

    background: rgba(10, 10, 10, 0.97);
    backdrop-filter: blur(12px);
    pointer-events: auto;
}

.nav-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 10px 16px 12px;

    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    position: relative;
    z-index: 1;
}

.nav-left {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex-shrink: 0;
}

.nav-right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    min-width: 0;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    user-select: none;
    max-width: 100%;
    white-space: nowrap;
    cursor: pointer;
    background: none;
    border: none;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

.brand:active .brand-name {
    opacity: 0.7;
}

.brand-name {
    font-family: 'Saira Stencil One', sans-serif;
    font-weight: 400;
    font-size: 17px;
    letter-spacing: 2.5px;
    text-transform: uppercase;
    color: var(--accent) !important;
    background: none !important;
    -webkit-text-fill-color: var(--accent) !important;
    text-shadow: none;
    transition: opacity 0.15s;
}

@media (max-width: 480px) {
    .brand-name {
        font-size: 13px;
        letter-spacing: 1.5px;
    }
    .profile-name { display: none; }
}

.tier-badge {
    padding: 3px 8px;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.6px;
    background: linear-gradient(135deg, rgba(255, 215, 0, 0.2), rgba(255, 255, 255, 0.15));
    border: 1px solid rgba(255, 215, 0, 0.35);
    color: rgba(255, 235, 180, 0.95);
}

/* Profile menu */
.profile-menu {
    position: relative;
    display: inline-flex;
    align-items: center;
    z-index: 9600;
}

.profile-trigger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px 4px 4px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    color: inherit;
}

.profile-trigger:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.22);
}

.profile-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    font-weight: 800;
    font-size: 13px;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.profile-name {
    font-weight: 700;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.92);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-caret {
    font-size: 10px;
    color: rgba(255, 255, 255, 0.5);
    transition: transform 0.2s;
}

.profile-trigger[aria-expanded="true"] .profile-caret {
    transform: rotate(180deg);
}

.profile-dropdown {
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    min-width: 220px;
    padding: 6px;
    border-radius: 14px;
    background: #111;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(14px);
    display: none;
    z-index: 9601;
}

.profile-dropdown.open {
    display: block;
    animation: profileDropIn 0.18s ease-out;
}

@keyframes profileDropIn {
    from { opacity: 0; transform: translateY(-8px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.profile-dropdown-header {
    padding: 10px 12px 8px;
}

.profile-dropdown-name {
    display: block;
    font-weight: 800;
    font-size: 14px;
    color: #fff;
}

.profile-dropdown-email {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.45);
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-dropdown-divider {
    height: 1px;
    margin: 4px 8px;
    background: rgba(255, 255, 255, 0.10);
}

.profile-dropdown-item {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: 10px;
    border: 1px solid transparent;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: background 0.12s;
}

.profile-dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.08);
}

.profile-dropdown-logout {
    color: #f87171;
}

.profile-dropdown-logout:hover {
    background: rgba(248, 113, 113, 0.10);
}

/* ===============================
   Typography
================================ */
.h2 {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -0.2px;
}

.muted {
    color: var(--muted);
}

.tiny {
    font-size: 12px;
}

.mono {
    font-family: var(--mono);
}

/* ===============================
   Cards / Common
================================ */
.card {
    background:
        radial-gradient(700px 320px at 15% 0%, rgba(255, 255, 255, 0.04), transparent 55%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(0, 0, 0, 0.18)),
        rgba(20, 20, 20, 0.90);
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px;
    box-shadow: var(--shadow);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.badge {
    font-size: 13px;
    padding: 5px 14px;
    border-radius: 999px;
    border: 1.5px solid #ffffff;
    background: #ffffff;
    color: #000;
    font-weight: bold;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 12px rgba(255,255,255,0.10);
    backdrop-filter: blur(8px);
}

.msg {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.70);
    min-height: 18px;
}

.msg.good {
    color: var(--good);
}

.msg.bad {
    color: var(--bad);
}

/* ===============================
   social-style Dashboard
================================ */
.page-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 2px 14px;
}

.page-head-title {
    font-size: 34px;
    font-weight: 900;
    letter-spacing: -1px;
    text-shadow: 0 14px 40px rgba(0, 0, 0, 0.55);
}

.page-head-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.ghost-icon {
    height: 40px;
    width: 40px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
}

.ghost-icon:active {
    transform: translateY(1px);
}

.card-hero {
    padding: 16px;
    margin-bottom: 14px;
}

.activity-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.activity-avatar {
    width: 44px;
    height: 44px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
    font-size: 18px;
}

.activity-who {
    flex: 1;
    min-width: 0;
}

.activity-name {
    font-weight: 850;
    letter-spacing: -0.2px;
}

.activity-meta {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
}

.dots {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.75);
    font-size: 18px;
    cursor: pointer;
}

.activity-title {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.8px;
    margin: 6px 0 10px;
}

.stats-row {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 12px;
    margin: 10px 0 6px;
}

.stat {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.22);
    padding: 12px 12px 10px;
}

.stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
    margin-bottom: 4px;
}

.stat-value {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: -0.4px;
}

.activity-cta {
    margin-top: 8px;
}

.dash-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}

/* ===============================
   Forms
================================ */
.label {
    display: block;
    margin: 10px 0 6px;
    font-size: 12px;
    color: var(--muted);
}

.input,
.textarea,
.select {
    width: 100%;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.14);
    color: rgba(255, 255, 255, 0.92);
    padding: 11px 12px;
    border-radius: 14px;
    outline: none;
    font-size: 14px;
    transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.input:focus,
.textarea:focus,
.select:focus {
    border-color: rgba(255, 255, 255, 0.50);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.09);
}

.textarea {
    resize: vertical;
    min-height: 90px;
}

.select {
    width: 100%;
}

/* ===============================
   Buttons
================================ */
.btn {
    margin-top: 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--line);
    color: var(--text);
    padding: 10px 16px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: transform 120ms ease, filter 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.btn-xs {
    margin-top: 0;
    padding: 4px 8px;
    font-size: 11px;
    border-radius: 6px;
}

.edit-btn-hidden {
    display: none !important;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.95) 0%,
            rgba(200, 200, 200, 0.92) 55%,
            rgba(100, 100, 100, 0.55) 100%);
    color: #000000;
    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.30);
}

.btn-primary::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 120px at 20% 0%, rgba(255, 255, 255, .18), transparent 55%);
    opacity: .9;
    pointer-events: none;
}

.btn-danger {
    position: relative;
    overflow: hidden;
    background: linear-gradient(90deg,
            rgba(220, 38, 38, 0.95) 0%,
            rgba(153, 27, 27, 0.92) 55%,
            rgba(0, 0, 0, 0.55) 100%);
    border: 1px solid rgba(220, 38, 38, 0.35);
    box-shadow: 0 16px 40px rgba(220, 38, 38, 0.20);
}

.btn-danger::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(600px 120px at 20% 0%, rgba(255, 255, 255, .18), transparent 55%);
    opacity: .9;
    pointer-events: none;
}

.btn.wide {
    width: 100%;
    height: 44px;
    margin-top: 14px;
}

/* Coach day selection buttons */
.coach-day-btn {
    padding: 12px 16px;
    background: var(--card2);
    border: 2px solid var(--line);
    color: var(--text);
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 200ms ease;
    position: relative;
    z-index: 1;
}

.coach-day-btn:hover {
    border-color: rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.08);
    z-index: 2;
}

.coach-day-btn.selected {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.20), rgba(200, 200, 200, 0.12));
    border-color: var(--accent);
    color: var(--text);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.15);
    z-index: 3;
}

.coach-day-btn:active {
    transform: scale(0.96);
}

/* Coach quick modification buttons */
.coach-quick-mod-btn,
.coach-quick-draft-btn {
    transition: all 0.2s ease;
}

.coach-quick-mod-btn:hover,
.coach-quick-draft-btn:hover {
    border-color: var(--accent) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    transform: translateY(-1px);
}

.coach-quick-mod-btn:active,
.coach-quick-draft-btn:active {
    transform: scale(0.96);
}

/* Quick-reply suggestion row (chips + day picker) */
.coach-suggestion-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 12px 12px 12px;
    max-width: 86%;
}

.coach-suggestion-done {
    background: var(--accent, #6c5ce7);
    color: #fff;
    border-color: transparent;
}

/* Close button in modals */
#coachIntroClose {
    transition: opacity 0.2s ease;
}

#coachIntroClose:hover {
    opacity: 1 !important;
}

/* ===============================
   Feed (social-style cards)
================================ */
.feed {
    display: grid;
    gap: 12px;
}

.feed-item {
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(0, 0, 0, 0.20);
    padding: 14px;
}

.feed-head {
    display: flex;
    align-items: center;
    gap: 12px;
}

.feed-avatar {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.06);
    display: grid;
    place-items: center;
}

.feed-who {
    flex: 1;
    min-width: 0;
}

.feed-name {
    font-weight: 850;
    letter-spacing: -0.2px;
}

.feed-sub {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
}

.feed-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.8px;
    margin: 10px 0 10px;
}

.feed-stats {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
}

.feed-stat {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    padding: 10px 10px 8px;
}

.feed-stat-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.70);
    margin-bottom: 4px;
}

.feed-stat-val {
    font-size: 18px;
    font-weight: 900;
    letter-spacing: -0.3px;
}

.feed-body {
    color: rgba(255, 255, 255, 0.86);
    font-size: 14px;
    margin-top: 6px;
}

.feed-actions {
    display: flex;
    justify-content: space-around;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.action-btn {
    border: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.88);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 8px 10px;
    border-radius: 14px;
}

.action-btn:active {
    transform: translateY(1px);
}

.action-ico {
    font-size: 18px;
}

.action-txt {
    font-weight: 700;
    font-size: 13px;
    opacity: 0.9;
}

/* ===============================
   Bottom Nav (visual)
================================ */
.bottomnav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9500;

    padding: 8px 6px 56px;

    background: linear-gradient(0deg,
            rgba(0, 0, 0, 0.88) 0%,
            rgba(0, 0, 0, 0.55) 65%,
            rgba(0, 0, 0, 0.00) 100%);
    backdrop-filter: blur(14px);

    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 4px;
}

.bottomnav-item {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.04);
    color: rgba(255, 255, 255, 0.90);
    border-radius: 14px;
    padding: 11px 2px 10px;
    display: grid;
    place-items: center;
    gap: 0;
    cursor: pointer;
}

.bottomnav-item.is-active {
    border-color: rgba(255, 255, 255, 0.25);
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.25);
}

.bn-ico {
    font-size: 18px;
}

.bn-txt {
    font-size: 12px;
    font-weight: 750;
    opacity: 0.9;
}

/* Match class names used in index.html */
.bottomnav-ico {
    display: none;
}

.bottomnav-txt {
    font-family: 'Saira Stencil One', sans-serif;
    font-size: 10px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    opacity: 0.95;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.live-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: #ef4444;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
    animation: livePulse 1.6s infinite;
}

@keyframes livePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.75);
    }
    70% {
        box-shadow: 0 0 0 9px rgba(239, 68, 68, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
    }
}

/* Club live map — per-member ripple animation */
@keyframes club-ripple {
    0%   { transform: scale(0.5); opacity: 0.35; }
    70%  { transform: scale(1.8); opacity: 0;    }
    100% { transform: scale(0.5); opacity: 0;    }
}

/* Stagger ripples so markers don't all pulse at the same instant */
.club-live-marker-1 .club-ripple { animation-delay: 0s;    }
.club-live-marker-2 .club-ripple { animation-delay: 0.4s;  }
.club-live-marker-3 .club-ripple { animation-delay: 0.8s;  }
.club-live-marker-4 .club-ripple { animation-delay: 1.2s;  }

/* MapLibre popup dark override for club live map */
.maplibregl-popup-content {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 12px !important;
}
.maplibregl-popup-tip { display: none !important; }

/* Go Live toggle slider thumb */
#goLiveSlider::before {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    left: 3px;
    bottom: 3px;
    background: #fff;
    border-radius: 50%;
    transition: transform 0.2s;
}
#goLiveToggle:checked + #goLiveSlider::before {
    transform: translateX(18px);
}

/* ===============================
   Login (keep your existing styling)
================================ */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 28px 18px 60px;
}

.login-shell {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.35fr 0.9fr;
    gap: 22px;
    align-items: stretch;
}

.login-hero {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background:
        radial-gradient(900px 500px at 15% 20%, rgba(255, 255, 255, 0.12), transparent 60%),
        radial-gradient(800px 500px at 85% 10%, rgba(200, 200, 200, 0.10), transparent 60%),
        rgba(0, 0, 0, 0.18);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.55);
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(200, 200, 200, 0.08), rgba(0, 0, 0, 0.66));
    pointer-events: none;
}

.hero-content {
    position: relative;
    padding: 34px 32px;
    max-width: 680px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    margin-bottom: 18px;
    opacity: 0.95;
}

.login-hero h1 {
    margin: 0 0 16px;
    font-size: clamp(36px, 5vw, 48px);
    font-weight: 950;
    letter-spacing: -1.2px;
    line-height: 1.05;

    background: linear-gradient(90deg,
            rgba(255, 255, 255, 0.98) 0%,
            rgba(230, 230, 230, 0.92) 35%,
            rgba(200, 200, 200, 0.92) 70%,
            rgba(150, 150, 150, 0.90) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;

    text-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

.hero-bullets {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: grid;
    gap: 10px;
}

.hero-bullets li {
    position: relative;
    padding-left: 22px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.86);
    font-size: 15px;
}

.hero-bullets li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 9px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

.login-card {
    display: flex;
    align-items: center;
}

.login-card-inner {
    width: 100%;
    border-radius: 22px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
        rgba(10, 12, 16, 0.55);
    box-shadow: 0 18px 55px rgba(0, 0, 0, 0.55);
    padding: 22px;
    position: relative;
    overflow: hidden;
}

.login-title {
    font-size: 16px;
    font-weight: 900;
    letter-spacing: -0.2px;
}

.field {
    margin-top: 12px;
}

.field label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.72);
    margin-bottom: 6px;
    font-weight: 700;
}

.hint {
    margin-top: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.72);
    min-height: 18px;
}

.hint.good {
    color: var(--good);
}

.hint.bad {
    color: var(--bad);
}

.login-topbar {
    position: sticky;
    top: 0;
    z-index: 90;
    display: flex;
    justify-content: center;

    padding: calc(env(safe-area-inset-top, 0px) + var(--loginbar-offset)) 18px 12px;

    background: linear-gradient(180deg,
            rgba(0, 0, 0, 0.82) 0%,
            rgba(0, 0, 0, 0.46) 60%,
            rgba(0, 0, 0, 0.00) 100%);
    backdrop-filter: blur(12px);
}

.login-topbrand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 26px;
    border-radius: 999px;
    border: none;
    background: rgba(0, 0, 0, 0.30);
    box-shadow:
        0 22px 70px rgba(0, 0, 0, 0.55),
        0 10px 40px rgba(0, 0, 0, 0.35);
}

.login-topname {
    font-family: 'Saira Stencil One', sans-serif;
    font-weight: 400;
    letter-spacing: 3px;
    font-size: 32px;
    line-height: 0.95;
    text-transform: uppercase;
    color: var(--accent);
    background: none;
    -webkit-text-fill-color: var(--accent);
    text-shadow: none;
}

/* ===============================
   Responsive
================================ */
@media (max-width: 980px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .hero-content {
        padding: 26px 22px;
    }

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

    .stats-row,
    .feed-stats {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   Custom dropdown (Workout Type)
================================ */
.select#workoutTypeWrap {
    position: relative;
}

.select-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.04);
    color: var(--text);
    cursor: pointer;
}

.select-caret {
    opacity: .85;
}

.select-menu {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    border-radius: 14px;
    border: 1px solid var(--line);
    background: rgba(10, 14, 20, 0.98);
    box-shadow: 0 18px 50px rgba(0, 0, 0, .55);
    padding: 6px;
    display: none;
    z-index: 50;
}

.select#workoutTypeWrap.open .select-menu {
    display: block;
}

.select-item {
    width: 100%;
    text-align: left;
    border: 0;
    background: transparent;
    color: var(--text);
    padding: 10px 10px;
    border-radius: 10px;
    cursor: pointer;
}

.select-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.select-item.is-active {
    outline: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
}

/* FINAL OVERRIDE: brand name must be solid white everywhere */
header.topnav .nav-center .brand .brand-name,
#topNav .nav-center .brand .brand-name,
.login-topbar .login-topbrand .login-topname {
    font-family: 'Saira Stencil One', sans-serif !important;
    color: var(--accent) !important;
    background: none !important;
    -webkit-text-fill-color: var(--accent) !important;
    -webkit-background-clip: initial !important;
    background-clip: initial !important;
}

.record-map {
    height: 340px;
    width: 100%;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, .08);
}

/* ===============================
   Auth (Login / Signup) panels
================================ */

.auth-panel {
    display: block;
}

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

.auth-back {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .10);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
    cursor: pointer;
}

.auth-social {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
    margin-bottom: 10px;
}

.btn-social {
    background: rgba(255, 255, 255, .05);
    border: 1px solid rgba(255, 255, 255, .12);
    color: var(--text);
}

.social-dot {
    display: inline-flex;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, .08);
    margin-right: 10px;
    font-weight: 800;
}

.auth-divider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 14px 0;
    color: rgba(255, 255, 255, .55);
    font-size: 12px;
    letter-spacing: .2px;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: rgba(255, 255, 255, .12);
}

.auth-divider span {
    padding: 0 12px;
}

.auth-foot {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.link {
    background: none;
    border: none;
    color: rgba(255, 255, 255, .75);
    cursor: pointer;
    text-align: left;
    padding: 0;
    font-weight: 600;
}

.link span {
    color: var(--accent);
}

.terms .u {
    text-decoration: underline;
}

/* ===============================
   AUTH PANELS (social-style)
================================ */

.auth-panel {
    width: 100%;
}

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

.auth-back {
    appearance: none;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(0, 0, 0, .25);
    color: var(--text);
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: grid;
    place-items: center;
}

.auth-social {
    display: grid;
    gap: 12px;
    margin-top: 6px;
}

.btn.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 52px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .12);
    background: rgba(255, 255, 255, .04);
    color: var(--text);
}

.btn.btn-social:hover {
    filter: brightness(1.08);
}

.btn.btn-social.btn-google {
    justify-content: flex-start;
    padding: 0 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.04));
    border-color: rgba(255, 255, 255, 0.18);
    text-decoration: none;
}

.google-icon {
    width: 30px;
    height: 30px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-weight: 900;
    color: #111;
    background: #fff;
    box-shadow: inset 0 -2px 8px rgba(0, 0, 0, 0.18);
}

.btn.btn-social.btn-google span:last-child {
    flex: 1;
    text-align: center;
    transform: translateX(-15px);
}

.social-dot {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .10);
    font-weight: 800;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 14px 0;
    color: rgba(255, 255, 255, .55);
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    height: 1px;
    flex: 1;
    background: rgba(255, 255, 255, .12);
}

.auth-divider span {
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: lowercase;
}

.auth-foot {
    margin-top: 14px;
    display: grid;
    gap: 12px;
}

.auth-foot .link {
    appearance: none;
    background: transparent;
    border: 0;
    color: rgba(255, 255, 255, .85);
    text-align: center;
    cursor: pointer;
}

.auth-foot .link span {
    text-decoration: underline;
}

.terms {
    text-align: center;
    line-height: 1.35;
}

.terms a {
    color: rgba(255, 255, 255, 0.92);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.terms a:hover {
    color: #ffffff;
}

.terms .u {
    text-decoration: underline;
}

/* Mobile: hide the hero like the mobile screens */
@media (max-width: 820px) {
    .login-shell {
        grid-template-columns: 1fr;
    }

    .login-hero {
        display: none !important;
    }

    .login-card {
        min-height: calc(100vh - 70px);
    }

    .login-card-inner {
        width: 100%;
    }
}

/* Coach confirm modal: subtle fade + scale */
#coachConfirmModal {
  opacity: 0;
  transform: scale(0.98);
  transition: opacity 180ms ease, transform 180ms ease;
  will-change: opacity, transform;
}
#coachConfirmModal.show {
  opacity: 1;
  transform: scale(1);
}


/* --- FIX: Move Workout modal was display:block but 0x0 rect --- */
#moveWorkoutModal{
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100vw;
  height: 100vh;
  display: none;          /* JS flips to block */
  z-index: 99999;         /* above planDetailModal */
  background: rgba(0,0,0,0.55);
  overflow: auto;
}

#moveWorkoutModal[style*="display: block"]{
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

#moveWorkoutModal .card{
  max-width: 720px;
  width: 100%;
}

/* Coach modal: single-button mode */
#coachConfirmNo{display:none!important;}


/* Toast */
#undrrtdToast{
  position:fixed;
  left:50%;
  bottom:22px;
  transform:translateX(-50%);
  z-index:11000;
  padding:10px 14px;
  border-radius:999px;
  background:rgba(20,20,26,0.78);
  border:1px solid rgba(255,70,110,0.28);
  color:#fff;
  backdrop-filter:blur(10px);
  box-shadow:0 10px 30px rgba(0,0,0,0.35);
  font-weight:650;
  font-size:14px;
  letter-spacing:0.2px;
  opacity:0;
  transition:opacity .18s ease, transform .18s ease;
  pointer-events:none;
}
#undrrtdToast.show{
  opacity:1;
  transform:translateX(-50%) translateY(-4px);
}


/* ==============================
   Coach Intro Modal (Popup)
   ============================== */
.modal-backdrop{
  position: fixed;
  inset: 0;
  display: none;            /* shown via JS */
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0,0,0,0.62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 9999;
}

.modal-card{
  width: min(560px, 92vw);
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(20,24,34,0.96);
  box-shadow: 0 24px 70px rgba(0,0,0,0.55);
  padding: 18px 16px 14px 16px;
}

.modal-card h3{
  margin: 0 0 10px 0;
  font-size: 18px;
}

.modal-card p{
  margin: 0 0 10px 0;
  opacity: 0.92;
  line-height: 1.35;
}

.modal-card .btn{
  margin-top: 8px;
  width: 100%;
}


/* COACH INTRO MODAL ANIMATION */
#coachIntroModal {
  display: none;               /* JS sets to flex when shown */
  opacity: 0;
  transition: opacity 180ms ease;
}

#coachIntroModal.is-open {
  opacity: 1;
}

#coachIntroModal .modal-card {
  transform: translateY(10px) scale(0.985);
  opacity: 0;
  transition: transform 220ms ease, opacity 180ms ease;
  will-change: transform, opacity;
}

#coachIntroModal.is-open .modal-card {
  transform: translateY(0) scale(1);
  opacity: 1;
}

#coachIntroModal.coach-flow {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}

#coachIntroModal.coach-flow .modal-card {
    width: min(900px, 95vw);
    max-height: 85vh;
    padding: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#coachIntroFlow {
    display: flex;
    flex-direction: column;
    width: 100%;
    min-width: 100%;
    overflow-y: auto;
    flex: 1;
}

#coachIntroFlow #aiCoachChatCard {
    margin-top: 0;
    flex-shrink: 0;
}

#coachIntroFlow #coachPlanSummaryCard {
    margin-top: 12px;
    flex-shrink: 0;
}

#coachIntroFlow #aiCoachChatCard {
    margin-top: 0;
}

/* Coach chat input sizing — handled by fixed bar above */

#aiCoachChatInput {
    min-height: 48px;
    max-height: 150px;
    padding: 12px 16px;
    font-size: 15px;
    flex: 1 1 auto;
    min-width: 0;
    resize: none;
    overflow-y: auto;
    line-height: 1.4;
    font-family: inherit;
}

#coachTrainingDaysCalendar {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: var(--panel);
    border-radius: 10px;
    border: 1px solid var(--line);
    z-index: 1000;
    position: relative;
}

#coachTrainingDaysCalendar[style*="display: block"] {
    display: block !important;
}

#aiCoachChatForm button[type="submit"] {
    height: 48px;
    padding: 8px 10px;
    font-size: 12px;
    flex: 0 0 72px;
}

#btnClearCoachChat {
    flex: 0 0 auto;
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  #coachIntroModal,
  #coachIntroModal .modal-card {
    transition: none !important;
  }
}

/* ===============================
   Latest Activity Card (Home Tab)
================================ */
.latest-card {
    position: relative;
}

.latest-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.latest-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.latest-user {
    font-size: 13px;
    color: var(--muted);
}

.latest-body {
    padding-top: 8px;
}

.latest-meta {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.latest-main {
    margin-top: 8px;
}

.latest-main-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 12px;
}

.latest-main-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.latest-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--line);
    border-radius: 20px;
    font-size: 13px;
    color: var(--text);
}

.latest-pill .muted {
    color: var(--muted);
    font-weight: 500;
}

/* ===============================
   Home Profile Header (Strava-inspired)
================================ */
#homeView > .page {
    max-width: 680px;
    margin: 0 auto;
    padding-bottom: 20px;
}

.hp-profile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px 16px;
}
.hp-avatar-wrap {
    position: relative;
    cursor: pointer;
    margin-bottom: 10px;
}
.hp-avatar {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    background: var(--accent, #e8ff00);
    color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 26px;
    flex-shrink: 0;
    box-shadow: 0 0 0 3px rgba(232,255,0,0.18);
    overflow: hidden;
}
.hp-avatar-edit {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent, #e8ff00);
    border: 2px solid var(--bg, #000);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    line-height: 1;
}
.hp-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 16px;
}
.hp-stats-row {
    display: flex;
    gap: 0;
    width: 100%;
    max-width: 320px;
    justify-content: center;
    margin-bottom: 14px;
}
.hp-stat {
    flex: 1;
    text-align: center;
    cursor: pointer;
    padding: 6px 0;
}
.hp-stat-num {
    font-size: 20px;
    font-weight: 800;
    color: var(--text);
    line-height: 1.2;
}
.hp-stat-label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 2px;
}
.hp-latest {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    width: 100%;
    max-width: 320px;
}
.hp-latest-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.hp-latest-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

/* ===== Weekly Streak Strip ===== */
.hp-streak {
    padding: 12px 16px 8px;
    border-bottom: 1px solid var(--line);
}
.hp-streak-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}
.hp-streak-fire {
    font-size: 20px;
}
.hp-streak-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.hp-streak-days {
    display: flex;
    justify-content: space-between;
    gap: 4px;
}
.hp-streak-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}
.hp-day-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--muted);
    text-transform: uppercase;
}
.hp-day-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    transition: background 0.2s, color 0.2s;
}
.hp-day-num.hp-day-today {
    border: 2px solid var(--muted);
}
.hp-day-num.hp-day-active {
    background: #FC5200;
    color: #fff;
    font-weight: 700;
}
.hp-day-num.hp-day-active.hp-day-today {
    border-color: #FC5200;
}

/* ===== Training Log Link ===== */
.hp-training-log {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    transition: background 0.15s;
}
.hp-training-log:active {
    background: rgba(255,255,255,0.04);
}

/* ===== This Week Summary ===== */
.hp-this-week {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 12px;
}
.hp-tw-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: var(--muted);
    margin-bottom: 8px;
}
.hp-tw-row {
    display: flex;
    gap: 24px;
}
.hp-tw-stat {
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.hp-tw-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.hp-tw-unit {
    font-size: 13px;
    color: var(--muted);
    font-weight: 500;
}

/* ===============================
   Activity Card (Strava-style Home Feed)
================================ */
.activity-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 14px;
    margin-bottom: 14px;
    overflow: hidden;
}
.activity-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px 8px;
}
.activity-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    flex-shrink: 0;
}
.activity-header-info {
    flex: 1;
    min-width: 0;
}
.activity-header-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text);
}
.activity-header-meta {
    font-size: 12px;
    color: var(--muted);
    display: flex;
    align-items: center;
    gap: 6px;
}
.activity-card-body {
    padding: 0 16px 12px;
}
.activity-type-icon {
    font-size: 16px;
    margin-right: 4px;
}
.activity-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.activity-stats {
    display: flex;
    gap: 0;
}
.activity-stat {
    flex: 1;
    text-align: left;
    padding-right: 12px;
    border-right: 1px solid var(--line);
}
.activity-stat:last-child {
    border-right: none;
    padding-right: 0;
    padding-left: 12px;
}
.activity-stat:first-child ~ .activity-stat {
    padding-left: 12px;
}
.activity-stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 2px;
}
.activity-stat-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
}
.activity-map-container {
    width: 100%;
    height: 200px;
    background: rgba(255,255,255,0.03);
    border-top: 1px solid var(--line);
    position: relative;
    cursor: pointer;
}
.activity-card-actions {
    display: flex;
    align-items: center;
    gap: 0;
    padding: 8px 8px;
    border-top: 1px solid var(--line);
}
.activity-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 13px;
    padding: 8px 0;
    cursor: pointer;
    transition: color 0.15s;
}
.activity-pr-badge {
    display: inline-block;
    padding: 4px 10px;
    margin-bottom: 8px;
    border-radius: 6px;
    background: rgba(255, 165, 0, 0.12);
    border: 1px solid rgba(255, 165, 0, 0.25);
    color: #ffa500;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.3px;
}
.activity-action-btn:hover,
.activity-action-btn:active {
    color: var(--accent);
}
.activity-action-btn svg {
    width: 18px;
    height: 18px;
}
.activity-no-data {
    padding: 20px 16px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

/* ===============================
   Activity Detail Modal (full-screen)
================================ */
.activity-detail-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10002;
    background: var(--bg);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.activity-detail-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    padding-top: calc(env(safe-area-inset-top, 36px) + 8px);
    background: rgba(255,255,255,0.03);
    border-bottom: 1px solid var(--line);
}
.activity-detail-topbar button {
    background: none;
    border: none;
    color: var(--text);
    font-size: 15px;
    cursor: pointer;
    padding: 4px 0;
}
.activity-detail-content {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 100px;
}
.activity-detail-header {
    padding: 20px 0 16px;
}
.activity-detail-user {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.activity-detail-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 20px;
    flex-shrink: 0;
}
.activity-detail-user-info {
    flex: 1;
}
.activity-detail-user-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}
.activity-detail-user-meta {
    font-size: 13px;
    color: var(--muted);
}
.activity-detail-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}
.activity-detail-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
}
.activity-detail-stat {
    padding: 14px 16px;
    border-right: 1px solid var(--line);
}
.activity-detail-stat:nth-child(3n) {
    border-right: none;
}
.activity-detail-stat:nth-child(n+4) {
    border-top: 1px solid var(--line);
}
.activity-detail-stat-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
}
.activity-detail-stat-label {
    font-size: 11px;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-top: 2px;
}
.activity-detail-map-wrap {
    position: relative;
    margin-bottom: 20px;
}
.activity-detail-map {
    width: 100%;
    height: 350px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--line);
}
.activity-detail-map .maplibregl-canvas {
    outline: none;
}
.activity-detail-map .maplibregl-ctrl-bottom-left,
.activity-detail-map .maplibregl-ctrl-bottom-right,
.activity-detail-map .maplibregl-ctrl-logo {
    display: none !important;
}
.activity-detail-play-btn {
    position: absolute;
    bottom: 14px;
    right: 14px;
    z-index: 1000;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background: #FF6B00;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
    transition: transform 0.15s, background 0.15s;
}
.activity-detail-play-btn:hover {
    transform: scale(1.1);
}
.activity-detail-play-btn.playing {
    background: #ef4444;
}
/* Hide Leaflet attribution across all maps */
.leaflet-control-attribution {
    display: none !important;
}
.activity-detail-elev {
    width: 100%;
    height: 160px;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    position: relative;
    cursor: crosshair;
}
.activity-detail-elev canvas {
    width: 100%;
    height: 100%;
}
.elev-tooltip {
    position: absolute;
    background: rgba(0,0,0,0.85);
    color: #fff;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    pointer-events: none;
    white-space: nowrap;
    z-index: 10;
    border: 1px solid rgba(255,255,255,0.15);
}
.activity-detail-notes {
    padding: 16px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    border-radius: 12px;
    margin-bottom: 20px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    white-space: pre-wrap;
}
@media (max-width: 480px) {
    .activity-detail-stat-value {
        font-size: 18px;
    }
    .activity-detail-map {
        height: 280px;
    }
    .activity-detail-elev {
        height: 140px;
    }
}

/* ===============================
   Latest Activity Card (Home Tab)
================================ */
.latest-card {
    margin-bottom: 16px;
}

.latest-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.latest-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--accent);
}

.latest-user {
    font-size: 14px;
    color: var(--muted);
}

.latest-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.latest-meta {
    font-size: 13px;
    color: var(--muted);
}

.latest-main {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.latest-main-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
}

.latest-main-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.latest-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 6px 12px;
    font-size: 13px;
}

.latest-pill .muted {
    color: var(--muted);
}

/* ===============================
   Workout Celebration Overlay
================================ */
#celebrationOverlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 99999;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    overflow: hidden;
}
#celebrationOverlay.celeb-visible {
    opacity: 1;
}
#celebrationOverlay.celeb-fadeout {
    opacity: 0;
    transition: opacity 0.6s ease;
}

/* Animated radial pulse rings */
.celeb-ring {
    position: absolute;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.06);
    top: 50%; left: 50%;
    transform: translate(-50%, -50%) scale(0);
    pointer-events: none;
}
.celeb-ring-1 {
    width: 300px; height: 300px;
    animation: celebRing 2.5s ease-out 0.3s forwards;
}
.celeb-ring-2 {
    width: 500px; height: 500px;
    animation: celebRing 2.8s ease-out 0.5s forwards;
}
.celeb-ring-3 {
    width: 750px; height: 750px;
    animation: celebRing 3.2s ease-out 0.7s forwards;
}
@keyframes celebRing {
    0% { transform: translate(-50%, -50%) scale(0); opacity: 0; border-color: rgba(255,255,255,0.15); }
    30% { opacity: 1; }
    100% { transform: translate(-50%, -50%) scale(1); opacity: 0; border-color: rgba(255,255,255,0); }
}

/* Glow behind the icon */
.celeb-glow {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -55%);
    width: 200px; height: 200px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    animation: celebGlow 2s ease-in-out 0.3s both;
}
@keyframes celebGlow {
    0% { opacity: 0; transform: translate(-50%, -55%) scale(0.3); }
    50% { opacity: 1; }
    100% { opacity: 0.6; transform: translate(-50%, -55%) scale(1); }
}

/* Floating particles */
.celeb-particle {
    position: absolute;
    width: 3px; height: 3px;
    border-radius: 50%;
    background: rgba(255,255,255,0.5);
}
.celeb-particle:nth-child(1) { top: 20%; left: 15%; animation: celebFloat 2.5s ease-out 0.4s both; }
.celeb-particle:nth-child(2) { top: 30%; right: 20%; animation: celebFloat 2.2s ease-out 0.6s both; }
.celeb-particle:nth-child(3) { bottom: 35%; left: 25%; animation: celebFloat 2.8s ease-out 0.3s both; }
.celeb-particle:nth-child(4) { bottom: 25%; right: 15%; animation: celebFloat 2.4s ease-out 0.5s both; }
.celeb-particle:nth-child(5) { top: 45%; left: 10%; animation: celebFloat 2.6s ease-out 0.7s both; }
.celeb-particle:nth-child(6) { top: 15%; right: 30%; animation: celebFloat 2.3s ease-out 0.8s both; }
.celeb-particle:nth-child(7) { bottom: 40%; right: 10%; animation: celebFloat 2.7s ease-out 0.2s both; }
.celeb-particle:nth-child(8) { bottom: 15%; left: 35%; animation: celebFloat 2.1s ease-out 0.9s both; }
@keyframes celebFloat {
    0% { opacity: 0; transform: translateY(20px) scale(0); }
    30% { opacity: 1; transform: translateY(-10px) scale(1); }
    100% { opacity: 0; transform: translateY(-40px) scale(0.5); }
}

/* Horizontal accent line */
.celeb-line {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: celebLine 1.2s ease-out 0.2s forwards;
}
@keyframes celebLine {
    0% { width: 0; opacity: 0; }
    50% { opacity: 1; }
    100% { width: 80%; opacity: 0; }
}

.celeb-content {
    text-align: center;
    z-index: 2;
    animation: celebContentIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.15s both;
}
@keyframes celebContentIn {
    0% { opacity: 0; transform: translateY(40px) scale(0.85); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
.celeb-icon {
    font-size: 80px;
    margin-bottom: 20px;
    animation: celebBounce 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
    filter: drop-shadow(0 0 30px rgba(255,255,255,0.15));
}
@keyframes celebBounce {
    0% { transform: scale(0) rotate(-10deg); opacity: 0; }
    60% { transform: scale(1.15) rotate(3deg); }
    80% { transform: scale(0.95) rotate(-1deg); }
    100% { transform: scale(1) rotate(0deg); opacity: 1; }
}
.celeb-type {
    font-size: 32px;
    font-weight: 900;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 6px;
    margin-bottom: 8px;
    animation: celebTypeIn 0.6s ease-out 0.5s both;
}
@keyframes celebTypeIn {
    0% { opacity: 0; letter-spacing: 20px; }
    100% { opacity: 1; letter-spacing: 6px; }
}
.celeb-time {
    font-size: 17px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 28px;
    font-weight: 300;
    letter-spacing: 1px;
    animation: celebFadeUp 0.5s ease-out 0.65s both;
}
.celeb-coach {
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    animation: celebFadeUp 0.5s ease-out 0.8s both;
}
.celeb-msg {
    font-size: 16px;
    font-weight: 500;
    color: #fff;
    max-width: 320px;
    margin: 0 auto 36px;
    line-height: 1.55;
    animation: celebFadeUp 0.5s ease-out 0.9s both;
}
@keyframes celebFadeUp {
    0% { opacity: 0; transform: translateY(14px); }
    100% { opacity: 1; transform: translateY(0); }
}
.celeb-brand {
    font-family: 'Saira Stencil One', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: rgba(255,255,255,0.22);
    letter-spacing: 4px;
    text-transform: uppercase;
    animation: celebFadeUp 0.4s ease-out 1.1s both;
}

/* ===============================
   POST-WORKOUT DEBRIEF PANEL
================================ */
#postWorkoutDebrief {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(0,0,0,0.72);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}
#postWorkoutDebrief.pwd-visible {
    opacity: 1;
    pointer-events: all;
}
#postWorkoutDebrief.pwd-hiding {
    opacity: 0;
    pointer-events: none;
}
#postWorkoutDebriefSheet {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    background: #12121f;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-radius: 22px 22px 0 0;
    padding: 16px 18px 36px;
    transform: translateY(100%);
    transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
#postWorkoutDebrief.pwd-visible #postWorkoutDebriefSheet {
    transform: translateY(0);
}
#postWorkoutDebrief.pwd-hiding #postWorkoutDebriefSheet {
    transform: translateY(100%);
}
.pwd-stat {
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    padding: 10px 4px;
    text-align: center;
}
.pwd-stat-val {
    font-size: 16px;
    font-weight: 800;
    color: #fff;
    line-height: 1.1;
}
.pwd-stat-sm {
    font-size: 12px !important;
}
.pwd-stat-lbl {
    font-size: 9px;
    color: rgba(255,255,255,0.35);
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}
@keyframes debriefSpin { to { transform: rotate(360deg); } }

/* ===============================
   "How Did It Feel?" Buttons
================================ */
.feel-btn {
    flex: 1;
    background: rgba(255,255,255,0.06);
    border: 2px solid var(--line);
    border-radius: 12px;
    font-size: 24px;
    padding: 10px 0;
    cursor: pointer;
    transition: all 0.15s ease;
    text-align: center;
}
.feel-btn:hover {
    background: rgba(255,255,255,0.1);
    transform: scale(1.05);
}
.feel-btn.feel-active {
    border-color: #FF6B00;
    background: rgba(255,107,0,0.15);
    transform: scale(1.1);
    box-shadow: 0 0 12px rgba(255,107,0,0.3);
}

/* ===============================
   Media thumbnail strip
================================ */
.media-thumb-wrap {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
}
.media-thumb-wrap img,
.media-thumb-wrap video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.media-thumb-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,.7);
    color: #fff;
    font-size: 13px;
    line-height: 20px;
    text-align: center;
    cursor: pointer;
    border: none;
    padding: 0;
}
.media-thumb-badge {
    position: absolute;
    bottom: 3px;
    left: 3px;
    font-size: 10px;
    background: rgba(0,0,0,.65);
    color: #fff;
    border-radius: 4px;
    padding: 1px 4px;
}



/* Coach modal improvements for mobile */
@media (max-width: 600px) {
    #coachIntroModal {
        width: 95vw !important;
        max-width: 95vw !important;
        height: auto !important;
        max-height: 95vh !important;
        border-radius: 20px !important;
        padding: 16px !important;
    }

    #coachIntroModal .modal-card {
        border-radius: 12px;
        max-height: calc(95vh - 40px);
        display: flex;
        flex-direction: column;
    }

    /* Make chat area scrollable on mobile */
    #aiCoachChatMessages {
        overflow-y: auto !important;
        flex: 1 1 0;
    }

    /* Chat input — fixed bar handles its own layout */

    /* Quick reply chips - stack on mobile */
    #aiCoachQuickReplies {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }

    #aiCoachQuickReplies button,
    .coach-day-btn {
        padding: 8px 12px;
        font-size: 12px;
        min-width: 70px;
        flex: 1 1 auto;
        min-width: calc(50% - 3px);
    }

    /* Plan summary card - full width on mobile */
    #coachPlanSummaryCard {
        margin: 10px 0 !important;
    }

    #coachPlanSummaryCard > div:nth-child(3) {
        grid-template-columns: 1fr;
    }

    /* Training days calendar - mobile grid */
    #coachDaysGrid {
        grid-template-columns: repeat(auto-fit, minmax(60px, 1fr)) !important;
        gap: 6px !important;
    }

    .coach-day-btn {
        padding: 6px 8px;
        font-size: 11px;
        min-height: 35px;
    }

    /* Plan view calendar - scrollable on mobile */
    #planDayStrip {
        overflow-x: auto;
        display: flex;
        gap: 6px;
        padding-bottom: 8px;
    }

    #planDayStrip button {
        min-width: 35px;
        padding: 6px;
        font-size: 11px;
    }

    /* Modal buttons stack vertically on mobile */
    .modal-actions,
    #coachDaysGrid + div {
        flex-direction: column;
    }

    .modal-actions button,
    #coachDaysGrid + div button {
        width: 100%;
    }
}

/* Tablet improvements (600px - 900px) */
@media (min-width: 601px) and (max-width: 900px) {
    #coachIntroModal {
        width: 90vw;
        max-width: 550px;
    }

    #aiCoachQuickReplies button {
        padding: 10px 14px;
        font-size: 13px;
    }

    #coachPlanSummaryCard > div:nth-child(3) {
        grid-template-columns: 1fr 1fr;
    }
}

/* Small screens: hide less important info */
@media (max-width: 480px) {
    .card-title {
        font-size: 18px;
    }

    .tiny {
        font-size: 11px;
    }

    .latest-pill {
        padding: 4px 8px;
        font-size: 11px;
    }

    .feed-stat {
        font-size: 12px;
    }

    .bottomnav {
        padding: 8px 0;
    }

    .bottomnav-item {
        font-size: 10px;
        padding: 8px 4px 6px;
        border-radius: 14px;
    }

    /* Prevent iOS Safari auto-zoom on input tap */
    .input,
    .textarea,
    .select {
        font-size: 16px;
    }

    .tab-view > .page,
    .shell {
        padding: 10px 12px 88px;
    }

    .card {
        padding: 14px 12px;
        border-radius: 18px;
    }

    .page-head-title {
        font-size: 26px;
    }

    .login-card-inner {
        padding: 18px 14px;
    }

    .login-page {
        padding: 16px 14px 40px;
    }

    .nav-welcome {
        padding: 5px 8px;
        font-size: 12px;
    }
}
/* ===============================
   Groups
================================ */
.groups-header {
    display: flex;
    gap: 12px;
    align-items: center;
}

.groups-header .input {
    flex: 1;
}

.groups-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 16px;
}

.groups-empty {
    padding: 24px;
    text-align: center;
    color: var(--muted);
    font-size: 14px;
}

.group-item {
    padding: 16px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--line);
    cursor: pointer;
    transition: all 0.2s;
}

.group-item:hover {
    background: var(--card2);
    border-color: var(--accent);
    transform: translateY(-2px);
}

.group-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.group-item-name {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.group-item-badge {
    padding: 4px 12px;
    background: rgba(255, 255, 255, 0.12);
    color: var(--accent);
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.group-item-description {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.group-item-meta {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--muted);
}

.group-item-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-y: auto;
}

.modal-content {
    background: var(--card);
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}

.modal-content.modal-large {
    max-width: 800px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--line);
}

.modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--muted);
    font-size: 28px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.modal-close:hover {
    background: var(--panel);
    color: var(--text);
}

.modal-body {
    padding: 24px;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 24px;
}

.error-msg {
    color: var(--bad);
    font-size: 14px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(251, 113, 133, 0.1);
    border-radius: 8px;
}

.success-msg {
    color: var(--good);
    font-size: 14px;
    margin-top: 12px;
    padding: 12px;
    background: rgba(52, 211, 153, 0.1);
    border-radius: 8px;
}

/* ── First-login tour ── */
.onboarding-overlay {
    position: fixed;
    inset: 0;
    z-index: 10020;
    pointer-events: none;
}

.onboarding-card {
    pointer-events: auto;
    position: fixed;
    z-index: 10021;
    width: 300px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    background: rgba(14, 16, 20, 0.95);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.06);
    padding: 18px 20px 16px;
    transition: left 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                bottom 0.42s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.3s ease;
    will-change: left, bottom;
}

.onboarding-card::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: var(--arrow-x, 50%);
    transform: translateX(-50%) rotate(45deg);
    width: 14px;
    height: 14px;
    background: rgba(14, 16, 20, 0.95);
    border-right: 1px solid rgba(255, 255, 255, 0.14);
    border-bottom: 1px solid rgba(255, 255, 255, 0.14);
    transition: left 0.42s cubic-bezier(0.22, 1, 0.36, 1);
}

.onboarding-card.tour-entering {
    animation: tourCardIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes tourCardIn {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.onboarding-overlay.tour-closing .onboarding-card {
    opacity: 0;
    transform: translateY(20px) scale(0.97);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.onboarding-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.onboarding-kicker {
    display: inline-flex;
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.6);
    font-size: 10px;
    letter-spacing: 0.3px;
}

.onboarding-close {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    font-size: 20px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
    transition: color 0.2s;
}

.onboarding-close:hover {
    color: rgba(255, 255, 255, 0.9);
}

.onboarding-body {
    overflow: hidden;
    position: relative;
    min-height: 70px;
}

.onboarding-content {
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                opacity 0.25s ease;
    will-change: transform, opacity;
}

.onboarding-content.slide-out-left {
    transform: translateX(-30px);
    opacity: 0;
}

.onboarding-content.slide-out-right {
    transform: translateX(30px);
    opacity: 0;
}

.onboarding-content.slide-in-right {
    transform: translateX(30px);
    opacity: 0;
    transition: none;
}

.onboarding-content.slide-in-left {
    transform: translateX(-30px);
    opacity: 0;
    transition: none;
}

.onboarding-title {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    margin: 6px 0 6px;
}

.onboarding-text {
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: 13px;
    line-height: 1.55;
}

.onboarding-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    gap: 10px;
}

.onboarding-dots {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.onboarding-dot {
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.25);
    transition: width 0.35s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.35s ease;
}

.onboarding-dot.is-active {
    width: 18px;
    background: rgba(255, 255, 255, 0.9);
}

.onboarding-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.onboarding-actions .btn {
    padding: 6px 14px;
    font-size: 12px;
    border-radius: 8px;
}

/* Bottom-nav tour highlight */
.bottomnav-item.tour-active {
    border-color: rgba(255, 255, 255, 0.6);
    box-shadow: 0 0 16px rgba(255, 255, 255, 0.15);
    animation: tourNavPulse 1.6s ease-in-out infinite;
}

@keyframes tourNavPulse {
    0%, 100% { box-shadow: 0 0 16px rgba(255, 255, 255, 0.15); }
    50%      { box-shadow: 0 0 26px rgba(255, 255, 255, 0.3); }
}

@media (max-width: 720px) {
    .onboarding-card {
        width: 280px;
        padding: 14px 16px 14px;
    }

    .onboarding-title {
        font-size: 16px;
    }

    .onboarding-text {
        font-size: 12px;
    }
}

/* Group Details Tabs */
.group-details-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 1px solid var(--line);
}

.group-tab {
    padding: 12px 20px;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

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

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

.feed-list, .members-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feed-item {
    padding: 16px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--line);
}

.feed-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.feed-item-user {
    font-weight: 600;
    color: var(--text);
}

.feed-item-date {
    font-size: 12px;
    color: var(--muted);
}

.feed-item-workout {
    display: flex;
    gap: 16px;
    font-size: 14px;
    color: var(--muted);
}

.member-item {
    padding: 12px;
    background: var(--panel);
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.member-name {
    font-weight: 500;
    color: var(--text);
}

.member-role {
    padding: 4px 10px;
    background: rgba(52, 211, 153, 0.15);
    color: var(--good);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.stat-card {
    padding: 16px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--line);
}

.stat-label {
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text);
}

.stat-unit {
    font-size: 14px;
    color: var(--muted);
    margin-left: 4px;
}

/* Analytics View */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

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

.group-comparison {
    margin-top: 16px;
}

.comparison-item {
    padding: 16px;
    background: var(--panel);
    border-radius: 12px;
    border: 1px solid var(--line);
    margin-bottom: 16px;
}

.comparison-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.comparison-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.comparison-badge {
    font-size: 12px;
    padding: 4px 10px;
    background: var(--card);
    border-radius: 12px;
    color: var(--muted);
}

.comparison-stats {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.comparison-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.comparison-stat-label {
    font-size: 12px;
    color: var(--muted);
}

.comparison-stat-values {
    display: flex;
    gap: 8px;
    align-items: baseline;
}

.comparison-stat-you {
    font-size: 18px;
    font-weight: 600;
    color: var(--accent);
}

.comparison-stat-group {
    font-size: 14px;
    color: var(--muted);
}

.comparison-stat-diff {
    font-size: 12px;
    margin-left: 4px;
}

.comparison-stat-diff.positive {
    color: var(--good);
}

.comparison-stat-diff.negative {
    color: var(--bad);
}

/* Privacy Toggle Switch */
#groupIsPublicToggle {
    position: relative;
    width: 44px;
    height: 24px;
    appearance: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    outline: none;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#groupIsPublicToggle:checked {
    background: var(--accent);
    border-color: var(--accent);
}

#groupIsPublicToggle::before {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    top: 2px;
    left: 2px;
    background: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

#groupIsPublicToggle:checked::before {
    transform: translateX(20px);
}

/* ===============================
   Coach Active Plan Card
================================ */
.coach-active-plan-card {
    /* Replaced by .coach-plan-banner */
    display: none !important;
}

/* ===============================
   Coach Plan Banner (pinned inside chat container)
================================ */
.coach-plan-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 20px;
    margin: 0 16px 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.03) 100%);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 14px;
    flex-shrink: 0;
}
.coach-plan-banner-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 0;
    overflow: hidden;
}
.coach-plan-banner-icon {
    font-size: 24px;
    flex-shrink: 0;
}
.coach-plan-banner-info {
    min-width: 0;
    overflow: hidden;
    flex: 1 1 0;
}
.coach-plan-banner-title {
    font-weight: 700;
    font-size: 13px;
    color: #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coach-plan-banner-phase {
    font-size: 11px;
    color: #ffffff;
    margin-top: 1px;
    font-weight: 500;
}
.coach-plan-banner-right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.coach-plan-banner-today {
    font-size: 12px;
    color: #94a3b8;
    max-width: 280px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.coach-plan-banner-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.25);
    background: rgba(255,255,255,0.08);
    color: #ffffff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.coach-plan-banner-btn:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.50);
}

@media (max-width: 600px) {
    /* Banner: single compact row, never overflows viewport */
    .coach-plan-banner {
        flex-direction: row !important;
        align-items: center !important;
        flex-wrap: nowrap !important;
        padding: 8px 10px !important;
        margin: 0 !important;
        border-radius: 0 !important;
        border-left: none !important;
        border-right: none !important;
        gap: 8px !important;
        width: 100% !important;
        box-sizing: border-box !important;
        overflow: hidden !important;
    }

    /* Left side: shrinks and clips — takes all remaining space */
    .coach-plan-banner-left {
        flex: 1 1 0 !important;
        min-width: 0 !important;
        overflow: hidden !important;
    }
    .coach-plan-banner-icon {
        font-size: 18px !important;
        flex-shrink: 0 !important;
    }
    .coach-plan-banner-info {
        min-width: 0 !important;
        overflow: hidden !important;
        flex: 1 1 0 !important;
    }

    /* Title: one line, ellipsis */
    .coach-plan-banner-title {
        font-size: 11px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    /* Phase: hide on very small screens to save space */
    .coach-plan-banner-phase {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 100% !important;
    }

    /* Right side: fixed, never grows */
    .coach-plan-banner-right {
        flex-shrink: 0 !important;
        flex-direction: column !important;
        align-items: flex-end !important;
        gap: 2px !important;
        max-width: 110px !important;
    }
}

/* ═══════════════════════════════════════════════════════
   PREMIUM PLAN LIVE OVERLAY  (.plo-*)
   ═══════════════════════════════════════════════════════ */
#planLiveOverlay {
    position: fixed;
    inset: 0;
    z-index: 10500;
    background: #0c0c1a;
    display: flex;
    flex-direction: column;
    color: #fff;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    animation: ploSlideUp 0.35s ease-out;
}
@keyframes ploSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

/* ── Coach header strip ── */
.plo-header {
    display: flex;
    align-items: center;
    padding: 14px 16px 10px;
    gap: 12px;
    flex-shrink: 0;
}
.plo-coach-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.plo-coach-info { flex: 1; min-width: 0; }
.plo-coach-name {
    font-size: 11px; font-weight: 800;
    letter-spacing: 1.5px; text-transform: uppercase;
    opacity: 0.6;
}
.plo-workout-title {
    font-size: 16px; font-weight: 700;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.plo-close-btn {
    background: none; border: none; color: rgba(255,255,255,0.4);
    font-size: 26px; cursor: pointer; padding: 4px 8px;
    flex-shrink: 0;
}

/* ── Workout meta (intensity, duration, phase) ── */
.plo-meta {
    display: flex; gap: 8px; padding: 0 16px 8px;
    flex-wrap: wrap; flex-shrink: 0;
}
.plo-meta-pill {
    background: rgba(255,255,255,0.08);
    border-radius: 20px; padding: 4px 12px;
    font-size: 11px; font-weight: 600;
    letter-spacing: 0.5px; text-transform: uppercase;
}

/* ── Big timer ── */
.plo-timer {
    font-size: 72px;
    font-weight: 200;
    font-family: "SF Mono", "Cascadia Mono", "Fira Code", monospace;
    text-align: center;
    padding: 12px 0 8px;
    letter-spacing: 2px;
    flex-shrink: 0;
    line-height: 1;
}

/* ── Stats pills row ── */
.plo-stats {
    display: flex;
    justify-content: space-around;
    padding: 8px 12px 16px;
    flex-shrink: 0;
}
.plo-stat {
    text-align: center; min-width: 60px;
}
.plo-stat-val {
    font-size: 26px; font-weight: 700;
    font-family: "SF Mono", "Cascadia Mono", monospace;
    line-height: 1.1;
}
.plo-stat-lbl {
    font-size: 10px; font-weight: 700;
    letter-spacing: 1.2px; text-transform: uppercase;
    opacity: 0.45; margin-top: 2px;
}

/* ── Map area (outdoor) ── */
.plo-map-wrap {
    flex: 1; min-height: 180px;
    margin: 0 16px 12px;
    border-radius: 14px;
    overflow: hidden;
    background: #111;
}

/* ── Apex workout panel (S&C) ── */
.plo-apex-panel {
    flex: 1;
    margin: 0 16px 12px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.plo-apex-content {
    padding: 4px 0;
}

/* ── Coach nudge ── */
.plo-nudge {
    margin: 0 16px 10px;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px; font-weight: 500;
    line-height: 1.4;
}

/* ── Paused badge ── */
.plo-paused-badge {
    text-align: center;
    font-size: 18px; font-weight: 800;
    letter-spacing: 2px; color: #fbbf24;
    padding: 8px 0;
    animation: ploPulse 1.5s ease-in-out infinite;
}
@keyframes ploPulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

/* ── Controls ── */
.plo-controls {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px));
    flex-shrink: 0;
}
.plo-btn {
    flex: 1;
    padding: 16px;
    border: none;
    border-radius: 14px;
    font-size: 16px; font-weight: 800;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: transform 0.1s, opacity 0.15s;
}
.plo-btn:active { transform: scale(0.97); opacity: 0.85; }
.plo-btn-pause {
    background: rgba(255,255,255,0.1);
    color: #fff;
}
.plo-btn-finish {
    background: #22c55e;
    color: #0a0a18;
}

/* ── Coach accent themes ── */
#planLiveOverlay.plo-miles   { --plo-accent: #e8a020; }
#planLiveOverlay.plo-cadence { --plo-accent: #5b8dd9; }
#planLiveOverlay.plo-apex    { --plo-accent: #d4603a; }
#planLiveOverlay.plo-prime   { --plo-accent: #e8a020; }

#planLiveOverlay .plo-coach-avatar { background: var(--plo-accent, #e8a020); color: #0c0c1a; }
#planLiveOverlay .plo-timer        { color: var(--plo-accent, #fff); }
#planLiveOverlay .plo-nudge        { background: color-mix(in srgb, var(--plo-accent) 15%, transparent); }
#planLiveOverlay .plo-btn-finish   { background: var(--plo-accent, #22c55e); }

/* ── Exercise Demo Drawer ── */
.ex-demo-drawer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 11000;
    max-height: 70vh;
    background: #111118;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.7);
    animation: exDrawerSlideUp 0.3s ease-out;
    display: flex;
    flex-direction: column;
}
@keyframes exDrawerSlideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}
.ex-demo-drawer-inner {
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
}
.ex-demo-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}
.ex-demo-title {
    font-size: 15px;
    font-weight: 700;
    color: #fff;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ex-demo-close {
    background: none;
    border: none;
    color: rgba(255,255,255,0.5);
    font-size: 26px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.ex-demo-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 18px 20px;
}
.ex-demo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}
.ex-demo-spinner {
    width: 32px; height: 32px;
    border: 3px solid rgba(167,139,250,0.2);
    border-top-color: #a78bfa;
    border-radius: 50%;
    animation: exSpin 0.7s linear infinite;
}
@keyframes exSpin {
    to { transform: rotate(360deg); }
}
.ex-demo-gif-wrap {
    text-align: center;
    margin-bottom: 14px;
    background: #fff;
    border-radius: 14px;
    overflow: hidden;
}
.ex-demo-gif {
    width: 100%;
    max-width: 360px;
    height: auto;
    display: block;
    margin: 0 auto;
}
.ex-demo-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 14px;
}
.ex-demo-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
    background: rgba(167,139,250,0.12);
    color: #a78bfa;
    text-transform: capitalize;
}
.ex-demo-instructions {
    counter-reset: exStep;
}
.ex-demo-step {
    display: flex;
    gap: 10px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    font-size: 13px;
    color: rgba(255,255,255,0.8);
    line-height: 1.55;
}
.ex-demo-step::before {
    counter-increment: exStep;
    content: counter(exStep);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 22px; height: 22px;
    border-radius: 50%;
    background: rgba(167,139,250,0.15);
    color: #a78bfa;
    font-size: 11px; font-weight: 700;
    flex-shrink: 0;
    margin-top: 1px;
}

    /* Today text: clipped to one line */
    .coach-plan-banner-today {
        font-size: 10px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        max-width: 108px !important;
    }

    .coach-plan-banner-btn {
        font-size: 10px !important;
        padding: 4px 8px !important;
        white-space: nowrap !important;
    }
}

/* ===============================
   Coach Top Bar
================================ */
.coach-topbar {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
    padding: 8px 20px 10px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    flex-shrink: 0;
}

.coach-topbar-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: none;
    color: var(--text);
    font-family: 'Fraunces', 'Georgia', serif;
}

.coach-topbar-sub {
    font-size: 11px;
    color: #9ca3af;
}

@media (max-width: 700px) {
    .coach-topbar {
        flex-direction: column;
        align-items: flex-start;
        gap: 2px;
    }
}

/* ===============================
   Coach Quick-Action Chips
================================ */
.coach-quick-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 18px 4px;
    flex-shrink: 0;
}

.coach-chip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    font-family: inherit;
}

.coach-chip:hover {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.35);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255,255,255,0.10);
}
.coach-chip:active {
    transform: translateY(0);
}

/* ═══════════════════════════════
   Map Style Toggle Button
═══════════════════════════════ */
.undrrtd-map-style-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 1001;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.75);
    border: 2px solid rgba(255, 255, 255, 0.25);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
    transition: background 0.2s, transform 0.15s;
}
.undrrtd-map-style-btn:hover {
    background: rgba(0, 0, 0, 0.9);
    transform: scale(1.08);
}
.undrrtd-map-style-btn:active {
    transform: scale(0.95);
}

/* Navigation marker pulse ring */
@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.6;
    }
    70% {
        transform: scale(1.8);
        opacity: 0;
    }
    100% {
        transform: scale(1.8);
        opacity: 0;
    }
}

/* Live dot pulsing */
@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

/* ========== S&C Workout Library ========== */
.wl-cat-tab {
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(148,163,184,0.25);
    background: rgba(30,30,45,0.7);
    color: #94a3b8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.wl-cat-tab:hover { border-color: rgba(139,92,246,0.4); }
.wl-cat-active {
    background: rgba(139,92,246,0.18);
    border-color: rgba(139,92,246,0.5);
    color: #a78bfa;
}
.wl-cat-count {
    display: inline-block;
    margin-left: 4px;
    padding: 1px 6px;
    border-radius: 8px;
    background: rgba(148,163,184,0.12);
    font-size: 11px;
    font-weight: 400;
}
.wl-workout-card {
    background: rgba(30,30,50,0.6);
    border: 1px solid rgba(148,163,184,0.12);
    border-radius: 12px;
    padding: 14px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.1s;
}
.wl-workout-card:hover {
    border-color: rgba(139,92,246,0.4);
    transform: translateY(-1px);
}
.wl-workout-card:active { transform: scale(0.99); }
.wl-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.wl-card-title {
    font-size: 15px;
    font-weight: 700;
    color: #e2e8f0;
}
.wl-card-meta {
    font-size: 12px;
    color: #64748b;
    margin-top: 4px;
}
.wl-difficulty-badge {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid;
    letter-spacing: 0.5px;
}
.wl-equip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 8px;
}
.wl-equip-tag {
    font-size: 11px;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(77,208,225,0.10);
    color: #4dd0e1;
    border: 1px solid rgba(77,208,225,0.20);
    text-transform: capitalize;
}
.wl-exercise-preview {
    margin-top: 10px;
    padding-top: 8px;
    border-top: 1px solid rgba(148,163,184,0.08);
}
.wl-section-label {
    font-size: 12px;
    font-weight: 700;
    color: #94a3b8;
    text-transform: uppercase;
    margin-top: 6px;
    margin-bottom: 2px;
}
.wl-exercise-line {
    font-size: 13px;
    color: #c8d6e5;
    padding: 2px 0 2px 12px;
    position: relative;
}
.wl-exercise-line::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: #64748b;
}
.wl-exercise-more {
    font-size: 12px;
    color: #a78bfa;
    margin-top: 4px;
    padding-left: 12px;
}
/* Detail view */
.wl-detail-section {
    margin-bottom: 16px;
}
.wl-detail-section-name {
    font-size: 14px;
    font-weight: 700;
    color: #a78bfa;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid rgba(139,92,246,0.15);
}
.wl-detail-set-info {
    font-size: 12px;
    color: #94a3b8;
    font-style: italic;
    margin-bottom: 6px;
}
.wl-detail-exercises {
    margin: 0;
    padding-left: 20px;
    list-style: disc;
}
.wl-detail-exercises li {
    font-size: 14px;
    color: #e2e8f0;
    padding: 3px 0;
    line-height: 1.5;
}

/* ==============================
   S&C Quick Workout Picker
   ============================== */
#scQuickPickerSection {
    margin: 12px 0;
    padding: 14px;
    border-radius: 14px;
    background: rgba(139,92,246,0.06);
    border: 1px solid rgba(139,92,246,0.18);
}
.sc-picker-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: rgba(255,255,255,0.45);
    margin-bottom: 8px;
}
.sc-focus-row {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.sc-focus-btn {
    flex: 1;
    min-width: 70px;
    padding: 8px 6px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.6);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    text-align: center;
}
.sc-focus-btn.active {
    background: rgba(139,92,246,0.2);
    border-color: rgba(139,92,246,0.5);
    color: #a78bfa;
}
.sc-conditioning-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.5);
    cursor: pointer;
    transition: all 0.15s;
}
.sc-conditioning-toggle:has(input:checked) {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.35);
    color: #c4b5fd;
}
.sc-conditioning-toggle input[type="checkbox"] {
    accent-color: #8b5cf6;
    width: 14px;
    height: 14px;
    margin: 0;
}
.sc-equip-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
}
.sc-equip-chip {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 8px;
    border-radius: 8px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    font-size: 12px;
    color: rgba(255,255,255,0.6);
    cursor: pointer;
    transition: all 0.15s;
}
.sc-equip-chip:has(input:checked) {
    background: rgba(139,92,246,0.12);
    border-color: rgba(139,92,246,0.35);
    color: #c4b5fd;
}
.sc-equip-chip input[type="checkbox"] {
    accent-color: #8b5cf6;
    width: 14px;
    height: 14px;
    margin: 0;
}
/* Result card */
.sc-workout-card {
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(139,92,246,0.18);
    overflow: hidden;
}
.sc-workout-header {
    padding: 14px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.sc-workout-title {
    font-size: 16px;
    font-weight: 800;
    color: #e2e8f0;
    margin-bottom: 6px;
}
.sc-workout-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 12px;
    color: rgba(255,255,255,0.45);
}
.sc-cat-badge {
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(139,92,246,0.12);
    color: #a78bfa;
    font-weight: 600;
    font-size: 11px;
    text-transform: capitalize;
}
.sc-equip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}
.sc-equip-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.5);
    text-transform: capitalize;
}
.sc-section {
    padding: 10px 14px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
}
.sc-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: #a78bfa;
    margin-bottom: 8px;
}
.sc-exercises-list {
    padding: 10px 14px;
}
.sc-exercise-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255,255,255,0.03);
}
.sc-exercise-item:last-child { border-bottom: none; }
.sc-exercise-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(139,92,246,0.15);
    color: #a78bfa;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}
.sc-exercise-name {
    font-size: 14px;
    font-weight: 600;
    color: #e2e8f0;
}
.sc-exercise-detail {
    font-size: 12px;
    color: rgba(255,255,255,0.4);
    margin-top: 2px;
}
.sc-exercise-notes {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    font-style: italic;
    margin-top: 2px;
}
.sc-workout-actions {
    padding: 10px 14px;
    display: flex;
    gap: 8px;
}

/* Spinner animation for async coach analysis */
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===============================
   Record Tab — Full-screen map + bottom sheet redesign
================================ */

/* Make the recordView fill the whole viewport (no scroll) */
#recordView {
    overflow: hidden;
    height: 100vh;
    max-height: 100vh;
}
#recordMapFull {
    height: 100vh;
    position: relative;
}

/* Sport type selection cards */
.sport-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 8px 4px;
    border-radius: 10px;
    border: 1.5px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    color: rgba(255,255,255,0.6);
}
.sport-card:active {
    transform: scale(0.94);
}
.sport-card:hover {
    background: rgba(255,255,255,0.08);
    border-color: rgba(255,255,255,0.2);
}
.sport-card.active {
    background: rgba(232,255,0,0.08);
    border-color: rgba(232,255,0,0.45);
    color: #e8ff00;
}
.sport-card-icon {
    font-size: 20px;
    line-height: 1;
}
.sport-card-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-align: center;
    white-space: nowrap;
}

/* Readiness check buttons */
.readiness-btn {
    font-family: inherit;
    color: rgba(255,255,255,0.55);
    transition: all 0.15s ease;
}
.readiness-btn:hover {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.25) !important;
}
.readiness-btn.active[data-feel="1"] {
    background: rgba(239,68,68,0.12) !important;
    border-color: rgba(239,68,68,0.45) !important;
    color: #ef4444;
}
.readiness-btn.active[data-feel="3"] {
    background: rgba(251,191,36,0.12) !important;
    border-color: rgba(251,191,36,0.45) !important;
    color: #fbbf24;
}
.readiness-btn.active[data-feel="5"] {
    background: rgba(34,197,94,0.12) !important;
    border-color: rgba(34,197,94,0.45) !important;
    color: #22c55e;
}

/* Share location button — active state */
#btnShareLocation.live {
    background: rgba(239,68,68,0.2) !important;
    border-color: rgba(239,68,68,0.55) !important;
    box-shadow: 0 0 8px rgba(239,68,68,0.35);
}
