/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans JP', sans-serif; background: #f5f7fa; color: #1a1a2e; line-height: 1.6; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* ===== Layout ===== */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 240px; background: #1a1a2e; color: #e0e0e0; display: flex; flex-direction: column; position: fixed; top: 0; left: 0; bottom: 0; z-index: 100; }
.main-content { flex: 1; margin-left: 240px; padding: 24px 32px; min-height: 100vh; }

/* ===== Sidebar ===== */
.sidebar-header { padding: 20px; border-bottom: 1px solid #2d2d4a; }
.sidebar-header h1 { font-size: 1.1rem; font-weight: 700; color: #fff; }
.sidebar-header .version { font-size: 0.75rem; color: #888; }
.nav-menu { list-style: none; padding: 12px 0; flex: 1; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: #b0b0c8; transition: all 0.15s; font-size: 0.95rem; }
.nav-link:hover { background: #2d2d4a; color: #fff; }
.nav-link.active { background: #3a3a5c; color: #fff; border-left: 3px solid #4dabf7; padding-left: 17px; }
.nav-icon { font-size: 1.1rem; }
.nav-section { font-size: 0.65rem; font-weight: 600; color: #666; text-transform: uppercase; letter-spacing: 0.08em; padding: 16px 20px 4px; pointer-events: none; }
.sidebar-footer { padding: 16px; border-top: 1px solid #2d2d4a; }
.run-selector { display: flex; flex-direction: column; gap: 6px; }
.run-selector label { font-size: 0.75rem; color: #888; }
.run-selector select { background: #2d2d4a; color: #fff; border: 1px solid #3a3a5c; border-radius: 4px; padding: 6px 8px; font-size: 0.8rem; }
.run-selector .btn-sm { margin-top: 4px; }

/* ===== Pages ===== */
.page { display: none; }
.page.active { display: block; }
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.page-header h2 { font-size: 1.5rem; font-weight: 700; }

/* ===== Buttons ===== */
.btn { padding: 8px 16px; border: none; border-radius: 6px; cursor: pointer; font-size: 0.85rem; font-weight: 500; transition: all 0.15s; display: inline-flex; align-items: center; gap: 6px; }
.btn-primary { background: #4dabf7; color: #fff; }
.btn-primary:hover { background: #339af0; }
.btn-outline { background: transparent; border: 1px solid #dee2e6; color: #495057; }
.btn-outline:hover { background: #f1f3f5; }
.btn-sm { padding: 4px 10px; font-size: 0.8rem; border-radius: 4px; background: #4dabf7; color: #fff; border: none; cursor: pointer; }
.btn-sm:hover { background: #339af0; }
.btn-danger { background: #ff6b6b; color: #fff; }
.btn-danger:hover { background: #f03e3e; }
.btn-success { background: #40c057; color: #fff; border: none; }
.btn-success:hover { background: #2f9e44; }
.btn-sm.btn-outline { background: transparent; border: 1px solid #dee2e6; color: #495057; }
.btn-sm.btn-outline:hover { background: #f1f3f5; }
.btn-sm.btn-success { background: #40c057; color: #fff; }
.btn-sm.btn-success:hover { background: #2f9e44; }

/* ===== Feedback Tabs ===== */
.fb-tabs { display: flex; border-bottom: 2px solid #e9ecef; margin-bottom: 20px; gap: 0; }
.fb-tab { background: none; border: none; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 10px 24px; font-size: 0.88rem; font-weight: 600; color: #64748b; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; transition: all 0.15s; }
.fb-tab:hover { color: #374151; background: #f8fafc; border-radius: 6px 6px 0 0; }
.fb-tab.active { color: #1d4ed8; border-bottom-color: #3b82f6; }
.fb-tab-content { display: flex; flex-direction: column; gap: 12px; }

/* ===== Feedback Cards ===== */
.fb-card { flex-direction: column; gap: 10px; }
.fb-card-header { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }

/* Reporter info banner */
.fb-reporter-badge { display: inline-flex; align-items: center; gap: 4px; font-size: 0.7rem; font-weight: 600; color: #6b7280; background: #f3f4f6; border-radius: 10px; padding: 2px 8px; }

/* ===== Feedback Replies ===== */
.fb-replies { border-top: 1px solid #f1f3f5; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fb-reply { background: #eff6ff; border-left: 3px solid #3b82f6; border-radius: 0 6px 6px 0; padding: 8px 12px; font-size: 0.8rem; }
.fb-reply-author { font-weight: 700; color: #1d4ed8; font-size: 0.72rem; margin-bottom: 2px; letter-spacing: 0.01em; }
.fb-reply-body { color: #1e3a5f; line-height: 1.5; }
.fb-reply-date { color: #93c5fd; font-size: 0.68rem; margin-top: 2px; }
.fb-reply-form { border-top: 1px solid #f1f3f5; padding-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fb-reply-author-input { border: 1px solid #dee2e6; border-radius: 4px; padding: 3px 8px; font-size: 0.75rem; width: 140px; font-family: inherit; color: #374151; }
.fb-reply-author-input:focus { outline: none; border-color: #4dabf7; }
.fb-reply-input { width: 100%; border: 1px solid #dee2e6; border-radius: 6px; padding: 8px 10px; font-size: 0.82rem; font-family: inherit; resize: vertical; }
.fb-reply-input:focus { outline: none; border-color: #4dabf7; }
.fb-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.fb-card-resolve { display: flex; justify-content: flex-end; border-top: 1px solid #f0fdf4; padding-top: 10px; margin-top: 2px; }

/* ===== Badges ===== */
.badge { padding: 3px 10px; border-radius: 12px; font-size: 0.75rem; font-weight: 600; }
.badge-info { background: #e7f5ff; color: #1971c2; }
.badge-ok { background: #d3f9d8; color: #2b8a3e; }
.badge-ng { background: #ffe3e3; color: #c92a2a; }
.badge-skip { background: #fff3bf; color: #e67700; }
.badge-pending { background: #f1f3f5; color: #868e96; }
.badge-p0 { background: #ffe3e3; color: #c92a2a; font-weight: 700; }
.badge-p1 { background: #fff3bf; color: #e67700; }
.badge-p2 { background: #e7f5ff; color: #1971c2; }

/* ===== Select ===== */
.select-sm { padding: 6px 10px; border: 1px solid #dee2e6; border-radius: 6px; font-size: 0.85rem; background: #fff; }

/* ===== Stats Grid ===== */
.stats-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; padding: 20px; text-align: center; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #dee2e6; }
.stat-card.stat-ok { border-left-color: #40c057; }
.stat-card.stat-ng { border-left-color: #ff6b6b; }
.stat-card.stat-skip { border-left-color: #fcc419; }
.stat-card.stat-pending { border-left-color: #adb5bd; }
.stat-number { font-size: 2rem; font-weight: 700; }
.stat-ok .stat-number { color: #2b8a3e; }
.stat-ng .stat-number { color: #c92a2a; }
.stat-skip .stat-number { color: #e67700; }
.stat-pending .stat-number { color: #868e96; }
.stat-label { font-size: 0.8rem; color: #868e96; margin-top: 4px; }

/* ===== Progress Bar ===== */
.progress-section { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.progress-bar-container { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress-bar { flex: 1; height: 24px; background: #f1f3f5; border-radius: 12px; overflow: hidden; display: flex; }
.progress-segment { height: 100%; transition: width 0.3s ease; }
.progress-ok { background: #40c057; }
.progress-ng { background: #ff6b6b; }
.progress-skip { background: #fcc419; }
.progress-text { font-weight: 700; font-size: 1rem; min-width: 48px; }

/* ===== Category Progress ===== */
.category-progress { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.category-progress h3 { margin-bottom: 16px; }
.cat-bar-row { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.cat-bar-label { width: 160px; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cat-bar-track { flex: 1; height: 16px; background: #f1f3f5; border-radius: 8px; overflow: hidden; display: flex; }
.cat-bar-count { font-size: 0.8rem; color: #868e96; min-width: 60px; text-align: right; }

/* ===== Tables ===== */
.table { width: 100%; background: #fff; border-radius: 10px; overflow: hidden; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.table thead { background: #f8f9fa; }
.table th { padding: 10px 14px; text-align: left; font-weight: 600; font-size: 0.8rem; color: #495057; border-bottom: 2px solid #e9ecef; }
.table td { padding: 10px 14px; font-size: 0.85rem; border-bottom: 1px solid #f1f3f5; }
.table tbody tr:hover { background: #f8f9fa; }

/* ===== Recent Section ===== */
.recent-section { background: #fff; border-radius: 10px; padding: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.recent-section h3 { margin-bottom: 16px; }

/* ===== Test Runner ===== */
.test-runner-controls { display: flex; gap: 8px; flex-wrap: wrap; }
.test-runner-layout { display: flex; gap: 20px; }
.test-category-sidebar { width: 200px; flex-shrink: 0; }
.test-cases-list { flex: 1; min-width: 0; }

.cat-nav-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px; border-radius: 6px; cursor: pointer; font-size: 0.85rem; margin-bottom: 4px; transition: background 0.15s; }
.cat-nav-item:hover { background: #e9ecef; }
.cat-nav-item.active { background: #e7f5ff; color: #1971c2; font-weight: 600; }
.cat-nav-count { font-size: 0.75rem; color: #868e96; }

/* ===== Test Case Card ===== */
.test-card { background: #fff; border-radius: 10px; margin-bottom: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); overflow: hidden; border-left: 4px solid #dee2e6; }
.test-card.status-ok { border-left-color: #40c057; }
.test-card.status-ng { border-left-color: #ff6b6b; }
.test-card.status-skip { border-left-color: #fcc419; }
.test-card.status-pending { border-left-color: #adb5bd; }

.test-card-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; cursor: pointer; user-select: none; }
.test-card-header:hover { background: #f8f9fa; }
.test-card-title { display: flex; align-items: center; gap: 10px; }
.test-card-title .case-id { font-weight: 700; color: #495057; font-size: 0.85rem; }
.test-card-title .case-name { font-weight: 500; }
.test-card-actions { display: flex; align-items: center; gap: 8px; }

.test-card-body { display: none; padding: 0 18px 18px; }
.test-card.expanded .test-card-body { display: block; }

.precondition { background: #fff9db; padding: 8px 12px; border-radius: 6px; font-size: 0.85rem; margin-bottom: 12px; }
.precondition strong { color: #e67700; }

.step-table { width: 100%; margin-bottom: 12px; }
.step-table th { padding: 8px 10px; background: #f8f9fa; font-size: 0.8rem; text-align: left; border-bottom: 1px solid #e9ecef; }
.step-table td { padding: 8px 10px; font-size: 0.85rem; border-bottom: 1px solid #f1f3f5; vertical-align: top; }
.step-table td:first-child { width: 36px; text-align: center; color: #868e96; }

.test-card-footer { display: flex; align-items: flex-start; gap: 12px; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f1f3f5; }
.test-card-footer textarea { flex: 1; padding: 8px 12px; border: 1px solid #dee2e6; border-radius: 6px; font-size: 0.85rem; resize: vertical; min-height: 60px; font-family: inherit; }
.status-buttons { display: flex; gap: 6px; flex-shrink: 0; flex-direction: column; }
.status-btn { padding: 6px 14px; border: 2px solid transparent; border-radius: 6px; cursor: pointer; font-size: 0.8rem; font-weight: 600; background: #f1f3f5; color: #495057; transition: all 0.15s; }
.status-btn:hover { transform: translateY(-1px); }
.status-btn.selected { color: #fff; }
.status-btn[data-status="ok"].selected { background: #40c057; border-color: #2b8a3e; }
.status-btn[data-status="ng"].selected { background: #ff6b6b; border-color: #c92a2a; }
.status-btn[data-status="skip"].selected { background: #fcc419; border-color: #e67700; color: #1a1a2e; }
.save-indicator { font-size: 0.75rem; color: #40c057; opacity: 0; transition: opacity 0.3s; }
.save-indicator.visible { opacity: 1; }

/* ===== Manual ===== */
.manual-layout { display: flex; gap: 24px; }
.manual-toc { width: 240px; flex-shrink: 0; position: sticky; top: 24px; align-self: flex-start; max-height: calc(100vh - 120px); overflow-y: auto; background: #fff; border-radius: 10px; padding: 16px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.manual-toc h4 { font-size: 0.85rem; margin-bottom: 12px; color: #495057; }
.manual-toc a { display: block; padding: 4px 8px; font-size: 0.8rem; color: #495057; border-radius: 4px; margin-bottom: 2px; }
.manual-toc a:hover { background: #e7f5ff; color: #1971c2; }
.manual-toc a.indent { padding-left: 20px; font-size: 0.78rem; }
.manual-content { flex: 1; background: #fff; border-radius: 10px; padding: 32px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); min-width: 0; }
.manual-content h1, .manual-content h2, .manual-content h3, .manual-content h4 { margin-top: 1.5em; margin-bottom: 0.5em; scroll-margin-top: 16px; }
.manual-content h1 { font-size: 1.6rem; border-bottom: 2px solid #e9ecef; padding-bottom: 8px; }
.manual-content h2 { font-size: 1.3rem; border-bottom: 1px solid #f1f3f5; padding-bottom: 6px; }
.manual-content h3 { font-size: 1.1rem; }
.manual-content table { border: 1px solid #e9ecef; margin: 12px 0; }
.manual-content th, .manual-content td { padding: 8px 12px; border: 1px solid #e9ecef; font-size: 0.85rem; }
.manual-content th { background: #f8f9fa; }
.manual-content code { background: #f1f3f5; padding: 2px 6px; border-radius: 3px; font-size: 0.85em; }
.manual-content pre { background: #1a1a2e; color: #e0e0e0; padding: 16px; border-radius: 8px; overflow-x: auto; margin: 12px 0; }
.manual-content pre code { background: transparent; padding: 0; color: inherit; }
.manual-content blockquote { border-left: 4px solid #4dabf7; padding: 8px 16px; background: #e7f5ff; margin: 12px 0; border-radius: 0 6px 6px 0; }
.manual-content img { max-width: 360px; border-radius: 8px; border: 1px solid #e2e8f0; box-shadow: 0 2px 12px rgba(0,0,0,0.10); margin: 16px 0; cursor: zoom-in; transition: opacity 0.15s; }
.manual-content img:hover { opacity: 0.85; }
.img-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999; padding: 24px; }
.img-modal-overlay.visible { display: flex; justify-content: center; align-items: flex-start; }
.img-modal-overlay .img-modal-scroll { overflow: auto; max-width: 95vw; max-height: 95vh; border-radius: 8px; }
.img-modal-overlay .img-modal-scroll img { display: block; max-width: none; width: auto; height: auto; border-radius: 8px; box-shadow: 0 4px 32px rgba(0,0,0,0.4); cursor: grab; }
.img-modal-overlay .img-modal-close { position: fixed; top: 16px; right: 24px; background: rgba(255,255,255,0.15); color: #fff; border: none; font-size: 24px; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; z-index: 10000; }
.img-modal-overlay .img-modal-close:hover { background: rgba(255,255,255,0.3); }
.manual-content hr { border: none; border-top: 1px solid #e9ecef; margin: 24px 0; }

/* ===== Reports ===== */
.report-filters { display: flex; gap: 12px; margin-bottom: 16px; }
.report-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 20px; }
.report-summary .stat-card { padding: 14px; }
.export-controls { display: flex; gap: 8px; }

/* ===== Modal ===== */
.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: 200; }
.modal { background: #fff; border-radius: 16px; padding: 32px; width: 400px; max-width: 90vw; box-shadow: 0 16px 70px rgba(0,0,0,0.15); border: 1px solid #e2e8f0; }
.modal h3 { margin-bottom: 24px; font-size: 1.15rem; font-weight: 700; color: #0f172a; letter-spacing: -0.01em; }
.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 6px; color: #64748b; letter-spacing: 0.01em; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 10px 12px; border: 1px solid #e2e8f0; border-radius: 8px;
  font-size: 0.875rem; font-family: inherit; background: #fff; color: #0f172a;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: #94a3b8; }
.form-group input:hover, .form-group select:hover, .form-group textarea:hover { border-color: #cbd5e1; }
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: #0f172a; box-shadow: 0 0 0 1px #0f172a;
}
.form-group textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.form-group select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 36px; }
.form-group .form-row { display: flex; gap: 12px; }
.form-group .form-row > * { flex: 1; }
.modal-actions { margin-top: 24px; display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions .btn { padding: 9px 20px; font-size: 0.875rem; font-weight: 500; border-radius: 8px; }
.modal-actions .btn-primary { background: #0f172a; border-color: #0f172a; }
.modal-actions .btn-primary:hover { background: #1e293b; }
.modal-actions .btn-outline { border: 1px solid #e2e8f0; background: #fff; color: #64748b; }
.modal-actions .btn-outline:hover { background: #f8fafc; color: #0f172a; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 20px; }

/* ===== Utility ===== */
.loading { color: #868e96; font-style: italic; }
.empty-state { text-align: center; padding: 40px; color: #868e96; }

/* ===== Responsive ===== */
/* ===== Data Prep Section ===== */
.data-prep-section { margin-top: 32px; background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.data-prep-section h3 { margin-bottom: 4px; }
.data-prep-actions { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.data-prep-sheets h4 { font-size: 0.9rem; color: #334155; margin-bottom: 12px; }

/* ===== Cost Section ===== */
.cost-section { margin-top: 24px; }
.cost-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.cost-card { background: #fff; border: 1px solid #e9ecef; border-radius: 10px; padding: 16px; }
.cost-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.cost-price { font-weight: 700; color: #1971c2; font-size: 1.05rem; }
.cost-total { color: #0f172a; font-size: 1.1rem; }
.cost-card-desc { font-size: 0.78rem; color: #64748b; margin-bottom: 4px; }
.cost-card-plan { font-size: 0.72rem; color: #94a3b8; margin-bottom: 8px; }
.cost-card-details { border-top: 1px solid #f1f3f5; padding-top: 8px; }
.cost-detail-row { display: flex; justify-content: space-between; font-size: 0.75rem; color: #495057; padding: 2px 0; }

/* ===== Email Template Preview ===== */
.email-preview-card { background: #fff; border-radius: 10px; margin-bottom: 20px; box-shadow: 0 1px 4px rgba(0,0,0,0.08); overflow: hidden; }
.email-preview-header { padding: 14px 20px; background: #f8fafc; border-bottom: 1px solid #e2e8f0; }
.email-preview-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.email-preview-envelope { padding: 14px 20px; background: #fafbfc; border-bottom: 1px solid #e9ecef; font-size: 0.85rem; }
.email-field { margin: 4px 0; }
.email-label { color: #64748b; font-weight: 600; display: inline-block; width: 60px; }
.email-preview-body { padding: 24px 32px; font-size: 0.9rem; line-height: 1.7; color: #1a1a2e; font-family: 'Segoe UI', 'Hiragino Sans', sans-serif; }
.email-var { background: #dbeafe; color: #1d4ed8; padding: 1px 6px; border-radius: 4px; font-weight: 500; }
.email-var-raw { background: #fef3c7; color: #92400e; padding: 1px 6px; border-radius: 4px; font-family: monospace; font-size: 0.8em; }

/* ===== Client TODO Cards ===== */
.todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 12px; }
.todo-card { background: #fff; border-radius: 10px; padding: 16px; border: 1px solid #e9ecef; display: flex; gap: 12px; }
.todo-card-check { flex-shrink: 0; padding-top: 2px; }
.todo-card-check input[type="checkbox"] { width: 20px; height: 20px; cursor: pointer; accent-color: #2563eb; }
.todo-card-content { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.todo-done { opacity: 0.5; background: #f8faf8; }
.todo-done .todo-card-title strong { text-decoration: line-through; color: #94a3b8; }
.todo-card-title { font-size: 0.92rem; }
.todo-card-title code { margin-right: 6px; }
.todo-id { font-size: 0.65rem; color: #868e96; background: #f1f3f5; padding: 2px 6px; border-radius: 4px; }
.todo-card-badges { display: flex; gap: 4px; align-items: center; }
.todo-card-body { font-size: 0.78rem; color: #495057; line-height: 1.5; }
.todo-card-cost { font-size: 0.75rem; color: #e67700; font-weight: 600; background: #fffbeb; padding: 6px 10px; border-radius: 6px; border: 1px solid #fef3c7; }

/* ===== Spec Viewer ===== */
.spec-viewer-layout { display: flex; gap: 20px; margin-top: 16px; }
.spec-doc { flex: 3; background: #fff; border-radius: 10px; padding: 24px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); max-height: calc(100vh - 200px); overflow-y: auto; min-width: 0; }
.spec-doc h1, .spec-doc h2, .spec-doc h3 { margin-top: 1.2em; margin-bottom: 0.5em; }
.spec-doc h2 { font-size: 1.2rem; border-bottom: 1px solid #e9ecef; padding-bottom: 6px; }
.spec-doc h3 { font-size: 1rem; }
.spec-doc table { border: 1px solid #e9ecef; margin: 8px 0; font-size: 0.8rem; }
.spec-doc th, .spec-doc td { padding: 4px 8px; border: 1px solid #e9ecef; }
.spec-doc th { background: #f8f9fa; }
.spec-doc code { background: #f1f3f5; padding: 1px 4px; border-radius: 3px; font-size: 0.85em; }
.spec-doc pre { background: #1a1a2e; color: #e0e0e0; padding: 12px; border-radius: 6px; overflow-x: auto; font-size: 0.8rem; }
.spec-doc pre code { background: transparent; }
.spec-diffs { flex: 2; max-height: calc(100vh - 200px); overflow-y: auto; }
.spec-diff-card { background: #fff; border-radius: 8px; padding: 14px; margin-bottom: 10px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); border-left: 4px solid #e9ecef; }
.spec-diff-card.impact-high { border-left-color: #2563eb; }
.spec-diff-card.impact-medium { border-left-color: #2563eb; }
.spec-diff-card.impact-low { border-left-color: #51cf66; }
.spec-diff-card.impact-improvement { border-left-color: #51cf66; }
.spec-diff-card .diff-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.spec-diff-card .diff-id { font-family: monospace; font-size: 0.75rem; color: #868e96; }
.spec-diff-card .diff-cat { font-size: 0.75rem; font-weight: 600; }
.spec-diff-card .diff-body { font-size: 0.8rem; line-height: 1.5; }
.spec-diff-card .diff-design { background: #fff3f3; padding: 6px 10px; border-radius: 4px; margin: 4px 0; }
.spec-diff-card .diff-actual { background: #f0fff4; padding: 6px 10px; border-radius: 4px; margin: 4px 0; }
.spec-diff-card .diff-reason { color: #868e96; font-size: 0.75rem; font-style: italic; margin-top: 6px; }
.spec-diff-card:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.15); }
.spec-diff-card.active { outline: 2px solid #228be6; box-shadow: 0 2px 12px rgba(34,139,230,0.3); }
.spec-diff-marker { display: inline-block; background: #2563eb; color: #fff; font-size: 10px; font-weight: 600; padding: 1px 8px; border-radius: 10px; margin-left: 8px; vertical-align: middle; }
.spec-highlight { background: #fff3bf !important; border-radius: 4px; padding: 2px 4px; transition: background 0.3s; }
.spec-doc h2.spec-highlight, .spec-doc h3.spec-highlight, .spec-doc h4.spec-highlight { background: #fff3bf !important; }

/* ===== Test History ===== */
.th-round { background: #fff; border-radius: 10px; padding: 20px; margin-bottom: 20px; box-shadow: 0 1px 3px rgba(0,0,0,0.08); }
.th-round-header h3 { font-size: 1.1rem; margin-bottom: 8px; }
.th-round-meta { display: flex; gap: 16px; flex-wrap: wrap; font-size: 0.8rem; color: #666; margin-bottom: 16px; }
.th-phase { border: 1px solid #e9ecef; border-radius: 8px; margin-bottom: 8px; overflow: hidden; }
.th-phase-header { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; cursor: pointer; background: #f8f9fa; transition: background 0.15s; }
.th-phase-header:hover { background: #e9ecef; }
.th-phase-title { font-weight: 600; font-size: 0.9rem; }
.th-phase-stats { display: flex; gap: 6px; align-items: center; }
.th-phase-body { display: none; padding: 0; }
.th-phase.expanded .th-phase-body { display: block; }
.th-phase-body .table { margin: 0; font-size: 0.8rem; }
.th-phase-body .table td, .th-phase-body .table th { padding: 6px 10px; }

/* ===== Feedback Split-View Layout ===== */
.fb-layout { display: flex; gap: 0; height: calc(100vh - 220px); min-height: 400px; }
.fb-list-panel { width: 320px; min-width: 220px; border-right: 1px solid #e9ecef; overflow-y: auto; flex-shrink: 0; }
.fb-detail-panel { flex: 1; overflow-y: auto; padding: 20px 24px; background: #fff; border-radius: 0 8px 8px 0; }
.fb-list-item { padding: 10px 14px; border-bottom: 1px solid #f1f3f5; cursor: pointer; transition: background 0.1s; }
.fb-list-item:hover { background: #f8fafc; }
.fb-list-item.active { background: #eff6ff; border-left: 3px solid #3b82f6; padding-left: 11px; }
.fb-list-title { font-size: 0.82rem; font-weight: 600; color: #1e293b; line-height: 1.4; margin-bottom: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-list-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 0.7rem; color: #64748b; margin-bottom: 4px; }
.fb-list-date { color: #94a3b8; margin-left: auto; white-space: nowrap; }
.fb-has-reply { color: #2563eb; font-weight: 600; }
.fb-no-reply { color: #9ca3af; }
.fb-unread { background: #fffbeb; border-left: 3px solid #f59e0b; padding-left: 11px; }
.fb-unread:hover { background: #fef3c7; }
.fb-unread.active { background: #eff6ff; border-left-color: #3b82f6; }
.fb-unread .fb-list-title { font-weight: 700; }
.fb-new-flag { font-weight: 700; padding: 1px 6px; border-radius: 4px; font-size: 0.66rem; white-space: nowrap; }
.fb-flag-new { color: #b45309; background: #fef3c7; }
.fb-flag-reply { color: #fff; background: #f59e0b; }
.fb-list-badges { display: flex; gap: 4px; flex-wrap: wrap; }
.fb-list-empty { padding: 20px 14px; color: #94a3b8; font-size: 0.82rem; }
.fb-detail-empty { display: flex; align-items: center; justify-content: center; height: 200px; color: #94a3b8; font-size: 0.88rem; }
.fb-detail { display: flex; flex-direction: column; gap: 0; }
.fb-detail-header { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #f1f3f5; }
.fb-detail-title { font-size: 1.05rem; font-weight: 700; color: #1e293b; line-height: 1.4; margin-top: 4px; }
.fb-detail-actions { display: flex; gap: 6px; align-items: flex-start; flex-shrink: 0; padding-top: 2px; }
.fb-detail-body { font-size: 0.85rem; color: #374151; line-height: 1.7; white-space: pre-wrap; margin-bottom: 12px; }
.fb-dev-notes-detail { background: #fff7ed; border-left: 3px solid #f97316; border-radius: 0 6px 6px 0; padding: 8px 12px; font-size: 0.78rem; color: #92400e; margin-top: 10px; margin-bottom: 10px; }

@media (max-width: 1024px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; padding: 16px; }
  .stats-grid { grid-template-columns: repeat(3, 1fr); }
  .test-category-sidebar { width: 160px; }
}
@media (max-width: 768px) {
  .sidebar { width: 60px; }
  .sidebar-header h1, .nav-link span:not(.nav-icon), .sidebar-footer label, .version { display: none; }
  .nav-link { justify-content: center; padding: 12px; }
  .main-content { margin-left: 60px; padding: 12px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .test-runner-layout { flex-direction: column; }
  .test-category-sidebar { width: 100%; }
  .manual-layout { flex-direction: column; }
  .manual-toc { width: 100%; position: static; }
  .fb-layout { flex-direction: column; height: auto; }
  .fb-list-panel { width: 100%; border-right: none; border-bottom: 1px solid #e9ecef; max-height: 300px; }
  .fb-detail-panel { border-radius: 0 0 8px 8px; }
}
