/* KLF 사건 정리 도우미 - 의뢰인 UI (모바일 퍼스트) */

:root {
    --primary: #1a365d;
    --primary-light: #2b6cb0;
    --bg: #f7fafc;
    --white: #ffffff;
    --gray-50: #f7fafc;
    --gray-100: #edf2f7;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e0;
    --gray-400: #a0aec0;
    --gray-500: #718096;
    --gray-600: #4a5568;
    --gray-700: #2d3748;
    --gray-800: #1a202c;
    --blue-50: #ebf8ff;
    --blue-100: #bee3f8;
    --green-50: #f0fff4;
    --green-500: #48bb78;
    --red-500: #f56565;
    --shadow: 0 1px 3px rgba(0,0,0,0.12);
    --shadow-lg: 0 4px 12px rgba(0,0,0,0.15);
    --radius: 12px;
    --max-width: 800px;
}

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

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    font-size: 16px;
    color: var(--gray-800);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

#app {
    height: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
}

/* 화면 전환 */
.screen {
    display: none;
    height: 100%;
}
.screen.active {
    display: flex;
    flex-direction: column;
}

/* ===== 시작 화면 ===== */
.start-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
}

.logo {
    font-size: 3.5rem;
    margin-bottom: 1rem;
}

.start-container h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0.75rem;
}

.subtitle {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.875rem 2.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}
.btn-primary:hover {
    background: var(--primary-light);
}
.btn-primary:active {
    transform: scale(0.98);
}

.disclaimer {
    margin-top: 2rem;
    padding: 1rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    line-height: 1.5;
    background: var(--gray-100);
    border-radius: var(--radius);
}

/* ===== 대화 화면 ===== */
.chat-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--primary);
    color: var(--white);
    box-shadow: var(--shadow);
    flex-shrink: 0;
    z-index: 10;
}

.header-logo { font-size: 1.25rem; }
.header-title {
    font-size: 1rem;
    font-weight: 600;
    flex: 1;
}
.header-status {
    font-size: 0.75rem;
    opacity: 0.8;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    -webkit-overflow-scrolling: touch;
}

/* 메시지 버블 */
.message {
    display: flex;
    gap: 0.5rem;
    max-width: 85%;
    animation: fadeIn 0.3s ease;
}
.message.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}
.message.assistant {
    align-self: flex-start;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}
.message.assistant .message-avatar {
    background: var(--blue-100);
}
.message.user .message-avatar {
    background: var(--gray-200);
}

.message-bubble {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    line-height: 1.6;
    font-size: 0.9375rem;
    word-break: break-word;
}
.message.assistant .message-bubble {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-top-left-radius: 4px;
}
.message.user .message-bubble {
    background: var(--primary);
    color: var(--white);
    border-top-right-radius: 4px;
}

/* 파일 첨부 표시 */
.message-files {
    margin-top: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.file-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    background: var(--blue-50);
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--primary-light);
}
.message.user .file-badge {
    background: rgba(255,255,255,0.2);
    color: var(--white);
}

/* 타이핑 인디케이터 */
.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 0.5rem;
}
.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--gray-400);
    animation: typing 1.4s infinite;
}
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-4px); opacity: 1; }
}

/* 업로드 미리보기 */
.upload-preview {
    padding: 0.5rem 1rem;
    background: var(--gray-50);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}
.upload-preview-list {
    display: flex;
    gap: 0.5rem;
    overflow-x: auto;
}
.upload-preview-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0.75rem;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 0.8rem;
    white-space: nowrap;
}
.upload-preview-item .remove-file {
    cursor: pointer;
    color: var(--gray-400);
    font-size: 1rem;
    line-height: 1;
}
.upload-preview-item .remove-file:hover {
    color: var(--red-500);
}

/* 입력 영역 */
.chat-input-area {
    padding: 0.5rem 0.75rem;
    background: var(--white);
    border-top: 1px solid var(--gray-200);
    flex-shrink: 0;
}

.input-wrapper {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    background: var(--gray-100);
    border-radius: 24px;
    padding: 0.25rem 0.5rem;
}

