/* Matrix on Board skin: cream ground, plum headings, navy text, gold for rules and the logo only. Arial. */
:root {
  --navy: #2B3844;
  --plum: #401A35;
  --gold: #E9C249;
  --gold-dark: #C9A227;
  --cream: #FFF7EB;
  --card: #FFFFFF;
  --line: #E6DCCB;
  --muted: #6B7178;
  --up: #2E6B3F;
  --down: #9A2F2F;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--navy);
  font-family: Arial, Helvetica, sans-serif;
  font-size: 16px;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
h1, h2, h3 { color: var(--plum); margin: 0 0 .4em; line-height: 1.2; }
a { color: var(--plum); }
button, input, textarea, select { font: inherit; color: inherit; }
.rule { height: 3px; background: var(--gold); border: 0; margin: 10px 0 16px; width: 72px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hidden { display: none !important; }

.btn {
  appearance: none; border: 0; border-radius: 999px; padding: 12px 20px;
  background: var(--plum); color: var(--cream); font-weight: bold; cursor: pointer;
  text-decoration: none; display: inline-block; text-align: center;
}
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: transparent; color: var(--plum); border: 2px solid var(--plum); }
.btn.small { padding: 6px 12px; font-size: 13px; }
.btn.link { background: none; color: var(--plum); padding: 6px 4px; text-decoration: underline; font-weight: normal; }

input[type=text], input[type=password], textarea {
  width: 100%; border: 2px solid var(--line); border-radius: 10px; padding: 12px; background: #fff;
}
input:focus, textarea:focus { outline: none; border-color: var(--plum); }
textarea { resize: vertical; min-height: 120px; }
label { display: block; font-weight: bold; margin: 14px 0 6px; color: var(--plum); }

.card { background: var(--card); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 1px 0 var(--line), 0 0 0 1px var(--line) inset; }
.chip { display: inline-block; background: var(--plum); color: var(--cream); border-radius: 999px; padding: 2px 9px; font-size: 12px; font-weight: bold; }
.chip.gold { background: var(--gold); color: var(--plum); }
.notice { background: #fff; border-left: 4px solid var(--gold); padding: 10px 12px; border-radius: 6px; }
.error { color: var(--down); font-weight: bold; margin: 8px 0; }
.error:empty { display: none; }

/* agree (the only vote) */
.agree { border: 2px solid var(--line); background: #fff; border-radius: 999px; padding: 8px 16px; min-height: 42px; cursor: pointer; font-weight: bold; color: var(--plum); }
.agree.on { background: var(--up); border-color: var(--up); color: #fff; }
.agreepill { background: var(--cream); color: var(--plum); border-radius: 999px; padding: 3px 10px; font-weight: bold; font-size: 15px; white-space: nowrap; }

/* ---------- home ---------- */
.home { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; }
.home .logo { height: 48px; }
.home section { margin-top: 24px; }

/* ---------- participant (phone) ---------- */
.phone { max-width: 560px; margin: 0 auto; padding: 0 16px 40px; }
.phone header { padding: 14px 0 6px; }
.phone header .title { font-size: 20px; }
.qbtn { display: block; width: 100%; text-align: left; margin: 10px 0; padding: 16px; border-radius: var(--radius); border: 2px solid var(--line); background: #fff; cursor: pointer; font-size: 17px; color: var(--navy); }
.qbtn .chip { margin-right: 8px; }
.qbtn .count { float: right; color: var(--muted); font-size: 13px; margin-left: 8px; }
.qhead { margin: 6px 0 12px; }
.qhead h2 { font-size: 21px; margin: 8px 0 0; }
.compose textarea { min-height: 96px; }
.toast { background: var(--up); color: #fff; font-weight: bold; border-radius: 10px; padding: 10px 12px; margin: 10px 0; }
.others { margin-top: 22px; }
.others h3 { font-size: 16px; color: var(--plum); margin: 0 0 4px; }
.post { margin: 10px 0; }
.post .text { white-space: pre-wrap; word-wrap: break-word; font-size: 17px; margin-top: 4px; }
.post .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 8px; }
.post.mypost { box-shadow: 0 0 0 2px var(--plum) inset; }
.namebar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; background: #fff; border: 2px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.namebar strong { color: var(--plum); font-size: 19px; }
.namebar .btn { white-space: nowrap; }
.who { color: var(--muted); font-size: 13px; font-weight: bold; }
.later { color: var(--gold-dark); font-size: 13px; font-weight: bold; }
.privacy { margin-top: 28px; font-size: 13px; color: var(--muted); }

/* ---------- facilitator (big screen): one screen per question ---------- */
html.boardpage { scroll-snap-type: y proximity; scroll-padding-top: var(--barh, 0px); }
body.control { --barh: 52px; }
.ctlbar { position: sticky; top: 0; z-index: 5; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 52px; padding: 8px 20px; background: var(--cream); border-bottom: 1px solid var(--line); }
.ctlbar .keys { margin-left: auto; }
.modetag { font-size: 13px; background: var(--gold); color: var(--plum); padding: 3px 10px; border-radius: 999px; font-weight: bold; }
.screen { min-height: calc(100vh - var(--barh, 0px)); padding: 28px 40px 36px; scroll-snap-align: start; border-bottom: 1px solid var(--line); }
.across { border: 0; height: 4px; background: var(--gold); width: 100%; margin: 18px 0 24px; }
/* welcome screen */
.introgrid { display: grid; grid-template-columns: 1fr auto; gap: 48px; align-items: center; min-height: calc(100vh - var(--barh, 0px) - 64px); }
.intro .logo { height: 48px; }
.intro h1 { font-size: clamp(32px, 4vw, 64px); margin: 16px 0 0; }
.introqs { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.introqs li { font-size: clamp(20px, 2vw, 34px); color: var(--navy); }
.introqs .chip { font-size: 0.55em; vertical-align: middle; margin-right: 6px; }
.introqs .n { color: var(--muted); font-size: 0.55em; white-space: nowrap; }
.bigqr { text-align: center; background: #fff; padding: 18px; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line) inset; }
.bigqr img { width: clamp(220px, 24vw, 380px); height: auto; display: block; margin: 0 auto 8px; }
.bigqr .url { font-size: 15px; color: var(--muted); word-break: break-all; max-width: 380px; margin: 0 auto; }
.bigqr .code { font-size: clamp(30px, 3vw, 48px); letter-spacing: 6px; font-weight: bold; color: var(--plum); }
/* question screens */
.qscreen header, .laterscreen header { display: flex; justify-content: space-between; align-items: flex-start; gap: 24px; }
.qmeta { display: flex; gap: 10px; align-items: center; font-size: 16px; }
.qmeta .chip { font-size: 16px; }
.qscreen h2, .laterscreen h2 { font-size: clamp(28px, 3.4vw, 56px); margin: 10px 0 0; line-height: 1.15; }
.miniqr { text-align: center; background: #fff; border-radius: 12px; padding: 8px; box-shadow: 0 0 0 1px var(--line) inset; flex: none; }
.miniqr img { width: 104px; height: 104px; display: block; }
.miniqr .code { font-size: 18px; letter-spacing: 3px; font-weight: bold; color: var(--plum); }
.postgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 14px; align-items: start; }
.empty-col { color: var(--muted); font-size: 20px; padding: 4px; }
.screen .post { margin: 0; }
.screen .post .who { font-size: 15px; }
.screen .post .text { font-size: clamp(20px, 1.75vw, 32px); line-height: 1.3; }
.screen .post.hid { opacity: .45; }
.screen .post.parked { border-left: 6px solid var(--gold); }
.screen .post.fresh { box-shadow: 0 0 0 3px var(--gold) inset, 0 0 22px rgba(233, 194, 73, .75); }
.ctlpost { display: flex; gap: 4px; }
/* For later screen */
.laterscreen { background: var(--plum); color: var(--cream); }
.laterscreen h2 { color: var(--gold); }
.laterscreen .qmeta { color: #d9c6d2; }
.laterscreen .empty-col { color: #d9c6d2; }
.laterlist { margin: 0; padding-left: 36px; display: grid; gap: 14px; }
.laterlist li { font-size: clamp(20px, 1.8vw, 30px); }
.laterlist .chip { background: var(--gold); color: var(--plum); font-size: 0.5em; vertical-align: middle; }
.laterlist button { background: none; border: 0; color: var(--gold); cursor: pointer; font-size: 14px; text-decoration: underline; }
.bayagree { color: var(--gold); font-size: 0.6em; font-weight: bold; white-space: nowrap; }
.park { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: bold; color: var(--plum); user-select: none; }
.park input { width: 20px; height: 20px; accent-color: var(--plum); cursor: pointer; }
body.present .ctl { display: none !important; }
.ghostswitch { display: none; position: fixed; right: 10px; bottom: 10px; border: 0; background: var(--plum); color: var(--cream); border-radius: 999px; padding: 6px 12px; font-size: 12px; opacity: .2; cursor: pointer; z-index: 6; }
.ghostswitch:hover, .ghostswitch:focus-visible { opacity: 1; }
body.present .ghostswitch { display: block; }
.panel { position: fixed; inset: 0; background: rgba(43,56,68,.45); display: flex; align-items: flex-start; justify-content: center; padding: 40px 16px; z-index: 10; overflow: auto; }
.panel .card { width: 100%; max-width: 760px; padding: 22px; }
.qedit { display: flex; gap: 8px; margin: 8px 0; }
.qedit input { flex: 1; }
.locked-banner { background: var(--gold); color: var(--plum); font-weight: bold; text-align: center; padding: 6px; border-radius: 8px; margin-top: 12px; }

@media (max-width: 900px) {
  .ctlbar { position: static; }
  body.control { --barh: 0px; }
  .screen { padding: 20px 16px; }
  .introgrid { grid-template-columns: 1fr; gap: 24px; }
  .miniqr { display: none; }
}

/* ---------- print ---------- */
.print { max-width: 820px; margin: 0 auto; padding: 24px 16px; background: #fff; }
.print-body { background: #fff; }
.print table { width: 100%; border-collapse: collapse; margin: 6px 0 18px; font-size: 13px; }
.print th, .print td { border-bottom: 1px solid #ddd; padding: 6px 4px; text-align: left; vertical-align: top; }
.print th { color: var(--plum); }
.print td.num { text-align: right; white-space: nowrap; color: var(--gold-dark); font-weight: bold; }
.print h2 { font-size: 18px; margin-top: 22px; }
.print h3 { font-size: 14px; margin: 14px 0 2px; }
@media print {
  .no-print { display: none !important; }
  .print { padding: 0; }
  body { font-size: 10pt; }
}
