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

:root {
  --bg: #0f1117;
  --bg2: #1a1d27;
  --bg3: #22263a;
  --border: #2e3347;
  --accent: #6c63ff;
  --accent2: #4ecca3;
  --text: #e8eaf0;
  --text2: #8b90a8;
  --plate: #f5c518;
  --radius: 12px;
  --font: 'Segoe UI', system-ui, sans-serif;
}

body { background: var(--bg); color: var(--text); font-family: var(--font); min-height: 100vh; }
.container { max-width: 900px; margin: 0 auto; padding: 0 1.5rem 3rem; }

.header { border-bottom: 1px solid var(--border); padding: 1rem 0; margin-bottom: 2rem; }
.header .container { display: flex; align-items: center; gap: 1rem; padding-bottom: 0; }
.header__brand { display: flex; align-items: center; gap: 0.5rem; font-weight: 700; font-size: 1.15rem; }
.header__icon { font-size: 1.3rem; }
.header__sub { color: var(--text2); font-size: 0.88rem; margin-left: auto; }

.card { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.25rem; }

/* Upload */
.upload-zone { text-align: center; }
.upload-zone__inner { padding: 2.5rem 1rem; border: 2px dashed var(--border); border-radius: 10px; transition: border-color 0.2s, background 0.2s; }
.upload-zone__inner.drag-over { border-color: var(--accent); background: rgba(108,99,255,0.06); }
.upload-zone__icon { font-size: 2.5rem; margin-bottom: 0.75rem; opacity: 0.7; }
.upload-zone__title { font-size: 1.05rem; font-weight: 600; margin-bottom: 0.3rem; }
.upload-zone__sub { color: var(--text2); font-size: 0.85rem; margin-bottom: 1.25rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.6rem 1.25rem; border-radius: 8px; border: none; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s; }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #7c74ff; }
.btn--ghost { background: transparent; border: 1px solid var(--border); color: var(--text2); }
.btn--ghost:hover { border-color: var(--text2); color: var(--text); }
.btn--xs { padding: 0.25rem 0.65rem; font-size: 0.78rem; }

/* Processing */
.processing { display: flex; align-items: center; gap: 1rem; background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 1.25rem; }
.processing__spinner { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.8s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }
.processing__title { font-weight: 600; margin-bottom: 0.15rem; }
.processing__sub { color: var(--text2); font-size: 0.85rem; }

/* Result */
.result { background: var(--bg2); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; margin-bottom: 1.25rem; }
.result__top { display: flex; align-items: flex-start; gap: 2rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.result__actions { margin-top: 1.25rem; }

/* Plate display */
.plate-display { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.plate-display__label { font-size: 0.78rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; }
.plate-box {
  background: var(--plate);
  color: #111;
  font-size: 2rem;
  font-weight: 900;
  letter-spacing: 0.15em;
  padding: 0.5rem 1.5rem;
  border-radius: 8px;
  border: 3px solid #333;
  min-width: 220px;
  text-align: center;
  font-family: 'Courier New', monospace;
  text-transform: uppercase;
  box-shadow: 0 4px 20px rgba(245,197,24,0.25);
}
.plate-display__conf { font-size: 0.82rem; color: var(--text2); }
.plate-display__conf strong { color: var(--accent2); }

/* Candidates */
.candidates { flex: 1; }
.candidates__label { font-size: 0.78rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; font-weight: 600; margin-bottom: 0.6rem; }
.candidates__list { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.candidates__list li { display: flex; justify-content: space-between; align-items: center; background: var(--bg3); border-radius: 6px; padding: 0.4rem 0.75rem; font-size: 0.88rem; }
.cand-text { font-weight: 600; font-family: monospace; }
.cand-conf { font-size: 0.78rem; color: var(--text2); }

/* Images */
.result__images { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 600px) { .result__images { grid-template-columns: 1fr; } }
.img-panel__label { font-size: 0.78rem; color: var(--text2); text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: 0.5rem; font-weight: 600; }
.result-img { width: 100%; border-radius: 8px; border: 1px solid var(--border); object-fit: contain; max-height: 320px; background: var(--bg3); }
.result-img--crop { max-height: 100px; object-fit: contain; }

/* History */
.history__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.panel__title { font-size: 0.85rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text2); }
.history__list { display: flex; flex-direction: column; gap: 0.4rem; }
.history-item { display: flex; align-items: center; gap: 0.75rem; padding: 0.6rem 0.85rem; background: var(--bg3); border-radius: 8px; font-size: 0.88rem; }
.history-item__plate { font-family: monospace; font-weight: 700; color: var(--plate); flex: 1; }
.history-item__file { color: var(--text2); font-size: 0.8rem; flex: 2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history-item__conf { color: var(--accent2); font-size: 0.8rem; }
.history-item__time { color: var(--text2); font-size: 0.78rem; }

.empty { color: var(--text2); font-size: 0.88rem; text-align: center; padding: 1rem 0; }
[hidden] { display: none !important; }
