:root {
  --bg: #0f1115;
  --panel: #1a1d24;
  --border: #2a2e37;
  --text: #e6e8eb;
  --muted: #9aa0a6;
  --accent: #4c8bf5;
  --error: #ff3b30;
}

* { box-sizing: border-box; }

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

header {
  padding: 24px 16px 8px;
  text-align: center;
}

header h1 { margin: 0; font-size: 1.8rem; }
.subtitle { margin: 4px 0 0; color: var(--muted); }

main {
  max-width: 820px;
  margin: 0 auto;
  padding: 16px;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.file-btn {
  display: inline-block;
  background: var(--accent);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
}

.file-btn input { display: none; }

.filename { color: var(--muted); font-size: 0.9rem; }

.status {
  min-height: 1.2em;
  color: var(--muted);
  font-size: 0.95rem;
  margin: 8px 0 16px;
}
.status.error { color: var(--error); }

.results { display: grid; gap: 16px; }
.hidden { display: none !important; }

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
}

.panel h2 { margin: 0 0 12px; font-size: 1.1rem; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.panel-head h2 { margin: 0; }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 600;
}

.line-list {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 320px;
  overflow-y: auto;
}

.line-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.line-text { word-break: break-word; }
.line-score {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.85rem;
  white-space: nowrap;
}

.empty { color: var(--muted); }

.image-wrap {
  position: relative;
  display: inline-block;
  max-width: 100%;
}

.image-wrap img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 6px;
}

#overlay {
  position: absolute;
  top: 0;
  left: 0;
  pointer-events: none;
}