#chat-input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 0.5rem 0.25rem;
    font-size: 0.9375rem;
    font-family: inherit;
    resize: none;
    max-height: 120px;
    line-height: 1.4;
    outline: none;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--gray-500);
    transition: background 0.2s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.btn-icon:hover {
    background: var(--gray-200);
}

.btn-send {
    color: var(--primary);
}
.btn-send:disabled {
    color: var(--gray-300);
    cursor: not-allowed;
}
.btn-send:not(:disabled):hover {
    background: var(--primary);
    color: var(--white);
}

/* 마이크 버튼 (STT) */
.btn-mic {
    color: var(--gray-500);
    position: relative;
}
.btn-mic.recording {
    color: var(--red-500);
    animation: micPulse 1.2s ease-in-out infinite;
}
.btn-mic.recording::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid var(--red-500);
    animation: micRing 1.2s ease-in-out infinite;
    pointer-events: none;
}

@keyframes micPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}
@keyframes micRing {
    0% { opacity: 0.7; transform: scale(0.8); }
    50% { opacity: 0.3; transform: scale(1.2); }
    100% { opacity: 0; transform: scale(1.4); }
}

/* 첨부 메뉴 */
.attach-menu {
    position: relative;
    z-index: 20;
}
.attach-menu-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    z-index: 20;
}
.attach-menu-panel {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: var(--max-width);
    margin: 0 auto;
    background: var(--white);
    border-radius: 16px 16px 0 0;
    padding: 0.75rem 0;
    box-shadow: var(--shadow-lg);
    z-index: 21;
    animation: slideUp 0.2s ease;
}
@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.attach-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 0.875rem 1.5rem;
    border: none;
    background: transparent;
    font-size: 1rem;
    color: var(--gray-700);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.attach-option:hover {
    background: var(--gray-100);
}
.attach-option:active {
    background: var(--gray-200);
}
.attach-option-icon {
    font-size: 1.5rem;
    width: 32px;
    text-align: center;
}

/* 면책 바 */
.disclaimer-bar {
    padding: 0.5rem 1rem;
    font-size: 0.7rem;
    color: var(--gray-500);
    text-align: center;
    background: var(--gray-100);
    flex-shrink: 0;
}

/* ===== 결과 화면 ===== */
.result-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    -webkit-overflow-scrolling: touch;
}

.result-content {
    max-width: var(--max-width);
    margin: 0 auto;
}

.result-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 1.25rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow);
}

.result-section h2 {
    font-size: 1.125rem;
    color: var(--primary);
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--gray-200);
}

.result-section h3 {
    font-size: 0.95rem;
    color: var(--gray-700);
    margin: 1rem 0 0.5rem;
}

.summary-field {
    display: flex;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.summary-field:last-child { border-bottom: none; }
.summary-label {
    font-weight: 600;
    color: var(--gray-600);
    min-width: 80px;
    font-size: 0.875rem;
}
.summary-value {
    flex: 1;
    font-size: 0.9rem;
}

/* 테이블 */
.result-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}
.result-table th, .result-table td {
    padding: 0.5rem;
    border: 1px solid var(--gray-200);
    text-align: left;
    vertical-align: top;
}
.result-table th {
    background: var(--gray-100);
    font-weight: 600;
    font-size: 0.8rem;
}
.evidence-status {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
}
.evidence-status.owned { color: var(--green-500); }
.evidence-status.missing { color: var(--gray-400); }

.result-note {
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: var(--gray-500);
    font-style: italic;
}

