/* Terminal tokens copied from the in-game Components.Assets.Elections.ElectionUI,
   layered with a US-elections (red/white/blue, stars & stripes) theme. */
:root {
  --chrome: rgb(23,27,34);
  --mast: linear-gradient(180deg, rgb(39,62,88) 0%, rgb(35,56,80) 27%, rgb(23,37,53) 100%);
  --band: rgb(23,37,53);
  --bluesec: rgb(35,56,80);
  --ribbon: linear-gradient(180deg, rgb(110,128,138) 0%, rgb(158,181,197) 33%, rgb(110,128,138) 100%);
  --divider: rgb(51,52,58);
  --active: rgb(107,38,31);
  --tan: linear-gradient(180deg, rgb(127,107,95) 0%, rgb(177,144,120) 33%, rgb(127,107,95) 100%);
  --tanedge: rgb(127,107,95);
  --page: rgb(246,253,255);
  --pageStroke: rgb(110,128,138);
  --ink: rgb(0,0,0);
  --link: rgb(41,112,166);
  --btnInk: rgb(35,36,40);
  --flag-red: #b22234;
  --arial: Arial, Helvetica, sans-serif;
  --sans: "Source Sans 3", "Source Sans Pro", Arial, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { display: flex; align-items: center; justify-content: center; padding: 26px;
  background: radial-gradient(1100px 650px at 50% 0%, #2a3340, #161a20 60%, #0d1015); }

.window { width: 430px; max-width: 100%; background: var(--chrome); border-radius: 10px;
  padding: 4px; box-shadow: 0 22px 55px rgba(0,0,0,.55); }

.header { position: relative; }
.bluemain { position: relative; background: var(--mast); border-radius: 6px; padding: 7px 12px 4px; overflow: hidden;
  display: flex; align-items: flex-end; justify-content: space-between; }
.bluemain .pat { position: absolute; inset: 0; opacity: .10; pointer-events: none;
  background-image: repeating-linear-gradient(135deg, #fff 0 2px, transparent 2px 9px); }
.bluemain .t1 { font-family: var(--arial); font-weight: 700; font-size: 24px; color: #fff; line-height: 1.05; white-space: nowrap; }
.bluemain .t2 { font-family: var(--arial); font-weight: 500; font-size: 14px; color: #fff; letter-spacing: 1px; }
.bluemain .who { position: relative; font-family: var(--sans); font-weight: 300; font-size: 12px; color: #c8d6ea; text-align: right; flex-shrink: 1; min-width: 0; padding-left: 10px; }
.band { height: 4px; background: linear-gradient(180deg, var(--flag-red) 0 45%, #ffffff 45% 60%, var(--band) 60% 100%); }

.ribbon { display: flex; align-items: stretch; background: var(--ribbon); padding-left: 8px; margin-top: 4px; height: 26px; }
.ribbon .div { width: 1px; background: var(--divider); }
/* Tabs are a mix of <button> and <a> now that the ribbon links to sibling services, so the anchor
   defaults (underline, link colour, inline layout) have to be neutralised or PORTAL renders as a stray
   hyperlink. nowrap keeps LOG OUT from wrapping and clipping once the ribbon gets crowded. */
.tab { font-family: var(--arial); font-weight: 700; font-size: 10.5px; letter-spacing: .2px; color: var(--btnInk);
  background: none; border: 0; padding: 0 7px; cursor: pointer;
  display: flex; align-items: center; white-space: nowrap; text-decoration: none; }
.tab:hover { background: rgba(255,255,255,.28); }
.tab.active { background: var(--active); color: #fff; }
.tab.right { margin-left: auto; }

.page { background: var(--page); border: 2px solid var(--pageStroke); border-radius: 6px;
  margin: 5px 6px 6px; padding: 16px 18px 20px; min-height: 150px; max-height: 42vh; overflow: auto; color: var(--ink); }
.ptitle { font-family: var(--sans); font-weight: 400; font-size: 16px; text-align: center; margin: 0 0 8px; }
.body { font-family: var(--sans); font-weight: 300; font-size: 14px; line-height: 1.5; }
.body b, .semibold { font-weight: 600; }
.rule { border: 0; border-top: 1px solid #d3dde8; margin: 10px 0; }

.row { display: flex; align-items: center; gap: 6px; min-height: 26px; }
.bullet { width: 4px; height: 4px; border-radius: 50%; background: var(--btnInk); flex: 0 0 auto; }
.link { font-family: var(--sans); font-weight: 400; font-size: 16px; color: var(--link); text-decoration: underline;
  background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.link:hover { color: rgb(28,86,131); }
.meta { font-family: var(--sans); font-weight: 300; font-size: 12px; color: #54606e; margin-left: auto; white-space: nowrap; }
.tag { font-family: var(--arial); font-weight: 700; font-size: 9px; letter-spacing: .4px; padding: 1px 6px; border-radius: 8px; }
.tag.open { background: rgba(46,106,52,.16); color: #225a2a; } .tag.closed { background: rgba(84,96,110,.16); color: #54606e; }

.btn { font-family: var(--arial); font-weight: 700; font-size: 11px; letter-spacing: .5px; text-transform: uppercase;
  color: var(--btnInk); background: var(--tan); border: 1px solid var(--tanedge); border-radius: 2px;
  padding: 5px 12px; cursor: pointer; }
.btn.maroon { background: var(--active); border-color: rgb(80,28,23); color: #fff; }
.btn.wide { width: 160px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
/* A .btn that LEAVES for another page instead of doing something here — same neutralising the ribbon
   tabs need, since an anchor brings its own underline, link colour and inline layout. */
a.btn { display: inline-block; text-decoration: none; color: var(--btnInk); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 12px 0; }

.flabel { font-family: var(--sans); font-weight: 400; font-size: 16px; margin: 12px 0 2px; }
.frow { display: flex; align-items: center; gap: 6px; }
.box { flex: 1; font-family: var(--sans); font-size: 14px; color: #000; background: #fff;
  border: 1px solid #000; border-radius: 0; padding: 5px 6px; }
.box:focus { outline: none; border-color: var(--link); }
.note { font-family: var(--sans); font-weight: 300; font-size: 14px; margin-top: 12px; }
.err { font-family: var(--sans); font-weight: 400; font-size: 14px; color: var(--flag-red); text-align: center; min-height: 18px; margin-top: 10px; }

.winner { font-family: var(--sans); text-align: center; margin: 6px 0 12px; padding: 10px 0;
  background: #eef6f0; border-top: 2px solid var(--flag-red); border-bottom: 2px solid var(--band); }
.winner .wlabel { font-family: var(--arial); font-weight: 700; font-size: 10px; letter-spacing: 1px; text-transform: uppercase; color: var(--flag-red); }
.winner b { display: block; font-weight: 600; font-size: 20px; color: var(--band); margin: 2px 0; }
.wsub { font-family: var(--sans); font-weight: 300; font-size: 12px; color: #54606e; }
.round { margin: 10px 0; }
.round .rh { font-family: var(--sans); font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.rhsub { font-weight: 400; font-size: 11px; color: #54606e; }
.bar { display: flex; align-items: center; gap: 8px; font-family: var(--sans); font-weight: 300; font-size: 13px; margin: 3px 0; }
.bar .nm { width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar .track { flex: 1; height: 9px; background: #e1e7ef; border-radius: 5px; overflow: hidden; }
.bar .track > i { display: block; height: 100%; background: var(--link); border-radius: 5px; transition: width .8s ease; }
.bar .v { width: 72px; text-align: right; color: #54606e; }
.bar.elim .nm { color: var(--active); text-decoration: line-through; }
.bar.elim .track > i { background: #c3b0ae; }
.bar.elim { animation: flashElim .7s ease; }
@keyframes flashElim { 0% { background: rgba(178,34,52,.20); } 100% { background: transparent; } }
.round.reveal { opacity: 0; transform: translateY(8px); transition: opacity .4s ease, transform .4s ease; }
.round.reveal.show { opacity: 1; transform: none; }
.winner.reveal { opacity: 0; transform: scale(.96); transition: opacity .45s ease, transform .45s ease; }
.winner.reveal.show { opacity: 1; transform: none; }
.bar.elected .nm { color: #1f6b35; font-weight: 600; }
.bar.elected .track > i { background: #2e8b57; }
.bar.elected { animation: flashElect .7s ease; }
@keyframes flashElect { 0% { background: rgba(46,139,87,.22); } 100% { background: transparent; } }
.quota { text-align: center; font-family: var(--sans); font-size: 12px; color: #54606e; margin: 0 0 8px; }
.seatsbox { flex: 0 0 auto; width: 120px; }
.elist { margin-top: 2px; }
.erow { display: flex; align-items: center; gap: 8px; padding: 8px 6px; border-bottom: 1px solid #e6ecf3; }
.erow:last-child { border-bottom: 0; }
.erow:hover { background: #eef4fb; }
.erow-meta { margin-left: auto; display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.counts { font-family: var(--sans); font-weight: 300; font-size: 12px; color: #54606e; }
.empty { text-align: center; font-family: var(--sans); font-weight: 300; font-size: 14px; color: #54606e; padding: 18px 0; }
.live { text-align: center; font-family: var(--sans); font-size: 12px; color: #2e8b57; margin: 0 0 8px; }
.livedot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #2e8b57; margin-right: 6px; vertical-align: middle; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .3; } }

.tag.scheduled { background: rgba(170,116,51,.18); color: #8a5a1c; }
.tag.voting { background: rgba(46,106,52,.16); color: #225a2a; }
.tag.registration { background: rgba(41,112,166,.16); color: #1c5683; }
.tag.pending { background: rgba(84,96,110,.16); color: #54606e; }
.tag.recall { background: rgba(150,70,64,.18); color: #8a3630; }
.tag.referendum { background: rgba(41,112,166,.16); color: #1c5683; }
.statusbox { display: inline-flex; align-items: center; gap: 0; }
.cd { font-family: var(--sans); font-weight: 300; font-size: 11px; color: #54606e; }
.statusline { display: flex; gap: 12px; align-items: center; justify-content: center; flex-wrap: wrap; margin: 2px 0 4px; }
.sched { display: flex; gap: 14px; flex-wrap: wrap; margin: 2px 0 6px; }
.schedrow { display: flex; flex-direction: column; gap: 3px; font-family: var(--sans); font-weight: 400; font-size: 13px; color: #33414f; }
.dt { font-family: var(--sans); font-size: 13px; color: #000; background: #fff; border: 1px solid #97a3b5; border-radius: 0; padding: 5px 6px; }
.dt:focus { outline: none; border-color: var(--link); }
.toast { position: fixed; bottom: 18px; left: 50%; transform: translateX(-50%); background: #232a34; color: #eef1f5;
  border: 1px solid #2b3645; padding: 10px 16px; border-radius: 6px; font-family: var(--sans); font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; }
.toast.show { opacity: 1; } .toast.err { border-color: var(--flag-red); color: #f0a8a6; }


/* A disqualified candidate is struck out, not deleted: the row stays legible and on the record so
   there is something to appeal against and something to reinstate. */
.erow.dq { background: #fbf1f0; }
.erow.dq:hover { background: #f7e7e5; }
.erow.dq .body s { color: #7a4f4a; }
.dqtag { font-family: var(--arial); font-weight: 700; font-size: 10px; letter-spacing: .5px;
  text-transform: uppercase; color: #fff; background: var(--active); border-radius: 3px;
  padding: 1px 5px; margin-left: 6px; vertical-align: 1px; }
.dqnote { border-left: 3px solid var(--active); padding-left: 8px; text-align: left; }
