/* ═══════════════════════════════════════════
   SAVANT SWING v2.0 — FIRST LIGHT
   Stylesheet
   ═══════════════════════════════════════════ */

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

:root {
  --green-deep: #0f3d2a;
  --green-mid: #1a5e3a;
  --green-light: #2a8c5a;
  --green-pale: #e8f5ee;
  --cream: #f5f5f0;
  --warm-white: #ffffff;
  --warm-gray: #6b6560;
  --light-gray: #e8e4e0;
  --text-primary: #1a1714;
  --text-secondary: #4a4540;
  --gold: #c5a55a;
  --red-soft: #c44;
  --blue-soft: #2E5090;
  --orange-soft: #d47520;

  --font-body: Georgia, 'Times New Roman', serif;
  --font-mono: 'SF Mono', 'Menlo', monospace;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);
}

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ─── HEADER ─── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1.5rem;
  border-bottom: 1px solid var(--light-gray);
  background: var(--warm-white);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: #1a1a1a;
  font-weight: 600;
  font-size: 1.1rem;
}

.brand-mark { display: none;
  width: 28px; height: 28px;
  background: var(--green-deep);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-dot {
  width: 9px; height: 9px;
  border: 1.5px solid var(--green-pale);
  border-radius: 50%;
}

.header-version {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--warm-gray);
  letter-spacing: 0.04em;
}

/* ─── UPLOAD PANEL ─── */
.upload-panel {
  max-width: 600px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

.upload-container {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.upload-zone {
  border: 2px dashed var(--light-gray);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  background: var(--warm-white);
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--green-mid);
  background: var(--green-pale);
}

.upload-icon { margin-bottom: 1rem; color: var(--warm-gray); }
.upload-zone:hover .upload-icon { color: var(--green-mid); }

.upload-label {
  font-size: 1rem;
  font-weight: 500;
  margin-bottom: 0.3rem;
}

.upload-sublabel {
  font-size: 0.8rem;
  color: var(--warm-gray);
}

.upload-preview {
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #000;
  position: relative;
}

.upload-preview video {
  width: 100%;
  max-height: 300px;
  object-fit: contain;
}

.preview-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 0.5rem 1rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8rem;
}

.btn-clear {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 0.3rem;
  opacity: 0.7;
}
.btn-clear:hover { opacity: 1; }

/* ─── FORM ─── */
.form-row {
  display: flex;
  gap: 0.8rem;
}

.form-field {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.form-field label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--warm-gray);
  letter-spacing: 0.03em;
}

.form-field input,
.form-field select {
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  background: var(--warm-white);
  color: var(--text-primary);
  transition: border-color 0.2s;
}

.form-field input:focus,
.form-field select:focus {
  outline: none;
  border-color: var(--green-mid);
}

.btn-analyze {
  padding: 0.9rem 2rem;
  background: var(--green-deep);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.2s;
  align-self: center;
}

.btn-analyze:hover:not(:disabled) {
  background: var(--green-mid);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(15,61,42,0.2);
}

.btn-analyze:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ─── PROCESSING ─── */
.processing-panel {
  max-width: 400px;
  margin: 4rem auto;
  padding: 0 1.5rem;
  text-align: center;
}

.processing-spinner {
  width: 48px; height: 48px;
  border: 3px solid var(--light-gray);
  border-top-color: var(--green-mid);
  border-radius: 50%;
  margin: 0 auto 1.5rem;
  animation: spin 0.8s linear infinite;
}

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

.processing-stage {
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 1rem;
}

