/* ============================================================
   Design tokens
   ============================================================ */
:root {
    /* Surfaces */
    --bg:        #07090f;
    --surface:   #0f1626;
    --surface-2: #161f33;
    --surface-3: #1f2a44;
    --border:    #1e293b;
    --border-2:  #2d3a52;

    /* Text */
    --text:      #e2e8f0;
    --text-2:    #94a3b8;
    --text-3:    #64748b;

    /* Accents */
    --cyan:      #06b6d4;
    --cyan-2:    #22d3ee;
    --green:     #10b981;
    --green-2:   #34d399;
    --amber:     #f59e0b;
    --amber-2:   #fbbf24;
    --red:       #ef4444;
    --red-2:     #f87171;
    --purple:    #8b5cf6;
    --purple-2:  #a78bfa;

    /* Semitransparent fills */
    --fill-cyan:   rgba(34,211,238,0.10);
    --fill-green:  rgba(52,211,153,0.10);
    --fill-amber:  rgba(251,191,36,0.10);
    --fill-red:    rgba(248,113,113,0.10);
    --fill-purple: rgba(167,139,250,0.10);

    /* Shadows */
    --shadow-1:  0 1px 2px rgba(0,0,0,0.4);
    --shadow-2:  0 4px 16px rgba(0,0,0,0.5);
    --shadow-3:  0 16px 48px rgba(0,0,0,0.6);
    --glow-cyan: 0 0 32px rgba(34,211,238,0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", "Helvetica Neue", system-ui, sans-serif;
    background: var(--bg);
    background-image:
        radial-gradient(ellipse 80% 50% at 30% 0%, rgba(34,211,238,0.06), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(139,92,246,0.05), transparent 60%);
    background-attachment: fixed;
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ============================================================
   Layout
   ============================================================ */
.container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 20px 24px 32px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ============================================================
   Header
   ============================================================ */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 14px 22px;
    box-shadow: var(--shadow-1);
}

h1 {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
}

.controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

#poseSelect {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
#poseSelect:hover  { background: var(--surface-3); border-color: var(--cyan); }
#poseSelect:focus  { outline: none; border-color: var(--cyan-2); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }

.upload-btn, .progress-btn {
    padding: 9px 14px;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    border: 1px solid var(--border-2);
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
}
.upload-btn:hover, .progress-btn:hover { background: var(--surface-3); border-color: var(--cyan); }

/* ============================================================
   Progress dashboard panel
   ============================================================ */
.progress-panel {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.25s ease;
    opacity: 0;
}
.progress-panel.open {
    max-height: 380px;
    opacity: 1;
}
.progress-panel-inner {
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 22px;
    border-radius: 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-1);
}
.progress-panel-inner h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.progress-chart-container {
    height: 240px;
    position: relative;
}
.progress-empty {
    text-align: center;
    color: var(--text-3);
    font-size: 13px;
    padding-top: 90px;
}

/* ============================================================
   Main grid
   ============================================================ */
/* Legacy layout from pre-tab redesign — neutralized.
   New page system uses .page-container (block layout) — see Phase 1 redesign. */
main.legacy-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr);
    gap: 20px;
}

/* ============================================================
   Video
   ============================================================ */
.video-container {
    position: relative;
    background: #000;
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    box-shadow: var(--shadow-2);
}
#video, #canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.pulse-border {
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    border: 3px solid transparent;
    transition: border-color 0.15s;
}
.pulse-border.green {
    border-color: var(--green-2);
    animation: pulse-green 0.8s ease-out forwards;
}
.pulse-border.yellow { border-color: var(--amber-2); }
.pulse-border.orange { border-color: #fb923c; }

@keyframes pulse-green {
    0%   { box-shadow: 0 0 0 0 rgba(52,211,153,0.6); }
    50%  { box-shadow: 0 0 0 14px rgba(52,211,153,0); }
    100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}

/* ============================================================
   Lesson panel — full course content
   ============================================================ */
.feedback-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: var(--shadow-2);
}

.feedback-panel > h2 {
    display: none; /* Replaced by lesson-header */
}

#tipsBox {
    padding: 22px 24px 16px;
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 18px;
    max-height: 580px;
}

/* Header */
.lesson-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    flex-wrap: wrap;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    margin-bottom: -2px;
}
.lesson-header > div:first-child {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.lesson-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: -0.01em;
    line-height: 1.15;
}
.lesson-title-en {
    font-size: 12px;
    color: var(--text-3);
    font-style: italic;
    letter-spacing: 0.01em;
}
.lesson-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 4px 9px;
    border-radius: 12px;
    background: var(--surface-2);
    color: var(--text-2);
    flex-shrink: 0;
    border: 1px solid var(--border-2);
}
.lesson-badge.lunge-base    { background: var(--fill-cyan);   color: var(--cyan-2);   border-color: rgba(34,211,238,0.3); }
.lesson-badge.lunge-variant { background: var(--fill-purple); color: var(--purple-2); border-color: rgba(167,139,250,0.3); }
.lesson-badge.basic         { background: var(--fill-green);  color: var(--green-2);  border-color: rgba(52,211,153,0.3); }
.lesson-badge.blade         { background: var(--fill-amber);  color: var(--amber-2);  border-color: rgba(251,191,36,0.3); }

/* Weapon pills */
.lesson-weapons {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}
.weapon-pill {
    font-size: 11px;
    font-weight: 500;
    padding: 4px 10px;
    border-radius: 11px;
    background: var(--surface-2);
    color: var(--text-2);
    border: 1px solid var(--border-2);
}
.weapon-pill.good { background: var(--fill-green);  color: var(--green-2);  border-color: rgba(52,211,153,0.3); }
.weapon-pill.mid  { background: var(--fill-amber);  color: var(--amber-2);  border-color: rgba(251,191,36,0.3); }
.weapon-pill.bad  { background: var(--fill-red);    color: var(--red-2);    border-color: rgba(248,113,113,0.3); }

/* Section blocks */
.lesson-section {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.lesson-section-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.lesson-section-title::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--cyan);
    border-radius: 2px;
}
.lesson-section-body {
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--text-2);
}

/* ✓ / ✗ lists */
.lesson-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 7px; }
.lesson-list li {
    font-size: 13px;
    line-height: 1.55;
    padding: 8px 12px 8px 32px;
    position: relative;
    border-radius: 7px;
    background: var(--surface-2);
    color: var(--text);
}
.lesson-list li::before {
    position: absolute;
    left: 12px;
    top: 8px;
    font-weight: 700;
    font-size: 13px;
}
.lesson-list.good li {
    background: var(--fill-green);
    border-left: 2px solid var(--green-2);
}
.lesson-list.good li::before { content: '✓'; color: var(--green-2); }
.lesson-list.bad li {
    background: var(--fill-red);
    border-left: 2px solid var(--red-2);
}
.lesson-list.bad li::before { content: '✗'; color: var(--red-2); }

/* Tactic cards */
.tactic-cards { display: flex; flex-direction: column; gap: 8px; }
.tactic-card {
    background: var(--surface-2);
    border-left: 3px solid var(--amber-2);
    border-radius: 8px;
    padding: 11px 13px;
}
.tactic-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--amber-2);
    margin-bottom: 4px;
    display: flex;
    gap: 6px;
}
.tactic-ts {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 400;
}
.tactic-desc {
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--text-2);
}

/* Drill cards — INTERACTIVE */
.drill-cards { display: flex; flex-direction: column; gap: 8px; }
.drill-card {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--green-2);
    border-radius: 8px;
    padding: 12px 14px;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s, border-color 0.15s, box-shadow 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.drill-card:hover {
    background: var(--surface-3);
    border-left-color: var(--cyan-2);
    transform: translateX(3px);
    box-shadow: var(--shadow-1);
}
.drill-card-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--fill-green);
    color: var(--green-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: background 0.15s, color 0.15s;
}
.drill-card:hover .drill-card-icon {
    background: var(--fill-cyan);
    color: var(--cyan-2);
}
.drill-card-body { flex: 1; min-width: 0; }
.drill-name {
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
    display: flex;
    gap: 6px;
    align-items: center;
}
.drill-ts {
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    font-size: 11px;
    color: var(--text-3);
    font-weight: 400;
}
.drill-desc {
    font-size: 12px;
    line-height: 1.5;
    color: var(--text-2);
}
.drill-card-arrow {
    color: var(--text-3);
    flex-shrink: 0;
    transition: transform 0.15s, color 0.15s;
    font-size: 18px;
    line-height: 1;
}
.drill-card:hover .drill-card-arrow {
    color: var(--cyan-2);
    transform: translateX(2px);
}

/* Rules */
.rules-list {
    display: flex;
    flex-direction: column;
    gap: 0;
    background: var(--fill-amber);
    border: 1px solid rgba(251,191,36,0.2);
    border-radius: 8px;
    padding: 6px 12px;
}
.rule-row {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    gap: 10px;
    align-items: center;
    font-size: 12px;
    padding: 9px 0;
    border-bottom: 1px dashed rgba(251,191,36,0.18);
    line-height: 1.5;
}
.rule-row:last-child { border-bottom: none; }
.rule-cond { color: var(--text-2); }
.rule-arrow { color: var(--amber-2); font-weight: 700; }
.rule-action { color: var(--amber-2); font-weight: 500; }

/* Summary */
.lesson-summary {
    background: var(--fill-purple);
    border-left: 3px solid var(--purple-2);
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.65;
    color: var(--text);
}

/* ============================================================
   Demo box
   ============================================================ */
.demo-box {
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 18px 24px 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.demo-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    display: flex;
    align-items: center;
    gap: 6px;
}
.demo-label::before {
    content: '';
    width: 3px;
    height: 14px;
    background: var(--cyan);
    border-radius: 2px;
}
.demo-hint {
    font-size: 10.5px;
    color: var(--text-3);
    font-weight: 400;
    margin-left: 4px;
    text-transform: none;
    letter-spacing: 0;
}
#demoCanvas {
    width: 100%;
    height: 260px;
    background: #000;
    border-radius: 9px;
    border: 1px solid var(--border-2);
    display: block;
    cursor: grab;
    user-select: none;
}
#demoCanvas:active { cursor: grabbing; }
.demo-views { display: flex; gap: 5px; margin-top: 2px; }
.demo-views button {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: 11.5px;
    font-weight: 500;
    padding: 7px 0;
    border-radius: 7px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.demo-views button:hover {
    background: var(--surface-3);
    color: var(--cyan-2);
    border-color: rgba(34,211,238,0.4);
}

/* ============================================================
   Live-feedback rail (bottom of right panel)
   ============================================================ */
#feedbackList {
    padding: 0 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
#feedbackList:empty { padding: 0; }
.feedback-item {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    background: var(--surface-2);
    border-left: 3px solid var(--green-2);
}
.feedback-item.warning { border-left-color: var(--amber-2); }
.feedback-item.error   { border-left-color: var(--red-2); }

.score {
    margin: 12px 0 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-2);
    background: var(--surface-2);
    padding: 16px 18px;
    border-radius: 0 0 14px 14px;
    border-top: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
}
#score {
    font-size: 38px;
    font-weight: 800;
    color: var(--green-2);
    margin: 0 6px;
    transition: color 0.3s;
    letter-spacing: -0.02em;
}
.score-max { color: var(--text-3); font-weight: 500; font-size: 14px; }

/* ============================================================
   Footer / action buttons
   ============================================================ */
footer {
    display: flex;
    justify-content: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    padding: 16px;
    border-radius: 14px;
    box-shadow: var(--shadow-1);
}
footer button {
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-2);
    border-radius: 9px;
    cursor: pointer;
    background: var(--surface-2);
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
    letter-spacing: 0.01em;
}
footer button:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--cyan);
    transform: translateY(-1px);
}
footer button:disabled { opacity: 0.4; cursor: not-allowed; }

#startBtn {
    background: linear-gradient(180deg, var(--cyan-2), var(--cyan));
    color: #04111c;
    border-color: var(--cyan);
    font-weight: 700;
}
#startBtn:hover:not(:disabled) {
    background: linear-gradient(180deg, #67e8f9, var(--cyan-2));
    box-shadow: var(--glow-cyan);
}

#recordBtn.recording {
    background: linear-gradient(180deg, var(--red-2), var(--red));
    color: #fff;
    border-color: var(--red);
    animation: recording-pulse 1s ease-in-out infinite;
}
@keyframes recording-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.6); }
    50%      { box-shadow: 0 0 0 10px rgba(239,68,68,0); }
}

/* ============================================================
   Modals — shared
   ============================================================ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,9,15,0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 16px;
    padding: 28px 30px;
    max-width: 540px;
    width: 92%;
    max-height: 92vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    box-shadow: var(--shadow-3);
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { transform: translateY(16px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-card h2 {
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    color: var(--text);
    letter-spacing: -0.01em;
}

/* Session summary */
.summary-content { display: flex; flex-direction: column; gap: 10px; }
.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 14px;
}
.summary-row .pose-name { font-weight: 600; color: var(--text); }
.summary-row .score-badge {
    font-size: 22px;
    font-weight: 700;
    color: var(--green-2);
}
.summary-row .score-delta { font-size: 12px; opacity: 0.85; }
.summary-row .score-delta.positive { color: var(--green-2); }
.summary-row .score-delta.negative { color: var(--red-2); }
.summary-row .score-delta.neutral  { color: var(--text-3); }
.summary-total {
    text-align: center;
    font-size: 13px;
    color: var(--text-3);
    padding-top: 4px;
}

