:root {
    --step-inactive: #e5e7eb;
    --step-active: var(--transcend-blue);
    --step-complete: var(--metric-green);
}

.container { max-width: 1200px; margin: 0 auto; padding: 24px; }
.auth-copy { margin: 16px 0 24px; }
.auth-copy-tight { margin-bottom: 16px; }
.auth-copy-muted { color: var(--text-secondary); }
.initially-hidden { display: none; }
.page-contract,
.source-freshness { margin: 0 0 18px; padding: 18px 20px; border: 1px solid var(--border-color); border-radius: 8px; background: #f8fafc; }
.page-contract { border-left: 4px solid #1e3a8a; }
.page-contract h2 { font-size: 1.15rem; color: var(--text-primary); margin: 0 0 8px; }
.page-contract p,
.source-freshness p { margin: 0; color: var(--text-primary); line-height: 1.6; }
.access-summary { margin: 0 0 18px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.access-summary > div { border: 1px solid var(--border-color); border-radius: 8px; background: #ffffff; padding: 14px; }
.access-label,
.source-label { display: block; margin-bottom: 8px; color: var(--text-secondary); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.access-summary span:last-child { color: var(--text-primary); font-size: 0.9rem; line-height: 1.5; }
.source-freshness { border-left: 4px solid #0f766e; background: #f0fdfa; }

/* Header */
.header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 20px 0; margin-bottom: 24px; border-bottom: 2px solid var(--border-color);
}
.logo-section { display: flex; align-items: center; gap: 16px; }
.logo-section a { display: flex; align-items: center; }
.logo { height: 32px; width: auto; }
.logo-divider { width: 1px; height: 24px; background: var(--border-color); }
.logo-subtitle { font-size: 1rem; font-weight: 500; color: var(--text-secondary); }
.auth-section { display: flex; align-items: center; gap: 12px; }
.user-info { display: flex; align-items: center; gap: 10px; }
.user-photo { width: 36px; height: 36px; border-radius: 50%; border: 2px solid var(--border-color); }
.user-name { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }

/* Step Indicator */
.step-indicator {
    display: flex; justify-content: center; align-items: center; gap: 8px;
    padding: 24px 0; margin-bottom: 32px; background: white;
    border-radius: var(--radius-lg); border: 1px solid var(--border-color);
}
.step {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 12px 16px; border-radius: var(--radius-md); cursor: pointer;
    transition: all 0.2s ease; min-width: 100px;
}
.step:hover { background: var(--bg-primary); }
.step.disabled { cursor: not-allowed; opacity: 0.5; }
.step-circle {
    width: 36px; height: 36px; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; font-weight: 600;
    font-size: 0.9rem; background: var(--step-inactive); color: white;
    transition: all 0.2s ease;
}
.step.active .step-circle { background: var(--step-active); box-shadow: 0 0 0 4px rgba(44, 90, 160, 0.2); }
.step.complete .step-circle { background: var(--step-complete); }
.step-label { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }
.step.active .step-label { color: var(--transcend-blue); }
.step.complete .step-label { color: var(--metric-green); }
.step-connector { width: 40px; height: 2px; background: var(--step-inactive); }
.step-connector.complete { background: var(--step-complete); }

/* Content */
.content-card { background: white; border-radius: var(--radius-lg); border: 1px solid var(--border-color); padding: 32px; margin-bottom: 24px; }
.step-content { display: none; }
.step-content.active { display: block; }
.step-title { font-size: 1.5rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.step-description { font-size: 1rem; color: var(--text-secondary); margin-bottom: 24px; }

/* Inspire */
.deck-structures { display: grid; gap: 20px; }
.structure-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; background: var(--bg-primary); }
.structure-card h4 { font-size: 1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 12px; }
.structure-slides { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.slide-chip { font-size: 0.75rem; font-weight: 500; padding: 4px 10px; border-radius: 12px; background: var(--transcend-light); color: var(--transcend-blue); }
.structure-annotation { font-size: 0.85rem; color: var(--text-secondary); padding-left: 16px; border-left: 2px solid var(--border-color); }
.inspire-checkbox { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-primary); border-radius: var(--radius-md); margin-top: 24px; }
.inspire-checkbox input { width: 20px; height: 20px; cursor: pointer; }
.inspire-checkbox label { font-size: 0.95rem; color: var(--text-primary); cursor: pointer; }

/* Gather */
.form-grid { display: grid; gap: 20px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.form-label { font-size: 0.9rem; font-weight: 600; color: var(--text-primary); }
.form-hint { font-size: 0.8rem; color: var(--text-secondary); }
.form-input, .form-textarea {
    padding: 12px 16px; border: 1px solid var(--border-color); border-radius: var(--radius-sm);
    font-size: 0.95rem; font-family: inherit; transition: border-color 0.2s ease;
}
.form-input:focus, .form-textarea:focus { outline: none; border-color: var(--transcend-blue); box-shadow: 0 0 0 3px rgba(44, 90, 160, 0.1); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-progress { display: flex; align-items: center; gap: 12px; padding: 16px; background: var(--bg-primary); border-radius: var(--radius-md); margin-top: 24px; }
.progress-bar { flex: 1; height: 8px; background: var(--border-color); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--metric-green); transition: width 0.3s ease; }
.progress-fill-empty { width: 0%; }
.progress-text { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); min-width: 80px; }

/* Generate - Slide Cards */
.generate-prompt { text-align: center; padding: 40px; }
.generate-prompt p { font-size: 1rem; color: var(--text-secondary); margin-bottom: 24px; }
.slides-container { display: none; }
.slide-card {
    border: 1px solid var(--border-color); border-radius: var(--radius-md);
    padding: 20px; margin-bottom: 16px; background: var(--bg-primary);
}
.slide-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.slide-number {
    font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: white;
    background: var(--transcend-blue); padding: 4px 10px; border-radius: 12px;
}
.slide-title { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
.slide-key-message {
    font-size: 0.9rem; color: var(--transcend-blue); font-style: italic;
    margin-bottom: 12px; padding: 8px 12px; background: var(--transcend-light);
    border-radius: var(--radius-sm);
}
.slide-bullets { margin: 0 0 12px; padding-left: 20px; }
.slide-bullets li { font-size: 0.9rem; color: var(--text-primary); line-height: 1.6; margin-bottom: 4px; }
.slide-section { margin-bottom: 10px; }
.slide-section-label { font-size: 0.75rem; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; }
.slide-section-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }

/* Refine */
.score-card { border: 1px solid var(--border-color); border-radius: var(--radius-md); padding: 24px; margin-bottom: 16px; }
.score-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.score-label { font-size: 1rem; font-weight: 600; }
.score-grade { font-size: 1.25rem; font-weight: 700; padding: 6px 16px; border-radius: 12px; }
.score-grade.grade-a { background: #dcfce7; color: #166534; }
.score-grade.grade-b { background: #fef3c7; color: #92400e; }
.score-grade.grade-c { background: #fee2e2; color: #991b1b; }
.score-breakdown { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.score-criterion { text-align: center; padding: 12px 8px; background: var(--bg-primary); border-radius: var(--radius-sm); }
.criterion-name { font-size: 0.7rem; font-weight: 600; text-transform: uppercase; color: var(--text-secondary); margin-bottom: 4px; }
.criterion-score { font-size: 1.1rem; font-weight: 600; color: var(--text-primary); }
.score-feedback {
    font-size: 0.9rem; color: var(--text-secondary); padding: 12px 16px;
    background: var(--bg-primary); border-radius: var(--radius-sm); border-left: 4px solid var(--transcend-blue);
}
.threshold-notice { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: var(--radius-md); margin-top: 24px; }
.threshold-notice.success { background: #dcfce7; color: #166534; }
.threshold-notice.warning { background: #fef3c7; color: #92400e; }

/* Lock */
.lock-summary { margin-bottom: 32px; }
.summary-item { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--border-color); }
.summary-label { font-size: 0.9rem; color: var(--text-secondary); }
.summary-value { font-size: 0.9rem; font-weight: 500; color: var(--text-primary); }
.recipients-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.recipient-tag { font-size: 0.85rem; padding: 6px 12px; background: var(--transcend-light); color: var(--transcend-blue); border-radius: 20px; }
.lock-subtitle { font-size: 1rem; margin-bottom: 12px; }
.lock-confirmation { background: #fef3c7; border: 1px solid #f59e0b; border-radius: var(--radius-md); padding: 16px; margin-bottom: 24px; }
.lock-confirmation p { font-size: 0.9rem; color: #92400e; margin: 0; }
.success-state { text-align: center; padding: 40px; }
.success-icon { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; min-height: 40px; padding: 10px 18px; border-radius: 999px; background: #dcfce7; color: #166534; font-size: 0.85rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 16px; }
.document-id { font-size: 0.85rem; color: var(--text-secondary); }
.success-actions { margin-top: 24px; }
.comments-empty-help { font-size: 12px; margin-top: 8px; }

/* Buttons */
.btn { padding: 12px 24px; border-radius: var(--radius-sm); font-size: 0.95rem; font-weight: 500; cursor: pointer; border: none; transition: all 0.2s ease; display: inline-flex; align-items: center; gap: 8px; }
.btn-primary { background: var(--transcend-blue); color: white; }
.btn-primary:hover { background: var(--transcend-blue-dark); }
.btn-primary:disabled { background: var(--border-color); cursor: not-allowed; }
.btn-secondary { background: white; color: var(--text-primary); border: 1px solid var(--border-color); }
.btn-secondary:hover { background: var(--bg-primary); }
.btn-success { background: var(--metric-green); color: white; }
.btn-success:hover { background: #1e8449; }
.nav-buttons { display: flex; justify-content: space-between; align-items: center; padding-top: 24px; border-top: 1px solid var(--border-color); }

/* Spinner & Loading */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 1s linear infinite; }
.spinner-lg { width: 48px; height: 48px; border: 3px solid var(--border-color); border-top-color: var(--transcend-blue); margin: 0 auto 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(255,255,255,0.9); display: none; align-items: center; justify-content: center; z-index: 1000; }
.loading-overlay.active { display: flex; }
.loading-content { text-align: center; }
.loading-content .spinner { width: 48px; height: 48px; border-width: 3px; border-color: var(--border-color); border-top-color: var(--transcend-blue); margin: 0 auto 16px; }

/* Auth */
#loadingState, #authRequired, #accessDenied { text-align: center; padding: 80px 20px; }
#appContent.hidden { display: none; }

/* Back Link */
.back-link { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); text-decoration: none; font-size: 0.9rem; margin-bottom: 24px; }
.back-link:hover { color: var(--transcend-blue); }

/* Footer */
.footer { text-align: center; padding: 40px 20px; color: var(--text-secondary); font-size: 0.85rem; border-top: 1px solid var(--border-color); margin-top: 40px; }
.footer p { margin: 4px 0; }

/* Responsive */
@media (max-width: 768px) {
    .step-indicator { flex-wrap: wrap; gap: 12px; }
    .step-connector { display: none; }
    .form-row { grid-template-columns: 1fr; }
    .score-breakdown { grid-template-columns: repeat(3, 1fr); }
    .access-summary { grid-template-columns: 1fr; }
}
