:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --muted: #6b7280;
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --success: #059669;
  --warning: #d97706;
  --error: #dc2626;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 96px;
}

header h1 {
  font-size: 28px;
  margin: 0 0 8px;
  font-weight: 600;
}

.subtitle {
  color: var(--muted);
  margin: 0 0 32px;
}

.dropzone {
  border: 2px dashed var(--border);
  border-radius: 12px;
  background: var(--surface);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  outline: none;
}

.dropzone:hover, .dropzone:focus-visible {
  border-color: var(--accent);
}

.dropzone.dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.dropzone-inner svg {
  color: var(--muted);
  margin-bottom: 12px;
}

.dropzone-text {
  margin: 0;
  font-size: 16px;
}

.dropzone-hint {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  padding: 0;
  font: inherit;
  text-decoration: underline;
}

.link-btn:hover {
  color: #1d4ed8;
}

.status {
  margin-top: 24px;
  padding: 16px 20px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.status.working { border-left: 3px solid var(--accent); }
.status.success { border-left: 3px solid var(--success); }
.status.partial { border-left: 3px solid var(--warning); }
.status.error { border-left: 3px solid var(--error); }

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--accent-soft);
  border-top-color: var(--accent);
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

.dropzone.is-busy {
  pointer-events: none;
  opacity: 0.6;
}

.results {
  margin-top: 24px;
  padding: 20px;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.results h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
}

.issue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.issue-list li {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
}

.issue-list .badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.issue-list .badge.epic { background: #fef3c7; color: #92400e; }
.issue-list a { color: var(--accent); text-decoration: none; font-weight: 600; }
.issue-list a:hover { text-decoration: underline; }
.issue-list .summary { flex: 1; color: var(--text); }

.history {
  margin-top: 48px;
}

.history-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.history h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

th, td {
  text-align: left;
  padding: 10px 14px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

th {
  background: #f9fafb;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.04em;
}

tr:last-child td { border-bottom: none; }

.status-pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.status-pill.success { background: #d1fae5; color: #065f46; }
.status-pill.partial { background: #fef3c7; color: #92400e; }
.status-pill.error { background: #fee2e2; color: #991b1b; }

.muted { color: var(--muted); font-size: 14px; }

.keys-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.keys-list a {
  color: var(--accent);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, monospace;
  font-size: 12px;
  padding: 2px 6px;
  background: var(--accent-soft);
  border-radius: 4px;
}

.keys-list a:hover { text-decoration: underline; }
