/* Run My Return Design Tokens */
:root {
  --hh-color-base-black: #000000;
  --hh-color-base-cloud: #F5F5F5;
  --hh-color-base-iron: #4A4A4A;
  --hh-color-base-offWhite: #FAFAFA;
  --hh-color-base-stone: #B0B0B0;
  --hh-color-base-white: #FFFFFF;
  --hh-color-borders-default: #E6E6E6;
  --hh-color-borders-strong: #BDBDBD;
  --hh-color-borders-subtle: #F0F0F0;
  --hh-color-brand-primary-300: #F2B8A6;
  --hh-color-brand-primary-600: #C35E46;
  --hh-color-brand-primary: #E07A5F;
  --hh-color-brand-sage-300: #B3CFC0;
  --hh-color-brand-sage-700: #5F8C79;
  --hh-color-brand-sage: #81B29A;
  --hh-color-brand-slate-300: #6C6E85;
  --hh-color-brand-slate-800: #2B2C3F;
  --hh-color-brand-slate: #3D405B;
  --hh-color-status-error: #D95D48;
  --hh-color-status-info: #5A6FA6;
  --hh-color-status-success: #6DAF8F;
  --hh-color-status-warning: #E8B26B;
  --hh-color-text-inverse: #FFFFFF;
  --hh-color-text-primary: #000000;
  --hh-color-text-secondary: #4A4A4A;
  --hh-color-text-tertiary: #B0B0B0;
  --hh-radius-full: 999px;
  --hh-radius-lg: 16px;
  --hh-radius-md: 12px;
  --hh-radius-sm: 8px;
  --hh-radius-xl: 20px;
  --hh-shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --hh-shadow-md: 0 2px 8px rgba(0,0,0,0.08);
  --hh-shadow-sm: 0 1px 2px rgba(0,0,0,0.06);
  --hh-space-2xl: 32px;
  --hh-space-3xl: 40px;
  --hh-space-lg: 16px;
  --hh-space-md: 12px;
  --hh-space-sm: 8px;
  --hh-space-xl: 24px;
  --hh-space-xs: 4px;
  --hh-type-body-lh: 24px;
  --hh-type-body-size: 16px;
  --hh-type-body-weight: 400;
  --hh-type-h1-lh: 40px;
  --hh-type-h1-size: 32px;
  --hh-type-h1-weight: 700;
  --hh-type-h2-lh: 32px;
  --hh-type-h2-size: 24px;
  --hh-type-h2-weight: 600;
  --hh-type-h3-lh: 28px;
  --hh-type-h3-size: 20px;
  --hh-type-h3-weight: 600;
  --hh-type-h4-lh: 24px;
  --hh-type-h4-size: 18px;
  --hh-type-h4-weight: 500;
  --hh-type-helper-lh: 16px;
  --hh-type-helper-size: 12px;
  --hh-type-helper-weight: 400;
  --hh-type-small-lh: 20px;
  --hh-type-small-size: 14px;
  --hh-type-small-weight: 400;
  --hh-font-family: Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --hh-font-feature-settings: 'tnum';
}

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

body {
    font-family: var(--hh-font-family);
    line-height: var(--hh-type-body-lh);
    color: var(--hh-color-text-primary);
    background: var(--hh-color-base-offWhite);
    min-height: 100vh;
}

.loading {
    display: none;
    max-width: 500px;
    margin: 0 auto;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    padding: 32px;
}

.progress-dashboard {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 24px;
}

.progress-header {
    text-align: center;
    margin-bottom: 24px;
}

.progress-header h3 {
    color: #1a1a1a;
    font-size: 1.1em;
    font-weight: 600;
    margin-bottom: 8px;
}

.progress-header .analysis-id {
    color: #6b7280;
    font-size: 12px;
    font-family: 'SF Mono', Monaco, monospace;
}

.overall-progress {
    margin-bottom: 24px;
}

.overall-progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.overall-progress-label span:first-child {
    font-weight: 500;
    color: #1a1a1a;
}

.overall-progress-label span:last-child {
    font-size: 14px;
    color: #6b7280;
    font-weight: 500;
}

.progress-bar-container {
    background: #e5e7eb;
    border-radius: 4px;
    height: 8px;
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, #10b981, #059669);
    height: 100%;
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.stages-container {
    display: grid;
    gap: 16px;
}

.stage {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 16px;
    transition: all 0.2s ease;
}

.stage.pending {
    opacity: 0.6;
}

.stage.in_progress {
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.1);
}

.stage.completed {
    border-color: #10b981;
    background: #f0fdf4;
}

.stage.failed {
    border-color: #ef4444;
    background: #fef2f2;
}

.stage.skipped {
    border-color: #f59e0b;
    background: #fffbeb;
}

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

.stage-title {
    font-weight: 500;
    color: #1a1a1a;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stage-status {
    font-size: 12px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stage-status.pending {
    background: #f3f4f6;
    color: #6b7280;
}

.stage-status.in_progress {
    background: #dbeafe;
    color: #3b82f6;
}

.stage-status.completed {
    background: #dcfce7;
    color: #16a34a;
}

.stage-status.failed {
    background: #fee2e2;
    color: #dc2626;
}

.stage-status.skipped {
    background: #fef3c7;
    color: #d97706;
}

.stage-message {
    color: #6b7280;
    font-size: 13px;
    margin-bottom: 12px;
}

.stage-progress {
    margin-bottom: 12px;
}

.stage-progress .progress-bar-container {
    height: 6px;
}

.substages {
    display: none;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e7eb;
}

.substages.show {
    display: block;
}

.substage {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 4px 0;
    font-size: 12px;
}

.substage-name {
    color: #6b7280;
}

.substage-status {
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.substage-status.completed {
    color: #16a34a;
}

.substage-status.failed {
    color: #dc2626;
}

.substage-status.in_progress {
    color: #3b82f6;
}

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

.spinner {
    border: 2px solid #f0f0f0;
    border-top: 2px solid #1a1a1a;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.duration-display {
    font-size: 11px;
    color: #9ca3af;
    font-family: 'SF Mono', Monaco, monospace;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #b91c1c;
    padding: 12px;
    border-radius: 6px;
    font-size: 13px;
    margin-top: 16px;
}
