/* Agenda Maker. Two parts: the editing UI (.app, .panel, .stage) and the A4
   page (#page), which has two looks: .site (white, the website's type, made
   for a black-and-white printer) and .classic (the blue table the club used
   before). Only #page is printed. */

@font-face { font-family: "Source Serif 4"; font-style: normal; font-weight: 200 900; src: url(fonts/SourceSerif4.woff2) format("woff2"); }
@font-face { font-family: "Source Serif 4"; font-style: italic; font-weight: 200 900; src: url(fonts/SourceSerif4-Italic.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; src: url(fonts/IBMPlexMono-400.woff2) format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; src: url(fonts/IBMPlexMono-500.woff2) format("woff2"); }

:root {
  --paper: #fbf4ee; --sunk: #f4e9e0; --accent: #772432; --gold: #c8a45c;
  --text: #241c1a; --text-80: #241c1abf; --text-50: #241c1a85; --rule: #241c1a26;
  --serif: "Source Serif 4", "Songti SC", "SimSun", "Noto Serif SC", Georgia, serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--text); font-synthesis-style: none; }

/* ---------- editing UI ---------- */
.app { display: flex; min-height: 100vh; }
.panel { width: 440px; flex: none; padding: 24px 24px 60px; border-right: 1px solid var(--rule);
         font-family: var(--serif); font-size: 15px; height: 100vh; overflow-y: auto; position: sticky; top: 0; }
