/* 尾牙摸彩券（kit.css 之上只加版面）。券的尺寸一律用 --mm：預覽時 1mm＝容器寬 / 210，列印時就是 1mm */
:root { --accent-soft: #fbe9e4; }
.rt-top { padding-bottom: 4px; }
.rt-grid { max-width: 1080px; margin: 0 auto; }
.rt-out { padding-top: 0; }
.rt-in { padding-top: 8px; display: grid; gap: var(--s2); }
.rt-check { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); }
.rt-check > summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 0 var(--s3); font-weight: 700; color: var(--band); }
.rt-check > summary::-webkit-details-marker { display: none; }
.rt-check > summary::after { content: "＋"; font-weight: 900; }
.rt-check[open] > summary::after { content: "－"; }
.rt-check .rt-form { padding: var(--s1) var(--s3); }
.rt-check .rt-form .field { margin: 0 0 var(--s3); }
.rt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.rt-hint { display: block; margin: calc(-1 * var(--s2)) 0 var(--s3); }
.rt-order { border: 0; padding: 0; }
.rt-order legend { font-weight: 700; margin-bottom: 6px; }
.rt-radio { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 400; }
.rt-radio input { width: 20px; height: 20px; }
.rt-sum { margin: 14px 0 0; }
.rt-cap { margin: 16px 0 6px; font-size: .875rem; font-weight: 700; color: var(--ink-soft); }
.rt-actions { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
.rt-stack-tip { margin: 0; padding: 10px 12px; border-left: 4px solid var(--band); background: var(--accent-soft); line-height: 1.6; }
.rt-disclaim { font-size: .875rem; color: var(--ink-soft); margin-top: 18px; }
#rt-un:empty { min-height: 276px; }

/* 縮小預覽：一張 A4 放進容器寬 */
.rt-preview { container-type: inline-size; box-shadow: 0 1px 0 var(--line), 0 6px 18px rgba(30, 30, 30, .12); background: #fff; }
.rt-preview .rt-sheet { --mm: calc(100cqw / 210); }

/* 一頁 A4 */
.rt-sheet { --mm: 1mm; width: calc(210 * var(--mm)); height: calc(297 * var(--mm)); padding: calc(8 * var(--mm)); box-sizing: border-box; position: relative; background: #fff; color: #1d1d1b;
  display: grid; grid-template-columns: repeat(var(--cols), 1fr); grid-template-rows: repeat(var(--rows), 1fr);
  font-size: calc(var(--k, 1) * var(--mm)); font-family: "Noto Sans TC", "PingFang TC", "Microsoft JhengHei", sans-serif; }
/* 裁切線：每格四邊細虛線（相鄰兩格共用同一條，裁一刀） */
.rt-t { display: grid; grid-template-columns: 31% 1fr; min-width: 0; min-height: 0; overflow: hidden; outline: max(1px, calc(.25 * var(--mm))) dashed #9a9a9a; outline-offset: calc(-.125 * var(--mm)); }
.rt-blank { outline-color: #d6d6d6; }
/* 第 1 頁上方紙邊那句：離紙邊 5.5～7.5 mm，格子上緣（8 mm）前留 0.5 mm，不碰裁切線 */
.rt-tip { position: absolute; left: calc(8 * var(--mm)); top: calc(5.5 * var(--mm)); margin: 0; font-size: calc(2 * var(--mm)); line-height: 1; color: #555; white-space: nowrap; }
/* 存根：號碼上下各一次，對折後打開哪邊都看得到；右邊是撕線 */
.rt-stub { display: flex; flex-direction: column; justify-content: space-between; gap: calc(1.2 * var(--mm)); padding: calc(3 * var(--mm)) calc(3 * var(--mm)); border-right: max(1px, calc(.4 * var(--mm))) dotted #555; min-width: 0; }
.rt-no { font-size: 5em; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: .02em; color: #b23a2b; }
.rt-no2 { align-self: flex-end; transform: rotate(180deg); }
.rt-line { display: block; font-size: 2.8em; line-height: 1; padding-bottom: calc(1 * var(--mm)); border-bottom: max(1px, calc(.25 * var(--mm))) solid #777; white-space: nowrap; overflow: hidden; }
.rt-main { overflow: hidden; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; gap: calc(1.2 * var(--mm)); padding: calc(3 * var(--mm)) calc(4 * var(--mm)); min-width: 0; }
.rt-org { font-size: 3.4em; line-height: 1.2; color: #555; }
.rt-title { font-size: 6em; line-height: 1.2; font-weight: 900; }
.rt-date { font-size: 3.4em; line-height: 1.2; }
.rt-big { font-size: 14em; line-height: 1; font-weight: 900; color: #b23a2b; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.rt-note { font-size: 3em; line-height: 1.2; color: #555; }
.rt-org, .rt-title, .rt-date, .rt-note { max-width: 100%; overflow-wrap: anywhere; text-wrap: balance; }   /* 長的折兩行；還放不下由 app.js 整張一起縮字（--k） */
/* 一頁 4 張（大張）放大；10、12 張（矮）縮小 */
.rt-per-4 .rt-t { grid-template-columns: 26% 1fr; }
.rt-per-4 .rt-title { font-size: 8em; }
.rt-per-4 .rt-big { font-size: 18em; }
.rt-per-4 .rt-org, .rt-per-4 .rt-date { font-size: 4.4em; }
.rt-per-4 .rt-no { font-size: 6.5em; }
.rt-per-4 .rt-line { font-size: 3.4em; }
.rt-per-10 .rt-title { font-size: 5.4em; }
.rt-per-10 .rt-big { font-size: 11em; }
.rt-per-12 .rt-main, .rt-per-12 .rt-stub { padding-top: calc(2 * var(--mm)); padding-bottom: calc(2 * var(--mm)); gap: calc(.8 * var(--mm)); }
.rt-per-12 .rt-title { font-size: 4.6em; }
.rt-per-12 .rt-org, .rt-per-12 .rt-date { font-size: 3em; }
.rt-per-12 .rt-big { font-size: 9em; }
.rt-per-12 .rt-no { font-size: 4.2em; }
.rt-per-12 .rt-line { font-size: 2.5em; }

@media (min-width: 960px) {
  #rt-un:empty { min-height: 264px; }
  .rt-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 24px; align-items: start; padding: 0 16px; }
  .rt-grid > .kit-wrap { max-width: none; margin: 0; padding-left: 0; padding-right: 0; }
  .rt-in { position: sticky; top: 76px; }
  .rt-out { padding-top: 8px; }
  .rt-top { max-width: 1080px; }
}
@media print {
  @page { size: A4; margin: 0; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .rt-grid, .rt-top, .rt-disclaim, .kit-disclaim-out, .pot-stage { display: none !important; }   /* 只印券（kit 會把說明搬到 .kit-disclaim-out） */
  #rt-print .rt-sheet { break-after: page; page-break-after: always; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #rt-print .rt-sheet:last-child { break-after: auto; page-break-after: auto; }
}