.modal-close-btn {
    width: 100%;
    padding: 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.modal-close-btn:hover { background: var(--surface-3); border-color: var(--cyan); }

/* ============================================================
   Comparison modal
   ============================================================ */
.comparison-card { max-width: 760px; }
.comparison-skeletons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.comparison-side {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 11px;
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.comparison-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--cyan-2);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.comparison-side canvas {
    width: 100%;
    height: 320px;
    background: #000;
    border-radius: 8px;
    border: 1px solid var(--border-2);
    display: block;
    cursor: grab;
    user-select: none;
}
.comparison-side canvas:active { cursor: grabbing; }
.comparison-views {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
}
.comparison-views button {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 7px;
    cursor: pointer;
}
.comparison-views button:hover { background: var(--surface-3); color: var(--cyan-2); border-color: var(--cyan); }
.comparison-hint { font-size: 11px; color: var(--text-3); margin-left: auto; }

.angle-diff-list { display: flex; flex-direction: column; gap: 6px; max-height: 240px; overflow-y: auto; }
.angle-diff-row {
    display: grid;
    grid-template-columns: 110px 70px 70px auto;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green-2);
    border-radius: 8px;
    font-size: 13px;
}
.angle-diff-row.warn { border-left-color: var(--amber-2); background: var(--fill-amber); }
.angle-diff-row.bad  { border-left-color: var(--red-2);   background: var(--fill-red); }
.angle-diff-row .name { font-weight: 600; }
.angle-diff-row .vals { font-family: ui-monospace, monospace; color: var(--text-2); font-size: 12px; }
.angle-diff-row .delta { font-weight: 700; font-family: ui-monospace, monospace; }
.angle-diff-row.bad  .delta { color: var(--red-2); }
.angle-diff-row.warn .delta { color: var(--amber-2); }
.angle-diff-row.good .delta { color: var(--green-2); }
.angle-diff-row .advice { font-size: 12px; color: var(--text-2); }

/* ============================================================
   Recognition modal — reused styling
   ============================================================ */
.recognition-card { max-width: 800px; }
.recognition-stats { display: flex; flex-wrap: wrap; gap: 8px; }
.stat-pill {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 11px;
    padding: 9px 14px;
    font-size: 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    min-width: 80px;
}
.stat-pill .count { font-weight: 700; font-size: 22px; color: var(--cyan-2); line-height: 1; }
.stat-pill.total { background: var(--fill-green); border-color: rgba(52,211,153,0.4); }
.stat-pill.total .count { color: var(--green-2); }
.stat-pill .label { color: var(--text-2); }

.recognition-timeline {
    height: 56px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 9px;
    position: relative;
    overflow: hidden;
}
.timeline-rep {
    position: absolute;
    top: 8px;
    bottom: 22px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 10px;
    color: #fff;
    padding: 2px 4px;
    overflow: hidden;
    white-space: nowrap;
    transition: filter 0.15s;
}
.timeline-rep:hover { filter: brightness(1.3); }
.timeline-rep.low-conf { opacity: 0.5; border: 1px dashed rgba(255,255,255,0.6); }
.timeline-axis {
    position: absolute;
    bottom: 5px; left: 0; right: 0;
    height: 14px;
    font-size: 10px;
    color: var(--text-3);
    display: flex;
    justify-content: space-between;
    padding: 0 8px;
}
.recognition-rep-list {
    max-height: 240px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.rep-row {
    display: grid;
    grid-template-columns: 60px 1fr 90px 60px;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--green-2);
    border-radius: 8px;
    font-size: 13px;
}
.rep-row.warn  { border-left-color: var(--amber-2); }
.rep-row.bad   { border-left-color: var(--red-2); opacity: 0.75; }
.rep-row .rep-time   { font-family: ui-monospace, monospace; color: var(--text-3); font-size: 12px; }
.rep-row .rep-pose   { font-weight: 600; }
.rep-row .rep-runnerup { font-size: 11px; color: var(--text-3); }
.rep-row .rep-conf   { font-family: ui-monospace, monospace; font-size: 12px; }
.rep-row .rep-conf.high { color: var(--green-2); }
.rep-row .rep-conf.med  { color: var(--amber-2); }
.rep-row .rep-conf.low  { color: var(--red-2); }
.rep-row .rep-duration { text-align: right; color: var(--text-3); font-size: 11px; }

/* ============================================================
   Drill modal — NEW
   ============================================================ */
.drill-card-modal { max-width: 540px; }
.drill-modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 14px;
    background: var(--fill-green);
    color: var(--green-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    margin: 0 auto;
}
.drill-modal-name {
    text-align: center;
    font-size: 22px;
    font-weight: 700;
    color: var(--text);
    margin-top: 4px;
}
.drill-modal-pose {
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.drill-modal-desc {
    background: var(--surface-2);
    border-left: 3px solid var(--green-2);
    border-radius: 9px;
    padding: 14px 16px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text);
}
.drill-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.drill-step {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 14px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    font-size: 13px;
    line-height: 1.5;
}
.drill-step-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--fill-cyan);
    color: var(--cyan-2);
    font-weight: 700;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.drill-action-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.drill-start-btn {
    padding: 14px;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    background: linear-gradient(180deg, var(--green-2), var(--green));
    color: #04111c;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.drill-start-btn:hover { filter: brightness(1.1); transform: translateY(-1px); }
.drill-cancel-btn {
    padding: 14px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-2);
    border-radius: 10px;
    background: var(--surface-2);
    color: var(--text-2);
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.drill-cancel-btn:hover { background: var(--surface-3); border-color: var(--cyan); }

.drill-soon {
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    padding: 6px 0;
    background: var(--surface-2);
    border-radius: 7px;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 980px) {
    main { grid-template-columns: 1fr; }
    header { flex-direction: column; gap: 12px; align-items: stretch; }
    .controls { flex-wrap: wrap; }
}
@media (max-width: 600px) {
    .container { padding: 14px; }
    h1 { font-size: 18px; }
    .lesson-title { font-size: 19px; }
    footer { flex-wrap: wrap; }
    footer button { flex: 1; min-width: 110px; padding: 11px 12px; }
}

/* ============================================================
   ============================================================
   PHASE 1 REDESIGN — 5-tab page system (BladeInsight)
   Overrides old single-page layout. Anything below wins.
   ============================================================
   ============================================================ */

/* Reset body padding for full-bleed app shell */
body { padding: 0; }

/* ---- App header (top bar with brand + tabs) ---- */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--surface);
    border: none;
    border-radius: 0;
    border-bottom: 1px solid var(--border);
    padding: 14px 28px;
    box-shadow: var(--shadow-1);
    position: sticky;
    top: 0;
    z-index: 50;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.brand-logo {
    font-size: 28px;
    line-height: 1;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--text);
    line-height: 1.1;
}
.brand-tag {
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 0.04em;
}

.tab-nav {
    display: flex;
    gap: 4px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 4px;
}
.tab-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    padding: 9px 18px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.15s, color 0.15s;
}
.tab-btn:hover {
    background: var(--surface-2);
    color: var(--text);
}
.tab-btn.active {
    background: linear-gradient(180deg, var(--cyan-2), var(--cyan));
    color: #04111c;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(34,211,238,0.3);
}

/* ---- Page container & system ---- */
.page-container {
    max-width: 1480px;
    margin: 0 auto;
    padding: 24px 28px 40px;
}
.page { display: none; }
.page.active { display: block; animation: pageFade 0.2s ease; }
@keyframes pageFade {
    from { opacity: 0; transform: translateY(4px); }
    to   { opacity: 1; transform: translateY(0); }
}
.page > h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 18px;
    letter-spacing: -0.01em;
}
.page h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 12px;
}

/* Card primitive */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-1);
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}
.card-header h3 { margin: 0; }
.card-meta { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.06em; }
.card-link {
    font-size: 12px;
    color: var(--cyan-2);
    text-decoration: none;
    cursor: pointer;
}
.card-link:hover { color: var(--cyan); }

/* CTAs */
.cta-primary {
    background: linear-gradient(180deg, var(--cyan-2), var(--cyan));
    color: #04111c;
    font-size: 14px;
    font-weight: 700;
    border: none;
    border-radius: 10px;
    padding: 12px 24px;
    cursor: pointer;
    letter-spacing: 0.01em;
    transition: filter 0.15s, transform 0.15s;
}
.cta-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.cta-primary.cta-full { width: 100%; }
.cta-secondary {
    background: var(--surface-2);
    color: var(--text);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}
.cta-secondary:hover { background: var(--surface-3); border-color: var(--cyan); }

/* ============================================================
   首页 — Home
   ============================================================ */
.home-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 24px;
    gap: 24px;
    flex-wrap: wrap;
}
.greeting {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
}
.greeting span { color: var(--cyan-2); }
.hero-sub {
    font-size: 14px;
    color: var(--text-2);
    margin-top: 6px;
}
.stage-pill {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 14px 18px;
    min-width: 280px;
}
.stage-pill-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.stage-pill-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--cyan-2);
    margin-bottom: 8px;
}
.stage-pill-progress { display: flex; align-items: center; gap: 10px; }
.progress-bar {
    flex: 1;
    height: 6px;
    background: var(--bg);
    border-radius: 3px;
    overflow: hidden;
}
.progress-bar > span {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
    border-radius: 3px;
}
.progress-text {
    font-size: 11px;
    color: var(--text-3);
    white-space: nowrap;
}

.home-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    grid-template-rows: auto auto;
    gap: 20px;
}
.today-card { grid-row: span 2; }

.task-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    counter-reset: tasknum;
}
.task-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 14px 12px 44px;
    position: relative;
    counter-increment: tasknum;
}
.task-list li::before {
    content: counter(tasknum);
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--fill-cyan);
    color: var(--cyan-2);
    font-size: 12px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.task-pose { font-size: 13px; font-weight: 600; }
.task-meta { font-size: 11px; color: var(--text-3); font-family: ui-monospace, monospace; }

.today-cta-row {
    display: flex;
    gap: 10px;
}
.today-cta-row .cta-primary { flex: 1; }
.today-tip {
    background: var(--fill-amber);
    border-left: 3px solid var(--amber-2);
    border-radius: 7px;
    padding: 10px 14px;
    font-size: 12.5px;
    color: var(--text);
    line-height: 1.5;
}

.week-stats { display: flex; flex-direction: column; gap: 10px; }
.ws-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 7px;
    font-size: 13px;
}
.ws-label { color: var(--text-2); }
.ws-value { font-weight: 700; color: var(--text); font-family: ui-monospace, monospace; }

.home-recent-list { display: flex; flex-direction: column; gap: 6px; }
.recent-item {
    display: grid;
    grid-template-columns: 60px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    background: var(--surface-2);
    border-left: 3px solid var(--cyan);
    border-radius: 7px;
    font-size: 12px;
}
.recent-item .ri-date { color: var(--text-3); font-family: ui-monospace, monospace; font-size: 11px; }
.recent-item .ri-pose { font-weight: 600; }
.recent-item .ri-score { color: var(--green-2); font-weight: 700; font-family: ui-monospace, monospace; }
.recent-empty {
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    padding: 18px;
}

/* ============================================================
   课程页 — Courses
   ============================================================ */
.courses-layout {
    display: grid;
    grid-template-columns: 220px minmax(280px, 1fr) minmax(360px, 1.4fr);
    gap: 18px;
}

.stage-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.stage-nav-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 700;
    padding: 4px 8px 12px;
}
.stage-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s, background 0.15s, transform 0.15s;
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: var(--text);
}
.stage-item:hover {
    background: var(--surface-2);
    border-left-color: var(--cyan);
    transform: translateX(2px);
}
.stage-item.active {
    background: var(--surface-2);
    border-color: var(--cyan);
    border-left-color: var(--cyan-2);
    border-left-width: 3px;
}
.stage-item.locked { opacity: 0.45; cursor: not-allowed; }
.stage-item.locked:hover { transform: none; border-left-color: transparent; }
.stage-num {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
}
.stage-item.active .stage-num { color: var(--cyan-2); }
.stage-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
}
.stage-meta {
    font-size: 11px;
    color: var(--text-3);
}

.course-list-header {
    margin-bottom: 14px;
}
.course-list-header h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 4px;
}
.stage-desc {
    font-size: 13px;
    color: var(--text-2);
}

.course-cards { display: flex; flex-direction: column; gap: 8px; }
.course-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 3px solid transparent;
    border-radius: 10px;
    padding: 14px 16px;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    display: flex;
    align-items: center;
    gap: 12px;
}
.course-card:hover {
    background: var(--surface-2);
    border-left-color: var(--cyan);
}
.course-card.active {
    background: var(--surface-2);
    border-left-color: var(--cyan-2);
    border-color: rgba(34,211,238,0.4);
}
.course-card-icon {
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--fill-cyan);
    color: var(--cyan-2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.course-card-body { flex: 1; min-width: 0; }
.course-card-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.course-card-en {
    font-size: 11px;
    color: var(--text-3);
    font-style: italic;
}
.course-card-arrow {
    color: var(--text-3);
    font-size: 18px;
}
.course-card.active .course-card-arrow { color: var(--cyan-2); }

.lesson-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 20px;
    box-shadow: var(--shadow-1);
}
/* Override tipsBox padding inside lesson-detail (it's no longer a panel) */
.lesson-detail #tipsBox {
    padding: 0;
    background: transparent;
    border: none;
    max-height: none;
}
/* Demo box inside lesson-detail */
.lesson-detail .demo-box {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 14px;
    border-top: 1px solid var(--border-2);
    margin-top: 4px;
}

/* ============================================================
   记录页 — Records
   ============================================================ */
.records-header { margin-bottom: 24px; }
.records-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.rec-stat {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px 18px;
    text-align: center;
}
.rec-stat-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--cyan-2);
    line-height: 1.1;
    letter-spacing: -0.02em;
    font-family: ui-monospace, monospace;
}
.rec-stat-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 4px;
}

