/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: 'Inter', sans-serif; color: #191919; background: #f7f7f5;
       -webkit-font-smoothing: antialiased; min-height: 100vh; }
img { max-width: 100%; display: block; }

/* ── Header ── */
.header {
  position: sticky; top: 0; z-index: 100;
  background: #1A2332; color: #fff;
  display: flex; align-items: center; gap: 10px;
  padding: 0 28px; height: 52px;
  font-family: 'JetBrains Mono', monospace; font-size: 12px; font-weight: 500;
  letter-spacing: 0.12em;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.header-brand { color: #fff; }
.header-sep { color: #EDB44C; opacity: 0.8; }
.header-title { color: rgba(255,255,255,0.45); }

/* ── Layout ── */
.layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  min-height: calc(100vh - 52px);
}

/* ── Panels ── */
.panel { padding: 28px; }

.panel-input {
  background: #fff;
  border-right: 1px solid rgba(0,0,0,0.07);
  display: flex; flex-direction: column; gap: 20px;
}

.panel-results {
  background: #f7f7f5;
  display: flex; flex-direction: column;
}

/* ── Fields ── */
.field { display: flex; flex-direction: column; gap: 6px; }

.field-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: rgba(25,25,25,0.45);
}

.select {
  width: 100%; padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: 6px;
  background: #fff; color: #191919;
  font-family: 'Inter', sans-serif; font-size: 13px;
  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='%23999' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  cursor: pointer;
  transition: border-color 0.15s;
}
.select:focus { outline: none; border-color: #1A2332; }

.textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid rgba(0,0,0,0.12); border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 13px; color: #191919;
  resize: vertical; transition: border-color 0.15s;
}
.textarea:focus { outline: none; border-color: #1A2332; }

.detected-label {
  font-size: 11px; color: #EDB44C;
  font-family: 'JetBrains Mono', monospace;
  margin-top: 2px;
}

/* ── Upload zone ── */
.upload-zone {
  border: 1.5px dashed rgba(0,0,0,0.18); border-radius: 8px;
  padding: 28px 20px; text-align: center; cursor: pointer;
  background: #fafaf8; transition: border-color 0.15s, background 0.15s;
  position: relative;
}
.upload-zone:hover, .upload-zone.dragover {
  border-color: #1A2332; background: #f0f0ee;
}
.upload-zone input[type="file"] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.upload-icon {
  width: 28px; height: 28px; margin: 0 auto 10px;
  color: rgba(0,0,0,0.3);
}
.upload-text { font-size: 13px; color: #191919; margin-bottom: 4px; }
.upload-link { color: #1A2332; text-decoration: underline; font-weight: 500; }
.upload-sub { font-size: 11px; color: rgba(0,0,0,0.4); font-family: 'JetBrains Mono', monospace; }

/* ── File list ── */
.file-list { list-style: none; display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.file-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 7px 10px; background: #f7f7f5; border-radius: 5px;
  font-size: 12px; color: #191919;
}
.file-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item-dim { font-family: 'JetBrains Mono', monospace; font-size: 10px; color: rgba(0,0,0,0.4); margin: 0 8px; }
.file-item-remove {
  background: none; border: none; cursor: pointer; color: rgba(0,0,0,0.3);
  font-size: 14px; line-height: 1; padding: 0 2px;
  transition: color 0.15s;
}
.file-item-remove:hover { color: #c0392b; }

/* ── Run button ── */
.btn-run {
  margin-top: auto;
  width: 100%; padding: 12px;
  background: #EDB44C; color: #191919;
  border: none; border-radius: 6px;
  font-family: 'Inter', sans-serif; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: background 0.15s, opacity 0.15s;
  letter-spacing: -0.01em;
}
.btn-run:hover:not(:disabled) { background: #d9a340; }
.btn-run:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── States ── */
.state-empty, .state-loading {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center; padding: 60px 40px;
}

.empty-icon { width: 48px; height: 48px; color: rgba(0,0,0,0.15); margin-bottom: 16px; }
.empty-title { font-size: 15px; font-weight: 500; color: rgba(0,0,0,0.4); margin-bottom: 6px; }
.empty-sub { font-size: 13px; color: rgba(0,0,0,0.3); max-width: 280px; line-height: 1.5; }

.spinner {
  width: 32px; height: 32px;
  border: 2.5px solid rgba(0,0,0,0.1);
  border-top-color: #1A2332;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 14px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-label { font-size: 13px; color: rgba(0,0,0,0.45); font-family: 'JetBrains Mono', monospace; }

/* ── Results ── */
.state-results { display: flex; flex-direction: column; height: 100%; overflow: hidden; }

/* File tabs */
.file-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  overflow-x: auto;
  flex-shrink: 0;
  background: #fff;
}
.file-tab {
  padding: 10px 16px; font-size: 12px; cursor: pointer;
  border: none; background: none;
  font-family: 'JetBrains Mono', monospace;
  color: rgba(0,0,0,0.45); white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color 0.15s;
}
.file-tab.active { color: #1A2332; border-bottom-color: #EDB44C; font-weight: 500; }
.file-tab:hover:not(.active) { color: #191919; }

/* Report container */
#report-container { flex: 1; overflow-y: auto; padding: 24px; }

/* Verdict */
.verdict {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px; border-radius: 8px; margin-bottom: 20px;
}
.verdict.pass { background: #f0faf0; border: 1px solid #a3d9a3; }
.verdict.fail { background: #fff5f5; border: 1px solid #f5c0c0; }
.verdict-badge {
  font-size: 22px;
}
.verdict-text { }
.verdict-title {
  font-size: 14px; font-weight: 600;
}
.verdict.pass .verdict-title { color: #2d6a2d; }
.verdict.fail .verdict-title { color: #c0392b; }
.verdict-sub {
  font-size: 12px; color: rgba(0,0,0,0.45);
  font-family: 'JetBrains Mono', monospace; margin-top: 2px;
}

/* Progress bar */
.progress-wrap { margin-bottom: 24px; }
.progress-bar-track {
  height: 4px; background: rgba(0,0,0,0.08); border-radius: 2px; overflow: hidden;
}
.progress-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
.progress-bar-fill.pass { background: #4caf70; }
.progress-bar-fill.fail { background: #e05252; }
.progress-label {
  font-size: 11px; color: rgba(0,0,0,0.4);
  font-family: 'JetBrains Mono', monospace;
  margin-top: 5px;
}

/* Checklist */
.checklist { margin-bottom: 28px; }
.checklist-group { margin-bottom: 16px; }
.checklist-group-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(0,0,0,0.35);
  padding: 0 0 8px; border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 4px;
}
.check-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 4px; border-radius: 4px; font-size: 13px;
}
.check-row:hover { background: rgba(0,0,0,0.025); }
.check-icon { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.check-text { flex: 1; line-height: 1.4; }
.check-row.pass .check-text { color: #191919; }
.check-row.fail .check-text { color: #c0392b; font-weight: 500; }
.check-row.cannot_verify .check-text { color: rgba(0,0,0,0.4); }

/* Issues */
.issues-section { }
.issues-heading {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px; font-weight: 500; letter-spacing: 0.14em;
  text-transform: uppercase; color: rgba(0,0,0,0.35);
  padding-bottom: 10px; border-bottom: 1px solid rgba(0,0,0,0.06);
  margin-bottom: 12px;
}
.issue-card {
  background: #fff; border: 1px solid rgba(0,0,0,0.08);
  border-radius: 8px; padding: 14px 16px; margin-bottom: 10px;
  border-left: 3px solid #e05252;
}
.issue-title { font-size: 13px; font-weight: 600; color: #191919; margin-bottom: 10px; }
.issue-row { display: grid; grid-template-columns: 60px 1fr; gap: 6px; margin-bottom: 6px; }
.issue-row:last-child { margin-bottom: 0; }
.issue-key {
  font-family: 'JetBrains Mono', monospace; font-size: 10px;
  font-weight: 500; color: rgba(0,0,0,0.35); text-transform: uppercase;
  letter-spacing: 0.08em; padding-top: 2px;
}
.issue-val { font-size: 13px; line-height: 1.5; color: #191919; }
.issue-val.fix { color: #1A2332; font-weight: 500; }

/* Report actions */
.report-actions {
  padding: 16px 24px;
  border-top: 1px solid rgba(0,0,0,0.07);
  background: #fff;
  flex-shrink: 0;
}
.btn-secondary {
  padding: 8px 16px;
  background: transparent; border: 1px solid rgba(0,0,0,0.15);
  border-radius: 6px; font-size: 12px; cursor: pointer;
  font-family: 'Inter', sans-serif; color: #191919;
  transition: border-color 0.15s, background 0.15s;
}
.btn-secondary:hover { background: #f0f0ee; border-color: rgba(0,0,0,0.25); }
.btn-secondary.copied { color: #2d6a2d; border-color: #a3d9a3; background: #f0faf0; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .panel-input { border-right: none; border-bottom: 1px solid rgba(0,0,0,0.07); }
  .panel-results { min-height: 400px; }
}
