:root {
  --ink: #142033;
  --muted: #5c6b7a;
  --paper: #f3efe6;
  --card: #fffdf8;
  --line: #d9d1c3;
  --blue: #1d4e89;
  --blue-deep: #163e6e;
  --lamp: #c62828;
  --warn: #8a4b08;
  --warn-bg: #fff1d6;
  --good: #1b7f4e;
  --shadow: 0 16px 40px rgba(20, 32, 51, 0.12);
  font-family: "Noto Sans", "Noto Sans Gurmukhi", "Noto Sans Devanagari", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
a { color: var(--blue); }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { font-family: "Noto Serif", "Noto Sans Gurmukhi", "Noto Sans Devanagari", serif; font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin: 0.2rem 0; }

.disclaimer {
  background: var(--warn-bg);
  color: var(--warn);
  padding: 0.55rem 1rem;
  font-size: 0.82rem;
  line-height: 1.35;
  border-bottom: 1px solid #f0d7a2;
}
.top {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  background: var(--ink);
  color: #f6f1e7;
}
.top a { color: inherit; text-decoration: none; }
.brand { display: flex; gap: 0.6rem; align-items: center; }
.brand strong { display: block; letter-spacing: 0.01em; }
.brand small { display: block; color: #c9d4e0; font-size: 0.75rem; }
.mark {
  width: 1.7rem; height: 1.7rem; border-radius: 6px;
  background:
    radial-gradient(circle at 50% 38%, #e53935 0 18%, transparent 19%),
    linear-gradient(#f4efe4, #f4efe4);
  box-shadow: inset 0 0 0 2px #f4efe4;
}
.top nav { display: flex; gap: 0.9rem; font-size: 0.92rem; }
.langs { display: flex; gap: 0.25rem; }
.langs a, .top button, .admin .top button {
  border: 1px solid transparent;
  background: transparent;
  color: #f6f1e7;
  padding: 0.25rem 0.5rem;
  border-radius: 999px;
  text-decoration: none;
  cursor: pointer;
}
.langs a.on { background: #f4efe4; color: var(--ink); }
main { width: min(1100px, calc(100% - 1.5rem)); margin: 0 auto; padding: 1rem 0 2.5rem; }
.hero h1, .kicker { margin-top: 0.4rem; }
.kicker { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.72rem; color: var(--blue); font-weight: 700; }
.muted, .fine { color: var(--muted); }
.note {
  background: #fff;
  border-left: 4px solid var(--blue);
  padding: 0.7rem 0.85rem;
  border-radius: 0 10px 10px 0;
}
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.filters label, .card label, .about label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; }
input, select, textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  min-width: 0;
}
button, .row-actions a {
  background: var(--blue);
  color: white;
  border: 0;
  border-radius: 999px;
  padding: 0.55rem 0.95rem;
  cursor: pointer;
}
button.ghost, a.ghost { background: transparent; color: var(--blue); border: 1px solid var(--blue); }
.ac-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
.ac-list a {
  display: flex; gap: 0.75rem; align-items: center;
  background: var(--card); border: 1px solid var(--line); border-radius: 12px;
  padding: 0.7rem 0.8rem; text-decoration: none; color: inherit;
}
.num {
  display: inline-grid; place-items: center;
  min-width: 2.3rem; height: 2.3rem; border-radius: 8px;
  background: var(--ink); color: #f4efe4; font-weight: 700;
}
.nm { display: block; }
.sub, .party-line { display: block; color: var(--muted); font-size: 0.8rem; }

.booth { display: grid; gap: 0.9rem; margin-top: 0.8rem; }
.cu, .vvpat {
  background: linear-gradient(#c5c9ce, #9ea6ae 55%, #8e969e);
  border-radius: 14px;
  padding: 0.55rem;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.55);
  border: 1px solid #7d868e;
}
.bu {
  position: relative;
  background: #ecebe8;
  border: 1.5px solid #8e949a;
  border-radius: 22px;
  padding: 0.35rem 0.35rem 0.55rem;
  box-shadow: 0 10px 24px rgba(20, 32, 51, 0.08);
  overflow: hidden;
}
.bu-top {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.15rem 0.55rem 0.35rem;
  color: #8b9298;
  font-size: 0.78rem;
  position: relative;
}
.ready-cluster { display: flex; align-items: center; gap: 0.4rem; }
#lamp-ready {
  width: 0.72rem; height: 0.72rem; border-radius: 50%;
  background: #1c6d78;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
}
#lamp-ready.ready { background: #14c4b4; box-shadow: 0 0 8px #14c4b4; }
.bu-brand { display: flex; align-items: center; justify-content: flex-end; gap: 0.45rem; padding-right: 1.4rem; }
.slot { width: 0.42rem; height: 0.85rem; border-radius: 2px; background: #1c1c1c; display: block; }
.corner-strip {
  position: absolute; top: 0; right: 0.85rem;
  width: 2.1rem; height: 0.42rem; background: #2f74a8; border-radius: 0 0 2px 2px;
}
.bu-face { display: flex; flex-direction: column; }
.bu-row {
  display: grid;
  grid-template-columns: 62% 38%;
  min-height: 3.35rem;
  align-items: stretch;
}
.paper-cell {
  display: grid;
  grid-template-columns: 1.35rem minmax(0, 1fr) 1.7rem;
  gap: 0.25rem;
  align-items: center;
  padding: 0.2rem 0.4rem 0.2rem 0.55rem;
  background: #d5dfdb;
  border-bottom: 1.5px solid #f7f8f6;
  box-shadow: inset 7px 0 0 #c5d2cc;
}
.bu-row:first-child .paper-cell { border-radius: 16px 16px 0 0; }
.bu-row:last-child .paper-cell { border-radius: 0 0 16px 16px; border-bottom: 0; }
.bu-row .sn { font-weight: 700; font-size: 0.85rem; color: #2c3338; }
.who strong { font-size: 0.86rem; line-height: 1.15; }
.party-line { font-size: 0.68rem; }
.sym { width: 1.45rem; height: 1.45rem; object-fit: contain; background: transparent; border: 0; }
.key-cell {
  display: flex; align-items: center; justify-content: space-evenly;
  background: #f3f3f1;
  border-bottom: 1px solid #e7e7e4;
}
.bu-row:last-child .key-cell { border-bottom: 0; }
.lamp {
  width: 0.72rem; height: 0.72rem; border-radius: 50%;
  background: #6d3a62;
  box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
}
.lamp.lit { background: #ff2d2d; box-shadow: 0 0 8px 2px rgba(255, 40, 40, 0.85); }
.blue {
  width: 3.15rem; height: 1.45rem; border-radius: 999px;
  background: #1f78a4;
  border: 0;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
  padding: 0;
}
.blue:disabled { cursor: not-allowed; opacity: 1; filter: none; }
.blue.armed { cursor: pointer; }
.booth.cast .blue { filter: none; }
.cu header, .vvpat header {
  display: flex; justify-content: space-between; gap: 0.5rem;
  color: #243140; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; padding: 0.25rem 0.4rem 0.45rem;
}
.blue:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid #f5c518; outline-offset: 2px; }
.side { display: grid; gap: 0.8rem; }
.cu-screen {
  background: #0d2a1c; color: #b6f5c8; font-family: ui-monospace, monospace;
  letter-spacing: 0.18em; text-align: center; padding: 0.7rem; border-radius: 6px;
  min-height: 2.4rem;
}
.lamps { display: flex; gap: 1rem; padding: 0.45rem 0.2rem; color: #1d2833; font-size: 0.75rem; }
.lamps i { display: inline-block; width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #355; vertical-align: middle; }
.lamps i.on { background: #43a047; box-shadow: 0 0 8px #43a047; }
.lamps i.busy { background: #ef6c00; box-shadow: 0 0 8px #ef6c00; }
.lamps i.ready { background: #00c853; box-shadow: 0 0 10px #00e676; }
.cu-keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.4rem; }
.cu-keys button { border-radius: 8px; background: #243447; }
#btn-ballot { background: var(--blue); }
.cu-keys button:disabled { opacity: 0.55; }
.vvpat .window {
  height: 9.5rem; background: #07080a; border-radius: 8px; overflow: hidden; position: relative;
  box-shadow: inset 0 0 0 6px #8d99a3, inset 0 0 24px #000;
  transition: background 0.2s ease;
}
.vvpat .window.lit {
  background: #1a120c;
  box-shadow: inset 0 0 0 6px #8d99a3, inset 0 0 36px rgba(255, 214, 140, 0.55);
}
.slip {
  position: absolute; left: 12%; right: 12%; top: 0.6rem;
  background: #fffef8; color: var(--ink); border: 1px dashed #b7aa96;
  padding: 0.45rem 0.5rem 0.55rem; text-align: center;
  transition: transform 0.9s cubic-bezier(.4, 0, .9, .6), opacity 0.9s ease;
}
.slip.drop { transform: translateY(160%); opacity: 0.15; }
.slip img { width: 2.4rem; height: 2.4rem; }
.steps { padding-left: 1.1rem; }
.steps li { margin: 0.45rem 0; }
.after { margin-top: 1.2rem; }
.about, .card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 0.9rem;
}
.about fieldset { border: 1px solid var(--line); border-radius: 10px; }
.about label { display: inline-flex; flex-direction: row; align-items: center; margin-right: 0.8rem; }
.row-actions { display: flex; gap: 0.5rem; margin-top: 0.6rem; }
.ads { margin-top: 1.2rem; }
.ads-label { font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.ad-row { display: grid; gap: 0.5rem; }
.ad-card {
  display: flex; gap: 0.6rem; align-items: center;
  background: white; border: 1px dashed var(--line); border-radius: 12px; padding: 0.6rem; text-decoration: none; color: inherit;
}
.ad-card img { width: 72px; height: 48px; object-fit: cover; border-radius: 6px; }
.foot { padding: 1rem; color: var(--muted); font-size: 0.85rem; }
.foot a { margin-right: 0.8rem; }
.prose { max-width: 42rem; }
.total { font-size: 1.4rem; font-weight: 700; }
.bars, #party-bars, #seat-bars { display: grid; gap: 0.4rem; }
.bar { display: grid; grid-template-columns: 0.8rem 4.5rem auto auto 1fr; gap: 0.4rem; align-items: center; font-size: 0.9rem; }
.swatch { width: 0.8rem; height: 0.8rem; border-radius: 2px; }
.track { height: 0.45rem; background: #e7e1d6; border-radius: 99px; overflow: hidden; }
.track span { display: block; height: 100%; }
.admin-login { display: grid; place-items: center; min-height: 100vh; }
.admin-login .card { width: min(28rem, calc(100% - 2rem)); }
.error { color: var(--lamp); }
.admin main, .admin .panel { width: min(1200px, calc(100% - 1.2rem)); margin: 0.8rem auto 2rem; }
.admin .top button.on { background: #f4efe4; color: var(--ink); }
.stats { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.stat { background: white; border: 1px solid var(--line); border-radius: 12px; padding: 0.7rem 0.9rem; min-width: 8rem; }
.stat b { display: block; font-size: 1.4rem; }
.split { display: grid; gap: 1rem; }
.map-wrap { display: grid; gap: 0.8rem; }
#map-svg { width: 100%; height: auto; background: #e7eef2; border-radius: 16px; }
#map-svg path { stroke: #fff; stroke-width: 0.6; cursor: pointer; }
#map-svg path:hover, #map-svg path.on { stroke: var(--ink); stroke-width: 1.4; }
.table-wrap { overflow: auto; background: white; border-radius: 12px; border: 1px solid var(--line); }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
.edit-row { display: grid; gap: 0.35rem; grid-template-columns: 3rem 1fr 1fr 1fr 7rem auto; margin-bottom: 0.4rem; }
#series { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
#series i { display: block; background: var(--blue); width: 10px; border-radius: 3px 3px 0 0; }
.hidden-row { display: none; }

@media (min-width: 900px) {
  .booth { grid-template-columns: 1.4fr 0.8fr; align-items: start; }
  .ad-row { grid-template-columns: 1fr 1fr; }
  .ac-list { grid-template-columns: 1fr 1fr; }
  .split, .map-wrap { grid-template-columns: 1.2fr 0.8fr; }
}
@media (max-width: 640px) {
  .edit-row { grid-template-columns: 1fr 1fr; }
  .bar { grid-template-columns: 0.8rem 3.2rem auto 1fr; }
  .bar em { display: none; }
}