.processing-bar {
  height: 4px;
  background: var(--light-gray);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.processing-fill {
  height: 100%;
  background: var(--green-mid);
  border-radius: 2px;
  width: 0%;
  transition: width 0.3s ease;
}

.processing-time {
  font-size: 0.8rem;
  font-family: var(--font-mono);
  color: var(--warm-gray);
}

/* ─── RESULTS ─── */
.results-panel {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* ─── POSE VIEWER ─── */
.pose-viewer {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

#pose-canvas {
  width: 100%;
  height: 400px;
  display: block;
  background: #1a1a1a;
}

.pose-controls {
  padding: 1rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.pose-events {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.pose-event-btn {
  padding: 0.3rem 0.7rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  font-weight: 400;
  background: var(--green-pale);
  color: #1a1a1a;
  border: 1px solid transparent;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.15s;
}

.pose-event-btn:hover {
  background: var(--green-deep);
  color: #fff;
}

.pose-event-btn.active {
  background: var(--green-deep);
  color: #fff;
}

.frame-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: var(--light-gray);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}

.frame-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  background: var(--green-deep);
  border-radius: 50%;
  cursor: grab;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

.frame-slider::-webkit-slider-thumb:active { cursor: grabbing; }

.pose-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--warm-gray);
}

/* ─── SUMMARY CARD ─── */
.summary-card {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.8rem;
  border-left: 4px solid var(--green-mid);
}

.summary-card h2 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-mid);
  margin-bottom: 1rem;
}

.summary-item {
  margin-bottom: 0.8rem;
}

.summary-item:last-child { margin-bottom: 0; }

.summary-tag {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  margin-bottom: 0.3rem;
}

.summary-tag.constraint { background: #e8f0fe; color: #1a56db; }
.summary-tag.priority { background: #fef3e2; color: #b45309; }
.summary-tag.signature { background: var(--green-pale); color: #1a1a1a; }
.summary-tag.try-this { background: #fef3e2; color: #92400e; }

.summary-text {
  font-size: 0.92rem;
  color: var(--text-primary);
  line-height: 1.55;
}

/* ─── EVENTS TIMELINE ─── */
.events-timeline {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.6rem;
}

.events-timeline h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-gray);
  margin-bottom: 0.8rem;
}

.event-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.event-chip {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.78rem;
  border: 1px solid var(--light-gray);
  background: var(--warm-white);
}

.event-chip .chip-icon {
  font-size: 0.7rem;
  opacity: 0.7;
}

.event-chip .chip-time {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--warm-gray);
}

.event-chip.confidence-HIGH { border-color: var(--green-light); }
.event-chip.confidence-MEDIUM { border-color: var(--orange-soft); }
.event-chip.confidence-LOW { border-color: var(--red-soft); border-style: dashed; }

/* ─── METRICS ─── */
.metrics-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.metric-group {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.6rem;
}

/* metric-group h3 replaced by fieldset/legend */

.metric-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.8rem;
}

.metric-card {
  padding: 0.8rem;
  border-radius: var(--radius-sm);
  background: var(--cream);
}

.metric-card .metric-value {
  font-size: 1.4rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
}

.metric-card .metric-unit {
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--warm-gray);
}

.metric-card .metric-name {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 0.3rem;
}

.metric-card .metric-confidence {
  display: inline-block;
  width: 6px; height: 6px;
  border-radius: 50%;
  margin-left: 0.3rem;
  vertical-align: middle;
}

.metric-confidence.HIGH { background: var(--green-light); }
.metric-confidence.MEDIUM { background: var(--orange-soft); }
.metric-confidence.LOW { background: var(--red-soft); }

/* ─── PLOT ─── */
.plot-section {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  padding: 1.4rem 1.6rem;
}

.plot-section h3 {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--warm-gray);
  margin-bottom: 0.8rem;
}

.plot-section img {
  width: 100%;
  border-radius: var(--radius-sm);
}

/* ─── RESULT FOOTER ─── */
.result-footer {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--light-gray);
  font-size: 0.8rem;
  flex-wrap: wrap;
}

.result-footer span {
  font-family: var(--font-mono);
  color: var(--warm-gray);
}

.result-footer a {
  color: var(--green-mid);
  text-decoration: none;
}
.result-footer a:hover { text-decoration: underline; }