.records-section { margin-bottom: 28px; }
.week-log-list { display: flex; flex-direction: column; gap: 8px; }
.log-day {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
}
.log-day-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--border-2);
    margin-bottom: 8px;
}
.log-day-date { font-size: 13px; font-weight: 600; }
.log-day-summary { font-size: 11px; color: var(--text-3); }
.log-day-poses {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.log-pose-pill {
    background: var(--surface-2);
    border-left: 3px solid var(--cyan);
    border-radius: 7px;
    padding: 6px 10px;
    font-size: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}
.log-pose-pill .lp-name { font-weight: 600; }
.log-pose-pill .lp-stats {
    font-family: ui-monospace, monospace;
    color: var(--text-2);
    font-size: 11px;
}

.pose-progress-list { display: flex; flex-direction: column; gap: 8px; }
.pose-progress-row {
    display: grid;
    grid-template-columns: 1fr 80px 80px 1fr;
    gap: 12px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 12px 16px;
    font-size: 13px;
}
.pp-name { font-weight: 600; }
.pp-best { font-family: ui-monospace, monospace; color: var(--green-2); font-weight: 700; }
.pp-count { font-family: ui-monospace, monospace; color: var(--text-2); }
.pp-bar-wrap { background: var(--bg); height: 6px; border-radius: 3px; overflow: hidden; }
.pp-bar-fill { height: 100%; background: linear-gradient(90deg, var(--cyan), var(--green-2)); border-radius: 3px; }

.empty-state {
    text-align: center;
    padding: 40px 20px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 12px;
}
.empty-icon { font-size: 36px; margin-bottom: 8px; opacity: 0.6; }
.empty-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.empty-sub { font-size: 12px; color: var(--text-3); margin-bottom: 16px; }
.empty-state-text {
    font-size: 12.5px;
    color: var(--text-3);
    text-align: center;
    padding: 14px 0;
    line-height: 1.6;
}

/* ============================================================
   视频页 — Videos
   ============================================================ */
.videos-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    gap: 16px;
    flex-wrap: wrap;
}
.vm-tabs {
    display: flex;
    gap: 4px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 4px;
}
.vm-tab {
    background: transparent;
    border: none;
    color: var(--text-2);
    font-size: 13px;
    font-weight: 500;
    padding: 8px 18px;
    border-radius: 7px;
    cursor: pointer;
}
.vm-tab.active {
    background: var(--surface-3);
    color: var(--cyan-2);
    font-weight: 700;
}
.vm-pose-selector { display: flex; align-items: center; gap: 8px; }
.vm-pose-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.video-workspace {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}
.live-feedback-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: 100%;
}
.lfc-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.video-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px;
    flex-wrap: wrap;
}
.action-btn {
    padding: 11px 28px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border-2);
    border-radius: 9px;
    cursor: pointer;
    background: var(--surface-2);
    color: var(--text);
    transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.action-btn:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--cyan);
    transform: translateY(-1px);
}
.action-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.action-btn.primary {
    background: linear-gradient(180deg, var(--cyan-2), var(--cyan));
    color: #04111c;
    border-color: var(--cyan);
    font-weight: 700;
}
.action-btn.primary:hover:not(:disabled) {
    background: linear-gradient(180deg, #67e8f9, var(--cyan-2));
    box-shadow: var(--glow-cyan);
}

.upload-btn-cta {
    padding: 11px 22px;
    font-size: 14px;
    font-weight: 600;
    border: 1px dashed var(--cyan);
    border-radius: 9px;
    cursor: pointer;
    background: var(--fill-cyan);
    color: var(--cyan-2);
    transition: background 0.15s;
}
.upload-btn-cta:hover { background: rgba(34,211,238,0.18); }

/* ============================================================
   数据页 — Data
   ============================================================ */
.data-header { margin-bottom: 18px; }
.data-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 18px;
    text-align: center;
}
.stat-num {
    font-size: 30px;
    font-weight: 800;
    color: var(--cyan-2);
    line-height: 1.1;
    font-family: ui-monospace, monospace;
    letter-spacing: -0.02em;
}
.stat-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 6px;
}

.chart-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 22px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-1);
}
.chart-card h3 {
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.chart-card.placeholder { opacity: 0.7; }
.phase-tag {
    font-size: 10px;
    background: var(--fill-purple);
    color: var(--purple-2);
    padding: 2px 8px;
    border-radius: 9px;
    font-weight: 600;
    text-transform: none;
    letter-spacing: 0;
}

.pose-stats-table { display: flex; flex-direction: column; gap: 6px; }
.pose-stats-row {
    display: grid;
    grid-template-columns: 2fr 80px 80px 80px;
    gap: 12px;
    align-items: center;
    padding: 10px 14px;
    background: var(--surface-2);
    border-radius: 8px;
    font-size: 13px;
}
.pose-stats-row.header {
    background: transparent;
    color: var(--text-3);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 600;
    padding: 4px 14px;
}
.pose-stats-row .ps-name { font-weight: 600; }
.pose-stats-row .ps-num { font-family: ui-monospace, monospace; text-align: right; color: var(--text-2); }
.pose-stats-row .ps-best { color: var(--green-2); font-weight: 700; }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1100px) {
    .courses-layout { grid-template-columns: 1fr; gap: 16px; }
    .stage-nav { flex-direction: row; flex-wrap: wrap; }
    .stage-item { flex: 1 1 180px; }
    .home-grid { grid-template-columns: 1fr; }
    .today-card { grid-row: auto; }
    .video-workspace { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
    .app-header {
        flex-direction: column;
        gap: 12px;
        padding: 12px;
    }
    .tab-nav { width: 100%; justify-content: space-between; flex-wrap: wrap; }
    .tab-btn { padding: 8px 10px; flex: 1; justify-content: center; }
    .tab-btn span { display: none; }
    .page-container { padding: 16px; }
    .greeting { font-size: 24px; }
    .stage-pill { width: 100%; }
}

/* ============================================================
   ============================================================
   PHASE 2 VISUAL POLISH — sharper hierarchy, more delight
   ============================================================
   ============================================================ */

/* ---- Refined design tokens ---- */
:root {
    --gold:      #f5a623;
    --gold-2:    #ffc857;
    --magenta:   #ec4899;
    --magenta-2: #f472b6;
    /* Stage accents — each stage gets a unique color for visual variety */
    --s1: #34d399;  /* Stage 1: green (foundation) */
    --s2: #22d3ee;  /* Stage 2: cyan (lunges - signature)*/
    --s3: #a78bfa;  /* Stage 3: purple (advanced) */
    --s4: #fbbf24;  /* Stage 4: amber */
    --s5: #f472b6;  /* Stage 5: magenta */
}

/* ---- Hero refresh ---- */
.home-hero {
    background: linear-gradient(135deg,
        rgba(34,211,238,0.06) 0%,
        rgba(167,139,250,0.06) 50%,
        rgba(244,114,182,0.04) 100%);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 28px 32px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}
.home-hero::before {
    content: '🤺';
    position: absolute;
    right: -20px;
    top: -10px;
    font-size: 180px;
    opacity: 0.04;
    transform: rotate(-15deg);
    pointer-events: none;
}
.greeting {
    font-size: 38px;
    font-weight: 800;
    letter-spacing: -0.025em;
    background: linear-gradient(90deg, var(--text) 0%, var(--cyan-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-sub {
    font-size: 15px;
    color: var(--text-2);
    margin-top: 8px;
    letter-spacing: 0.01em;
}

/* ---- Tab nav slide indicator ---- */
.tab-nav { position: relative; }
.tab-btn {
    position: relative;
    z-index: 1;
    transition: color 0.2s;
}
.tab-btn:not(.active) {
    background: transparent !important;
    color: var(--text-2);
    box-shadow: none;
}
.tab-btn:not(.active):hover { color: var(--text); }

/* ---- Card hover lift ---- */
.card {
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}
.card:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: var(--border-2);
}

/* ---- Today's task: more visual ---- */
.today-card {
    background: linear-gradient(180deg,
        var(--surface) 0%,
        rgba(34,211,238,0.04) 100%);
    border: 1px solid rgba(34,211,238,0.25);
}
.today-card .card-header h3 {
    font-size: 16px;
    color: var(--cyan-2);
    text-transform: none;
    letter-spacing: -0.01em;
}

/* Task list with icons + interactivity */
.task-list li {
    transition: background 0.15s, border-left-color 0.15s, transform 0.15s;
    border-left: 3px solid transparent;
    cursor: pointer;
}
.task-list li:hover {
    background: var(--surface-3);
    border-left-color: var(--cyan-2);
    transform: translateX(2px);
}
.task-list li.completed {
    opacity: 0.55;
    text-decoration: line-through;
}
.task-list li.completed::before {
    content: '✓';
    background: var(--fill-green);
    color: var(--green-2);
}

/* ---- Stat cards with mini-trend ---- */
.stat-card, .rec-stat {
    position: relative;
    overflow: hidden;
    transition: transform 0.2s, border-color 0.2s;
}
.stat-card::after, .rec-stat::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--cyan), var(--cyan-2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s;
}
.stat-card:hover::after, .rec-stat:hover::after { transform: scaleX(1); }
.stat-card:hover, .rec-stat:hover {
    transform: translateY(-2px);
    border-color: var(--cyan);
}
.stat-num, .rec-stat-num {
    font-size: 36px;
    background: linear-gradient(180deg, var(--text) 0%, var(--cyan-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Stage nav: per-stage colors ---- */
.stage-item[data-stage="1"]:not(.active) .stage-name { color: var(--s1); }
.stage-item[data-stage="2"]:not(.active) .stage-name { color: var(--s2); }
.stage-item[data-stage="3"]:not(.active) .stage-name { color: var(--s3); }
.stage-item[data-stage="4"] .stage-name { color: var(--s4); }
.stage-item[data-stage="5"] .stage-name { color: var(--s5); }
.stage-item[data-stage="1"].active { border-left-color: var(--s1); }
.stage-item[data-stage="2"].active { border-left-color: var(--s2); }
.stage-item[data-stage="3"].active { border-left-color: var(--s3); }
.stage-item[data-stage="4"].active { border-left-color: var(--s4); }
.stage-item[data-stage="5"].active { border-left-color: var(--s5); }

/* ---- Course cards: bigger, more tactile ---- */
.course-card {
    padding: 16px 18px;
    transition: transform 0.15s, border-left-color 0.15s, background 0.15s, border-color 0.15s;
    position: relative;
}
.course-card:hover {
    transform: translateX(4px);
}
.course-card-icon {
    width: 44px;
    height: 44px;
    background: linear-gradient(135deg, var(--fill-cyan), var(--fill-purple));
    color: var(--cyan-2);
    font-size: 20px;
    transition: transform 0.2s;
}
.course-card:hover .course-card-icon {
    transform: scale(1.05) rotate(-5deg);
}

/* ---- Recent items with timeline feel ---- */
.recent-item {
    transition: padding-left 0.15s, border-left-width 0.15s;
}
.recent-item:hover {
    padding-left: 16px;
    border-left-width: 5px;
}

/* ---- Greeting time-of-day adaptation ---- */
.greeting-time {
    font-size: 14px;
    color: var(--text-3);
    font-weight: 500;
    margin-bottom: 4px;
    letter-spacing: 0.02em;
}

/* ---- Phase 2: weekly report card ---- */
.weekly-report-card {
    background: linear-gradient(135deg,
        rgba(167,139,250,0.08),
        rgba(34,211,238,0.05));
    border: 1px solid rgba(167,139,250,0.3);
}
.weekly-report-card h3 { color: var(--purple-2); }
.report-section {
    background: var(--surface-2);
    border-radius: 9px;
    padding: 12px 14px;
    margin-bottom: 8px;
}
.report-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--purple-2);
    margin-bottom: 6px;
}
.report-section-body {
    font-size: 13px;
    line-height: 1.6;
    color: var(--text);
}
.report-section ul {
    list-style: none;
    padding: 0;
    margin: 4px 0 0;
}
.report-section li {
    font-size: 12.5px;
    line-height: 1.55;
    padding-left: 14px;
    position: relative;
    margin-top: 3px;
    color: var(--text-2);
}
.report-section li::before {
    content: '•';
    position: absolute;
    left: 0;
    color: var(--purple-2);
    font-weight: 700;
}

/* ---- Phase 2: radar chart container ---- */
.radar-card .chart-card-body {
    height: 320px;
    position: relative;
}
.radar-legend {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 14px;
    font-size: 11px;
    color: var(--text-3);
    justify-content: center;
}

/* ---- Sparkline trend bars ---- */
.trend-spark {
    display: flex;
    gap: 2px;
    align-items: flex-end;
    height: 24px;
    margin-top: 8px;
}
.trend-spark-bar {
    flex: 1;
    background: var(--cyan);
    opacity: 0.4;
    border-radius: 2px 2px 0 0;
    transition: opacity 0.15s;
    min-height: 3px;
}
.trend-spark-bar.recent { opacity: 1; }

/* ---- Animated counter on first render ---- */
@keyframes countUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.stat-num, .rec-stat-num, .stage-pill-name, .greeting {
    animation: countUp 0.4s ease-out;
}

/* ---- Empty states with more character ---- */
.empty-state, .empty-state-text {
    background: var(--surface);
    background-image:
        radial-gradient(circle at 50% 50%, rgba(34,211,238,0.04), transparent 60%);
}
.empty-icon {
    font-size: 48px;
    opacity: 0.7;
    margin-bottom: 12px;
    display: block;
}

/* ---- Subtle scroll polish ---- */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }

/* Weak-spot task highlight */
.task-list li.weak-spot {
    border-left-color: var(--amber-2);
    background: linear-gradient(90deg, var(--fill-amber), var(--surface-2) 30%);
}
.task-list li.weak-spot::before {
    background: var(--fill-amber);
    color: var(--amber-2);
}
.task-list li.weak-spot:hover { border-left-color: var(--gold-2); }

/* Radar chart card body shell */
.chart-card .chart-card-body {
    min-height: 240px;
}

/* ============================================================
   PHASE 2 — Rule-based check result display (comparison modal)
   ============================================================ */
.check-summary-bar {
    display: flex;
    align-items: center;
    gap: 18px;
    background: var(--surface-2);
    border-radius: 11px;
    padding: 16px 20px;
    margin-bottom: 14px;
}
.check-summary-text { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.check-score {
    font-size: 32px;
    font-weight: 800;
    line-height: 1;
    font-family: ui-monospace, monospace;
    letter-spacing: -0.02em;
}
.check-grade {
    font-size: 12px;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.check-progress {
    flex: 1;
    height: 14px;
    background: var(--bg);
    border-radius: 7px;
    overflow: hidden;
    display: flex;
}
.cp-segment.passed { background: var(--green); }
.cp-segment.failed { background: var(--red);   }

.check-section { margin-bottom: 16px; }
.check-section:last-child { margin-bottom: 0; }
.check-section-title {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 8px;
    padding-left: 4px;
}

.check-failed-list, .check-passed-list, .check-skipped-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.check-row.failed {
    display: grid;
    grid-template-columns: 32px 1fr;
    gap: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--red-2);
    border-radius: 9px;
    padding: 12px 14px;
}
.check-row.failed.medium { border-left-color: var(--amber-2); }
.check-row.failed.low    { border-left-color: var(--text-3);  }

.check-icon {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--fill-red);
    color: var(--red-2);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.check-row.failed.medium .check-icon {
    background: var(--fill-amber);
    color: var(--amber-2);
}
.check-row.failed.low .check-icon {
    background: rgba(100,116,139,0.2);
    color: var(--text-3);
}

.check-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.check-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.severity-tag {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.08em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--fill-red);
    color: var(--red-2);
    border: 1px solid rgba(248,113,113,0.4);
}
.severity-tag.medium { background: var(--fill-amber); color: var(--amber-2); border-color: rgba(251,191,36,0.4); }
.severity-tag.low    { background: rgba(100,116,139,0.18); color: var(--text-2); border-color: var(--border-2); }

.check-detail {
    display: flex;
    gap: 10px;
    font-size: 12px;
    flex-wrap: wrap;
    align-items: center;
    margin-top: 2px;
}
.check-actual {
    font-family: ui-monospace, monospace;
    color: var(--red-2);
    background: var(--fill-red);
    padding: 2px 8px;
    border-radius: 5px;
    font-weight: 600;
}
.check-row.failed.medium .check-actual { color: var(--amber-2); background: var(--fill-amber); }
.check-row.failed.low    .check-actual { color: var(--text-2);  background: rgba(100,116,139,0.15); }
.check-target {
    font-family: ui-monospace, monospace;
    color: var(--text-3);
    font-size: 11px;
}
.check-fail-msg {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.5;
    margin-top: 2px;
}
.check-fix {
    background: var(--fill-cyan);
    border-left: 2px solid var(--cyan-2);
    padding: 6px 10px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
    margin-top: 2px;
}

.check-row.passed.compact {
    display: grid;
    grid-template-columns: 24px 1fr auto;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    background: var(--fill-green);
    border-radius: 7px;
    font-size: 12.5px;
}
.check-icon-mini {
    color: var(--green-2);
    font-weight: 700;
    text-align: center;
}
.check-name-compact { color: var(--text); font-weight: 500; }
.check-value-mini {
    font-family: ui-monospace, monospace;
    color: var(--green-2);
    font-size: 11px;
    background: rgba(52,211,153,0.15);
    padding: 2px 7px;
    border-radius: 4px;
}

.check-row.skipped.compact {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 7px;
    font-size: 12px;
    color: var(--text-3);
    opacity: 0.7;
}
.check-skip-reason { font-size: 11px; font-style: italic; }

.check-footer {
    margin-top: 14px;
    padding: 10px 14px;
    background: var(--fill-cyan);
    border: 1px dashed rgba(34,211,238,0.4);
    border-radius: 8px;
    text-align: center;
    font-size: 12px;
    color: var(--text);
}

/* ============================================================
   PHASE 2 — Weakness card on home page
   ============================================================ */
.weakness-card {
    background: linear-gradient(135deg,
        rgba(251,191,36,0.08),
        rgba(248,113,113,0.05));
    border: 1px solid rgba(251,191,36,0.3);
}
.weakness-card .card-header h3 { color: var(--amber-2); }
.weakness-list { display: flex; flex-direction: column; gap: 8px; }
.weakness-item {
    background: var(--surface-2);
    border-left: 3px solid var(--amber-2);
    border-radius: 8px;
    padding: 10px 12px;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}
.weakness-item:hover { background: var(--surface-3); transform: translateX(2px); }
.weakness-item.high   { border-left-color: var(--red-2); }
.weakness-item.medium { border-left-color: var(--amber-2); }
.weakness-item.low    { border-left-color: var(--text-3); }
.weakness-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
}
.weakness-stats {
    font-size: 11px;
    color: var(--text-3);
    font-family: ui-monospace, monospace;
}
.weakness-fix {
    font-size: 11.5px;
    color: var(--text-2);
    line-height: 1.5;
    margin-top: 4px;
}
.weakness-empty {
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
    padding: 16px;
    background: var(--surface-2);
    border-radius: 8px;
}

/* ============================================================
   PHASE 3 — Onboarding overlay
   ============================================================ */
.onboard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(7,9,15,0.92);
    backdrop-filter: blur(12px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.3s ease;
}

.onboard-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 18px;
    padding: 36px 40px;
    max-width: 580px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-3);
    animation: slideUp 0.35s ease;
}
.onboard-card.report { max-width: 640px; }