/* 로딩 */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem;
    color: var(--gray-500);
}
.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--gray-200);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== 수임 동의 배너 ===== */
.consent-banner {
    margin: 0 1rem 1rem;
}
.consent-banner-content {
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
}
.consent-banner-content.consent-done {
    border-color: var(--green-500);
    background: var(--green-50);
}
.consent-banner-icon {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}
.consent-banner-text {
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin-bottom: 0.5rem;
}
.consent-done .consent-banner-text {
    color: #2f855a;
}
.consent-banner-desc {
    font-size: 0.85rem;
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.consent-banner-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.btn-consent-agree {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-consent-agree:hover {
    background: var(--primary-light);
}
.btn-consent-reject {
    background: var(--white);
    color: var(--gray-600);
    border: 1px solid var(--gray-300);
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-consent-reject:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
}

/* ===== 내 사건 목록 (시작 화면) ===== */
.my-cases-section {
    width: 100%;
    max-width: var(--max-width);
    padding: 0 1.5rem 1.5rem;
}

.my-cases-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    color: var(--gray-500);
    font-size: 0.85rem;
}
.my-cases-divider::before,
.my-cases-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--gray-300);
}

.my-cases-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.my-case-card {
    display: block;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
    text-decoration: none;
    color: inherit;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, border-color 0.2s;
    cursor: pointer;
}
.my-case-card:hover {
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.my-case-card.has-notification {
    border-color: var(--primary);
    border-width: 2px;
}

.case-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.case-card-type {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--gray-800);
}
.case-card-status {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 50px;
    background: var(--gray-100);
    color: var(--gray-600);
    font-weight: 500;
}

.case-card-notif {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 0.75rem;
    background: #ebf8ff;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.case-card-notif-icon {
    font-size: 1.1rem;
}

.case-card-date {
    font-size: 0.8rem;
    color: var(--gray-400);
}

/* ===== 타임라인 (결과 화면) ===== */
.timeline-list { display: flex; flex-direction: column; gap: 0.5rem; }
.timeline-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--white);
}
.timeline-num {
    font-weight: 700;
    color: var(--primary);
    min-width: 1.5rem;
    text-align: center;
    flex-shrink: 0;
}
.timeline-date {
    font-size: 0.85rem;
    color: var(--gray-500);
    min-width: 6rem;
    flex-shrink: 0;
}
.timeline-fact { flex: 1; font-size: 0.9rem; line-height: 1.5; }

.btn-edit-timeline, .btn-edit-evidence,
.btn-save-timeline, .btn-save-evidence {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-300);
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    white-space: nowrap;
    color: var(--gray-600);
    transition: all 0.15s;
    flex-shrink: 0;
}
.btn-edit-timeline:hover, .btn-edit-evidence:hover {
    border-color: var(--primary-light);
    color: var(--primary);
}
.btn-save-timeline, .btn-save-evidence {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}
.btn-save-timeline:hover, .btn-save-evidence:hover {
    background: var(--primary-light);
}

/* ===== 서증 업로드 목록 (결과 화면) ===== */
.evidence-upload-list { display: flex; flex-direction: column; gap: 0.5rem; }
.evidence-upload-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    background: var(--white);
}
.evidence-upload-icon { font-size: 1.2rem; flex-shrink: 0; }
.evidence-upload-name { flex: 1; font-size: 0.9rem; }

/* ===== 인라인 편집 ===== */
.edit-input {
    width: 100%;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary-light);
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
}
.edit-input:focus { border-color: var(--primary); box-shadow: 0 0 0 2px rgba(43,108,176,0.15); }
.edit-date { max-width: 6rem; }