.btn-new {
  margin-left: auto;
  padding: 0.4rem 1rem;
  background: var(--green-pale);
  color: #1a1a1a;
  border: none;
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-new:hover { background: var(--green-deep); color: #fff; }

/* ─── RESPONSIVE ─── */
@media (max-width: 600px) {
  .form-row { flex-direction: column; }
  #pose-canvas { height: 280px; }
  .metric-cards { grid-template-columns: repeat(2, 1fr); }
  .result-footer { flex-direction: column; align-items: flex-start; }
  .btn-new { margin-left: 0; }
}

/* ─── SIDE-BY-SIDE POSE VIEWER (v2.1) ─── */
.pose-panels {
  display: flex;
  gap: 0;
}

.pose-panel {
  flex: 1;
  position: relative;
  min-width: 0;
}

#video-canvas,
#pose-canvas {
  width: 100%;
  height: 400px;
  display: block;
  background: #1a1a1a;
}

#video-panel {
  border-right: 1px solid rgba(255,255,255,0.1);
}

@media (max-width: 600px) {
  .pose-panels { flex-direction: column; }
  #video-canvas, #pose-canvas { height: 250px; }
  #video-panel { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.1); }
}


/* ============================================
   Savant Swing v2.2 — Dual Upload + Fusion
   Append this to the end of style.css
   ============================================ */

.dual-upload-container {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
}

.upload-view-wrapper {
    flex: 1;
    min-width: 0;
}

