/* Tabula sites: product pictures and diagrams. The ONLY file where Aff and Neg colours may appear,
   because these pictures show round data. build.test.mjs enforces that. */
/* ---------- Product pictures (HTML that copies the real app layout, not a screenshot) ---------- */
.app { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-2); overflow: hidden; font: 400 12px/1.4 var(--font-sans); color: var(--text); }
.app-top { display: flex; align-items: center; gap: 14px; padding: 9px 14px; border-bottom: 1px solid var(--border); }
.app-top img { height: 18px; width: auto; }
.app-top b { font: italic 800 14px/1 var(--font-display); }
.app-top .tabs { display: flex; gap: 2px; }
.app-top .tabs span { padding: 5px 9px; border-radius: 6px; color: var(--text-2); font-weight: 500; }
.app-top .tabs span.on { background: var(--sunk); color: var(--text); font-weight: 600; }
.app-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 300px; }
.app-side { border-right: 1px solid var(--border); padding: 12px 10px; background: var(--canvas); }
.app-side h6 { margin: 0 0 8px; font: 700 11px/1 var(--font-sans); color: var(--text); }
.sp-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; }
.sp { border: 1px solid var(--border); border-radius: 6px; padding: 4px 6px; font-weight: 700; font-size: 11px; background: var(--panel); }
.sp small { display: block; font-weight: 400; color: var(--text-3); font-size: 10px; }
.sp.a { color: var(--aff); } .sp.n { color: var(--neg); }
.sp.on { border-color: var(--text); box-shadow: inset 0 0 0 1px var(--text); }
.sp.done { opacity: .55; }
.app-flow { min-width: 0; display: flex; flex-direction: column; }
.sheet-tabs { display: flex; gap: 4px; padding: 8px 12px 0; border-bottom: 1px solid var(--border); overflow: hidden; }
.sheet-tabs span { padding: 5px 10px; border-radius: 6px 6px 0 0; color: var(--text-3); font-weight: 500; white-space: nowrap; }
.sheet-tabs span.on { color: var(--text); background: var(--panel); border: 1px solid var(--border); border-bottom-color: var(--panel); margin-bottom: -1px; font-weight: 600; }
.cols { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); flex: 1; }
.col { border-left: 1px solid var(--border); padding: 10px 8px 14px; min-width: 0; }
.col:first-child { border-left: 0; }
.col h5 { margin: 0 0 8px; font: 700 11px/1 var(--font-sans); letter-spacing: .04em; }
.col.a h5 { color: var(--aff); } .col.n h5 { color: var(--neg); }
.col p { margin: 0 0 7px; padding: 1px 0 1px 7px; border-left: 2px solid var(--border); overflow-wrap: anywhere; hyphens: auto; color: var(--text); }
.col.a p { border-left-color: var(--aff-edge); } .col.n p { border-left-color: var(--neg-edge); }
.col p.sub { margin-left: 8px; color: var(--text-2); }
.col p.drop { color: var(--text-3); text-decoration: line-through; border-left-style: dashed; }
.col p.key { font-weight: 600; }
.app-clock { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-top: 1px solid var(--border); background: var(--canvas); white-space: nowrap; }
.app-clock .now { font-size: 11px; color: var(--text-2); }
.app-clock .now b { color: var(--aff); }
.app-clock .big { font: 800 22px/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.app-clock .chip { border: 1px solid var(--border-ctl); border-radius: 6px; padding: 3px 8px; font-weight: 600; font-size: 11px; }
.app-clock .chip.dark { background: var(--ink); color: var(--on-ink); border-color: var(--ink); }
.app-clock .prep { margin-left: auto; display: flex; gap: 12px; font-size: 11px; }
.app-clock .prep b { font: 700 14px/1 var(--font-display); font-variant-numeric: tabular-nums; color: var(--text); margin-left: 4px; }
.app-clock .pa { color: var(--aff); } .app-clock .pn { color: var(--neg); }
@media (max-width: 1100px) { .app-body { grid-template-columns: minmax(0, 1fr); } .app-side { display: none; } }
@media (max-width: 560px) { .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } .col:nth-child(n+4) { display: none; } .app-clock .prep span:last-child, .app-clock .chip:not(.dark) { display: none; } }