/* ===== 안전장치 (Safety Gates) ===== */
.safety-gate { margin-top: 1rem; }
.safety-gate-box {
    border: 2px solid var(--gray-200);
    border-radius: 8px;
    padding: 1.5rem;
    background: var(--gray-50);
    text-align: center;
}
.safety-gate-box h3 { margin-bottom: 0.75rem; font-size: 1.1rem; }
.safety-gate-box p { margin-bottom: 0.75rem; color: var(--gray-600); line-height: 1.6; }
.safety-warning { color: #c53030; font-size: 0.85rem; font-weight: 500; }
.safety-desc { font-size: 0.9rem; }
.safety-bullets {
    text-align: left; margin: 0.75rem auto; padding-left: 1.5rem;
    max-width: 400px; color: var(--gray-600); line-height: 1.8;
}
.safety-actions { display: flex; gap: 0.75rem; justify-content: center; margin-top: 1rem; }

.btn-safety-confirm {
    padding: 0.6rem 1.5rem; border: none; border-radius: 6px;
    background: var(--primary); color: white;
    font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.btn-safety-confirm:hover { background: var(--primary-light); }
.btn-safety-secondary {
    padding: 0.6rem 1.5rem; border: 1px solid var(--gray-300);
    border-radius: 6px; background: white; color: var(--gray-600);
    font-size: 0.95rem; cursor: pointer;
}

.safety-done {
    padding: 1rem; color: #2f855a; font-weight: 600;
    background: #f0fff4; border-radius: 6px; text-align: center;
}
.safety-done-final {
    padding: 1.5rem; color: #2f855a; font-weight: 600;
    font-size: 1.05rem; background: #f0fff4; border-radius: 8px;
    text-align: center; line-height: 1.8; margin-top: 1rem;
}

/* 마스킹 비교 */
.compare-columns { display: flex; gap: 1rem; margin: 1rem 0; }
.compare-col {
    flex: 1; padding: 1rem; border: 1px solid var(--gray-200);
    border-radius: 6px; background: white; text-align: left;
}
.compare-col h4 { font-size: 0.85rem; color: var(--gray-500); margin-bottom: 0.5rem; }
.compare-masked { border-color: #4299e1; background: #ebf8ff; }
.compare-table {
    width: 100%; border-collapse: collapse; font-size: 0.85rem;
    margin-top: 0.5rem;
}
.compare-table th {
    background: var(--gray-100); padding: 0.5rem; text-align: left;
    border-bottom: 2px solid var(--gray-200);
}
.compare-table td {
    padding: 0.5rem; border-bottom: 1px solid var(--gray-100);
    vertical-align: top;
}
.compare-table tr:nth-child(even) td { background: var(--gray-50); }
.error-text { color: #c53030; font-size: 0.85rem; }

@media (max-width: 600px) {
    .compare-columns { flex-direction: column; }
}

/* ===== v2: 수임청약 카드 (의뢰인 화면) ===== */
.proposals-banner {
    background: var(--white);
    border: 2px solid var(--primary);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-lg);
}
.proposals-banner-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--gray-800);
    margin-bottom: 1rem;
    text-align: center;
}
.proposals-card-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.proposal-card {
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    padding: 1rem;
    background: var(--gray-50);
}
.proposal-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}
.proposal-card-header strong {
    font-size: 0.95rem;
    color: var(--gray-800);
}
.proposal-card-firm {
    font-size: 0.8rem;
    color: var(--gray-500);
}
.proposal-card-terms {
    display: flex;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--gray-600);
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.proposal-card-msg {
    font-size: 0.85rem;
    color: var(--gray-600);
    font-style: italic;
    line-height: 1.5;
    margin-bottom: 0.75rem;
}
.btn-accept-proposal {
    display: block;
    width: 100%;
    padding: 0.6rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
}
.btn-accept-proposal:hover {
    background: var(--primary-light);
}
.proposals-notice {
    font-size: 0.78rem;
    color: var(--gray-500);
    text-align: center;
    margin-top: 1rem;
    line-height: 1.5;
}

/* 승낙 확인 모달 */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}
.modal-content {
    background: var(--white);
    border-radius: 12px;
    width: 100%;
    max-width: 420px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
}
.modal-header h3 { margin: 0; font-size: 1.1rem; }
.modal-close {
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: var(--gray-500); padding: 0 0.25rem;
}
.modal-body { padding: 1.25rem; }
.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--gray-200);
}
.accept-modal-question {
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 1rem;
}
.accept-modal-terms {
    background: var(--gray-50);
    padding: 0.75rem;
    border-radius: 6px;
    text-align: center;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}