.upload-view-label {
    font-family: var(--font-body);
    font-size: 14px;
    font-weight: 600;
    color: #4a4540;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.view-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.fo-dot { background: #2a8c5a; }
.dtl-dot { background: #c5a55a; }

.optional-tag {
    font-size: 11px;
    font-weight: 400;
    color: #6b6560;
    font-style: italic;
}

.upload-area-secondary {
    border: 2px dashed #e8e4e0;
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #faf8f5;
    min-height: 60px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.upload-area-secondary:hover {
    border-color: #c5a55a;
    background: #fffdf8;
}

.upload-area-secondary.drag-over {
    border-color: #c5a55a;
    background: #fef9ed;
    border-width: 3px;
}

.upload-area-secondary.file-selected {
    border-color: #c5a55a;
    border-style: solid;
    background: #fffdf8;
}

.upload-icon-secondary {
    font-size: 24px;
    color: #c5a55a;
    margin-bottom: 8px;
}

.upload-text-dtl {
    font-family: var(--font-body);
    font-size: 14px;
    color: #4a4540;
    margin-bottom: 4px;
}

.upload-subtext-dtl {
    font-family: var(--font-body);
    font-size: 12px;
    color: #6b6560;
}

/* ---- Metric source badges ---- */

.metric-source-badge {
    display: inline-block;
    font-family: 'DM Mono', monospace;
    font-size: 9px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 6px;
    vertical-align: middle;
    letter-spacing: 0.5px;
}

.source-face_on {
    background: #e8f5ee;
    color: #0f3d2a;
}

.source-dtl {
    background: #fef3d6;
    color: #8a7030;
}

/* ---- Fusion banner ---- */

.fusion-banner {
    background: linear-gradient(135deg, #e8f5ee 0%, #fef9ed 100%);
    border: 1px solid #e8e4e0;
    border-radius: 8px;
    padding: 10px 16px;
    margin-bottom: 16px;
    font-family: var(--font-body);
    font-size: 13px;
    color: #4a4540;
    display: flex;
    align-items: center;
    gap: 8px;
}

.fusion-icon {
    font-size: 16px;
}

/* ---- Pose view toggle ---- */

.pose-view-toggle {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.view-toggle-btn {
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 500;
    padding: 6px 14px;
    border-radius: 50px;
    border: 1px solid #e8e4e0;
    background: #faf8f5;
    color: #4a4540;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

.view-toggle-btn:hover {
    border-color: #1a5e3a;
}

.view-toggle-btn.active {
    background: #0f3d2a;
    color: #ffffff;
    border-color: #0f3d2a;
}

.view-toggle-btn.active .fo-dot {
    background: #2a8c5a;
}

.view-toggle-btn.active .dtl-dot {
    background: #c5a55a;
}

/* ---- Responsive ---- */

@media (max-width: 640px) {
    .dual-upload-container {
        flex-direction: column;
        gap: 12px;
    }
}

/* v2.2 fix: match upload zone heights */
.dual-upload-container {
    align-items: stretch;
}
.upload-area-secondary {
    height: 100%;
    box-sizing: border-box;
}

/* ═══════════════════════════════════════════
   v2.3 — Matched Upload Zones + First Frame Preview
   ═══════════════════════════════════════════ */

.upload-zone.has-preview {
  padding: 0;
  border: 2px solid var(--light-gray);
  border-style: solid;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}

.upload-preview-video {
  width: 100%;
  display: block;
  border-radius: 14px;
  background: #000;
}

.upload-preview-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 12px;
  font-size: 0.78rem;
  color: var(--warm-gray);
  background: var(--warm-white);
  border-top: 1px solid var(--light-gray);
}

.upload-preview-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 70%;
}

.upload-preview-change {
  color: var(--green-mid);
  cursor: pointer;
  font-weight: 500;
}

.upload-preview-change:hover {
  text-decoration: underline;
}

/* Ensure both zones match height in dual layout */
.dual-upload-container .upload-zone {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* ═══════════════════════════════════════════
   CICERO WIDGET — Embedded chat
   ═══════════════════════════════════════════ */

.cicero-widget {
  background: var(--warm-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.cicero-header {
  padding: 0.8rem 1.2rem;
  border-bottom: 1px solid var(--light-gray);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.cicero-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.cicero-subtitle {
  font-size: 0.75rem;
  color: var(--warm-gray);
}

.cicero-messages {
  padding: 1rem 1.2rem;
  max-height: 300px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cicero-msg {
  max-width: 85%;
  line-height: 1.5;
}

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

.cicero-msg-bot {
  align-self: flex-start;
}

.cicero-msg-user .cicero-msg-text {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 2px 12px;
  background: var(--green-deep);
  color: #fff;
  font-size: 0.88rem;
}

.cicero-msg-bot .cicero-msg-text {
  display: inline-block;
  padding: 0.5rem 0.9rem;
  border-radius: 12px 12px 12px 2px;
  background: #f0f0ec;
  color: var(--text-primary);
  font-size: 0.88rem;
}

.cicero-input-row {
  display: flex;
  gap: 0.5rem;
  padding: 0.8rem 1.2rem;
  border-top: 1px solid var(--light-gray);
}

.cicero-input {
  flex: 1;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--light-gray);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.88rem;
  background: var(--warm-white);
  color: var(--text-primary);
}

.cicero-input:focus {
  outline: none;
  border-color: var(--green-mid);
}

.cicero-send {
  padding: 0.6rem 1rem;
  background: var(--green-deep);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s;
}

.cicero-send:hover {
  background: var(--green-mid);
}

/* ─── METRIC GROUP BORDERS (v2.3 metric boxes) ─── */





/* ─── METRIC CARD LAYOUT (v2.3 metric boxes) ─── */
.metric-card .metric-name {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--warm-gray);
  margin-top: 0;
  margin-bottom: 0.2rem;
}

.metric-card .metric-value {
  font-size: 1.3rem;
  font-weight: 600;
  font-family: var(--font-mono);
  color: var(--text-primary);
  line-height: 1.2;
}

/* ─── RELATIVE LABELS ─── */
.metric-relative {
  font-size: 0.65rem;
  font-family: Georgia, 'Times New Roman', serif;
  font-style: italic;
  margin-top: 0.3rem;
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  display: inline-block;
}

.metric-relative.tour-range {
  color: #5b7b5a;
  background: #eef4ed;
}

.metric-relative.above-tour-avg,
.metric-relative.below-tour-avg {
  color: #8b7030;
  background: #f5f0e0;
}

.metric-relative.needs-work {
  color: #8b4a3a;
  background: #f5e8e4;
}

.metric-relative.elite {
  color: #3a5b8b;
  background: #e4ecf5;
}


/* ─── ALL METRIC TEXT: Georgia serif, black ─── */
.metric-card .metric-name {
  font-family: Georgia, 'Times New Roman', serif;
  color: #1a1a1a;
}

.metric-card .metric-value {
  font-family: Georgia, 'Times New Roman', serif;
  color: #1a1a1a;
}

/* ─── CICERO COMPACT ─── */
.cicero-widget {
  padding: 0.6rem !important;
}
.cicero-messages {
  min-height: 0 !important;
  max-height: 180px !important;
  padding: 0.3rem !important;
  gap: 0.3rem !important;
}
.cicero-messages:empty {
  display: none !important;
}
.cicero-input-row {
  margin-top: 0.3rem !important;
}



/* ─── CICERO as fieldset/legend ─── */
.cicero-widget {
  border: none !important;
  border-top: 3px solid #6a8a9a !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 0.5rem 1rem !important;
  box-shadow: none !important;
  position: relative !important;
}

.cicero-widget::before,
.cicero-widget::after {
  content: '' !important;
  position: absolute !important;
  top: -3px !important;
  width: 3px !important;
  height: 28px !important;
}
.cicero-widget::before {
  left: 0 !important;
  background: linear-gradient(to bottom, #6a8a9a 0%, transparent 100%) !important;
}
.cicero-widget::after {
  right: 0 !important;
  background: linear-gradient(to bottom, #6a8a9a 0%, transparent 100%) !important;
}

/* Hide the old cicero header — replaced by legend-style label */
.cicero-header { display: none !important; }

.cicero-messages {
  min-height: 0 !important;
  max-height: 180px !important;
  padding: 0.3rem !important;
  gap: 0.3rem !important;
}
.cicero-messages:empty { display: none !important; }
.cicero-input-row { margin-top: 0.3rem !important; }


/* ─── LAYOUT V2 (yacht dashboard final) ─── */

/* Compact form row */
.form-row-compact {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
}
.form-row-compact .form-input {
  flex: 1;
  padding: 0.5rem 0.7rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  color: #1a1a1a;
  background: #fff;
}
.form-row-compact .form-input::placeholder {
  color: #999;
  font-style: italic;
}
.hand-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.radio-label {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

/* Upload fieldsets */
.upload-fieldset {
  flex: 1;
  min-height: 120px;
}
.upload-fieldset .upload-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100px;
  cursor: pointer;
  border: none;
  background: transparent;
  margin: 0;
  padding: 0;
}
.upload-fieldset .upload-zone .upload-icon {
  color: #bbb;
}
.upload-fieldset .upload-zone .upload-label,
.upload-fieldset .upload-zone .upload-sublabel {
  display: none;
}
.upload-fieldset .upload-zone.has-preview {
  padding: 0;
}
.upload-preview-video {
  width: 100%;
  max-height: 200px;
  object-fit: contain;
  border-radius: 4px;
}

/* Dual container */
.dual-upload-container {
  display: flex;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* Analyze button */
.btn-analyze {
  font-family: Georgia, 'Times New Roman', serif !important;
  text-transform: lowercase !important;
}

/* ─── SECTION-CAP BORDERS (final) ─── */
.section-cap {
  border: none;
  border-top: 3px solid #999;
  border-radius: 6px 6px 0 0;
  padding: 1rem 1.2rem;
  margin: 0 0 1.2rem 0;
  background: var(--warm-white, #f5f5f0);
  position: relative;
}

/* Side strokes with gap from top */
.section-cap::before,
.section-cap::after {
  content: '';
  position: absolute;
  top: 6px;
  width: 3px;
  height: 22px;
  background: linear-gradient(to bottom, #999 0%, transparent 100%);
}
.section-cap::before { left: 0; }
.section-cap::after { right: 0; }

.section-cap legend {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #1a1a1a !important;
  padding: 0 0.8rem;
  margin: 0 auto;
  float: none;
  width: auto;
  text-align: center;
}

/* Per-group colors */
#metrics-body { border-top-color: #5b7b9a; }
#metrics-body::before, #metrics-body::after { background: linear-gradient(to bottom, #5b7b9a 0%, transparent 100%); }
#metrics-tempo { border-top-color: #7a9b6d; }
#metrics-tempo::before, #metrics-tempo::after { background: linear-gradient(to bottom, #7a9b6d 0%, transparent 100%); }
#metrics-speed { border-top-color: #c4956a; }
#metrics-speed::before, #metrics-speed::after { background: linear-gradient(to bottom, #c4956a 0%, transparent 100%); }
#metrics-ground { border-top-color: #8b7d6b; }
#metrics-ground::before, #metrics-ground::after { background: linear-gradient(to bottom, #8b7d6b 0%, transparent 100%); }

/* ALL TEXT BLACK */
.section-cap legend { color: #1a1a1a !important; }
.metric-card .metric-name { color: #1a1a1a !important; font-family: Georgia, 'Times New Roman', serif; }
.metric-card .metric-value { color: #1a1a1a !important; font-family: Georgia, 'Times New Roman', serif; }
.metric-relative { color: #1a1a1a !important; }
.summary-card h2, .events-timeline h3, .plot-section h3 { color: #1a1a1a !important; }

/* ─── CICERO WIDGET — top-cap style ─── */
.cicero-widget {
  border: none !important;
  border-top: 3px solid #999 !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 0.4rem 1rem 0.5rem 1rem !important;
  box-shadow: none !important;
  position: relative !important;
  background: var(--warm-white, #f5f5f0) !important;
}
.cicero-widget::before,
.cicero-widget::after {
  content: '' !important;
  position: absolute !important;
  top: 6px !important;
  width: 3px !important;
  height: 22px !important;
  background: linear-gradient(to bottom, #999 0%, transparent 100%) !important;
}
.cicero-widget::before { left: 0 !important; }
.cicero-widget::after { right: 0 !important; }

.cicero-header { display: none !important; }

.cicero-legend-label {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0.06em;
  color: #1a1a1a;
  text-align: center;
  background: var(--warm-white, #f5f5f0);
  padding: 0 0.8rem;
  margin: -0.9rem auto 0.3rem auto;
  width: fit-content;
  position: relative;
  z-index: 1;
}

.cicero-messages {
  min-height: 0 !important;
  max-height: 180px !important;
  padding: 0.2rem !important;
  gap: 0.2rem !important;
}
.cicero-messages:empty { display: none !important; }
.cicero-input-row { margin-top: 0.2rem !important; }

/* ─── DEMO LAYOUT FIXES ─── */

/* Upload boxes match video playback size */
.upload-fieldset .upload-zone {
  min-height: 240px !important;
  aspect-ratio: 16/9;
  background: #fff !important;
  border-radius: 6px;
}
.upload-fieldset {
  flex: 1;
  min-height: 260px;
}
.upload-preview-video {
  width: 100% !important;
  height: 100% !important;
  max-height: none !important;
  object-fit: contain;
}

/* Hide pose-viewer — upload boxes serve as video display */
.pose-viewer { display: none !important; }

/* Keep upload panel visible even after analysis */
.upload-panel[hidden] { display: block !important; }
.upload-panel { margin-bottom: 0; }

/* Cicero — border BREAKS around text like a proper fieldset legend */
.cicero-widget {
  border: none !important;
  border-top: 3px solid #999 !important;
  border-radius: 6px 6px 0 0 !important;
  padding: 0.3rem 0.8rem 0.4rem 0.8rem !important;
  box-shadow: none !important;
  position: relative !important;
  background: var(--warm-white, #f5f5f0) !important;
  margin-top: 1.2rem !important;
}
.cicero-widget::before,
.cicero-widget::after {
  content: '' !important;
  position: absolute !important;
  top: 6px !important;
  width: 3px !important;
  height: 22px !important;
  background: linear-gradient(to bottom, #999 0%, transparent 100%) !important;
}
.cicero-widget::before { left: 0 !important; }
.cicero-widget::after { right: 0 !important; }

/* Cicero legend label — sits in the border break */
.cicero-legend-label {
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 0.85rem !important;
  font-weight: 400 !important;
  letter-spacing: 0.06em !important;
  color: #1a1a1a !important;
  text-align: center !important;
  background: var(--warm-white, #f5f5f0) !important;
  padding: 0 0.8rem !important;
  margin: -0.75rem auto 0.15rem auto !important;
  width: fit-content !important;
  position: relative !important;
  z-index: 1 !important;
  display: block !important;
}

/* Kill the old cicero header completely */
.cicero-header { display: none !important; }

/* Kill any horizontal line/border below cicero header area */
.cicero-widget > hr,
.cicero-widget > div:first-child + hr,
.cicero-widget > .cicero-legend-label + hr { display: none !important; }

/* Squash cicero tighter */
.cicero-messages {
  min-height: 0 !important;
  max-height: 160px !important;
  padding: 0.15rem !important;
  gap: 0.15rem !important;
  margin: 0 !important;
}
.cicero-messages:empty { display: none !important; padding: 0 !important; margin: 0 !important; }
.cicero-input-row { margin-top: 0.15rem !important; }
.cicero-input-row input {
  font-family: Georgia, 'Times New Roman', serif !important;
  font-size: 0.85rem !important;
  padding: 0.35rem 0.6rem !important;
}

/* --- CENTERING + CICERO CLEAN --- */
.dual-upload-container {
  display: flex !important;
  gap: 1rem !important;
  justify-content: center !important;
  margin: 0 auto 1rem auto !important;
}

/* Cicero analysis — clean fieldset */
.cicero-section #cicero-content {
  min-height: 0;
  max-height: 200px;
  overflow-y: auto;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #1a1a1a;
  padding: 0.2rem 0;
}
.cicero-section #cicero-content:empty {
  display: none;
}
.cicero-chat-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
.cicero-chat-input {
  flex: 1;
  font-family: Georgia, serif;
  font-size: 0.85rem;
  color: #1a1a1a;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 0.4rem 0.7rem;
  background: #fff;
}
.cicero-chat-input::placeholder {
  color: #999;
  font-style: italic;
}
.cicero-send-btn {
  font-size: 1.1rem;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Kill old cicero widget entirely */
.cicero-widget { display: none !important; }

/* KILL SIDE STROKES */
.section-cap::before, .section-cap::after { display: none; }
.cicero-widget::before, .cicero-widget::after { display: none; }
.cicero-section::before, .cicero-section::after { display: none; }

/* CENTER UPLOAD BOXES */
.upload-container { max-width: 100%; margin: 0 auto; }
.dual-upload-container { justify-content: center; margin: 0 auto; max-width: 100%; }
.upload-fieldset { flex: 1; max-width: 48%; }
.upload-view-wrapper { flex: 1; max-width: 48%; }

/* KILL DUPLICATE PLAYBACK */
.pose-viewer, #pose-viewer { display: none; height: 0; overflow: hidden; visibility: hidden; }
.demo-viewer, #demo-viewer { display: none; height: 0; overflow: hidden; visibility: hidden; }
.dual-view-banner { display: none; }

/* PLAYBACK CONTROLS STRIP */
.playback-controls {
  margin: 0.5rem 0;
  padding: 0.4rem 0;
}
.event-jump-buttons {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
  margin-bottom: 0.3rem;
}
.event-jump-btn {
  font-family: Georgia, serif;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  color: #1a1a1a;
  cursor: pointer;
}
.event-jump-btn:hover { background: #eee; }
.event-jump-btn.active { background: #1a1a1a; color: #fff; }
.controls-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: #1a1a1a;
  margin-top: 0.2rem;
}
.marker-toggle {
  font-family: Georgia, serif;
  font-size: 0.75rem;
  color: #1a1a1a;
  cursor: pointer;
}
.dual-view-banner { display: none; }

/* KILL METRICS BANNER + MARKERS TOGGLE */
.dual-view-banner, [class*="dual-view-banner"] { display: none; }
.results-banner, [class*="results-banner"] { display: none; }

/* ─── MOBILE VIDEO FIT (v2.3.2) ─── */
@media (max-width: 768px) {
  .upload-fieldset .upload-zone {
    aspect-ratio: unset !important;
    min-height: 120px !important;
    max-width: 100vw;
  }
  .upload-fieldset {
    max-width: 100% !important;
    min-height: auto !important;
  }
  .upload-preview-video {
    max-height: 50vh !important;
    width: 100% !important;
    object-fit: contain;
  }
  .dual-upload-container {
    flex-direction: column !important;
    max-width: 100vw !important;
    padding: 0 0.5rem;
  }
}

/* Hide recorder link when preview is showing */
.upload-zone.has-preview ~ .capture-link,
.upload-zone.has-preview ~ #capture-link { display: none !important; }