.onboard-stage {
    font-size: 11px;
    font-weight: 700;
    color: var(--cyan-2);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 8px;
}

.onboard-card h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 14px;
    background: linear-gradient(180deg, var(--text), var(--cyan-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboard-lead {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text-2);
    margin-bottom: 22px;
}
.onboard-lead strong { color: var(--text); }

.onboard-pitch {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 28px;
}
.pitch-item {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--surface-2);
    border-radius: 11px;
    padding: 14px 16px;
}
.pitch-icon {
    font-size: 22px;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--fill-cyan);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.pitch-text {
    font-size: 14px;
    line-height: 1.5;
    color: var(--text);
}

.setup-tips {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
}
.setup-tip {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    background: var(--surface-2);
    border-radius: 10px;
    padding: 12px 14px;
}
.tip-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--cyan);
    color: #04111c;
    font-weight: 800;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.tip-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
}
.tip-desc {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.5;
}

.test-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 24px;
}
.test-meta-item {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 11px;
    padding: 14px;
    text-align: center;
}
.meta-label {
    font-size: 11px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}
.meta-value {
    font-size: 22px;
    font-weight: 800;
    color: var(--cyan-2);
    font-family: ui-monospace, monospace;
}

.onboard-actions {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.onboard-skip {
    flex: 0 0 auto;
    padding: 14px 22px;
    border: 1px solid var(--border-2);
    background: transparent;
    color: var(--text-2);
    font-size: 13px;
    border-radius: 11px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.onboard-skip:hover { background: var(--surface-2); color: var(--text); }
.onboard-primary {
    flex: 1;
    padding: 14px 24px;
    border: none;
    background: linear-gradient(180deg, var(--cyan-2), var(--cyan));
    color: #04111c;
    font-size: 15px;
    font-weight: 700;
    border-radius: 11px;
    cursor: pointer;
    transition: filter 0.15s, transform 0.15s;
}
.onboard-primary:hover { filter: brightness(1.1); transform: translateY(-1px); }
.onboard-primary.full { width: 100%; }

/* ---- Countdown overlay ---- */
.onboard-countdown {
    position: fixed;
    inset: 0;
    background: rgba(7,9,15,0.7);
    backdrop-filter: blur(6px);
    z-index: 999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    animation: fadeIn 0.2s ease;
}
.cd-num {
    font-size: 160px;
    font-weight: 900;
    color: var(--cyan-2);
    line-height: 1;
    letter-spacing: -0.04em;
    text-shadow: 0 0 60px rgba(34,211,238,0.5);
    animation: cdPop 1s ease-in-out infinite;
}
.cd-text {
    font-size: 18px;
    color: var(--text);
    margin-top: 16px;
    letter-spacing: 0.02em;
}
@keyframes cdPop {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.1); }
}

/* ---- Recording timer ---- */
.onboard-rec-timer {
    position: fixed;
    top: 24px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(239,68,68,0.95);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 998;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    animation: slideUp 0.3s ease;
}
.rec-icon {
    color: #fff;
    font-size: 18px;
    animation: blink 1s ease-in-out infinite;
}
@keyframes blink {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}
.rec-secs { font-family: ui-monospace, monospace; min-width: 1.6em; display: inline-block; }

/* ---- Report screen ---- */
.report-level-card {
    background: linear-gradient(135deg, var(--fill-cyan), var(--fill-purple));
    border: 1px solid rgba(34,211,238,0.35);
    border-radius: 14px;
    padding: 22px;
    text-align: center;
    margin-bottom: 22px;
}
.level-stars {
    font-size: 32px;
    color: var(--gold-2);
    letter-spacing: 0.1em;
    line-height: 1;
}
.level-name {
    font-size: 22px;
    font-weight: 800;
    margin-top: 8px;
    color: var(--text);
}
.level-detail {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 6px;
}

.onboard-card .report-section { margin-bottom: 20px; }
.onboard-card .report-section h3 {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
    color: var(--text);
}
.report-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.report-list li {
    background: var(--surface-2);
    border-radius: 9px;
    padding: 11px 14px;
    font-size: 13px;
    line-height: 1.55;
}
.report-list.strengths li {
    background: var(--fill-green);
    border-left: 3px solid var(--green-2);
    color: var(--text);
}
.report-list.weaknesses li {
    border-left: 3px solid var(--amber-2);
}
.report-list.weaknesses li.high { border-left-color: var(--red-2); background: var(--fill-red); }
.report-list.weaknesses li.medium { border-left-color: var(--amber-2); background: var(--fill-amber); }
.report-list.weaknesses li.low { border-left-color: var(--text-3); }
.report-list li.empty {
    background: var(--surface-2);
    color: var(--text-3);
    font-style: italic;
    text-align: center;
    border-left: none;
}
.w-name {
    font-weight: 600;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.w-sev {
    font-size: 9px;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 3px;
    background: rgba(248,113,113,0.2);
    color: var(--red-2);
    letter-spacing: 0.06em;
}
.w-fix {
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.55;
}

.plan-box {
    background: var(--surface-2);
    border-left: 3px solid var(--purple-2);
    border-radius: 9px;
    padding: 14px 16px;
    line-height: 1.7;
}
.plan-box p { margin: 0 0 8px; font-size: 13px; }
.plan-box p:last-child { margin-bottom: 0; }
.plan-box strong { color: var(--purple-2); }

/* Mobile */
@media (max-width: 600px) {
    .onboard-card { padding: 24px 22px; }
    .onboard-card h1 { font-size: 22px; }
    .test-meta { grid-template-columns: 1fr; }
    .cd-num { font-size: 100px; }
}

/* ============================================================
   Header: 新用户 reset button
   ============================================================ */
.header-action {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 9px 14px;
    border-radius: 9px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: 12px;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s;
}
.header-action:hover {
    background: var(--surface-3);
    color: var(--amber-2);
    border-color: var(--amber-2);
    transform: translateY(-1px);
}

/* New-user reset confirm modal — distinct from comparison/summary */
.reset-confirm-card {
    max-width: 420px;
    text-align: center;
}
.reset-confirm-card h2 {
    font-size: 22px;
    margin-bottom: 6px;
}
.reset-confirm-card .reset-warn {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
    margin-bottom: 16px;
}
.reset-clear-list {
    background: var(--surface-2);
    border: 1px dashed var(--border-2);
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 18px;
    text-align: left;
    list-style: none;
}
.reset-clear-list li {
    font-size: 12.5px;
    padding: 4px 0 4px 22px;
    position: relative;
    color: var(--text);
}
.reset-clear-list li::before {
    content: '🗑';
    position: absolute;
    left: 0;
    top: 4px;
    font-size: 12px;
}
.reset-actions { display: flex; gap: 10px; }
.reset-actions button { flex: 1; padding: 12px; font-size: 13px; font-weight: 600; border-radius: 9px; cursor: pointer; }
.reset-cancel-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
}
.reset-cancel-btn:hover { background: var(--surface-3); }
.reset-confirm-btn {
    background: linear-gradient(180deg, var(--amber-2), var(--amber));
    border: none;
    color: #1a1206;
    font-weight: 700;
}
.reset-confirm-btn:hover:not(:disabled) { filter: brightness(1.1); }
.reset-confirm-btn:disabled {
    background: var(--surface-2);
    color: var(--text-3);
    cursor: not-allowed;
    filter: none;
}
.reset-safety-note {
    background: var(--fill-green);
    border: 1px solid var(--green-2);
    border-left: 3px solid var(--green-2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text);
    margin: 12px 0;
}
.reset-typed-confirm {
    margin: 14px 0 16px;
}
.reset-typed-confirm label {
    display: block;
    font-size: 12px;
    color: var(--text-2);
    margin-bottom: 6px;
}
.reset-typed-confirm code {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 4px;
    padding: 1px 6px;
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--red-2);
}
.reset-typed-input {
    width: 100%;
    box-sizing: border-box;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    font-family: var(--font-mono);
    color: var(--text);
    outline: none;
}
.reset-typed-input:focus {
    border-color: var(--red-2);
}

/* Records page: import/export toolbar */
.records-section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 8px;
}
.records-tools {
    display: flex;
    gap: 6px;
}
.rec-tool-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.rec-tool-btn:hover:not(:disabled) {
    background: var(--surface-3);
    border-color: var(--steel);
}
.rec-tool-btn:disabled {
    opacity: 0.5;
    cursor: wait;
}

/* Toast */
.toast-msg {
    position: fixed;
    top: 84px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface);
    border: 1px solid var(--cyan);
    color: var(--cyan-2);
    padding: 12px 22px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    z-index: 999;
    box-shadow: var(--shadow-2);
    animation: toastIn 0.25s ease, toastOut 0.3s ease 1.7s forwards;
}
@keyframes toastIn  { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, -8px); } }

/* ============================================================
   Onboarding — rating + tactical screens
   ============================================================ */