.panel .kicker, .panel h2, .panel label, .panel .status, .checks { font-family: var(--mono); }
.kicker { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.panel h1 { font-size: 34px; color: var(--accent); margin: 4px 0 8px; letter-spacing: -.02em; }
.panel section { border-top: 1px solid var(--rule); padding: 16px 0 6px; }
.panel h2 { font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .12em; margin: 0 0 10px; }
.panel h2 span { color: var(--accent); margin-right: 8px; }
.panel label { display: block; font-size: 11px; color: var(--text-50); margin-bottom: 8px; }
.panel input, .panel textarea, .panel select { display: block; width: 100%; margin-top: 3px; font: 14px var(--serif); color: var(--text);
  background: #fff; border: 1px solid var(--rule); border-radius: 3px; padding: 6px 8px; }
.panel textarea { resize: vertical; font-family: var(--mono); font-size: 12px; }
.panel label.check { display: flex; align-items: center; gap: 6px; padding-top: 18px; color: var(--text); }
.panel label.check input { width: auto; margin: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
.row { display: flex; gap: 8px; align-items: center; margin: 6px 0; }
.row input { margin: 0; }
button { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .08em; padding: 8px 12px; border-radius: 3px;
         border: 1px solid var(--accent); background: #fff; color: var(--accent); cursor: pointer; white-space: nowrap; }
button.primary { background: var(--accent); color: #fdf1ec; }
button.ghost { border-style: dashed; width: 100%; }
button.mini { padding: 2px 7px; font-size: 11px; }
button:disabled { opacity: .5; cursor: wait; }
.hint { font-size: 13px; color: var(--text-80); line-height: 1.45; margin: 4px 0 10px; }
.status { font-size: 11px; color: var(--text-80); min-height: 1em; margin: 4px 0; white-space: pre-line; }
.status.err { color: #b3261e; }
.sp { border-left: 2px solid var(--gold); padding: 6px 0 2px 10px; margin-bottom: 12px; }
.sp .row { justify-content: space-between; margin: 0 0 4px; font-family: var(--mono); font-size: 11px; color: var(--text-50); }
.checks { font-size: 11px; line-height: 1.6; margin: 6px 0; }
.checks .bad { color: #b3261e; } .checks .ok { color: #2f6b3a; }
button.wide { width: 100%; margin-top: 8px; padding: 11px; font-size: 13px; }
button.grow { flex: 1; padding: 11px; font-size: 13px; }
.panel section.step { border-top: 1px solid var(--rule); padding: 16px 0; }
#step-paste { border-top: 0 !important; padding-top: 4px !important; }
#step-paste textarea { font-size: 12.5px; }
.step-label { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; color: var(--text-50); margin-bottom: 8px; }
.item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 6px 10px; padding: 8px 0; }
.item + .item { border-top: 1px dashed var(--rule); }
.item-name { font-size: 15px; }
.item-name::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #b3261e; margin: 0 9px 2px 0; }
.item textarea { grid-column: 1 / -1; margin: 0; }
.item #word-go { grid-column: 2; }
label.file { margin: 0 !important; font: 500 12px var(--mono) !important; color: var(--accent) !important; border: 1px solid var(--accent);
  border-radius: 3px; padding: 6px 10px; cursor: pointer; text-transform: uppercase; letter-spacing: .08em; }
label.file input { display: none; }
.note { font-size: 12.5px; color: var(--text-50); line-height: 1.45; margin: 8px 0 0; }
#order { margin: 0; padding-left: 22px; font-size: 15px; }
#order li { padding: 3px 0; }
#order .t { color: var(--text-50); font-size: 12.5px; margin-left: 4px; }
#order button { float: right; padding: 0 7px; font-size: 11px; }
.checks:empty, .status:empty { display: none; }
.stage[hidden] { display: none; }
.adv { border-top: 1px solid var(--rule); padding-top: 14px; }
.adv summary { cursor: pointer; color: var(--text-50); font: 12px var(--mono); list-style: none; }
.adv summary::after { content: " →"; }
.adv[open] summary::after { content: " ↓"; }
.adv[open] summary { margin-bottom: 6px; }
.adv h2 { font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: .12em; margin: 0 0 10px; }
.stage { flex: 1; padding: 24px; overflow: auto; background: var(--sunk); }
.scaler { transform-origin: top left; width: 210mm; }
#page { box-shadow: 0 1px 4px #0002; }

@media (max-width: 900px) {
  .app { flex-direction: column; }
  .panel { width: auto; height: auto; position: static; border-right: 0; }
}

/* ---------- the A4 page ---------- */
#page { width: 210mm; height: 297mm; overflow: hidden; background: #fff; color: #000; position: relative; }
#page img.qr { image-rendering: pixelated; }

/* site style */
#page.site { --text: #241c1a; --text-80: #241c1abf; --text-50: #241c1a85; --rule: #241c1a2e; --rule-strong: #241c1a55;
  --sunk: #f0eeec; padding: 9mm 10mm; font-family: var(--serif); font-size: 10.5px; color: var(--text);
  display: flex; flex-direction: column; }
.site .k { font-family: var(--mono); font-size: 8.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.site .head { display: flex; align-items: center; gap: 14px; padding-bottom: 9px; border-bottom: 1px solid var(--rule-strong); }
.site .head .tm { height: 66px; } .site .head .sz { height: 70px; } .site .head .blank { width: 66px; }
.site .head .mid { flex: 1; text-align: center; }
.site h1 { font-size: 25px; font-weight: 700; letter-spacing: -.02em; color: var(--accent); line-height: 1.1; margin: 3px 0 5px; }
.site .when b { font-size: 13px; } .site .when span { font-family: var(--mono); font-size: 11px; font-weight: 500; margin-left: 10px; }
.site .addr { font-size: 9.5px; color: var(--text-80); margin-top: 4px; }
.site .body { flex: 1; display: flex; gap: 12px; padding-top: 8px; min-height: 0; }
.site .side { width: 29%; display: flex; flex-direction: column; gap: 7px; padding-right: 12px; border-right: 1px solid var(--rule); }
.site .box { border-top: 1px solid var(--rule); padding-top: 6px; } .site .box:first-child { border-top: 0; padding-top: 0; }
.site .box .k { margin-bottom: 4px; }
.site .box .k::before, .site .cap::before { content: ""; display: block; width: 18px; height: 2px; background: var(--gold); margin-bottom: 4px; }
.site .word b { font-size: 16px; color: var(--accent); } .site .word .ph { font-family: var(--mono); font-size: 9px; color: var(--text-50); margin-left: 4px; }
.site .word p { font-size: 9.6px; line-height: 1.35; margin: 2px 0 0; } .site .word .eg { font-style: italic; color: var(--text-80); }
.site .small { font-size: 9.4px; line-height: 1.35; color: var(--text-80); margin: 0; }
.site .n { font-family: var(--mono); color: var(--accent); font-weight: 500; margin-right: 4px; }
.site .officers { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; font-size: 9.6px; line-height: 1.4; }
.site .officers span:nth-child(odd) { font-family: var(--mono); font-size: 8.5px; color: var(--text-50); text-transform: uppercase; letter-spacing: .06em; }
.site table.rules { width: 100%; border-collapse: collapse; font-family: var(--mono); font-size: 8.4px; text-align: center; }
.site table.rules th { font-weight: 500; color: var(--text-50); padding: 1px 2px 3px; }
.site table.rules td { padding: 2.5px 2px; border-top: 1px solid var(--rule); }
.site table.rules td:first-child { text-align: left; font-family: var(--serif); font-size: 9.4px; }
.site .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 4px; }
.site .main { flex: 1; min-width: 0; }
.site table.ag { width: 100%; border-collapse: collapse; table-layout: fixed; }
.site table.ag th { color: var(--text-50); font: 500 8.5px var(--mono); border-bottom: 1px solid var(--rule-strong);
  text-transform: uppercase; letter-spacing: .1em; padding: 0 6px 5px; text-align: left; }
.site table.ag td { padding: var(--pad, 4px) 6px; border-bottom: 1px solid var(--rule); vertical-align: middle; line-height: 1.3; }
.site td.tm, .site td.du { font-family: var(--mono); font-size: 9.6px; color: var(--text-80); }
.site td.du, .site th.du { text-align: center; }
.site tr.s td { background: var(--sunk); font-weight: 700; color: var(--accent); }
.site tr.s td.pg { font-style: italic; } .site tr.s td.tm, .site tr.s td.du { color: var(--accent); }
.site tr.sub td.pg { padding-left: 18px; color: var(--text-80); }
.site tr.speech td.pg { border-left: 2px solid var(--gold); }
.site .lv { font-family: var(--mono); font-size: 8.5px; color: var(--text-50); margin-right: 6px; }
.site .ti { font-weight: 700; font-style: italic; color: var(--accent); }
.site .ob { font-size: 9.4px; color: var(--text-80); margin-top: 1px; }
.site tr.speech td.who { font-weight: 700; }
.site .foot { display: flex; gap: 16px; padding-top: 9px; margin-top: 8px; }
.site .qrbox { width: 112px; }
.site .qrbox img, .site .qrbox .empty { width: 112px; height: 112px; display: block; padding: 6px; border: 1px solid var(--rule-strong); border-radius: 3px; background: #fff; }
.site .qrbox .empty { border-style: dashed; }
.site .cap { margin-top: 5px; display: block; }
.site .photo { flex: 1; } .site .photo img, .site .photo .empty { width: 100%; height: 112px; object-fit: cover; border-radius: 3px; display: block; }
.site .photo .empty { border: 1px dashed var(--rule-strong); }

/* classic style: the club's blue-bar table. Side column: bars centred,
   text left-aligned at one size, the three QR codes the same size and
   centred, and the free height shared evenly between the blocks. */
#page.classic { --pad: 4px; --cb: #9dc3e6; --cg: #d9d9d9; --gray: #555;
  padding: 8mm; font-family: Arial, "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif; font-size: 10.5px; color: #000; }
.classic .sheet { border: 1px solid #000; height: 100%; display: flex; flex-direction: column; }
.classic .head { display: flex; align-items: center; justify-content: space-between; padding: 6px 14px; border-bottom: 1px solid #000; }
.classic .head .tm { height: 58px; } .classic .head .sz { height: 62px; } .classic .head .blank { width: 58px; }
.classic .head .t { text-align: center; font-weight: bold; font-size: 12.5px; line-height: 1.4; }
.classic .body { flex: 1; min-height: 0; position: relative; }
.classic .body > table.ag { height: 100%; }
.classic .measure { position: absolute; left: 0; top: 0; width: 25%; visibility: hidden; }
.classic table.ag th.h, .classic table.ag td.h { background: var(--cb); font-weight: bold; text-align: center; }
.classic td.side { vertical-align: middle; padding: 0; }
.classic .c { padding: 6px 8px; font-size: 9.5px; line-height: 1.38; text-align: left; }
.classic .c p { margin: 0; } .classic .c p + p, .classic .c .num + p { margin-top: 3px; }
.classic .big { color: #c00000; font-weight: bold; font-size: 13px; }
.classic .ph { color: var(--gray); font-size: 9px; margin-left: 4px; font-weight: normal; }
.classic .eg { font-style: italic; color: var(--gray); }
.classic .num { display: grid; grid-template-columns: 12px 1fr; row-gap: 1px; }
.classic .num b { color: #c00000; }
.classic .off { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; grid-auto-rows: 14px; align-items: center; }
.classic .off span:nth-child(odd) { color: var(--gray); font-size: 8.5px; text-transform: uppercase; letter-spacing: .03em; }
.classic .qrc { display: flex; flex-direction: column; align-items: center; justify-content: center; padding-top: 8px; }
.classic .qrc .qr, .classic .qrc .qr-empty { width: 76px; height: 76px; display: block; }
.classic .qrc .qr-empty { border: 1px dashed #999; }
.classic .qrc span { font-size: 9.5px; font-weight: bold; margin-top: 3px; }
.classic .vote { width: 25%; border-right: 1px solid #000; display: flex; flex-direction: column; flex: none; }
.classic .vote .qrc { flex: 1; padding: 4px 0; min-height: 0; }
.classic .main { flex: 1; }
.classic table.ag { width: 100%; border-collapse: collapse; table-layout: fixed; }
.classic table.ag th { background: var(--cb); border: 1px solid #000; border-top: 0; padding: 4px; }
.classic table.ag td { border: 1px solid #000; padding: var(--pad) 6px; vertical-align: middle; line-height: 1.3; }
.classic table.ag tr:first-child > :first-child, .classic table.ag td.h, .classic table.ag td.side { border-left: 0; } .classic table.ag tr > :last-child { border-right: 0; }
.classic td.tm, .classic td.du, .classic td.who { text-align: center; }
#page td.who { overflow-wrap: anywhere; }
.classic tr.s td:not(.side) { background: var(--cb); font-weight: bold; } .classic tr.s td.pg { font-style: italic; }
.classic tr.sub td.tm { border-top: 0; border-bottom: 0; }
.classic tr.s td.h { font-style: normal; }
.classic tr.sub td.pg { padding-left: 16px; }
.classic .sp-l { display: grid; grid-template-columns: 58px 1fr; }
.classic .sp-l.ttl { color: #c00000; font-weight: bold; font-style: italic; }
.classic tr.speech td.who { font-weight: bold; }
.classic .foot { display: flex; border-top: 1px solid #000; height: 112px; flex: none; }
.classic .rules { flex: 1; } .classic .rules table { width: 100%; height: 100%; border-collapse: collapse; text-align: center; }
.classic .rules td, .classic .rules th { border: 1px solid #000; padding: 2px 3px; }
.classic .rules tr:last-child td { font-size: 9px; }
.classic .rules tr > :first-child { border-left: 0; } .classic .rules tr:last-child > * { border-bottom: 0; }
.classic .rules th { background: var(--cg); border-top: 0; }
.classic .g { background: #00b050; } .classic .y { background: #ffff00; } .classic .r { background: #ff0000; color: #fff; font-weight: bold; }
.classic .photo { width: 32%; border-left: 1px solid #000; display: flex; flex-direction: column; }
.classic .gh { background: var(--cg); font-weight: bold; padding: 4px 6px; border-bottom: 1px solid #000; text-align: center; }
.classic .photo .im { flex: 1; min-height: 0; padding: 5px; display: flex; }
.classic .photo img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- printing: only the page ---------- */
@page { size: A4; margin: 0; }
@media print {
  html, body { background: #fff; }
  .panel { display: none; }
  .app, .stage { display: block; padding: 0; margin: 0; background: #fff; overflow: visible; }
  .scaler { transform: none !important; }
  #page { box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
