:root {
  --bg: #0f172a;
  --surface: #1e293b;
  --surface-2: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #22c55e;
  --border: #475569;
  --radius: 14px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}

body { padding-bottom: calc(1rem + var(--safe-bottom)); }

.app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .75rem;
}

.brand-icon { font-size: 1.75rem; }
.header h1 { font-size: 1.15rem; font-weight: 700; }
.subtitle { font-size: .8rem; color: var(--muted); }

.badge {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: #f59e0b;
  color: #111;
  padding: .25rem .5rem;
  border-radius: 999px;
}

main {
  flex: 1;
  padding: 0 1rem 1rem;
}

.panel { display: none; }
.panel.active { display: block; }

.panel h2 {
  font-size: 1.2rem;
  margin-bottom: .35rem;
}

.hint {
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}

.hint.centered { text-align: center; }

/* Buttons */

.btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: .85rem 1rem;
  font-size: .95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn.full { width: 100%; }
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.primary:disabled { opacity: .45; cursor: not-allowed; }
.btn.secondary { background: var(--surface-2); color: #fff; }
.btn.ghost { background: transparent; color: var(--muted); border: 1px solid var(--border); }

.panel .btn.full + .btn.full,
.panel .btn.full + .hint + .btn.full { margin-top: .5rem; }

.hero {
  width: 100%;
  flex-direction: column;
  gap: .35rem;
  padding: 2.5rem 1rem;
  margin-bottom: .75rem;
  font-size: 1.35rem;
  border-radius: var(--radius);
}

.hero-icon { font-size: 3rem; }

.hero small {
  font-size: .85rem;
  font-weight: 400;
  opacity: .85;
}

/* Confirm */

.photo-preview {
  width: 100%;
  max-height: 42vh;
  object-fit: contain;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  margin-bottom: .75rem;
  background: #000;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  margin-bottom: 1rem;
}

.field span {
  font-size: .85rem;
  color: var(--muted);
}

.field input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: .85rem 1rem;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-align: center;
  text-transform: uppercase;
}

.status {
  min-height: 1.25rem;
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .75rem;
}

.status.working { color: #fbbf24; }
.status.success { color: var(--success); }
.status.error { color: #f87171; }

/* Working */

.plate-heading {
  font-size: 1.6rem;
  letter-spacing: .1em;
  text-align: center;
  margin-bottom: 1.25rem;
}

.progress {
  list-style: none;
  margin-bottom: 1rem;
}

.progress-step {
  position: relative;
  padding: .55rem 0 .55rem 2rem;
  color: var(--muted);
  font-size: .92rem;
}

.progress-step::before {
  content: "";
  position: absolute;
  left: .25rem;
  top: .85rem;
  width: .7rem;
  height: .7rem;
  border-radius: 50%;
  border: 2px solid var(--border);
}

.progress-step.active {
  color: var(--text);
  font-weight: 600;
}

.progress-step.active::before {
  border-color: var(--primary);
  background: var(--primary);
  animation: pulse 1.4s ease-in-out infinite;
}

.progress-step.done { color: var(--text); }

.progress-step.done::before {
  border-color: var(--success);
  background: var(--success);
}

@keyframes pulse {
  50% { opacity: .35; }
}

/* Result */

.info-card,
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 1rem;
  line-height: 1.6;
}

.result-card h3 {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .35rem;
}

.owner-name {
  font-size: 1.4rem;
  font-weight: 700;
}

.muted-line {
  color: var(--muted);
  font-size: .9rem;
}

.muted-line:empty { display: none; }

.warning-card {
  background: rgba(245, 158, 11, .12);
  border: 1px solid #f59e0b;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  margin: 1rem 0;
  font-size: .85rem;
  line-height: 1.5;
}

.directory-links { margin: 1.5rem 0 1rem; }

.directory-links h3 {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: .6rem;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5rem;
}

.link-grid .btn {
  font-size: .85rem;
  padding: .6rem .5rem;
}

.mono { font-family: ui-monospace, monospace; font-size: .9em; }
.hidden { display: none !important; }
