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

:root {
  --bg: #080808;
  --surface: #111;
  --surface-hover: #1a1a1a;
  --border: #222;
  --text: #999;
  --text-bright: #fff;
  --text-muted: #555;
  --pass: #22c55e;
  --fail: #ef4444;
  --warn: #f59e0b;
  --info: #3b82f6;
  --accent: #6366f1;
  --font-body: 'DM Sans', sans-serif;
  --font-heading: 'Bebas Neue', sans-serif;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--border);
}

.header-brand {
  font-family: var(--font-heading);
  font-size: 1.4rem;
  letter-spacing: 0.15em;
  color: var(--text-bright);
  text-decoration: none;
}

.header-tool {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

/* Main */
.main {
  max-width: 720px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

/* Dropzone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 3rem 2rem;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--text-muted);
  background: var(--surface-hover);
}

.dropzone-icon {
  width: 40px;
  height: 40px;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.dropzone-text {
  font-size: 0.95rem;
  color: var(--text-bright);
  margin-bottom: 0.4rem;
}

.dropzone-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* File bar */
.file-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  margin-top: 1rem;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}

.file-name {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-bright);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-clear {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0 0.3rem;
  line-height: 1;
}
.btn-clear:hover { color: var(--text-bright); }

.summary-pills {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 99px;
  letter-spacing: 0.03em;
}

.pill--pass { background: rgba(34,197,94,0.15); color: var(--pass); }
.pill--fail { background: rgba(239,68,68,0.15); color: var(--fail); }
.pill--warn { background: rgba(245,158,11,0.15); color: var(--warn); }
.pill--info { background: rgba(59,130,246,0.15); color: var(--info); }

/* Results */
.results {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 1rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}
.section-header:hover { background: var(--surface-hover); }

.section-title {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-bright);
}

.section-counts {
  display: flex;
  gap: 0.4rem;
}

.section-body {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
  display: none;
}
.section.open .section-body { display: block; }

.result-row {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.45rem 1rem;
  font-size: 0.82rem;
  line-height: 1.45;
}

.result-icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 1px;
}

.result-icon--pass { color: var(--pass); }
.result-icon--fail { color: var(--fail); }
.result-icon--warn { color: var(--warn); }
.result-icon--info { color: var(--info); }

.result-body { flex: 1; min-width: 0; }

.result-msg { color: var(--text); }
.result-row[data-status="fail"] .result-msg { color: var(--fail); }
.result-row[data-status="warn"] .result-msg { color: var(--warn); }

.result-actions {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

.btn-fix, .btn-ask {
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  border: 1px solid;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-fix {
  background: rgba(34,197,94,0.1);
  border-color: rgba(34,197,94,0.3);
  color: var(--pass);
}
.btn-fix:hover { background: rgba(34,197,94,0.2); }

.btn-ask {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
  color: var(--accent);
}
.btn-ask:hover { background: rgba(99,102,241,0.2); }

.fix-steps {
  margin-top: 0.3rem;
  padding-left: 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  list-style: decimal;
}
.fix-steps li { margin-bottom: 0.15rem; }

/* Download bar */
.download-bar {
  position: sticky;
  bottom: 1rem;
  margin-top: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.8rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.fix-count {
  font-size: 0.82rem;
  color: var(--pass);
  font-weight: 500;
}

.btn-download {
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.5rem 1.2rem;
  border-radius: 8px;
  border: none;
  background: var(--pass);
  color: #000;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-download:hover { opacity: 0.85; }

/* Claude panel */
.claude-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 420px;
  max-width: 90vw;
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.25s ease;
}
.claude-panel.open {
  transform: translateX(0);
}

.claude-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid var(--border);
}

.claude-title {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  letter-spacing: 0.1em;
  color: var(--text-bright);
}

.claude-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem;
}

.claude-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  padding: 2rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.spinner {
  width: 28px;
  height: 28px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.claude-response {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--text);
}
.claude-response p { margin-bottom: 0.8rem; }
.claude-response code {
  background: var(--bg);
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  font-size: 0.8rem;
}
.claude-response pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.8rem;
  overflow-x: auto;
  margin-bottom: 0.8rem;
}
.claude-response pre code {
  background: none;
  padding: 0;
}
.claude-response ol, .claude-response ul {
  padding-left: 1.2rem;
  margin-bottom: 0.8rem;
}
.claude-response li { margin-bottom: 0.3rem; }
.claude-response strong { color: var(--text-bright); }

/* Utilities */
.hidden { display: none !important; }

/* Responsive */
@media (max-width: 600px) {
  .main { padding: 0 1rem; }
  .header { padding: 0.8rem 1rem; }
  .claude-panel { width: 100vw; }
}