.accept-modal-terms div { margin: 0.25rem 0; }
.accept-modal-warning {
    background: #fffaf0;
    border: 1px solid #fbd38d;
    padding: 0.75rem;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #744210;
    line-height: 1.6;
}
.accept-modal-warning p { margin: 0.25rem 0; }
.btn-cancel {
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border: 1px solid var(--gray-300);
    border-radius: 6px;
    font-size: 0.85rem;
    cursor: pointer;
}
.btn-accept-confirm {
    padding: 0.5rem 1.5rem;
    background: var(--primary);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
}
.btn-accept-confirm:hover { background: var(--primary-light); }
.btn-accept-confirm:disabled { opacity: 0.6; cursor: not-allowed; }

/* ===== ENH-3: 결과→대화 복귀 버튼 ===== */
.btn-header-action {
    margin-left: auto;
    padding: 0.35rem 0.75rem;
    background: var(--primary-light, #4299e1);
    color: white;
    border: none;
    border-radius: var(--radius, 8px);
    font-size: 0.8rem;
    cursor: pointer;
}
.btn-header-action:hover { opacity: 0.85; }

/* ===== ENH-4: 수동 정리 완료 ===== */
.manual-complete-bar {
    padding: 0.5rem 1rem;
    text-align: center;
    border-top: 1px solid var(--gray-200);
}
.btn-complete {
    padding: 0.6rem 1.5rem;
    background: var(--primary, #2b6cb0);
    color: white;
    border: none;
    border-radius: var(--radius, 8px);
    font-size: 0.9rem;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}
.btn-complete:hover { opacity: 0.9; }
.btn-complete:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===== ENH-5: 촬영 안내 모달 ===== */
.modal-box {
    background: white;
    border-radius: 12px;
    padding: 1.5rem;
    max-width: 320px;
    width: 90%;
    text-align: center;
}
.camera-guide-box h3 { margin-bottom: 0.75rem; }
.camera-guide-box p { color: var(--gray-600); line-height: 1.6; margin-bottom: 1rem; }
.camera-guide-tips { margin-bottom: 1rem; text-align: left; }
.tip-good { color: #38a169; margin-bottom: 0.3rem; font-size: 0.85rem; }
.tip-bad { color: #e53e3e; font-size: 0.85rem; }

/* ===== ENH-6: 민감정보 경고 ===== */
.sensitive-badge {
    font-size: 0.75rem;
    color: #dd6b20;
    white-space: nowrap;
    cursor: help;
}

/* ===== ENH-7: 마스킹 재생성 안내 ===== */
.masking-refresh-notice {
    background: var(--blue-50, #ebf8ff);
    border: 1px solid #90cdf4;
    border-radius: var(--radius, 8px);
    padding: 0.75rem 1rem;
    margin-top: 0.5rem;
    font-size: 0.85rem;
}
.masking-refresh-notice p { margin-bottom: 0.5rem; }
.btn-sm { padding: 0.3rem 0.8rem; font-size: 0.8rem; }

/* ===== ENH-1: 타임라인 삭제/추가 버튼 ===== */
.btn-delete-timeline, .btn-delete-evidence {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid #feb2b2;
    border-radius: 4px;
    background: var(--white);
    cursor: pointer;
    white-space: nowrap;
    color: #e53e3e;
    flex-shrink: 0;
}
.btn-delete-timeline:hover, .btn-delete-evidence:hover {
    background: #fff5f5;
    border-color: #fc8181;
}
.btn-add-timeline {
    display: block;
    width: 100%;
    margin-top: 0.5rem;
    padding: 0.5rem;
    border: 1px dashed var(--gray-300);
    border-radius: 6px;
    background: transparent;
    color: var(--primary-light);
    font-size: 0.85rem;
    cursor: pointer;
    text-align: center;
}
.btn-add-timeline:hover {
    background: var(--blue-50, #ebf8ff);
    border-color: var(--primary-light);
}

/* ===== 반응형 ===== */
@media (min-width: 768px) {
    .chat-messages {
        padding: 1.5rem 2rem;
    }
    .message {
        max-width: 70%;
    }
    .start-container h1 {
        font-size: 1.75rem;
    }
}

@media (max-width: 480px) {
    .proposal-card-terms { flex-direction: column; gap: 0.25rem; }
    .modal-content { max-width: 100%; }
}
