.sd-layout { display: grid; grid-template-columns: minmax(0, 560px) minmax(260px, 1fr); gap: 20px; margin: 20px 0; align-items: start; }
.sd-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin: 18px 0 0; }
.sd-head h1 { font-size: 28px; }
.levels { display: flex; gap: 8px; flex-wrap: wrap; }
.board-card { padding: 12px; }
.board {
  display: grid; grid-template-columns: repeat(9, 1fr); width: 100%; aspect-ratio: 1; direction: ltr;
  border: 3px solid var(--text); border-radius: 10px; overflow: hidden; background: var(--card); user-select: none;
}
.cell {
  border: 0; border-right: 1px solid var(--border-strong); border-bottom: 1px solid var(--border-strong);
  background: var(--card); display: flex; align-items: center; justify-content: center; padding: 0; cursor: pointer;
  font-family: "Plus Jakarta Sans", var(--font-head); font-size: clamp(20px, 5.4vw, 30px); font-weight: 600; color: var(--primary); position: relative; min-width: 0;
}
.sd-row { display: contents; }
.cell.rl { border-right: 0; }
.cell.bl { border-bottom: 0; }
.cell.br { border-right: 3px solid var(--text); }
.cell.bb { border-bottom: 3px solid var(--text); }
.cell.given { color: var(--text); font-weight: 800; }
.cell.peer { background: var(--raised); }
.cell.same { background: var(--accent-soft); }
.cell.sel { background: var(--daily-bg); box-shadow: inset 0 0 0 3px var(--star); z-index: 1; }
.cell.bad { color: var(--err); background: var(--err-bg); }
.cell.hinted { color: var(--gold-text); }
.notes { position: absolute; inset: 2px; display: grid; grid-template-columns: repeat(3, 1fr); font-size: clamp(9px, 2.2vw, 12px); font-weight: 700; color: var(--text-2); line-height: 1; }
.notes span { display: flex; align-items: center; justify-content: center; }
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 12px; direction: ltr; }
.pad .num { font-family: "Plus Jakarta Sans", sans-serif; font-size: 24px; font-weight: 800; min-height: 56px; padding: 0; }
.pad .num[disabled] { opacity: .35; }
.actions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.side { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.buddy { max-width: 240px; margin: 0 auto; width: 100%; }
.bubble { background: var(--raised); border: 2px solid var(--border); border-radius: 14px; padding: 10px 14px; font-weight: 600; min-height: 56px; }
.win { text-align: center; padding: 18px; }
.win h2 { font-size: 26px; color: var(--primary); }
.stat { color: var(--text-2); font-size: 16px; }

.confirm { max-width: 420px; }
.confirm-body { padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.confirm-body h2 { font-size: 22px; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 6px; }
.confirm-actions .btn { min-height: 52px; }

/* Printable sheet */
.sheet-wrap { display: flex; flex-direction: column; align-items: center; gap: 14px; margin: 20px 0; }
.sheet-fit { position: relative; width: 100%; max-width: 210mm; }
.sheet { position: absolute; top: 0; left: 0; transform-origin: 0 0; width: 210mm; height: 297mm; box-sizing: border-box; background: #fff; color: #000; padding: 14mm; box-shadow: var(--shadow); border: 1px solid #ccc; display: flex; flex-direction: column; gap: 10mm; }
.sheet .s-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; font-size: 14px; }
.sheet .s-brand { display: flex; align-items: center; gap: 6px; font-weight: 800; font-family: "Plus Jakarta Sans", sans-serif; direction: ltr; }
.sheet .s-brand img { width: 28px; height: 28px; }
.sheet .s-fields div { margin-bottom: 4mm; }
.sheet h2 { text-align: center; font: 800 24px var(--font-head); }
.sheet .pboard { display: grid; grid-template-columns: repeat(9, 1fr); width: 140mm; max-width: 100%; aspect-ratio: 1; margin: 0 auto; border: 3px solid #000; direction: ltr; }
.sheet .pboard div { border-right: 1px solid #555; border-bottom: 1px solid #555; display: flex; align-items: center; justify-content: center; font: 700 26px "Plus Jakarta Sans", sans-serif; }
.sheet .pboard div:nth-child(9n) { border-right: 0; }
.sheet .pboard div:nth-child(n+73) { border-bottom: 0; }
.sheet .pboard .br { border-right: 3px solid #000; }
.sheet .pboard .bb { border-bottom: 3px solid #000; }
.sheet .s-foot { margin-top: auto; display: flex; justify-content: space-between; font-size: 12px; color: #333; }
.print-tools { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }

@media (max-width: 900px) { .sd-layout { grid-template-columns: 1fr; } .side { order: 2; } }
@media (max-width: 480px) {
  .board-card { padding: 6px; border-radius: 12px; }
  .main-sd { padding: 0 8px; }
}
@media print {
  @page { size: A4; margin: 0; }
  body { background: #fff !important; }
  .site-header, .site-footer, .print-tools, .no-print { display: none !important; }
  .sheet-wrap { margin: 0; gap: 0; }
  .sheet-fit { height: auto !important; max-width: none; position: static; }
  .sheet { position: static; transform: none !important; box-shadow: none; border: 0; width: 210mm; height: 297mm; page-break-after: always; break-after: page; }
}
