/* ====================================
   Supplyze App Styles
   Theme: Teal/Green (#00BFA5)
   Relies on: app-common.css, design-tokens.css
   ==================================== */

/* Supplyze theme variables */
:root {
    --sz-primary: #00BFA5;
    --sz-primary-dark: #009688;
    --sz-primary-darker: #00796B;
    --sz-primary-light: #E0F7F0;
    --sz-primary-lighter: #F0FDF9;
    --sz-accent: #00E676;
    --sz-accent-blue: #0091EA;
}

/* ====================================
   App Wrapper (full-width, no sidebar)
   ==================================== */
.sz-app-wrapper {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* ====================================
   Page Header
   ==================================== */
.sz-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 32px 20px;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    flex-shrink: 0;
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.4) 0%, rgba(0, 230, 118, 0.22) 40%, rgba(0, 145, 234, 0.06) 70%, transparent 100%);
}

.sz-page-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sz-logo-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
}

.sz-logo-svg {
    flex-shrink: 0;
}

.sz-logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.sz-page-title {
    font-size: 24px;
    font-weight: 700;
    color: #1A1A2E;
    margin: 0;
    letter-spacing: -0.8px;
    line-height: 1;
}

.sz-title-accent {
    font-weight: 800;
    color: var(--sz-primary);
}

.sz-page-subtitle {
    font-size: 11px;
    letter-spacing: 0.5px;
    color: var(--text-secondary, #6b7280);
    margin: 0;
}

.sz-page-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sz-btn-upload-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: var(--sz-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family, 'DM Sans', sans-serif);
}

.sz-btn-upload-header:hover {
    background: var(--sz-primary-dark);
    transform: translateY(-1px);
}

/* ====================================
   App Panels Layout
   ==================================== */