.rating-block { margin-bottom: 20px; }
.rating-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: 0.01em;
}
.rating-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rating-options.weapons { grid-template-columns: 1fr 1fr 1fr; }
.rating-opt {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 12px 14px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s;
    color: var(--text);
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.rating-opt:hover {
    background: var(--surface-3);
    border-color: var(--cyan-2);
    transform: translateY(-1px);
}
.rating-opt.selected {
    background: var(--fill-cyan);
    border-color: var(--cyan-2);
    box-shadow: 0 0 0 2px rgba(34,211,238,0.2);
}
.rating-opt.small { padding: 10px 12px; }
.rating-opt.weapon { text-align: center; }
.opt-label {
    font-size: 14px;
    font-weight: 600;
}
.rating-opt.selected .opt-label { color: var(--cyan-2); }
.opt-hint {
    font-size: 11px;
    color: var(--text-3);
    line-height: 1.4;
}

.onboard-primary:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: none;
    transform: none;
}
.onboard-primary:disabled:hover { transform: none; filter: none; }

/* ============================================================
   Onboarding — recommended stage + training mix
   ============================================================ */
.recommended-stage {
    background: linear-gradient(135deg,
        rgba(34,211,238,0.12),
        rgba(167,139,250,0.08));
    border: 1px solid rgba(34,211,238,0.3);
    border-radius: 12px;
    padding: 18px 20px;
}
.stage-name-big {
    font-size: 20px;
    font-weight: 800;
    color: var(--cyan-2);
    letter-spacing: -0.01em;
    margin-bottom: 6px;
}
.stage-reason {
    font-size: 13px;
    color: var(--text-2);
    line-height: 1.6;
}

.training-mix-bar {
    display: flex;
    height: 56px;
    border-radius: 11px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    margin-bottom: 8px;
}
.training-mix-bar .mix-segment {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #04111c;
    font-weight: 700;
    padding: 4px;
    min-width: 40px;
    overflow: hidden;
}
.training-mix-bar .mix-label {
    font-size: 11px;
    letter-spacing: 0.04em;
    white-space: nowrap;
}
.training-mix-bar .mix-pct {
    font-size: 12px;
    font-family: ui-monospace, monospace;
    font-weight: 800;
    opacity: 0.85;
}
.training-mix-hint {
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    line-height: 1.5;
}

/* ════════════════════════════════════════════════════════════
   ════════════════════════════════════════════════════════════
   BLADEINSIGHT DESIGN SYSTEM v2 — Steel + Gold + Editorial
   This block OVERRIDES earlier tokens via CSS cascade.
   ════════════════════════════════════════════════════════════
   ════════════════════════════════════════════════════════════ */
:root {
    /* ---- Brand colors: Steel (剑刃) + Gold (奖牌) ---- */
    --cyan:        #3b82f6;          /* Steel — replaces old cyan */
    --cyan-2:      #60a5fa;          /* Steel light */
    --steel:       #3b82f6;
    --steel-2:     #60a5fa;
    --steel-3:     #93c5fd;
    --gold:        #f59e0b;
    --gold-2:      #fbbf24;
    --gold-3:      #fde68a;

    /* Update fills to match new steel */
    --fill-cyan:   rgba(96,165,250,0.10);
    --fill-steel:  rgba(96,165,250,0.10);
    --fill-gold:   rgba(251,191,36,0.10);
    --glow-cyan:   0 0 32px rgba(96,165,250,0.32);
    --glow-steel:  0 0 32px rgba(96,165,250,0.32);
    --glow-gold:   0 0 32px rgba(251,191,36,0.28);

    /* ---- Typography stack ---- */
    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --font-body:    'Geist', -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", system-ui, sans-serif;
    --font-mono:    'Geist Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

/* ---- Apply body font globally ---- */
html, body {
    font-family: var(--font-body);
    font-feature-settings: 'cv11', 'ss01';   /* Geist alt forms */
    background-image:
        radial-gradient(ellipse 80% 50% at 30% 0%, rgba(96,165,250,0.06), transparent 60%),
        radial-gradient(ellipse 60% 50% at 80% 100%, rgba(251,191,36,0.04), transparent 60%);
}

/* ---- Editorial display typography for hero / brand ---- */
.brand-name {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 22px;
    font-weight: 400;
    letter-spacing: -0.01em;
    background: linear-gradient(180deg, var(--text), var(--steel-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.brand-tag {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.greeting {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    font-size: 56px;
    letter-spacing: -0.025em;
    line-height: 1.05;
    background: linear-gradient(120deg, var(--text) 0%, var(--steel-2) 60%, var(--gold-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.onboard-card h1,
.modal-card h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.015em;
}

.lesson-title {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.015em;
    font-size: 26px;
    background: linear-gradient(180deg, var(--text), var(--steel-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stage-name-big {
    font-family: var(--font-display);
    font-style: italic;
    font-weight: 400;
    letter-spacing: -0.015em;
    font-size: 24px;
}

/* ---- Numbers use Geist Mono (tabular-nums) ---- */
.stat-num, .rec-stat-num, .check-score,
#score, .meta-value, .level-stars,
.weakness-stats, .pose-stats-row, .ws-value,
.cd-num {
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
}

/* ---- Layout: wider, more screen real estate ---- */
.page-container {
    display: block;                /* defensive: override any legacy grid rule */
    max-width: 1680px;
    padding: 28px 40px 48px;
    margin: 0 auto;                /* center horizontally */
}
@media (min-width: 1920px) {
    .page-container { max-width: 1820px; }
}
.app-header { padding: 16px 40px; }

/* Bigger video workspace on wide screens */
.video-workspace {
    grid-template-columns: minmax(0, 2.5fr) minmax(320px, 1fr);
}
.video-container { aspect-ratio: 16 / 9; }

/* Courses page wider */
.courses-layout {
    grid-template-columns: 240px minmax(320px, 1.1fr) minmax(420px, 1.5fr);
}

/* ---- Achievement / Pass states use Gold (was generic green) ---- */
.score-badge,
.summary-row .score-badge {
    color: var(--gold-2);
    font-family: var(--font-mono);
    font-feature-settings: 'tnum';
}
.level-stars { color: var(--gold-2); text-shadow: 0 0 24px rgba(251,191,36,0.5); }

/* Stat-num primary now uses steel→gold gradient for warmth */
.stat-num, .rec-stat-num {
    background: linear-gradient(180deg, var(--text) 0%, var(--steel-2) 50%, var(--gold-2) 110%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---- Blade-swipe animation on primary CTAs ---- */
.cta-primary, .action-btn.primary, #startBtn,
.drill-start-btn, .reset-confirm-btn, .onboard-primary,
.modal-close-btn {
    position: relative;
    overflow: hidden;
    isolation: isolate;
}
.cta-primary::after, .action-btn.primary::after, #startBtn::after,
.drill-start-btn::after, .onboard-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -120%;
    width: 60%;
    height: 100%;
    background: linear-gradient(110deg,
        transparent 0%,
        rgba(255,255,255,0.0) 35%,
        rgba(255,255,255,0.45) 50%,
        rgba(255,255,255,0.0) 65%,
        transparent 100%);
    transform: skewX(-18deg);
    transition: left 0.55s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    z-index: 1;
}
.cta-primary:hover::after, .action-btn.primary:hover::after, #startBtn:hover::after,
.drill-start-btn:hover::after, .onboard-primary:hover:not(:disabled)::after {
    left: 160%;
}
.cta-primary > *, .action-btn.primary > *, #startBtn > * { position: relative; z-index: 2; }

/* ---- Section title left-bar uses steel ---- */
.lesson-section-title::before,
.demo-label::before {
    background: linear-gradient(180deg, var(--steel-2), var(--gold-2));
    width: 3px;
    border-radius: 2px;
}

/* ---- Tab nav active uses steel gradient (was cyan) ---- */
.tab-btn.active {
    background: linear-gradient(180deg, var(--steel-2), var(--steel));
    color: #04111c;
    font-weight: 700;
    box-shadow: 0 2px 12px rgba(96,165,250,0.4);
}

/* ---- Hero refresh ---- */
.home-hero {
    background:
        linear-gradient(135deg, rgba(96,165,250,0.08) 0%, rgba(251,191,36,0.04) 100%),
        var(--surface);
    border: 1px solid rgba(96,165,250,0.2);
    padding: 36px 40px;
}
.home-hero::before { font-size: 220px; opacity: 0.045; }

/* ---- Stage pill uses steel ---- */
.stage-pill-name { color: var(--steel-2); }
.progress-bar > span {
    background: linear-gradient(90deg, var(--steel), var(--gold-2));
}

/* ---- Today card border ---- */
.today-card {
    background: linear-gradient(180deg, var(--surface) 0%, rgba(96,165,250,0.04) 100%);
    border: 1px solid rgba(96,165,250,0.25);
}
.today-card .card-header h3 { color: var(--steel-2); }

/* ---- Refined empty/recent typography ---- */
.recent-item .ri-score { color: var(--gold-2); font-family: var(--font-mono); }
.weakness-name, .drill-name, .tactic-name, .lesson-section-title {
    letter-spacing: 0.04em;
}

/* ---- Better focus rings (steel) ---- */
button:focus-visible, select:focus-visible,
input:focus-visible, .rating-opt:focus-visible {
    outline: 2px solid var(--steel-2);
    outline-offset: 2px;
}

/* ============================================================
   Videos page — practice-card (lesson context while practicing)
   ============================================================ */
.practice-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: var(--shadow-1);
}

.practice-header {
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.practice-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--steel-2);
    margin-bottom: 4px;
}
.practice-name {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 22px;
    line-height: 1.15;
    background: linear-gradient(180deg, var(--text), var(--steel-2));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.practice-en {
    font-size: 11px;
    color: var(--text-3);
    font-style: italic;
    margin-top: 2px;
}

.practice-demo {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.practice-demo-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.practice-demo-label .demo-hint {
    font-size: 10px;
    color: var(--text-3);
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
}
#demoCanvasVideo {
    width: 100%;
    background: #000;
    border: 1px solid var(--border-2);
    border-radius: 9px;
    cursor: grab;
    display: block;
    user-select: none;
}
#demoCanvasVideo:active { cursor: grabbing; }

.demo-views.compact {
    display: flex;
    gap: 4px;
}
.demo-views.compact button {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-size: 10px;
    font-weight: 600;
    padding: 5px 0;
    border-radius: 6px;
    cursor: pointer;
}
.demo-views.compact button:hover {
    background: var(--surface-3);
    color: var(--steel-2);
    border-color: var(--steel);
}

.practice-cues, .practice-mistakes {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.cue-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
}
.cue-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cue-list li {
    font-size: 12px;
    line-height: 1.5;
    padding: 7px 10px 7px 26px;
    position: relative;
    border-radius: 6px;
    background: var(--surface-2);
}
.cue-list li::before {
    position: absolute;
    left: 9px;
    top: 7px;
    font-weight: 700;
    font-size: 11px;
}
.cue-list.good li {
    background: var(--fill-green);
    border-left: 2px solid var(--green-2);
}
.cue-list.good li::before { content: '✓'; color: var(--green-2); }
.cue-list.bad li {
    background: var(--fill-red);
    border-left: 2px solid var(--red-2);
}
.cue-list.bad li::before { content: '✗'; color: var(--red-2); }
.cue-list li.empty {
    background: transparent;
    padding-left: 10px;
    color: var(--text-3);
    font-style: italic;
}
.cue-list li.empty::before { content: ''; }

/* Compact live-feedback within video side */
.video-side .live-feedback-card {
    padding: 14px 16px;
}
.video-side .lfc-header {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 10px;
}
.video-side .score {
    margin-top: 8px;
    padding: 12px 14px;
    border-radius: 9px;
    border-top: none;
    background: var(--surface-2);
}
.video-side #score { font-size: 32px; }

/* Make video-side scroll if content is tall */
.video-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding-right: 4px;
}
.video-side::-webkit-scrollbar { width: 6px; }

/* ============================================================
   Multi-rep summary (comparison modal — top of check list)
   ============================================================ */
.multi-rep-summary {
    background: linear-gradient(135deg,
        rgba(96,165,250,0.10),
        rgba(251,191,36,0.06));
    border: 1px solid rgba(96,165,250,0.3);
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.mrs-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 8px;
}
.mrs-header-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--steel-2);
    letter-spacing: 0.02em;
}
.mrs-header-stats {
    font-size: 11px;
    color: var(--text-2);
    font-family: var(--font-mono);
}
.mrs-header-stats b {
    color: var(--text);
    font-weight: 700;
}

.mrs-reps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
}
.mrs-rep {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mrs-rep.is-best {
    border-color: var(--gold-2);
    background: linear-gradient(135deg, var(--fill-gold), var(--surface-2));
    box-shadow: 0 0 0 1px rgba(251,191,36,0.35);
}
.mrs-rep-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    font-size: 11px;
}
.mrs-rep-label {
    color: var(--text-2);
    font-weight: 600;
}
.mrs-rep.is-best .mrs-rep-label { color: var(--gold-2); }
.mrs-tag-best {
    background: var(--gold-2);
    color: #1a1206;
    padding: 1px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-left: 4px;
}
.mrs-rep-score {
    font-family: var(--font-mono);
    font-weight: 700;
    color: var(--text);
    font-size: 13px;
}
.mrs-bar-track {
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: hidden;
}
.mrs-bar-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s;
}
.mrs-bar-fill.good { background: var(--green-2); }
.mrs-bar-fill.mid  { background: var(--amber-2); }
.mrs-bar-fill.low  { background: var(--red-2); }
.mrs-rep-meta {
    font-size: 10px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.mrs-invalid {
    color: var(--red-2);
    font-weight: 600;
}
.mrs-hint {
    font-size: 11px;
    color: var(--text-3);
    text-align: center;
    font-style: italic;
}

/* ============================================================
   Onboarding report — reps card
   ============================================================ */
.report-reps-card {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 10px;
}
.reps-stat {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 9px;
    padding: 12px;
    text-align: center;
}
.reps-stat-num {
    font-family: var(--font-mono);
    font-size: 22px;
    font-weight: 800;
    color: var(--steel-2);
    line-height: 1;
}
.reps-stat-label {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 4px;
    letter-spacing: 0.04em;
}
.reps-warn {
    margin-top: 10px;
    padding: 10px 12px;
    background: var(--fill-amber);
    border-left: 3px solid var(--amber-2);
    border-radius: 7px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.5;
}

/* ============================================================
   Recordings list (record page) + Replay modal
   ============================================================ */
.recordings-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rec-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 12px 16px;
    cursor: pointer;
    transition: border-color 0.15s, transform 0.15s, background 0.15s;
}
.rec-card:hover {
    background: var(--surface-2);
    border-color: var(--steel);
    transform: translateX(3px);
}
.rec-card-thumb {
    width: 64px;
    height: 56px;
    background: linear-gradient(135deg, var(--fill-cyan), var(--fill-gold));
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
}
.rec-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.rec-card-pose { font-size: 15px; font-weight: 700; color: var(--text); }
.rec-card-meta {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.rec-card-meta .rec-score { font-weight: 700; }
.rec-card-meta .rec-score.good { color: var(--green-2); }
.rec-card-meta .rec-score.mid  { color: var(--amber-2); }
.rec-card-meta .rec-score.low  { color: var(--red-2); }
.rec-card-play {
    background: linear-gradient(180deg, var(--steel-2), var(--steel));
    color: #04111c;
    border: none;
    padding: 9px 18px;
    border-radius: 9px;
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    pointer-events: none; /* whole card is clickable */
}

/* ---- Replay modal ---- */
.replay-card {
    max-width: 1340px;
    width: 96%;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
    /* Override modal-card's whole-card scroll — we want per-column scroll inside the split */
    overflow: hidden;
}
@media (max-width: 980px) {
    /* On narrow screens, restore single-card scroll */
    .replay-card { overflow-y: auto; }
}

/* Two-column split: video on the left, analysis on the right */
.replay-split {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 16px;
    margin-top: 12px;
    flex: 1 1 auto;
    min-height: 0;            /* allow children to scroll */
    overflow: hidden;
}
.replay-split-left {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    min-height: 0;
    overflow-y: auto;
    padding-right: 4px;
}
.replay-split-right {
    overflow-y: auto;
    padding-right: 4px;
    min-width: 0;
}
@media (max-width: 980px) {
    .replay-split {
        grid-template-columns: 1fr;
        overflow: visible;
    }
    .replay-split-right { overflow-y: visible; }
}
.replay-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.replay-header h2 {
    font-family: var(--font-display);
    font-style: italic;
    text-align: left;
    font-size: 26px;
}
.replay-meta {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 4px;
    font-family: var(--font-mono);
}
.replay-delete-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--red-2);
    width: 36px;
    height: 36px;
    border-radius: 9px;
    cursor: pointer;
    font-size: 16px;
}
.replay-delete-btn:hover { background: var(--fill-red); border-color: var(--red-2); }

.replay-video-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    position: relative;
    width: 100%;
    min-height: 360px;          /* fallback for aspect-ratio collapse */
    flex-shrink: 0;             /* don't squash in column flex */
}
#replayVideo {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
    background: #000;
    position: absolute;
    inset: 0;
}
.replay-no-video {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    color: var(--amber-2);
    background: var(--surface-2);
    font-size: 13px;
    padding: 20px;
    text-align: center;
}

.replay-controls {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    background: var(--surface-2);
    border-radius: 10px;
}
.replay-ctl-btn {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.replay-ctl-btn:hover {
    background: var(--surface-3);
    border-color: var(--steel);
}
.replay-ctl-btn.peak {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}
.replay-ctl-btn.peak:hover {
    background: var(--red-2);
    color: #fff;
    border-color: var(--red-2);
}

/* ---- Timeline scrubber ---- */
.replay-timeline {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: 10px;
}
.replay-time-current,
.replay-time-total {
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-2);
    flex-shrink: 0;
    min-width: 38px;
}
.replay-time-current { color: var(--steel); font-weight: 600; }
.replay-scrubber-wrap {
    position: relative;
    flex: 1 1 auto;
    height: 22px;
    display: flex;
    align-items: center;
}
.replay-scrubber {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border-2);
    border-radius: 3px;
    outline: none;
    cursor: pointer;
}
.replay-scrubber::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    background: var(--steel);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--surface);
    box-shadow: 0 0 0 1px var(--steel);
}
.replay-scrubber::-moz-range-thumb {
    width: 14px;
    height: 14px;
    background: var(--steel);
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid var(--surface);
}
.replay-peak-tick {
    position: absolute;
    top: 2px;
    width: 3px;
    height: 18px;
    background: var(--red-2);
    border-radius: 2px;
    pointer-events: none;
    box-shadow: 0 0 0 1px rgba(7,9,15,0.7);
    transform: translateX(-50%);
    z-index: 2;
}
/* Per-failure ticks (small amber bars below the slider track) */
.replay-issue-ticks {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.replay-issue-tick {
    position: absolute;
    top: 16px;
    width: 6px;
    height: 8px;
    background: var(--amber-2);
    border-radius: 2px;
    transform: translateX(-50%);
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 0 0 1px rgba(7,9,15,0.6);
    z-index: 1;
    transition: transform 0.1s, height 0.1s;
}
.replay-issue-tick.high   { background: var(--red-2); }
.replay-issue-tick.medium { background: var(--amber-2); }
.replay-issue-tick.low    { background: var(--text-3); }
.replay-issue-tick:hover  { transform: translateX(-50%) scaleY(1.4); }

/* ---- Reference skeleton panel (coach's correct pose) ---- */
.replay-ref-panel {
    background: var(--surface-2);
    border: 1px solid var(--green-2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 12px;
}
.replay-ref-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--green-2);
    margin-bottom: 8px;
}
.replay-ref-sub {
    color: var(--text-3);
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    font-size: 10.5px;
}
.replay-ref-canvas {
    display: block;
    width: 100%;
    height: 280px;
    background: linear-gradient(to bottom, rgba(96,165,250,0.05), rgba(52,211,153,0.08));
    border-radius: 8px;
}
.replay-ref-hint {
    font-size: 10.5px;
    color: var(--text-3);
    margin-top: 6px;
    text-align: center;
    font-family: var(--font-mono);
}

