:root {
  --bg: #f4f5f7;
  --card: #fff;
  --ink: #15181d;
  --muted: #5d6573;
  --line: #e1e4ea;
  --full: #c93a3a;
  --few: #c98a00;
  --plenty: #23864f;
  --none: #8a919c;
  --brand: #1f4fd1;
  --radius: 14px;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Arabic", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
}
main { max-width: 560px; margin: 0 auto; padding: 16px 14px 48px; }
header.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
h1 { font-size: 1.45rem; margin: 0; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0 0 10px; }
.brand { color: var(--muted); font-size: .85rem; font-weight: 600; letter-spacing: .02em; }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }
.hidden { display: none !important; }
.wide { width: 100%; margin-top: 12px; }
.gap-top { margin-top: 12px; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.stack > * + * { margin-top: 10px; }

button, .btn {
  font: inherit;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
button:disabled { opacity: .45; cursor: default; }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 600; }
.btn-danger { color: var(--full); border-color: #f0c9c9; }
.btn-ghost { background: transparent; }
.lang { min-height: 36px; padding: 6px 12px; font-size: .9rem; }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-top: 12px; }
.card:empty { display: none; }
.card > p:first-child { margin-top: 0; }
.card > p:last-child { margin-bottom: 0; }

.zone-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.zone-name { font-weight: 700; font-size: 1.08rem; }
.chip {
  display: inline-block;
  border-radius: 999px;
  padding: 5px 12px;
  font-weight: 700;
  font-size: .92rem;
  color: #fff;
  background: var(--none);
  white-space: nowrap;
}
.chip.full { background: var(--full); }
.chip.few { background: var(--few); }
.chip.plenty { background: var(--plenty); }
.chip.stale { opacity: .55; }
.meta { color: var(--muted); font-size: .84rem; margin-top: 4px; }
.badge { display: inline-block; font-size: .75rem; font-weight: 700; border: 1px solid currentColor; border-radius: 6px; padding: 0 6px; margin-inline-start: 6px; color: var(--brand); }

.votes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.votes button { min-height: 48px; padding: 8px 6px; font-weight: 600; font-size: .9rem; line-height: 1.15; }
.votes .v-full { border-color: #efc2c2; color: var(--full); }
.votes .v-few { border-color: #ecd59a; color: #8a5f00; }
.votes .v-plenty { border-color: #b9dfc8; color: var(--plenty); }
.vote-hint { margin-top: 10px; color: var(--muted); font-size: .85rem; }

.toast {
  position: fixed; inset-inline: 12px; bottom: 16px; margin: 0 auto; max-width: 520px;
  background: #15181d; color: #fff; padding: 12px 14px; border-radius: 12px; font-size: .95rem;
  box-shadow: 0 6px 24px rgba(0,0,0,.25); z-index: 10;
}

label.field { display: block; font-weight: 600; font-size: .92rem; margin-top: 12px; }
input[type=text], input[type=password], textarea {
  font: inherit; width: 100%; margin-top: 6px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: #fff; color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: .95rem; }
.check input { width: 20px; height: 20px; margin-top: 2px; }

.pick { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 8px; }
.pick button.on { border-color: var(--brand); background: #eaf0ff; font-weight: 700; }

.car-photo { width: 100%; max-height: 320px; object-fit: cover; border-radius: 10px; margin-top: 10px; border: 1px solid var(--line); }
.car-zone { font-size: 1.25rem; font-weight: 800; }

details.privacy { margin-top: 18px; }
details.privacy summary { cursor: pointer; font-weight: 600; color: var(--muted); }
details.privacy p { color: var(--muted); font-size: .88rem; margin: 8px 0 0; }

.link-box { display: flex; gap: 8px; margin-top: 6px; }
.link-box input { margin-top: 0; font-size: .85rem; direction: ltr; }
.warn { background: #fff7e0; border: 1px solid #f0dc9e; border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin-top: 10px; }
.zone-edit { display: flex; gap: 8px; margin-top: 8px; }
.zone-edit input { margin-top: 0; }

/* Printable sign */
.sign { text-align: center; padding: 28px 20px; }
.sign .row { justify-content: center; }
.sign h1 { font-size: 2.6rem; margin-bottom: 4px; }
.sign .place { font-size: 1.4rem; font-weight: 700; margin: 6px 0 16px; }
.sign img.qr { width: 78%; max-width: 420px; image-rendering: pixelated; }
.sign .l1 { font-size: 1.25rem; font-weight: 700; margin-top: 16px; }
.sign .l2 { font-size: 1.1rem; margin-top: 4px; }
.sign .l3 { margin-top: 14px; color: var(--muted); }
.sign .url { margin-top: 10px; font-size: .95rem; direction: ltr; }
.sign .sep { border-top: 2px dashed var(--line); margin: 18px auto; width: 70%; }
@media print {
  body { background: #fff; }
  .no-print { display: none !important; }
  main { max-width: none; padding: 0; }
}
