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

body {
  font-family: var(--font-sans);
  background: var(--dark);
  color: var(--white);
  height: 100vh;
  overflow: hidden;
  font-weight: 400;
  line-height: 1.7;
}

.app { display: flex; height: 100vh; }

/* ===== サイドバー ===== */
.sidebar {
  width: 280px;
  background: var(--mid);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--border);
}

.sidebar-header h1 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 22px;
  color: var(--white);
  letter-spacing: -0.005em;
}
.sidebar-header p {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--blue-accent);
  margin-top: 6px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.case-actions { padding: 12px; border-bottom: 1px solid var(--border); }

.btn-new {
  width: 100%;
  padding: 10px 14px;
  background: var(--blue-accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-new:hover { background: var(--blue-light); transform: translateY(-1px); }

.btn-demo {
  width: 100%; padding: 8px 14px; margin-top: 8px;
  background: transparent; color: var(--blue-accent);
  border: 1px solid rgba(74, 127, 212, 0.4); border-radius: 100px;
  font-family: var(--font-sans);
  font-size: 11px; cursor: pointer; transition: all 0.2s ease;
  letter-spacing: 0.08em;
}
.btn-demo:hover { background: rgba(74, 127, 212, 0.08); border-color: var(--blue-accent); }
.btn-demo::before { content: '✦ '; font-size: 10px; }

.case-list { flex: 1; overflow-y: auto; padding: 8px; }

.case-item {
  padding: 12px 14px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.case-item:hover  { background: var(--black); border-color: var(--border); }
.case-item.active { background: var(--black); border-color: var(--blue-accent); }

.case-item-name {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.case-item-meta { font-size: 11px; color: var(--muted); margin-top: 4px; letter-spacing: 0.04em; }

.case-score-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ===== メインコンテンツ ===== */
.main-content { flex: 1; overflow-y: auto; padding: 40px; }

.welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 80%;
  color: var(--muted);
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}
.welcome-icon { font-size: 56px; margin-bottom: 24px; opacity: 0.7; }
.welcome h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 28px;
  color: var(--white);
  letter-spacing: -0.005em;
}
.welcome p {
  font-family: var(--font-sans);
  font-size: 14px;
  margin-top: 14px;
  line-height: 1.8;
  color: var(--muted);
}

/* ===== 案件詳細 ===== */
.case-detail { max-width: 1280px; margin: 0 auto; }

.case-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.case-header h2 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 26px;
  color: var(--white);
  flex: 1;
  letter-spacing: -0.005em;
}
.case-meta {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

/* ===== ファイルセクション ===== */
.files-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.files-section-3col {
  grid-template-columns: 1fr 1fr 1fr;
}
.column-hint {
  font-size: 11px;
  color: #64748b;
  margin: -6px 0 10px;
  line-height: 1.4;
}

.files-column {
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.2s ease;
}
.files-column:hover { border-color: rgba(74, 127, 212, 0.3); }

.files-column h3 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
}

.file-count {
  background: rgba(74, 127, 212, 0.15);
  color: var(--blue-accent);
  padding: 2px 10px;
  border-radius: 100px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.upload-area {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 18px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  margin-bottom: 12px;
  background: var(--black);
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--blue-accent);
  background: rgba(74, 127, 212, 0.04);
}
.upload-area input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.upload-label {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--blue-accent);
  font-weight: 500;
}
.upload-hint  {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

.file-list { list-style: none; max-height: 160px; overflow-y: auto; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 6px;
  border-radius: 4px;
  font-size: 12px;
  color: #94a3b8;
}
.file-list li:hover { background: #1e293b; }
.file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-ext  {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: #1e293b;
  color: #60a5fa;
  flex-shrink: 0;
}
.btn-delete-file {
  background: none;
  border: none;
  color: #475569;
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  flex-shrink: 0;
}
.btn-delete-file:hover { color: #f87171; }

/* ===== 解析セクション ===== */
.analyze-section { margin-bottom: 24px; }

.btn-analyze {
  padding: 12px 32px;
  background: var(--blue-accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.04em;
}
.btn-analyze:hover:not(:disabled) {
  background: var(--blue-light);
  transform: translateY(-1px);
}
.btn-analyze:disabled {
  background: var(--mid);
  color: var(--muted);
  cursor: not-allowed;
  border: 1px solid var(--border);
}
.btn-analyze:not(:disabled)::before { content: '✦ '; opacity: 0.8; }

.progress-log {
  margin-top: 12px;
  background: #0a0c14;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 12px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  max-height: 180px;
  overflow-y: auto;
}
.log-entry { padding: 3px 0; display: flex; align-items: flex-start; gap: 8px; }
.log-entry.info    .log-icon { color: #60a5fa; }
.log-entry.success .log-icon { color: #4ade80; }
.log-entry.warning .log-icon { color: #fbbf24; }
.log-entry.error   .log-icon { color: #f87171; }

/* ===== 結果セクション ===== */
.results-section {
  background: var(--mid);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 28px;
}

.results-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.results-header h3 {
  font-family: var(--font-serif);
  font-weight: 300;
  font-size: 22px;
  color: var(--white);
  flex: 1;
  letter-spacing: -0.005em;
}
.analyzed-at {
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.score-card {
  background: var(--black);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 12px;
  text-align: center;
  transition: border-color 0.2s ease;
}
.score-card:hover { border-color: rgba(74, 127, 212, 0.3); }
.score-number {
  font-family: var(--font-serif);
  font-size: 36px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.01em;
}
.score-label {
  font-family: var(--font-sans);
  font-size: 10px;
  color: var(--muted);
  margin-top: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.score-90plus  { color: #4ade80; }
.score-70to89  { color: #a3e635; }
.score-50to69  { color: #fbbf24; }
.score-30to49  { color: #fb923c; }
.score-under30 { color: #f87171; }

.summary-text {
  font-family: var(--font-sans);
  font-size: 14px;
  color: var(--white);
  line-height: 1.8;
  margin-bottom: 18px;
  padding: 16px 18px;
  background: var(--black);
  border-radius: 6px;
  border-left: 2px solid var(--blue-accent);
}

.section-title {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 500;
  color: var(--blue-accent);
  margin: 24px 0 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 12px;
}
.section-title::before {
  content: '';
  display: block;
  width: 28px;
  height: 1px;
  background: var(--blue-accent);
}

.critical-issues {
  background: #1c0a0a;
  border: 1px solid #7f1d1d;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.critical-issues h4 { font-size: 13px; color: #fca5a5; margin-bottom: 8px; }
.critical-issues li { font-size: 12px; color: #fca5a5; padding: 3px 0; list-style-position: inside; line-height: 1.5; }

.req-table-wrap { overflow-x: auto; }
.req-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
}
.req-table th {
  text-align: left;
  padding: 10px 12px;
  background: var(--black);
  color: var(--blue-accent);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 10px;
}
.req-table td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--white);
}
.req-table tr:hover td { background: var(--black); }

.badge { display: inline-block; padding: 2px 7px; border-radius: 10px; font-size: 10px; font-weight: 600; white-space: nowrap; }
.badge-必須 { background: #4c1d1d; color: #fca5a5; }
.badge-重要 { background: #4c3a00; color: #fde68a; }
.badge-要望 { background: #1e2a4a; color: #93c5fd; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-反映済 { background: #052e16; color: #4ade80; }
.status-部分的 { background: #422006; color: #fbbf24; }
.status-未反映 { background: #1c0a0a; color: #f87171; }
.status-対応済 { background: #052e16; color: #4ade80; }
.status-部分対応 { background: #422006; color: #fbbf24; }
.status-未対応 { background: #1c0a0a; color: #f87171; }
.status-対応不能 { background: #1e293b; color: #94a3b8; }

.evidence-text { color: var(--muted); font-size: 11px; line-height: 1.6; }

.recommendations {
  background: #0f1117;
  border-radius: 6px;
  padding: 12px 14px;
  margin-top: 8px;
}
.recommendations li {
  font-size: 13px;
  color: #94a3b8;
  padding: 4px 0;
  list-style-position: inside;
  line-height: 1.6;
}

/* ===== 過剰修正・差分詳細 ===== */
.over-modifications {
  background: #0f1c2e;
  border: 1px solid #1e3a5f;
  border-radius: 6px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.over-modifications h4 { font-size: 13px; color: #93c5fd; margin-bottom: 8px; }
.over-modifications li { font-size: 12px; color: #93c5fd; padding: 3px 0; list-style-position: inside; line-height: 1.5; }

.diff-details {
  margin-top: 20px;
  background: #0f1117;
  border: 1px solid #1e293b;
  border-radius: 6px;
  padding: 12px 14px;
}
.diff-details summary {
  cursor: pointer;
  font-size: 13px;
  color: #93c5fd;
  font-weight: 600;
  padding: 4px 0;
}
.diff-table { width: 100%; border-collapse: collapse; font-size: 11px; margin-top: 10px; }
.diff-table th, .diff-table td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid #1e293b;
  color: #94a3b8;
  vertical-align: top;
}
.diff-table th { color: #64748b; font-weight: 600; background: #0a0c14; }

/* ===== ボタン ===== */
.btn-primary {
  padding: 10px 22px;
  background: var(--blue-accent);
  color: var(--white);
  border: none;
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-primary:hover { background: var(--blue-light); transform: translateY(-1px); }

.btn-secondary {
  padding: 10px 22px;
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.btn-secondary:hover { color: var(--white); border-color: var(--blue-accent); }

.btn-danger-sm {
  padding: 6px 14px;
  background: transparent;
  color: var(--ng);
  border: 1px solid rgba(248, 113, 113, 0.3);
  border-radius: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s ease;
  letter-spacing: 0.04em;
}
.btn-danger-sm:hover { background: rgba(248, 113, 113, 0.08); border-color: var(--ng); }

/* ===== モーダル ===== */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: #1a1d27;
  border: 1px solid #2d3150;
  border-radius: 10px;
  padding: 24px;
  width: 380px;
}
.modal-content h3 { font-size: 16px; margin-bottom: 16px; }
.modal-content input {
  width: 100%;
  padding: 10px 12px;
  background: #0f1117;
  border: 1px solid #2d3150;
  border-radius: 6px;
  color: #e2e8f0;
  font-size: 14px;
  margin-bottom: 16px;
  outline: none;
}
.modal-content input:focus { border-color: #3b82f6; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ===== スクロールバー ===== */
::-webkit-scrollbar       { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #2d3150; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #3b4275; }