/* ---- Timestamp pill on failure cards ---- */
.rcheck-time-pill {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    margin-left: auto;
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    font-family: var(--font-mono);
    font-size: 10.5px;
    font-weight: 600;
    padding: 2px 7px;
    border-radius: 5px;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s, color 0.15s;
}
.rcheck-time-pill:hover {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}
.replay-speed-group {
    display: flex;
    gap: 4px;
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 4px;
}
.speed-label {
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding-left: 6px;
}
.replay-speed-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-mono);
}
.replay-speed-btn:hover { color: var(--text); }
.replay-speed-btn.active {
    background: var(--steel);
    color: #04111c;
}

/* Live angles grid (per-frame readout) */
.replay-live-angles {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 14px 16px;
}
.rla-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 10px;
}
.rla-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
    gap: 8px;
}
.rla-cell {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--green-2);
    border-radius: 8px;
    padding: 8px 10px;
}
.rla-cell.warn {
    border-left-color: var(--amber-2);
    background: var(--fill-amber);
}
.rla-label {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 600;
}
.rla-val {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    font-family: var(--font-mono);
    line-height: 1.1;
    margin: 2px 0;
}
.rla-cell.warn .rla-val { color: var(--amber-2); }
.rla-cell.ok   .rla-val { color: var(--green-2); }
.rla-target {
    font-size: 10px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.rla-frame-info {
    grid-column: 1 / -1;
    text-align: center;
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
    margin-top: 4px;
}

/* Replay static checks — rich card format */
.replay-static-checks {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 14px 16px;
}
.replay-checks-header {
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text);
    margin-bottom: 4px;
}
.replay-checks-subheader {
    font-size: 11px;
    color: var(--text-3);
    margin-bottom: 12px;
}
.replay-checks-section-title {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    margin: 14px 0 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.replay-checks-section-title .count-pill {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: var(--text-3);
}

/* Failure card — the "why is this wrong" surface */
.rcheck-fail-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.rcheck-fail {
    background: var(--fill-red);
    border: 1px solid var(--red-2);
    border-left: 4px solid var(--red-2);
    border-radius: 10px;
    padding: 11px 13px;
}
.rcheck-fail.medium { background: var(--fill-amber); border-color: var(--amber-2); border-left-color: var(--amber-2); }
.rcheck-fail.low    { background: var(--surface);   border-color: var(--border-2); border-left-color: var(--text-3); }

.rcheck-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    line-height: 1.3;
}
.rcheck-sev-badge {
    font-size: 9.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 2px 6px;
    border-radius: 4px;
    background: var(--red-2);
    color: #fff;
    flex-shrink: 0;
}
.rcheck-fail.medium .rcheck-sev-badge { background: var(--amber-2); color: #1a0f00; }
.rcheck-fail.low    .rcheck-sev-badge { background: var(--text-3); color: var(--surface); }

/* The comparison strip — "you did X" vs "target Y" */
.rcheck-compare {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 8px 0;
}
.rcheck-compare-cell {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 7px 10px;
    min-width: 0;
}
.rcheck-compare-cell.you {
    border-left: 3px solid var(--red-2);
}
.rcheck-fail.medium .rcheck-compare-cell.you { border-left-color: var(--amber-2); }
.rcheck-fail.low    .rcheck-compare-cell.you { border-left-color: var(--text-3); }
.rcheck-compare-cell.target {
    border-left: 3px solid var(--green-2);
}
.rcheck-compare-label {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-3);
    margin-bottom: 2px;
}
.rcheck-compare-val {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
    word-break: break-word;
}
.rcheck-compare-cell.you .rcheck-compare-val { color: var(--red-2); }
.rcheck-fail.medium .rcheck-compare-cell.you .rcheck-compare-val { color: var(--amber-2); }
.rcheck-compare-cell.target .rcheck-compare-val { color: var(--green-2); }

.rcheck-why {
    font-size: 12px;
    color: var(--text);
    line-height: 1.45;
    margin: 6px 0 4px;
}
.rcheck-why-label {
    font-weight: 700;
    color: var(--text-2);
}
.rcheck-fix {
    font-size: 11.5px;
    color: var(--text-2);
    line-height: 1.45;
    border-top: 1px dashed var(--border-2);
    padding-top: 6px;
    margin-top: 6px;
}
.rcheck-fix-label {
    font-weight: 700;
    color: var(--text);
}

/* Passed checks — compact green chips */
.rcheck-pass-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.rcheck-pass {
    background: var(--fill-green);
    border: 1px solid var(--green-2);
    border-radius: 7px;
    padding: 5px 9px;
    font-size: 11.5px;
    color: var(--text);
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.rcheck-pass .rcheck-pass-val {
    font-family: var(--font-mono);
    color: var(--green-2);
    font-size: 11px;
}

.rcheck-empty {
    color: var(--text-3);
    font-size: 12px;
    padding: 8px 0;
    text-align: center;
}
.rcheck-legacy-banner {
    background: var(--fill-amber);
    border: 1px solid var(--amber-2);
    border-left: 3px solid var(--amber-2);
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 10px;
}

/* ---- Per-rep section (one card per lunge in the recording) ---- */
.rep-section {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
}
.rep-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-2);
}
.rep-section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.rep-num {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    font-family: var(--font-display);
    font-style: italic;
}
.rep-status {
    font-size: 11.5px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
}
.rep-status.good { background: var(--fill-green); color: var(--green-2); }
.rep-status.mid  { background: var(--fill-amber); color: var(--amber-2); }
.rep-status.bad  { background: var(--fill-red); color: var(--red-2); }
.rep-invalid-badge {
    font-size: 9.5px;
    font-weight: 700;
    color: var(--text-3);
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    padding: 1px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.rep-pass-list {
    margin-top: 8px;
}

/* ---- Self-check tips (qualitative coach reminders, manual checkbox) ---- */
.rcheck-tips-hint {
    font-size: 10.5px;
    color: var(--text-3);
    margin-bottom: 8px;
    font-style: italic;
}
.rcheck-tip-list {
    list-style: none;
    padding: 0;
    margin: 0 0 4px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.rcheck-tip {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 7px 10px 7px 8px;
    transition: background 0.15s, border-color 0.15s, opacity 0.15s;
}
.rcheck-tip label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
    margin: 0;
}
.rcheck-tip input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 2px;
    width: 15px;
    height: 15px;
    accent-color: var(--green-2);
    cursor: pointer;
}
.rcheck-tip-text {
    font-size: 12px;
    line-height: 1.45;
    color: var(--text);
    user-select: none;
}
.rcheck-tip.checked {
    background: var(--fill-green);
    border-color: var(--green-2);
}
.rcheck-tip.checked .rcheck-tip-text {
    color: var(--text-2);
    text-decoration: line-through;
    text-decoration-color: var(--green-2);
}

/* ============================================================
   Replay overlay (skeleton + issue markers on top of video)
   ============================================================ */
.replay-video-wrap {
    position: relative;
}
#replayOverlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
    display: block;
}
.replay-overlay-toggle {
    position: absolute;
    bottom: 8px;
    left: 8px;
    background: rgba(7,9,15,0.78);
    backdrop-filter: blur(6px);
    border-radius: 8px;
    padding: 6px 10px;
    display: flex;
    gap: 12px;
    font-size: 11px;
    color: var(--text);
    z-index: 3;
}
.replay-overlay-toggle label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    user-select: none;
}
.replay-overlay-toggle input[type="checkbox"] {
    accent-color: var(--steel-2);
    margin: 0;
}

/* ============================================================
   Recording diagnostic panel
   ============================================================ */