.sz-app-panels {
    display: flex;
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

/* ====================================
   Records Panel (Left)
   ==================================== */
.sz-records-panel {
    width: 320px;
    flex-shrink: 0;
    background: var(--bg-secondary, #f9fafb);
    border-right: 1px solid var(--border-subtle, #e5e7eb);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.sz-panel-header {
    padding: 24px 20px 16px;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    background: linear-gradient(180deg, rgba(0, 191, 165, 0.06) 0%, transparent 100%);
}

.sz-panel-header h2 {
    margin: 0;
    font-size: 17px;
    font-weight: 700;
    color: var(--sz-primary-darker, #00796B);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sz-records-list {
    padding: 12px;
    overflow-y: auto;
    flex: 1;
}

.sz-records-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}

.sz-records-loading .spinner-small {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-subtle, #e5e7eb);
    border-top-color: var(--sz-primary, #00BFA5);
    border-radius: 50%;
    animation: sz-spin 0.8s linear infinite;
}

.sz-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 40px 20px;
    color: var(--text-secondary, #6b7280);
}

.sz-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--sz-primary-light);
    border-top-color: var(--sz-primary);
    border-radius: 50%;
    animation: sz-spin 0.8s linear infinite;
}

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

.sz-empty-records {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #6b7280);
}

.sz-empty-records p {
    margin: 0 0 16px 0;
}

.sz-help-text {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
}

.sz-record-card {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.sz-record-card:hover {
    border-color: var(--sz-primary);
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.1);
}

.sz-record-card.sz-selected {
    border-color: var(--sz-primary);
    background: var(--sz-primary-lighter);
}

.sz-record-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.sz-record-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sz-btn-delete-record {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.sz-btn-delete-record:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.sz-record-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 12px 0;
}

.sz-record-image {
    width: 100%;
    height: 120px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f5f5f5;
}

.sz-record-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sz-record-info-card h4 {
    margin: 0 0 4px 0;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-record-date {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}

.sz-btn-analyze {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    padding: 8px;
    background: var(--sz-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.sz-btn-analyze:hover {
    background: var(--sz-primary-dark);
}

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

/* Record card button group */
.sz-record-buttons {
    display: flex;
    gap: 6px;
}

.sz-btn-view-result {
    flex: 1;
    padding: 8px;
    background: var(--sz-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s;
}

.sz-btn-view-result:hover {
    background: var(--sz-primary-dark);
}

.sz-btn-reanalyze {
    padding: 8px 12px;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 8px;
    font-weight: 500;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.sz-btn-reanalyze:hover {
    background: var(--border-subtle, #e5e7eb);
    color: var(--text-primary, #111827);
}

.sz-btn-primary-small {
    padding: 10px 20px;
    background: var(--sz-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s;
}

.sz-btn-primary-small:hover {
    background: var(--sz-primary-dark);
}

/* ====================================
   Results Panel (Right)
   ==================================== */
.sz-results-panel {
    flex: 1;
    padding: 32px;
    overflow-y: auto;
    min-height: 0;
}

.sz-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 40px;
    color: var(--text-secondary, #6b7280);
}

.sz-empty-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sz-primary-light);
    border-radius: 50%;
    margin-bottom: 24px;
    color: var(--sz-primary);
}

.sz-empty-state h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary, #111827);
}

.sz-empty-state p {
    margin: 0;
    max-width: 400px;
    line-height: 1.6;
    font-size: 14px;
}

/* Results Content */
.sz-results-header {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-results-header h2 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-weight: 700;
}

.sz-record-info {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}

.sz-section {
    margin-bottom: 32px;
}

.sz-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-section-title svg {
    color: var(--sz-primary);
}

/* Abnormal Biomarkers */
.sz-abnormal-list {
    display: grid;
    gap: 12px;
}

.sz-abnormal-item {
    padding: 16px;
    background: #FFF3E0;
    border-left: 4px solid #FF9800;
    border-radius: 8px;
}

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

.sz-biomarker-name {
    font-weight: 600;
    font-size: 14px;
}

.sz-condition-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.sz-condition-high {
    background: #FFEBEE;
    color: #C62828;
}

.sz-condition-low {
    background: #E3F2FD;
    color: #1565C0;
}

.sz-abnormal-details {
    display: flex;
    gap: 16px;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}

.sz-value {
    font-weight: 600;
    color: var(--text-primary, #111827);
}

/* Recommendations */
.sz-recommendations-list {
    display: grid;
    gap: 16px;
}

.sz-recommendation-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.2s;
}

.sz-recommendation-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0, 0, 0, 0.08));
}

.sz-priority-1 {
    border-left: 4px solid #D32F2F;
}

.sz-priority-2 {
    border-left: 4px solid #F57C00;
}

.sz-priority-3,
.sz-priority-4,
.sz-priority-5 {
    border-left: 4px solid var(--sz-primary);
}

.sz-rec-header {
    margin-bottom: 16px;
}

.sz-rec-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sz-rec-title-row h4 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
}

.sz-priority-badge {
    padding: 4px 12px;
    background: #E8F5E9;
    color: #2E7D32;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.sz-evidence-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
}

.sz-evidence-strong {
    background: #E8F5E9;
    color: #2E7D32;
}

.sz-evidence-good {
    background: #E3F2FD;
    color: #1565C0;
}

.sz-evidence-preliminary {
    background: #FFF3E0;
    color: #EF6C00;
}

.sz-rec-body {
    margin-bottom: 16px;
}

.sz-rec-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-rec-label {
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}

.sz-rec-value {
    font-weight: 600;
    color: var(--text-primary, #111827);
    font-size: 13px;
}

.sz-rec-rationale {
    margin-top: 12px;
    padding: 12px;
    background: var(--bg-card, #ffffff);
    border-radius: 8px;
}

.sz-rec-rationale h5 {
    margin: 0 0 6px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-rec-rationale p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--text-secondary, #6b7280);
}

.sz-rec-precautions {
    display: flex;
    gap: 12px;
    margin-top: 12px;
    padding: 12px;
    background: #FFF9C4;
    border-left: 3px solid #FBC02D;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #F57F17;
}

.sz-rec-precautions svg {
    flex-shrink: 0;
    margin-top: 2px;
}

.sz-rec-footer {
    padding-top: 16px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-rec-footer h5 {
    margin: 0 0 12px 0;
    font-size: 13px;
    font-weight: 600;
}

.sz-purchase-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.sz-purchase-btn {
    flex: 1;
    min-width: 120px;
    padding: 10px 16px;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.2s;
}

.sz-btn-coupang {
    background: #FF6B00;
    color: white;
}

.sz-btn-coupang:hover {
    background: #E65100;
}

.sz-btn-iherb {
    background: #7CB342;
    color: white;
}

.sz-btn-iherb:hover {
    background: #689F38;
}

.sz-btn-naver {
    background: #00C73C;
    color: white;
}

.sz-btn-naver:hover {
    background: #00A82D;
}

/* No Recommendations State */
.sz-no-recommendations {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 60px 40px;
}

.sz-success-icon {
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #E8F5E9;
    border-radius: 50%;
    margin-bottom: 24px;
    color: #4CAF50;
}

.sz-no-recommendations h3 {
    margin: 0 0 12px 0;
    font-size: 18px;
    color: var(--text-primary, #111827);
}

.sz-no-recommendations p {
    margin: 0;
    max-width: 400px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.6;
    font-size: 14px;
}

/* ====================================
   Analysis Loading / Thinking Timeline
   ==================================== */
.sz-analysis-loading {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 40px 32px;
    max-height: calc(100vh - 200px);
    overflow-y: auto;
}

.sz-thinking-header {
    text-align: center;
    margin-bottom: 32px;
}

.sz-thinking-header h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-thinking-progress-bar {
    width: 100%;
    max-width: 480px;
    height: 4px;
    background: var(--sz-primary-light);
    border-radius: 2px;
    overflow: hidden;
    margin: 0 auto;
}

.sz-thinking-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sz-primary), var(--sz-accent));
    border-radius: 2px;
    transition: width 0.5s ease;
    width: 0%;
}

/* Thinking Container - Vertical Timeline */
.sz-thinking-container {
    max-width: 560px;
    margin: 0 auto;
    width: 100%;
}

/* Each Step */
.sz-thinking-step {
    position: relative;
    padding-left: 36px;
    padding-bottom: 24px;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.sz-thinking-step.sz-step-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Timeline vertical line */
.sz-thinking-step::before {
    content: '';
    position: absolute;
    left: 11px;
    top: 24px;
    bottom: 0;
    width: 2px;
    background: var(--border-subtle, #e5e7eb);
}

.sz-thinking-step:last-child::before {
    display: none;
}

.sz-thinking-step.sz-step-completed::before {
    background: var(--sz-primary);
}

.sz-thinking-step.sz-step-running::before {
    background: linear-gradient(to bottom, var(--sz-primary), var(--border-subtle, #e5e7eb));
}

/* Step Row Layout */
.sz-thinking-step-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

/* Timeline Node */
.sz-thinking-node {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    left: 0;
    top: 0;
}

.sz-node-pending {
    background: var(--bg-secondary, #f9fafb);
    border: 2px solid var(--border-subtle, #e5e7eb);
}

.sz-node-running {
    background: var(--sz-primary-light);
    border: 2px solid var(--sz-primary);
}

.sz-node-spinner {
    width: 12px;
    height: 12px;
    border: 2px solid var(--sz-primary-light);
    border-top-color: var(--sz-primary);
    border-radius: 50%;
    animation: sz-spin 0.7s linear infinite;
}

.sz-node-completed {
    background: var(--sz-primary);
    border: 2px solid var(--sz-primary);
    color: white;
}

.sz-node-completed svg {
    stroke: white;
}

/* Step Content */
.sz-thinking-step-content {
    flex: 1;
    min-width: 0;
}

.sz-thinking-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 24px;
}

.sz-step-completed .sz-thinking-title {
    color: var(--text-secondary, #6b7280);
}

.sz-step-running .sz-thinking-title {
    color: var(--sz-primary-dark);
}

/* Detail entries */
.sz-thinking-details {
    margin-top: 6px;
}

.sz-thinking-detail {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    line-height: 1.5;
    padding: 2px 0;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.sz-thinking-detail.sz-detail-visible {
    opacity: 1;
    transform: translateX(0);
}

.sz-step-running .sz-thinking-detail {
    color: var(--text-secondary, #6b7280);
}

.sz-step-running .sz-thinking-detail:last-child {
    color: var(--sz-primary-dark);
    font-weight: 500;
}

/* Legacy spinner (keep for upload progress) */
.sz-spinner-large {
    width: 60px;
    height: 60px;
    border: 4px solid var(--sz-primary-light);
    border-top-color: var(--sz-primary);
    border-radius: 50%;
    animation: sz-spin 0.8s linear infinite;
    margin-bottom: 24px;
}

/* ====================================
   Upload Progress
   ==================================== */
.sz-upload-progress {
    background: var(--bg-card, #ffffff);
    border-radius: 10px;
    padding: 16px;
    margin: 12px;
    border: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-progress-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--sz-primary);
    font-weight: 600;
    font-size: 13px;
}

.sz-progress-header svg {
    flex-shrink: 0;
}

.sz-progress-bar {
    width: 100%;
    height: 6px;
    background: var(--sz-primary-light);
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.sz-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sz-primary), var(--sz-accent));
    border-radius: 3px;
    transition: width 0.3s ease;
    width: 0%;
}

.sz-progress-text {
    margin: 0;
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    text-align: center;
}

/* ====================================
   Optimized Dosage in Recommendation Cards
   ==================================== */
.sz-original-dosage {
    text-decoration: line-through;
    color: var(--text-muted, #9ca3af);
    font-weight: 400;
}

.sz-rec-tips {
    margin-top: 12px;
    padding: 12px;
    background: #E8F5E9;
    border-radius: 8px;
}

.sz-rec-tips h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: #2E7D32;
}

.sz-rec-tips ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: #388E3C;
    line-height: 1.6;
}

/* ====================================
   Interactions Section
   ==================================== */
.sz-interactions-list {
    display: grid;
    gap: 12px;
}

.sz-safety-summary {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
    margin-bottom: 16px;
}

.sz-safety-summary p {
    margin: 0;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.sz-safety-badge {
    padding: 6px 16px;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    flex-shrink: 0;
}

.sz-safety-low {
    background: #E8F5E9;
    color: #2E7D32;
}

.sz-safety-medium {
    background: #FFF3E0;
    color: #EF6C00;
}

.sz-safety-high {
    background: #FFEBEE;
    color: #C62828;
}

.sz-interaction-card {
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid;
}

.sz-severity-low {
    background: #F1F8E9;
    border-left-color: #7CB342;
}

.sz-severity-medium {
    background: #FFF3E0;
    border-left-color: #FF9800;
}

.sz-severity-high {
    background: #FFEBEE;
    border-left-color: #E53935;
}

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

.sz-interaction-supplements {
    font-weight: 600;
    font-size: 13px;
}

.sz-severity-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.sz-severity-badge-low {
    background: #C8E6C9;
    color: #2E7D32;
}

.sz-severity-badge-medium {
    background: #FFE0B2;
    color: #E65100;
}

.sz-severity-badge-high {
    background: #FFCDD2;
    color: #B71C1C;
}

.sz-interaction-desc {
    margin: 0 0 8px 0;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.sz-interaction-action {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-subsection-title {
    font-size: 14px;
    font-weight: 600;
    margin: 20px 0 12px 0;
    color: var(--text-primary, #111827);
}

.sz-safe-combinations {
    margin-top: 16px;
}

.sz-safe-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sz-safe-tag {
    padding: 6px 14px;
    background: #E8F5E9;
    color: #2E7D32;
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
}

/* ====================================
   Evidence Section
   ==================================== */
.sz-evidence-list {
    display: grid;
    gap: 12px;
}

.sz-evidence-card {
    background: var(--bg-secondary, #f9fafb);
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.sz-evidence-card:hover {
    border-color: var(--sz-primary);
}

.sz-evidence-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    cursor: pointer;
    user-select: none;
}

.sz-evidence-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    flex: 1;
}

.sz-evidence-title-row h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 700;
}

.sz-evidence-badges {
    display: flex;
    gap: 6px;
}

.sz-confidence-badge {
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
}

.sz-confidence-high {
    background: #E8F5E9;
    color: #2E7D32;
}

.sz-confidence-medium {
    background: #FFF3E0;
    color: #EF6C00;
}

.sz-confidence-low {
    background: #FFEBEE;
    color: #C62828;
}

.sz-expand-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
    color: var(--text-muted, #9ca3af);
}

.sz-expanded .sz-expand-icon {
    transform: rotate(180deg);
}

.sz-evidence-details {
    display: none;
    padding: 0 16px 16px;
}

.sz-expanded .sz-evidence-details {
    display: block;
}

.sz-evidence-section {
    margin-bottom: 16px;
}

.sz-evidence-section h5,
.sz-study-quality h5,
.sz-references-section h5,
.sz-limitations h5 {
    margin: 0 0 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-findings-list {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary, #6b7280);
}

.sz-findings-list li {
    margin-bottom: 4px;
}

.sz-effect-size-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 12px;
    background: var(--bg-card, #ffffff);
    border-radius: 8px;
    margin-bottom: 16px;
    border-left: 4px solid var(--sz-primary);
}

.sz-effect-metric {
    display: flex;
    flex-direction: column;
}

.sz-effect-label {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
}

.sz-effect-value {
    font-size: 18px;
    font-weight: 700;
    color: var(--sz-primary-dark);
}

.sz-effect-timeframe {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    padding: 4px 12px;
    background: var(--sz-primary-light);
    border-radius: 100px;
}

.sz-study-quality {
    margin-bottom: 16px;
}

.sz-quality-grid {
    display: flex;
    gap: 12px;
}

.sz-quality-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 16px;
    background: var(--bg-card, #ffffff);
    border-radius: 8px;
    min-width: 70px;
}

.sz-quality-number {
    font-size: 18px;
    font-weight: 700;
    color: var(--sz-primary-dark);
}

.sz-quality-label {
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    margin-top: 4px;
}

.sz-references-section {
    margin-bottom: 16px;
}

.sz-references-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sz-references-list li {
    padding: 8px 0;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    font-size: 12px;
}

.sz-references-list li:last-child {
    border-bottom: none;
}

.sz-ref-title {
    display: block;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

.sz-ref-journal {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
}

.sz-ref-finding {
    display: block;
    font-size: 11px;
    color: var(--text-secondary, #6b7280);
    margin-top: 4px;
    line-height: 1.5;
}

.sz-limitations {
    margin-bottom: 16px;
}

.sz-limitations ul {
    margin: 0;
    padding-left: 20px;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.6;
}

.sz-clinical-relevance {
    padding: 12px 16px;
    background: #E3F2FD;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #1565C0;
}

/* ====================================
   Dosage Guide Section
   ==================================== */
.sz-dosage-general {
    margin-bottom: 16px;
}

.sz-dosage-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sz-dosage-list li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 12px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-primary, #111827);
}

.sz-dosage-list li svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--sz-primary);
}

.sz-monitoring-box {
    display: flex;
    gap: 16px;
    padding: 16px;
    background: #E3F2FD;
    border-left: 4px solid #1565C0;
    border-radius: 8px;
}

.sz-monitoring-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #1565C0;
}

.sz-monitoring-box strong {
    display: block;
    font-size: 13px;
    color: #0D47A1;
    margin-bottom: 4px;
}

.sz-monitoring-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #1565C0;
}

/* ====================================
   Error State
   ==================================== */
.sz-error-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    padding: 40px;
    text-align: center;
}

.sz-error-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #FFF5F5;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.sz-error-icon svg {
    color: #E53E3E;
}

.sz-error-state h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0 0 8px;
}

.sz-error-state p {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: 0 0 24px;
    max-width: 400px;
}

/* ====================================
   Record Status Badges
   ==================================== */
.sz-record-status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.sz-status-completed {
    background: #E6FFFA;
    color: #047857;
}

.sz-status-processing {
    background: #FFF7ED;
    color: #C2410C;
}

.sz-status-failed {
    background: #FFF5F5;
    color: #DC2626;
}

/* ====================================
   Results Content - Max Width
   ==================================== */
.sz-results-content {
    max-width: 800px;
    margin: 0 auto;
}

/* ====================================
   Abnormal Biomarker Cards v2
   ==================================== */
.sz-abnormal-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
}

.sz-bio-card {
    background: #fff;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    border-left: 4px solid;
}

.sz-bio-card.sz-cond-high {
    border-left-color: #ef4444;
    background: linear-gradient(135deg, #fff 80%, #fef2f2);
}

.sz-bio-card.sz-cond-low {
    border-left-color: #3b82f6;
    background: linear-gradient(135deg, #fff 80%, #eff6ff);
}

.sz-bio-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 4px;
}

.sz-bio-name {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-primary, #111827);
}

.sz-bio-badge {
    padding: 3px 10px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
}

.sz-bio-badge.sz-cond-high {
    background: #fef2f2;
    color: #dc2626;
}

.sz-bio-badge.sz-cond-low {
    background: #eff6ff;
    color: #2563eb;
}

.sz-bio-val-row {
    display: flex;
    align-items: baseline;
    gap: 4px;
    margin-bottom: 12px;
}

.sz-bio-val {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary, #111827);
    line-height: 1;
}

.sz-bio-unit {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
}

/* Range bar */
.sz-bar-wrap {
    margin-top: 4px;
}

.sz-bar {
    position: relative;
    height: 8px;
    background: #f3f4f6;
    border-radius: 4px;
}

.sz-bar-normal {
    position: absolute;
    top: 0;
    height: 100%;
    background: #86efac;
    border-radius: 4px;
}

.sz-bar-marker {
    position: absolute;
    top: 50%;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.sz-bar-high {
    background: #ef4444;
}

.sz-bar-low {
    background: #3b82f6;
}

.sz-bar-label {
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
}

/* ====================================
   Recommendation Cards v2 (Grid Layout)
   ==================================== */
.sz-rec-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.sz-rec-card {
    background: #fff;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 12px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.sz-rec-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.sz-rec-card.sz-priority-1 { border-top: 3px solid #ef4444; }
.sz-rec-card.sz-priority-2 { border-top: 3px solid #f59e0b; }
.sz-rec-card.sz-priority-3,
.sz-rec-card.sz-priority-4,
.sz-rec-card.sz-priority-5 { border-top: 3px solid var(--sz-primary); }

.sz-rec-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 12px;
    gap: 8px;
    flex-wrap: wrap;
}

.sz-rec-name-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sz-pill-icon {
    color: var(--sz-primary);
    flex-shrink: 0;
}

.sz-rec-name-row h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.sz-rec-badge-row {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

/* Dosage info rows */
.sz-rec-info {
    margin-bottom: 10px;
}

.sz-rec-info .sz-rec-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    padding: 6px 0;
    border-bottom: 1px solid #f3f4f6;
    font-size: 13px;
}

.sz-info-label {
    color: var(--text-muted, #9ca3af);
    font-weight: 500;
    white-space: nowrap;
    flex-shrink: 0;
}

.sz-info-val {
    font-weight: 600;
    color: var(--text-primary, #111827);
    text-align: right;
}

.sz-dose-base {
    color: var(--text-muted, #9ca3af);
    font-weight: 400;
}

/* Rationale */
.sz-rec-reason {
    margin-bottom: 10px;
}

.sz-rec-reason p {
    margin: 0;
    font-size: 12px;
    line-height: 1.6;
    color: var(--text-secondary, #6b7280);
}

/* Warning */
.sz-rec-warn {
    display: flex;
    gap: 8px;
    align-items: flex-start;
    padding: 8px 10px;
    background: #fef9c3;
    border-radius: 6px;
    margin-bottom: 10px;
    font-size: 12px;
    color: #a16207;
}

.sz-rec-warn svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #eab308;
}

/* Tips v2 */
.sz-rec-tips-v2 {
    margin-bottom: 10px;
}

.sz-rec-tips-v2 ul {
    margin: 0;
    padding-left: 16px;
    font-size: 12px;
    color: #16a34a;
    line-height: 1.6;
}

/* Evidence papers inline */
.sz-rec-papers {
    margin-bottom: 10px;
}

.sz-papers-toggle {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--sz-primary-dark);
    cursor: pointer;
    font-family: inherit;
}

.sz-papers-toggle svg {
    color: var(--sz-primary);
}

.sz-chevron {
    transition: transform 0.2s;
}

.sz-toggle-open .sz-chevron {
    transform: rotate(180deg);
}

.sz-papers-list {
    display: none;
    padding: 8px 0;
}

.sz-papers-list.sz-papers-open {
    display: block;
}

.sz-paper {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px solid #f3f4f6;
}

.sz-paper:last-child {
    border-bottom: none;
}

.sz-paper-info {
    flex: 1;
    min-width: 0;
}

.sz-paper-title {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 1.4;
}

.sz-paper-meta {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
    margin-top: 2px;
}

.sz-paper-link {
    flex-shrink: 0;
    font-size: 11px;
    color: var(--sz-primary);
    text-decoration: none;
    font-weight: 600;
    white-space: nowrap;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
}

.sz-paper-link:hover {
    text-decoration: underline;
}

.sz-no-evidence {
    display: block;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    font-style: italic;
    padding: 4px 0;
}

/* Compact purchase buttons */
.sz-buy-row {
    display: flex;
    gap: 6px;
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid #f3f4f6;
}

.sz-buy-chip {
    flex: 1;
    text-align: center;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity 0.2s;
}

.sz-buy-chip:hover {
    opacity: 0.85;
}

.sz-chip-coupang {
    background: #FF6B00;
    color: white;
}

.sz-chip-iherb {
    background: #7CB342;
    color: white;
}

.sz-chip-naver {
    background: #00C73C;
    color: white;
}

/* ====================================
   Dosage Schedule v2
   ==================================== */
.sz-schedule {
    background: var(--bg-secondary, #f9fafb);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.sz-schedule-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin-bottom: 12px;
}

.sz-schedule-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sz-schedule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    background: #fff;
    border-radius: 8px;
}

.sz-schedule-icon {
    color: var(--sz-primary);
    flex-shrink: 0;
}

.sz-schedule-detail {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sz-sched-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-sched-when {
    font-size: 12px;
    color: var(--sz-primary-dark);
}

.sz-advice-box {
    margin-top: 16px;
}

.sz-advice-box h4 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-advice-box ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.sz-advice-box li {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.sz-advice-box li svg {
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--sz-primary);
}

.sz-monitor-box {
    display: flex;
    gap: 12px;
    padding: 14px;
    background: #eff6ff;
    border-left: 3px solid #3b82f6;
    border-radius: 8px;
    margin-top: 16px;
}

.sz-monitor-box svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: #3b82f6;
}

.sz-monitor-box strong {
    display: block;
    font-size: 13px;
    color: #1e40af;
    margin-bottom: 4px;
}

.sz-monitor-box p {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: #2563eb;
}

/* ====================================
   Survey-Only Button (sidebar)
   ==================================== */
.sz-survey-only-section {
    padding: 12px 12px 0;
}

.sz-btn-survey-only {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    background: linear-gradient(135deg, rgba(0, 191, 165, 0.35) 0%, rgba(0, 230, 118, 0.25) 100%);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: left;
    color: #1a1a2e;
    font-family: var(--font-family, 'DM Sans', sans-serif);
}

.sz-btn-survey-only:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 191, 165, 0.35);
}

.sz-survey-only-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.35);
    border-radius: 10px;
    color: #00796B;
}

.sz-survey-only-text {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.sz-survey-only-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -0.3px;
}

.sz-survey-only-subtitle {
    font-size: 11px;
    opacity: 0.65;
    font-weight: 400;
}

.sz-survey-only-arrow {
    flex-shrink: 0;
    opacity: 0.5;
}

/* ====================================
   User Requests (health goals from survey)
   ==================================== */
.sz-requests-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sz-request-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, var(--sz-primary-light) 0%, #e0f2f1 100%);
    border: 1px solid rgba(0, 191, 165, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--sz-primary-darker);
    transition: all 0.2s;
}

.sz-request-chip svg {
    width: 14px;
    height: 14px;
    color: var(--sz-primary);
}

.sz-section-subtitle {
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
    margin: -4px 0 16px 0;
}

/* ====================================
   Lifestyle Supplements Cards
   ==================================== */
.sz-lifestyle-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
}

.sz-lifestyle-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: white;
    border: 1px solid var(--border-subtle, #e5e7eb);
    border-radius: 12px;
    transition: all 0.2s;
    border-left: 3px solid var(--sz-primary);
}

.sz-lifestyle-card:hover {
    border-color: var(--sz-primary);
    box-shadow: 0 2px 8px rgba(0, 191, 165, 0.1);
}

.sz-lifestyle-icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--sz-primary-light);
    border-radius: 10px;
    font-size: 18px;
}

.sz-lifestyle-info {
    flex: 1;
    min-width: 0;
}

.sz-lifestyle-nutrient {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin-bottom: 4px;
}

.sz-lifestyle-reason {
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
    line-height: 1.5;
}

.sz-lifestyle-category {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 6px;
}

.sz-cat-sleep { background: #EDE7F6; color: #7C4DFF; }
.sz-cat-diet { background: #FFF3E0; color: #FF9800; }
.sz-cat-lifestyle { background: #E3F2FD; color: #2196F3; }
.sz-cat-exercise { background: #E8F5E9; color: #4CAF50; }
.sz-cat-stress { background: #FCE4EC; color: #E91E63; }
.sz-cat-eye { background: #E0F7FA; color: #00BCD4; }
.sz-cat-alcohol { background: #FFF3E0; color: #FF9800; }
.sz-cat-smoking { background: #FFEBEE; color: #E53935; }
.sz-cat-screen { background: #E3F2FD; color: #2196F3; }

/* ====================================
   Current Supplements (Already Taking)
   ==================================== */
.sz-current-supps-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sz-current-supp-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: linear-gradient(135deg, #f3e8ff 0%, #ede9fe 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #6d28d9;
}

.sz-current-supp-type {
    font-size: 10px;
    color: #8b5cf6;
    opacity: 0.7;
}

/* Biomarker-Justified Badge */
.sz-biomarker-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.sz-biomarker-badge svg {
    color: #d97706;
}

.sz-section-note {
    font-size: 12px;
    color: #92400e;
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    padding: 8px 12px;
    margin: -4px 0 16px 0;
    border-radius: 0 6px 6px 0;
    line-height: 1.5;
}

/* ====================================
   Paper Abstract Modal
   ==================================== */
.sz-paper-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: sz-fade-in 0.2s ease;
}

@keyframes sz-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.sz-paper-modal {
    background: white;
    border-radius: 16px;
    max-width: 640px;
    width: 100%;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
    animation: sz-slide-up 0.3s ease;
}

@keyframes sz-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.sz-paper-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-paper-modal-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary, #111827);
    line-height: 1.5;
}

.sz-paper-modal-close {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 8px;
    background: var(--bg-secondary, #f9fafb);
    color: var(--text-secondary, #6b7280);
    font-size: 20px;
    cursor: pointer;
    transition: all 0.15s;
}

.sz-paper-modal-close:hover {
    background: var(--border-subtle, #e5e7eb);
    color: var(--text-primary, #111827);
}

.sz-paper-modal-meta {
    padding: 12px 24px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 12px;
    color: var(--text-secondary, #6b7280);
}

.sz-paper-meta-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 6px;
    font-weight: 500;
}

.sz-paper-modal-body {
    padding: 0 24px 24px;
    overflow-y: auto;
    flex: 1;
}

.sz-paper-modal-abstract {
    font-size: 14px;
    line-height: 1.8;
    color: var(--text-primary, #111827);
}

.sz-paper-modal-abstract .sz-paper-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px 0;
    color: var(--text-secondary, #6b7280);
    font-size: 13px;
}

.sz-paper-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.sz-btn-pubmed {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--sz-primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.sz-btn-pubmed:hover {
    background: var(--sz-primary-dark);
}

/* ====================================
   Responsive
   ==================================== */
@media (max-width: 1024px) {
    .sz-app-panels {
        flex-direction: column;
    }

    .sz-records-panel {
        width: 100%;
        max-height: 200px;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle, #e5e7eb);
    }

    .sz-records-list {
        display: flex;
        gap: 8px;
        overflow-x: auto;
        overflow-y: hidden;
        padding: 8px 12px;
    }

    .sz-record-card {
        min-width: 200px;
        flex-shrink: 0;
        margin-bottom: 0;
    }

    .sz-results-panel {
        padding: 20px;
    }

    .sz-rec-grid {
        grid-template-columns: 1fr;
    }

    .sz-analysis-loading {
        padding: 24px 16px;
    }

    .sz-thinking-container {
        max-width: 100%;
    }
}

@media (max-width: 768px) {
    .sz-page-header {
        padding: 16px 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .sz-page-title {
        font-size: 20px;
    }

    .sz-logo-svg {
        width: 26px;
        height: 26px;
    }

    .sz-bio-card {
        padding: 12px;
    }

    .sz-bio-val {
        font-size: 22px;
    }

    .sz-rec-head {
        flex-direction: column;
        gap: 6px;
    }

    .sz-abnormal-list {
        grid-template-columns: 1fr;
    }

    .sz-btn-upload-header {
        width: 100%;
        justify-content: center;
    }

    .sz-results-panel {
        padding: 16px;
    }

    .sz-empty-state {
        padding: 40px 20px;
    }
}

/* ====================================
   Consent Modal
   ==================================== */
.sz-consent-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sz-consent-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    animation: sz-consent-in 0.3s ease;
}

@keyframes sz-consent-in {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.sz-consent-header {
    padding: 32px 32px 20px;
    text-align: center;
    border-bottom: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-consent-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--sz-primary-light, #E0F7F0);
    color: var(--sz-primary, #00BFA5);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.sz-consent-header h2 {
    margin: 0 0 8px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.sz-consent-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.sz-consent-body {
    padding: 24px 32px;
    overflow-y: auto;
    flex: 1;
}

.sz-consent-section {
    margin-bottom: 20px;
}

.sz-consent-section:last-child {
    margin-bottom: 0;
}

.sz-consent-section h3 {
    margin: 0 0 10px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-consent-section ul {
    margin: 0;
    padding-left: 20px;
}

.sz-consent-section li {
    font-size: 13px;
    line-height: 1.7;
    color: var(--text-secondary, #6b7280);
}

.sz-consent-footer {
    padding: 20px 32px 28px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sz-consent-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    color: var(--text-primary, #111827);
    line-height: 1.5;
}

.sz-consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: var(--sz-primary, #00BFA5);
    cursor: pointer;
}

.sz-btn-consent {
    width: 100%;
    padding: 14px;
    background: var(--sz-primary, #00BFA5);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    font-family: var(--font-family, 'DM Sans', sans-serif);
}

.sz-btn-consent:hover:not(:disabled) {
    background: var(--sz-primary-dark, #009688);
}

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

@media (max-width: 768px) {
    .sz-consent-card {
        max-height: 90vh;
    }

    .sz-consent-header {
        padding: 24px 20px 16px;
    }

    .sz-consent-body {
        padding: 20px;
    }

    .sz-consent-footer {
        padding: 16px 20px 24px;
    }
}

/* ====================================
   Survey Header Button
   ==================================== */
.sz-btn-survey-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: var(--sz-primary);
    border: 1.5px solid var(--sz-primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: var(--font-family, 'DM Sans', sans-serif);
}

.sz-btn-survey-header:hover {
    background: var(--sz-primary-light);
    transform: translateY(-1px);
}

/* ====================================
   Survey Toggle (in sidebar)
   ==================================== */
.sz-sidebar-survey-toggle {
    padding: 16px 20px;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-survey-toggle-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary, #111827);
}

.sz-survey-toggle-label input {
    display: none;
}

.sz-toggle-slider {
    position: relative;
    width: 36px;
    height: 20px;
    background: #d1d5db;
    border-radius: 10px;
    transition: background 0.2s;
    flex-shrink: 0;
}

.sz-toggle-slider::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: white;
    border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.sz-survey-toggle-label input:checked + .sz-toggle-slider {
    background: var(--sz-primary);
}

.sz-survey-toggle-label input:checked + .sz-toggle-slider::after {
    transform: translateX(16px);
}

.sz-toggle-text {
    font-weight: 500;
}

.sz-survey-toggle-hint {
    margin: 6px 0 0 46px;
    font-size: 11px;
    color: var(--text-muted, #9ca3af);
    line-height: 1.4;
}

/* ====================================
   Survey Modal
   ==================================== */
.sz-survey-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.sz-survey-card {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 560px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
    animation: sz-consent-in 0.3s ease;
}

.sz-survey-header {
    padding: 28px 32px 16px;
    text-align: center;
    position: relative;
}

.sz-survey-header h2 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.sz-survey-header p {
    margin: 0;
    font-size: 14px;
    color: var(--text-secondary, #6b7280);
}

.sz-survey-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    font-size: 22px;
    color: var(--text-muted, #9ca3af);
    cursor: pointer;
    border-radius: 50%;
    transition: background 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sz-survey-close:hover {
    background: #f3f4f6;
    color: var(--text-primary, #111827);
}

.sz-survey-progress {
    height: 3px;
    background: #f3f4f6;
    width: 100%;
}

.sz-survey-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--sz-primary), var(--sz-accent));
    border-radius: 0 2px 2px 0;
    transition: width 0.3s ease;
}

.sz-survey-body {
    padding: 28px 32px;
    flex: 1;
    overflow-y: auto;
    min-height: 280px;
}

.sz-survey-question {
    margin-bottom: 6px;
}

.sz-survey-question h3 {
    margin: 0 0 6px;
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary, #111827);
}

.sz-survey-question p {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--text-secondary, #6b7280);
}

/* Input fields */
.sz-survey-input-group {
    display: flex;
    gap: 16px;
    margin-bottom: 16px;
}

.sz-survey-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sz-survey-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary, #111827);
}

.sz-survey-input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-subtle, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary, #111827);
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.sz-survey-input:focus {
    outline: none;
    border-color: var(--sz-primary);
}

.sz-survey-select {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--border-subtle, #e5e7eb);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-primary, #111827);
    background: white;
    cursor: pointer;
    box-sizing: border-box;
}

.sz-survey-select:focus {
    outline: none;
    border-color: var(--sz-primary);
}

/* Option chips (single/multi select) */
.sz-survey-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sz-survey-option {
    padding: 10px 16px;
    border: 1.5px solid var(--border-subtle, #e5e7eb);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary, #111827);
    background: white;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    font-family: inherit;
}

.sz-survey-option:hover {
    border-color: var(--sz-primary);
    background: var(--sz-primary-lighter, #F0FDF9);
}

.sz-survey-option.selected {
    border-color: var(--sz-primary);
    background: var(--sz-primary-light, #E0F7F0);
    color: var(--sz-primary-darker, #00796B);
    font-weight: 600;
}

.sz-survey-option.disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sz-survey-max-hint {
    font-size: 12px;
    color: var(--text-muted, #9ca3af);
    margin-top: 8px;
}

/* Custom input for "기타" option */
.sz-survey-custom-input {
    margin-top: 12px;
    display: none;
}

.sz-survey-custom-input.visible {
    display: block;
}

/* Survey footer */
.sz-survey-footer {
    padding: 16px 32px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid var(--border-subtle, #e5e7eb);
}

.sz-survey-step-indicator {
    font-size: 13px;
    color: var(--text-muted, #9ca3af);
    font-weight: 500;
}

.sz-btn-survey-prev,
.sz-btn-survey-next {
    padding: 10px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

.sz-btn-survey-prev {
    background: transparent;
    border: 1.5px solid var(--border-subtle, #e5e7eb);
    color: var(--text-secondary, #6b7280);
}

.sz-btn-survey-prev:hover {
    background: #f3f4f6;
}

.sz-btn-survey-next {
    background: var(--sz-primary);
    border: none;
    color: white;
}

.sz-btn-survey-next:hover {
    background: var(--sz-primary-dark);
}

.sz-btn-survey-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Mobile responsive for survey */
@media (max-width: 768px) {
    .sz-survey-card {
        max-height: 92vh;
    }

    .sz-survey-header {
        padding: 20px 20px 12px;
    }

    .sz-survey-body {
        padding: 20px;
        min-height: 240px;
    }

    .sz-survey-footer {
        padding: 12px 20px 20px;
    }

    .sz-survey-input-group {
        flex-direction: column;
        gap: 12px;
    }

    .sz-btn-survey-header {
        width: 100%;
        justify-content: center;
    }

    .sz-page-header-right {
        flex-direction: column;
        width: 100%;
    }
}