/* Clock picture */
.clock-card { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-2); padding: var(--s6); display: grid; gap: var(--s5); }
.clock-card .cc-now { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); }
.clock-card .cc-sp { font: 700 var(--fs-4)/1 var(--font-display); color: var(--neg); }
.clock-card .cc-sp small { display: block; font: 500 var(--fs-2)/1.4 var(--font-sans); color: var(--text-3); margin-top: 6px; }
.clock-card .cc-big { font: 800 clamp(56px, 8vw, 96px)/1 var(--font-display); letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.clock-card .cc-bar { height: 6px; border-radius: 6px; background: var(--sunk); overflow: hidden; }
.clock-card .cc-bar i { display: block; height: 100%; width: 3.6%; background: var(--text-3); border-radius: 6px; }
.clock-card .cc-prep { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.clock-card .cc-prep div { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px 14px; display: flex; justify-content: space-between; align-items: baseline; }
.clock-card .cc-prep span { font-size: var(--fs-2); font-weight: 600; }
.clock-card .cc-prep .pa span { color: var(--aff); } .clock-card .cc-prep .pn span { color: var(--neg); }
.clock-card .cc-prep b { font: 700 var(--fs-5)/1 var(--font-display); font-variant-numeric: tabular-nums; }
.clock-card .cc-keys { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s4); color: var(--text-3); font-size: var(--fs-2); align-items: center; }
.clock-card .cc-keys .nowrap { display: inline-flex; align-items: center; gap: 6px; }
.clock-card kbd { font: 600 12px/1 var(--font-mono); border: 1px solid var(--border-ctl); border-bottom-width: 2px; border-radius: 5px; padding: 4px 7px; color: var(--text); background: var(--panel); }

/* Ballot picture */
.ballot-card { border: 1px solid var(--border); border-radius: var(--r-xl); background: var(--panel); box-shadow: var(--shadow-2); overflow: hidden; }
.ballot-card header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border); font-weight: 600; font-size: var(--fs-2); }
.ballot-card header span { color: var(--text-3); font-weight: 500; }
.ballot-card .bc-body { padding: 18px; display: grid; gap: 14px; font-size: var(--fs-2); }
.ballot-card .bc-win { display: flex; gap: 8px; }
.ballot-card .bc-win span { flex: 1; text-align: center; padding: 10px; border-radius: var(--r-md); border: 1px solid var(--border); font-weight: 600; color: var(--text-3); }
.ballot-card .bc-win span.on { border: 2px solid var(--aff); color: var(--aff); background: var(--aff-tint); }
.ballot-card table { min-width: 0; font-size: var(--fs-2); }
.ballot-card td, .ballot-card th { padding: 8px 10px; }
.ballot-card td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--text); font-weight: 600; }
.ballot-card .ta { color: var(--aff); } .ballot-card .tn { color: var(--neg); }
.ballot-card .bc-rfd { border-left: 3px solid var(--border-ctl); padding: 2px 0 2px 12px; color: var(--text-2); line-height: 1.55; }
.ballot-card .bc-rfd b { color: var(--text); display: block; margin-bottom: 4px; font-size: var(--fs-1); letter-spacing: .06em; text-transform: uppercase; }
.ballot-card .bc-actions { display: flex; gap: 8px; }
.ballot-card .bc-actions span { border: 1px solid var(--border-ctl); border-radius: 6px; padding: 6px 10px; font-weight: 600; font-size: var(--fs-1); }

/* Diagrams drawn as inline SVG. Colours come from these classes, so light and dark both work. */
.diagram { width: 100%; height: auto; }
.diagram text { font: 600 13px var(--font-sans); fill: var(--text); }
.diagram .t2 { font-weight: 500; fill: var(--text-3); font-size: 12px; }
.diagram .box { fill: var(--panel); stroke: var(--border-ctl); stroke-width: 1.5; }
.diagram .box-ink { fill: var(--ink); stroke: var(--ink); }
.diagram .on-ink { fill: var(--on-ink); }
.diagram .line { stroke: var(--border-ctl); stroke-width: 1.5; fill: none; }
.diagram .arrow { fill: var(--border-ctl); }

/* Speech Events picture: rank board */
.rank { padding: var(--s5); display: grid; gap: 8px; }
.rank .r { display: grid; grid-template-columns: 34px 1fr auto; gap: var(--s3); align-items: center; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--panel); }
.rank .n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; background: var(--brand-tint); color: var(--brand-text); border: 1px solid var(--brand-edge); }
.rank .t { color: var(--text-3); font-family: var(--font-mono); }


/* Parent hero: two product pictures, one in front of the other. Rank colours here are the events accent. */
.stack { position: relative; padding-bottom: 72px; }
.stack .app:first-child { width: 88%; }
.stack .app:last-child { position: absolute; right: 0; bottom: 0; width: 52%; }
.stack .cols { min-height: 180px; }
@media (max-width: 560px) { .stack { padding-bottom: 0; display: grid; gap: var(--s4); } .stack .app:first-child, .stack .app:last-child { position: static; width: 100%; } }
.stack .app:first-child .cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stack .app:first-child .col:nth-child(n+4) { display: none; }

/* Speech Events drafts: comment sheet and Congress grid. */
.cmt { padding: 14px; display: grid; gap: 10px; }
.cmt-head { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.cmt-head .n { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand-text); border: 1px solid var(--brand-edge); font-weight: 700; }
.cmt-head .meta { margin-left: auto; color: var(--text-3); font-size: 11px; }
.cmt-q { border: 1px solid var(--border); border-radius: var(--r-md); padding: 10px 12px; background: var(--canvas); }
.cmt-q h6 { margin: 0 0 4px; font: 700 10px/1.2 var(--font-sans); color: var(--text-2); text-transform: uppercase; letter-spacing: .05em; }
.cmt-q p { margin: 0; font-size: 12px; line-height: 1.45; color: var(--text); }
.cg { width: 100%; min-width: 0; border-collapse: collapse; font-size: 12px; table-layout: fixed; }
.cg th:first-child, .cg td:first-child { width: 34%; }
.cg th, .cg td { padding: 8px 10px; border-bottom: 1px solid var(--border); text-align: left; overflow-wrap: anywhere; }
.cg th { font-weight: 600; color: var(--text-3); font-size: 10px; overflow-wrap: normal; }
.cg td + td { font-variant-numeric: tabular-nums; }
.cg tr.po td { background: var(--brand-tint); color: var(--brand-text); font-weight: 600; }
@media (max-width: 560px) {
  .cg th, .cg td { padding: 8px 6px; }
  .cg th:first-child, .cg td:first-child { width: 30%; }
  .app-clock .now { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 400px) { .app-top .tabs span:first-child:not(.on) { display: none; } }