.recording-diagnostic-wrap {
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 12px;
    font-size: 12px;
}
.recording-diagnostic-wrap summary {
    cursor: pointer;
    color: var(--text-2);
    font-weight: 500;
    user-select: none;
}
.recording-diagnostic-wrap summary:hover { color: var(--steel-2); }
.recording-diagnostic {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.diag-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: 6px;
    border-left: 3px solid var(--text-3);
}
.diag-row.ok  { border-left-color: var(--green-2); }
.diag-row.bad { border-left-color: var(--red-2); background: var(--fill-red); }
.diag-label { color: var(--text-2); font-weight: 500; }
.diag-value {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text);
}

.rec-video-badge {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 6px;
    margin-left: 8px;
    font-weight: 600;
    font-family: var(--font-mono);
}
.rec-video-badge.has { background: var(--fill-green); color: var(--green-2); border: 1px solid rgba(52,211,153,0.4); }
.rec-video-badge.no  { background: var(--fill-amber); color: var(--amber-2); border: 1px solid rgba(251,191,36,0.4); cursor: help; }

/* ============================================================
   比赛复盘 (MatchReview) — Phase 1
   ============================================================ */
.mr-page-header { margin-bottom: 18px; }
.mr-page-header h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 32px;
    margin: 0 0 6px;
}
.mr-page-sub {
    font-size: 13px;
    color: var(--text-2);
}

/* Upload zone */
.mr-upload-zone {
    border: 2px dashed var(--border-2);
    border-radius: 14px;
    padding: 36px 24px;
    text-align: center;
    background: var(--surface);
    transition: border-color 0.15s, background 0.15s;
    margin-bottom: 28px;
}
.mr-upload-zone.drag-over {
    border-color: var(--steel);
    background: var(--fill-blue, rgba(96,165,250,0.08));
}
.mr-upload-icon {
    font-size: 36px;
    color: var(--text-3);
    margin-bottom: 8px;
}
.mr-upload-main {
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}
.mr-upload-sub {
    font-size: 11px;
    color: var(--text-3);
    margin: 6px 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}
.mr-upload-btn {
    background: var(--steel);
    border: none;
    color: #04111c;
    padding: 10px 22px;
    border-radius: 9px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.mr-upload-btn:hover { filter: brightness(1.1); }
.mr-upload-hint {
    margin-top: 10px;
    font-size: 11px;
    color: var(--text-3);
}

/* Library */
.mr-library-section h3 {
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 14px;
    color: var(--text);
}
.mr-library-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}
.mr-library-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    position: relative;
}
.mr-library-card:hover {
    background: var(--surface-2);
    border-color: var(--steel);
}
.mr-card-thumb {
    font-size: 30px;
    flex-shrink: 0;
    width: 48px;
    text-align: center;
}
.mr-card-body { flex: 1 1 auto; min-width: 0; }
.mr-card-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mr-card-meta {
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.mr-card-delete {
    background: transparent;
    border: 1px solid var(--border-2);
    color: var(--red-2);
    width: 28px;
    height: 28px;
    border-radius: 7px;
    cursor: pointer;
    font-size: 14px;
    flex-shrink: 0;
}
.mr-card-delete:hover { background: var(--fill-red); border-color: var(--red-2); }

.mr-library-empty {
    text-align: center;
    padding: 30px 16px;
    color: var(--text-3);
    font-size: 13px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 10px;
}

/* Active view header */
.mr-active-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}
.mr-back-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.mr-back-btn:hover { background: var(--surface-3); }
.mr-active-header h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 22px;
    margin: 0;
    flex: 1 1 auto;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.mr-active-actions { display: flex; gap: 6px; }
.mr-icon-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    width: 34px;
    height: 34px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text);
}
.mr-icon-btn:hover { background: var(--surface-3); }
.mr-icon-btn.danger { color: var(--red-2); }
.mr-icon-btn.danger:hover { background: var(--fill-red); border-color: var(--red-2); }

/* Active body: video left, notes right */
.mr-active-body {
    display: grid;
    grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr);
    gap: 18px;
}
@media (max-width: 1100px) {
    .mr-active-body { grid-template-columns: 1fr; }
}

.mr-video-col { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.mr-video-wrap {
    background: #000;
    border-radius: 12px;
    overflow: hidden;
    aspect-ratio: 16/9;
    width: 100%;
    position: relative;
}
#mrVideo {
    width: 100%;
    height: 100%;
    display: block;
    background: #000;
    /* contain matches our overlay math (assumes letterboxed video).
       fill (browser default) stretches and breaks skeleton alignment
       for non-16:9 videos. */
    object-fit: contain;
}
.mr-skeleton-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 2;
}

/* ROI selection overlay (drag rectangle on the video to mark scoreboard) */
.mr-roi-layer {
    position: absolute;
    inset: 0;
    z-index: 100;          /* above native video controls */
    cursor: crosshair;
    background: rgba(7, 9, 15, 0.55);
    user-select: none;
}
/* When ROI mode is active, freeze the underlying video so its native
   controls and the skeleton overlay don't intercept drag events. */
.mr-video-wrap.roi-mode #mrVideo,
.mr-video-wrap.roi-mode .mr-skeleton-overlay {
    pointer-events: none;
}
.mr-roi-box {
    position: absolute;
    border: 2px solid var(--steel);
    background: rgba(96, 165, 250, 0.15);
    box-shadow: 0 0 0 9999px rgba(7,9,15,0.4);
    pointer-events: none;
}
.mr-roi-hint {
    position: absolute;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(7,9,15,0.85);
    color: #fff;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    border: 1px solid var(--steel);
    pointer-events: none;        /* clicks pass through to the drag layer */
}
.mr-roi-actions {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    pointer-events: auto;        /* buttons must still be clickable */
}
.mr-roi-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.mr-roi-btn:hover:not(:disabled) { background: var(--surface-3); }
.mr-roi-btn.primary {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}
.mr-roi-btn.primary:hover:not(:disabled) { filter: brightness(1.1); }
.mr-roi-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Persistent outline of the saved ROI (visible during playback) */
.mr-roi-outline {
    position: absolute;
    z-index: 3;
    border: 2px dashed var(--amber-2);
    background: rgba(251,191,36,0.05);
    pointer-events: none;
}
.mr-roi-outline::before {
    content: '📍 计分器';
    position: absolute;
    top: -22px;
    left: 0;
    background: rgba(7,9,15,0.85);
    color: var(--amber-2);
    padding: 1px 7px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 700;
    white-space: nowrap;
}

/* Clips tab — ROI status banner */
.mr-roi-status {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 7px;
    padding: 8px 12px;
    font-size: 11.5px;
    color: var(--text-3);
    margin-bottom: 10px;
    font-family: var(--font-mono);
}
.mr-roi-status.ok {
    background: var(--fill-green);
    border-color: var(--green-2);
    color: var(--green-2);
}
.mr-clip-steps {
    margin: 4px 0 0 18px;
    padding: 0;
    color: var(--text-2);
    font-size: 11.5px;
    line-height: 1.7;
}

/* ---- Skeleton processing bar (just below the video) ---- */
.mr-skeleton-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--surface-2);
    border-radius: 9px;
    flex-wrap: wrap;
}
.mr-skeleton-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12.5px;
    color: var(--text);
    font-weight: 600;
    cursor: pointer;
}
.mr-skeleton-toggle input[type="checkbox"] {
    width: 15px;
    height: 15px;
    accent-color: var(--steel);
    cursor: pointer;
}
.mr-skeleton-toggle input[type="checkbox"]:disabled { cursor: not-allowed; }
.mr-process-btn {
    background: var(--steel);
    border: none;
    color: #04111c;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}
.mr-process-btn:hover:not(:disabled) { filter: brightness(1.1); }
.mr-process-btn:disabled { opacity: 0.5; cursor: wait; }
.mr-skeleton-status {
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
    margin-left: auto;
}
.mr-skeleton-status.ok {
    color: var(--green-2);
}
.mr-skeleton-status.warn {
    color: var(--amber-2);
}

/* Diagnostic pane: shows the model's actual view + skeleton in the same coord space */
.mr-debug-pane {
    background: var(--surface);
    border: 1px dashed var(--amber-2);
    border-radius: 10px;
    padding: 10px 12px;
}
.mr-debug-title {
    font-size: 11px;
    color: var(--amber-2);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 6px;
}
.mr-debug-canvas {
    display: block;
    width: 100%;
    max-width: 480px;
    background: #000;
    border-radius: 6px;
    border: 1px solid var(--border-2);
}
.mr-debug-info {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-2);
    line-height: 1.5;
    font-family: var(--font-mono);
}

/* ---- Pose processing modal ---- */
.mr-process-card {
    max-width: 480px;
    text-align: center;
}
.mr-process-card h2 {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 22px;
    margin: 0 0 10px;
}
.mr-process-desc {
    font-size: 12.5px;
    color: var(--text-2);
    line-height: 1.6;
    margin: 0 0 14px;
}
.mr-process-bar-wrap {
    background: var(--surface-2);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    margin-bottom: 10px;
}
.mr-process-progress {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--steel), var(--green-2));
    border-radius: 999px;
    transition: width 0.2s;
}
.mr-process-text {
    font-size: 11.5px;
    color: var(--text-2);
    font-family: var(--font-mono);
    margin-bottom: 16px;
}
.mr-process-cancel {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 8px 18px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
}
.mr-process-cancel:hover { background: var(--surface-3); }

.mr-speed-row {
    display: flex;
    gap: 4px;
    align-items: center;
    padding: 6px 10px;
    background: var(--surface-2);
    border-radius: 8px;
}
.mr-speed-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    padding-right: 6px;
}
.mr-speed-btn {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-mono);
}
.mr-speed-btn:hover { color: var(--text); }
.mr-speed-btn.active {
    background: var(--steel);
    color: #04111c;
}

.mr-future-note {
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-3);
    font-style: italic;
}

/* Notes column */
.mr-notes-col {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}
.mr-add-note-card {
    background: var(--surface);
    border: 1px solid var(--steel);
    border-radius: 12px;
    padding: 12px 14px;
}
.mr-add-note-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}
.mr-add-note-ts {
    color: var(--steel);
    font-family: var(--font-mono);
    font-weight: 700;
}
.mr-shortcut {
    font-size: 10px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.mr-add-note-card textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 70px;
    max-height: 200px;
    resize: vertical;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    line-height: 1.5;
    outline: none;
}
.mr-add-note-card textarea:focus { border-color: var(--steel); }
.mr-add-note-btn {
    margin-top: 8px;
    background: var(--steel);
    border: none;
    color: #04111c;
    padding: 8px 16px;
    border-radius: 7px;
    font-size: 12.5px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
}
.mr-add-note-btn:hover { filter: brightness(1.1); }

.mr-notes-section h3 {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 10px;
    color: var(--text);
}
.mr-notes-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: 460px;
    overflow-y: auto;
}
.mr-note {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 9px;
    padding: 8px 10px;
}
.mr-note-row1 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.mr-note-jump {
    background: var(--fill-blue, rgba(96,165,250,0.12));
    border: 1px solid rgba(96,165,250,0.4);
    color: var(--steel);
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 11px;
    font-family: var(--font-mono);
    font-weight: 700;
    cursor: pointer;
}
.mr-note-jump:hover {
    background: var(--steel);
    color: #04111c;
}
.mr-note-delete {
    background: transparent;
    border: none;
    color: var(--text-3);
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 4px;
}
.mr-note-delete:hover { color: var(--red-2); background: var(--fill-red); }
.mr-note-text {
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
}
.mr-notes-empty {
    text-align: center;
    padding: 16px 12px;
    color: var(--text-3);
    font-size: 12px;
    font-style: italic;
}

/* ============================================================
   Tabs (events / heatmaps)
   ============================================================ */
.mr-tabs {
    display: flex;
    gap: 4px;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 12px;
}
.mr-tab {
    background: transparent;
    border: none;
    color: var(--text-2);
    padding: 8px 14px;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.mr-tab:hover { color: var(--text); }
.mr-tab.active {
    color: var(--steel);
    border-bottom-color: var(--steel);
}
.mr-tab-count {
    background: var(--surface-2);
    border-radius: 999px;
    padding: 1px 7px;
    font-size: 10.5px;
    font-family: var(--font-mono);
    color: var(--text-3);
}
.mr-tab.active .mr-tab-count {
    background: var(--steel);
    color: #04111c;
}

/* ============================================================
   Event types selector + form
   ============================================================ */
.mr-event-types {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin-bottom: 10px;
}
.mr-event-type {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 8px 6px;
    border-radius: 7px;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.mr-event-type:hover {
    background: var(--surface-3);
}
.mr-event-type.active {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}

.mr-add-event-card {
    background: var(--surface);
    border: 1px solid var(--steel);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.mr-add-event-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}
.mr-add-event-ts {
    color: var(--steel);
    font-family: var(--font-mono);
    font-weight: 700;
}
.mr-add-event-card textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 60px;
    max-height: 180px;
    resize: vertical;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text);
    font-family: inherit;
    line-height: 1.5;
    outline: none;
    margin-top: 10px;
}
.mr-add-event-card textarea:focus { border-color: var(--steel); }

/* Form rows (side / piste / target / sequence) */
.mr-form-row {
    margin-bottom: 10px;
}
.mr-form-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-2);
    margin-bottom: 5px;
}
.mr-form-hint {
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-3);
    margin-left: 6px;
    font-size: 10.5px;
}

/* Side / outcome pair */
.mr-side-pair, .mr-outcome-pair {
    display: flex;
    gap: 6px;
}
.mr-side-btn, .mr-outcome-btn {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mr-side-btn:hover, .mr-outcome-btn:hover { background: var(--surface-3); }
.mr-side-btn.left.active {
    background: rgba(96,165,250,0.2);
    border-color: var(--steel);
    color: var(--steel);
}
.mr-side-btn.right.active {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}
.mr-outcome-btn.win.active {
    background: var(--fill-green);
    border-color: var(--green-2);
    color: var(--green-2);
}
.mr-outcome-btn.loss.active {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}

/* Piste picker — bigger and bolder so it doesn't look like a thin status bar */
.mr-piste-picker {
    cursor: crosshair;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-2);
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.mr-piste-svg {
    width: 100%;
    height: 72px;
    display: block;
    transition: filter 0.15s;
}
.mr-piste-picker:hover .mr-piste-svg {
    filter: brightness(1.08);
}
.mr-piste-readout {
    margin-top: 6px;
    font-size: 12px;
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 600;
    text-align: center;
}

/* Target picker: two-fencer minimalist line-art (Olympic-poster style) */
.mr-target-picker {
    display: flex;
    justify-content: center;
    background: linear-gradient(180deg,
        rgba(15, 23, 42, 0.55) 0%,
        rgba(15, 23, 42, 0.25) 100%);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 12px 16px;
}
.mr-target-svg {
    width: 100%;
    max-width: 520px;
    height: auto;
    cursor: pointer;
    user-select: none;
}

/* Clickable zones — hover/selected swap stroke or fill to accent color.
   The two "kinds" (filled shapes vs stroked limbs) need different treatments:
   - fill / circle kinds: change FILL on hover/select
   - stroke kinds (limbs): change STROKE color + width
*/
.mr-target-zone {
    cursor: pointer;
    transition: stroke 0.18s, fill 0.18s, stroke-width 0.18s;
}
/* Filled shapes (head, torso): hover adds soft amber fill, selected solid amber */
.mr-target-zone[data-kind="circle"]:hover,
.mr-target-zone[data-kind="fill"]:hover {
    fill: rgba(251, 146, 60, 0.25);
    stroke: #fb923c;
}
.mr-target-zone[data-kind="circle"].selected,
.mr-target-zone[data-kind="fill"].selected {
    fill: rgba(251, 146, 60, 0.78);
    stroke: #fb923c;
    stroke-width: 2.5;
}
/* Stroked limbs: hover brightens stroke, selected thickens + accents */
.mr-target-zone[data-kind="stroke"]:hover {
    stroke: #fb923c;
    stroke-width: 4;
}
.mr-target-zone[data-kind="stroke"].selected {
    stroke: #fb923c;
    stroke-width: 14;
}
/* Heatmap mode: non-interactive */
.mr-fencer-zone {
    pointer-events: none;
}

/* Sequence builder */
.mr-sequence-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    padding: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 7px;
    min-height: 32px;
    margin-bottom: 6px;
}
.mr-sequence-empty {
    color: var(--text-3);
    font-size: 11px;
    font-style: italic;
}
.mr-sequence-step {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: var(--steel);
    color: #04111c;
    padding: 3px 4px 3px 7px;
    border-radius: 5px;
    font-size: 11.5px;
    font-weight: 700;
}
.mr-sequence-num {
    background: rgba(0,0,0,0.3);
    color: #fff;
    border-radius: 3px;
    padding: 1px 5px;
    font-size: 10px;
    font-family: var(--font-mono);
}
.mr-sequence-remove {
    background: transparent;
    border: none;
    color: rgba(7,17,28,0.6);
    cursor: pointer;
    font-size: 14px;
    line-height: 1;
    padding: 0 3px;
}
.mr-sequence-remove:hover { color: var(--red-2); }
.mr-sequence-arrow {
    color: var(--text-3);
    font-size: 13px;
    font-weight: 700;
}
.mr-sequence-palette {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 8px;
}
.mr-action-chip {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 11.5px;
    cursor: pointer;
}
.mr-action-chip:hover {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}
.mr-sequence-outcome {
    margin-bottom: 0;
}

/* ============================================================
   Events list
   ============================================================ */
.mr-events-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 7px;
    max-height: 460px;
    overflow-y: auto;
}
.mr-event {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-left: 3px solid var(--text-3);
    border-radius: 8px;
    padding: 8px 10px;
}
.mr-event.mr-event-score   { border-left-color: var(--green-2); }
.mr-event.mr-event-concede { border-left-color: var(--red-2); }
.mr-event.mr-event-sequence{ border-left-color: var(--steel); }

.mr-event-row1 {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 3px;
}
.mr-event-icon { font-size: 13px; }
.mr-event-type-tag {
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 700;
}
.mr-event-meta {
    font-size: 11.5px;
    color: var(--text-2);
    font-family: var(--font-mono);
    margin: 4px 0 3px;
    line-height: 1.5;
}

/* ============================================================
   Heatmap cards
   ============================================================ */
.mr-heatmap-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 12px 14px;
    margin-bottom: 14px;
}
.mr-heatmap-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}
.mr-heatmap-head h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 0;
    color: var(--text);
}
.mr-heatmap-filters {
    display: flex;
    gap: 4px;
}
.mr-heatmap-filters button {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 4px 9px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
}
.mr-heatmap-filters button.active {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}
.mr-heatmap-svg-wrap {
    width: 100%;
}
.mr-heatmap-svg {
    width: 100%;
    height: 80px;
    display: block;
    border-radius: 6px;
}
.mr-heatmap-target-svg {
    width: 220px;
    height: 280px;
    display: block;
    margin: 0 auto;
}
.mr-heatmap-hint {
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--text-3);
    text-align: center;
}
.mr-heatmap-total {
    margin-top: 8px;
    font-size: 11px;
    color: var(--text-2);
    text-align: center;
    font-family: var(--font-mono);
}

/* Fencer name row (foundation for scouting DB) */
.mr-fencer-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 9px;
    padding: 8px 12px;
    margin-bottom: 10px;
}
.mr-fencer-row label {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--text-2);
    font-weight: 600;
}
.mr-fencer-row input {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 6px;
    padding: 5px 8px;
    font-size: 12px;
    color: var(--text);
    outline: none;
}
.mr-fencer-row input:focus { border-color: var(--steel); }
.mr-vs {
    font-family: var(--font-mono);
    font-weight: 800;
    font-size: 12px;
    color: var(--text-3);
}

/* hitOn buttons (reuse side-btn styles + a slightly different active feel) */
.mr-hiton-btn {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mr-hiton-btn:hover { background: var(--surface-3); }
.mr-hiton-btn.left.active {
    background: rgba(96,165,250,0.2);
    border-color: var(--steel);
    color: var(--steel);
}
.mr-hiton-btn.right.active {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}

/* Valid / invalid buttons (reuse outcome-btn look) */
.mr-valid-btn {
    flex: 1;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 7px 10px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mr-valid-btn:hover { background: var(--surface-3); }
.mr-valid-btn.win.active {
    background: var(--fill-green);
    border-color: var(--green-2);
    color: var(--green-2);
}
.mr-valid-btn.loss.active {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}

/* Clips tab */
.mr-clip-intro {
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 11.5px;
    line-height: 1.6;
    color: var(--text-2);
    margin-bottom: 10px;
}
.mr-clip-controls {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    align-items: stretch;
}
.mr-clip-controls .mr-add-note-btn { flex: 1; }
.mr-clip-sens-label {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 10px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.mr-clip-sens {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 6px 8px;
    border-radius: 6px;
    font-size: 12px;
    cursor: pointer;
}
.mr-clip-clear-btn {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mr-clip-clear-btn:hover {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}
.mr-clip-add-btn {
    background: var(--surface-2);
    border: 1px solid var(--blue-2, #3b82f6);
    color: var(--blue-2, #3b82f6);
    padding: 8px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
}
.mr-clip-add-btn:hover {
    background: var(--fill-blue, rgba(59, 130, 246, 0.15));
}
/* Stepper at top of the clip list (prev / current / next) */
.mr-clip-stepper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 8px;
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 8px;
    position: sticky;
    top: 0;
    z-index: 2;
}
.mr-clip-step-btn {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s;
}
.mr-clip-step-btn:hover {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}
.mr-clip-pos {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    background: var(--surface);
    padding: 4px 10px;
    border-radius: 5px;
    min-width: 60px;
    text-align: center;
}

.mr-clips-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 520px;
    overflow-y: auto;
}

/* Each clip = a "lecture card" the coach clicks to navigate to */
.mr-clip {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-left: 4px solid var(--text-3);
    border-radius: 9px;
    padding: 0;
    display: flex;
    align-items: stretch;
    gap: 0;
    overflow: hidden;
    transition: background 0.15s, border-color 0.15s;
}
.mr-clip.kept     { background: var(--fill-green); }
.mr-clip.kept .mr-clip-num { color: var(--green-2); }
.mr-clip.active {
    background: rgba(96, 165, 250, 0.10);
    border-color: var(--steel);
    box-shadow: 0 0 0 2px rgba(96, 165, 250, 0.25);
}
.mr-clip-main {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    cursor: pointer;
    min-width: 0;
}
.mr-clip-main:hover {
    background: rgba(255, 255, 255, 0.03);
}
.mr-clip-num {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-family: var(--font-mono);
    flex-shrink: 0;
    min-width: 52px;
}
.mr-clip-num strong {
    color: var(--text);
    font-size: 18px;
    font-family: inherit;
    font-weight: 800;
    font-style: italic;
    display: inline-block;
    margin: 0 2px;
}
.mr-clip-body {
    flex: 1 1 auto;
    min-width: 0;
}
.mr-clip-time {
    font-size: 14px;
    font-weight: 800;
    color: var(--steel);
    font-family: var(--font-mono);
    line-height: 1.1;
}
.mr-clip.active .mr-clip-time {
    color: #fff;
}
.mr-clip-label {
    font-size: 11.5px;
    color: var(--text-2);
    margin-top: 2px;
}
.mr-clip-actions {
    display: flex;
    gap: 3px;
    padding: 8px 8px 8px 0;
    align-items: center;
    flex-shrink: 0;
}
.mr-clip-actions button {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 4px 7px;
    border-radius: 5px;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.mr-clip-keep:hover {
    background: var(--fill-green);
    border-color: var(--green-2);
    color: var(--green-2);
}
.mr-clip-reject:hover {
    background: var(--fill-red);
    border-color: var(--red-2);
    color: var(--red-2);
}
.mr-clip-to-event:hover {
    background: var(--steel);
    color: #04111c;
    border-color: var(--steel);
}

/* Scouting page (cross-review opponent database) */
.scout-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}
.scout-select-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-2);
}
.scout-select {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text);
    padding: 8px 14px;
    border-radius: 9px;
    font-size: 13px;
    cursor: pointer;
    min-width: 240px;
}
.scout-meta {
    font-size: 11px;
    color: var(--text-3);
    font-family: var(--font-mono);
}
.scout-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-3);
    font-size: 13px;
    background: var(--surface);
    border: 1px dashed var(--border-2);
    border-radius: 12px;
}
.scout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px;
}
.scout-card {
    background: var(--surface);
    border: 1px solid var(--border-2);
    border-radius: 12px;
    padding: 14px 16px;
}
.scout-card-full {
    grid-column: 1 / -1;
}
.scout-card h3 {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 10px;
    color: var(--text);
}
.scout-body-wrap {
    display: flex;
    justify-content: center;
}
.scout-body-wrap svg {
    width: 200px;
    height: 320px;
    display: block;
}
.scout-reviews {
    list-style: none;
    padding: 0;
    margin: 0;
    max-height: 280px;
    overflow-y: auto;
}
.scout-reviews li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 8px;
    border-bottom: 1px solid var(--border-2);
    font-size: 12px;
}
.scout-reviews li:last-child { border-bottom: none; }
.scout-r-side {
    font-size: 10.5px;
    color: var(--text-3);
    font-weight: 700;
    min-width: 28px;
}
.scout-r-name {
    flex: 1;
    color: var(--text);
}

/* Aggregate piste grid: 2 columns of piste strips */
.scout-piste-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}
.scout-piste-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-2);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Per-match cards */
.scout-match-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.scout-match-card {
    background: var(--surface-2);
    border: 1px solid var(--border-2);
    border-radius: 10px;
    padding: 10px 12px;
}
.scout-match-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-2);
    margin-bottom: 8px;
}
.scout-match-num {
    font-size: 11px;
    font-weight: 800;
    color: var(--text-3);
    background: var(--surface);
    border: 1px solid var(--border-2);
    padding: 4px 9px;
    border-radius: 5px;
}
.scout-match-info { flex: 1; min-width: 0; }
.scout-match-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}
.scout-match-meta {
    display: flex;
    gap: 10px;
    font-size: 11px;
    color: var(--text-3);
}
.scout-match-score {
    font-weight: 700;
    color: var(--text-2);
}
.scout-match-open {
    background: var(--surface);
    border: 1px solid var(--border-2);
    color: var(--text-2);
    padding: 5px 11px;
    font-size: 11.5px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
}
.scout-match-open:hover {
    background: var(--fill-blue, rgba(59, 130, 246, 0.15));
    color: var(--blue-2, #3b82f6);
    border-color: var(--blue-2, #3b82f6);
}
.scout-match-body {
    display: grid;
    grid-template-columns: minmax(160px, 220px) minmax(0, 1fr);
    gap: 16px;
    align-items: flex-start;
}
.scout-match-section { min-width: 0; }
.scout-match-section svg {
    width: 100%;
    display: block;
    border-radius: 6px;
}
.scout-match-section-title {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-3);
    margin: 6px 0 4px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}
.scout-match-section-title:first-child { margin-top: 0; }
.scout-match-empty {
    font-size: 11px;
    color: var(--text-3);
    font-style: italic;
    padding: 6px 8px;
    background: var(--surface);
    border-radius: 5px;
    border: 1px dashed var(--border-2);
    text-align: center;
}
.scout-r-date {
    color: var(--text-3);
    font-family: var(--font-mono);
    font-size: 10.5px;
}
.scout-empty-mini {
    color: var(--text-3);
    font-size: 11.5px;
    padding: 14px 8px;
    font-style: italic;
}
.scout-seq-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.scout-seq-table th,
.scout-seq-table td {
    text-align: left;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border-2);
}
.scout-seq-table th {
    font-size: 10.5px;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 700;
    background: var(--surface-2);
}
.scout-seq-table tr:last-child td { border-bottom: none; }
.scout-cell-win  { color: var(--green-2); font-weight: 700; }
.scout-cell-loss { color: var(--red-2);   font-weight: 700; }
