@page { size: A4; margin: 14mm 14mm 16mm; }
:root { --accent:#2f4bd6; --ink:#1b1d22; --muted:#5d6270; --line:#d9d5cc; --soft:#eef1fd; --warn:#fdf0dc; }
* { box-sizing: border-box; }
html, body { margin:0; color:var(--ink); font-family:"BIZ UDGothic","Yu Gothic","Noto Sans JP",sans-serif;
  font-size:10.5pt; line-height:1.75; -webkit-print-color-adjust:exact; print-color-adjust:exact; }
body { word-break:keep-all; overflow-wrap:anywhere; line-break:strict; }   /* break Japanese between phrases */
p, li, td { orphans:3; widows:3; text-wrap:pretty; }
h1, h2, h3 { line-height:1.4; text-wrap:balance; break-after:avoid; page-break-after:avoid; }

.cover { height:250mm; display:flex; flex-direction:column; justify-content:center; break-after:page; }
.cover .brand { color:var(--accent); font-weight:700; letter-spacing:.2em; font-size:12pt; }
.cover h1 { font-size:30pt; margin:6mm 0 4mm; }
.cover .sub { font-size:13pt; color:var(--muted); }
.cover .meta { margin-top:18mm; font-size:10pt; color:var(--muted); }
.toc { margin-top:12mm; font-size:11pt; columns:2; column-gap:10mm; list-style:none; padding:0; }
.toc li { margin:1mm 0; break-inside:avoid; }

h2 { break-before:page; page-break-before:always; font-size:17pt; border-left:6pt solid var(--accent);
  padding-left:4mm; margin:0 0 5mm; }
h2.cont { break-before:auto; page-break-before:auto; margin-top:8mm; }
h3 { font-size:12.5pt; margin:6mm 0 2mm; color:var(--accent); }
.lead { color:var(--muted); margin-top:0; }

.step { display:grid; grid-template-columns:1fr 50mm; gap:6mm; align-items:start; margin:4mm 0;
  break-inside:avoid; page-break-inside:avoid; }
.step.wide { grid-template-columns:1fr; }
.step.two { grid-template-columns:1fr 1fr; }
.step img, figure img { width:100%; border:0.6pt solid var(--line); border-radius:3mm; display:block; }
.shot { width:50mm; }
.shot.tall { max-height:230mm; object-fit:contain; object-position:top; }
figure { margin:0; break-inside:avoid; page-break-inside:avoid; }
figcaption { font-size:8.5pt; color:var(--muted); text-align:center; margin-top:1mm; }
.pair { display:grid; grid-template-columns:62mm 62mm; justify-content:center; gap:8mm; break-inside:avoid; page-break-inside:avoid; margin:4mm 0; }
.trio { display:grid; grid-template-columns:repeat(3,1fr); gap:4mm; break-inside:avoid; page-break-inside:avoid; margin:4mm 0; }

ol.num { counter-reset:n; list-style:none; padding:0; margin:2mm 0; }
ol.num > li { counter-increment:n; position:relative; padding-left:9mm; margin:2mm 0; break-inside:avoid; }
ol.num > li::before { content:counter(n); position:absolute; left:0; top:.2em; width:6mm; height:6mm; border-radius:50%;
  background:var(--accent); color:#fff; font-size:9pt; font-weight:700; text-align:center; line-height:6mm; }
ul { padding-left:5mm; margin:2mm 0; }
li { margin:1mm 0; }

.box { border:0.8pt solid var(--line); border-radius:3mm; padding:3mm 4mm; margin:3mm 0; break-inside:avoid; page-break-inside:avoid; }
.box.point { background:var(--soft); border-color:#c9d0fa; }
.box.warn { background:var(--warn); border-color:#f0d6a8; }
.box b.t { display:block; margin-bottom:1mm; }

table { width:100%; border-collapse:collapse; margin:3mm 0; font-size:9.5pt; break-inside:auto; }
tr { break-inside:avoid; page-break-inside:avoid; }
th, td { border:0.6pt solid var(--line); padding:1.6mm 2.4mm; text-align:left; vertical-align:top; }
th { background:#f4f2ee; font-weight:700; white-space:nowrap; }
thead { display:table-header-group; }

.qa { break-inside:avoid; page-break-inside:avoid; margin:3mm 0; border-bottom:0.5pt dashed var(--line); padding-bottom:2mm; }
.qa .q { font-weight:700; }
.qa .q::before { content:"Q. "; color:var(--accent); }
.qa .a::before { content:"A. "; font-weight:700; color:#1f7a4d; }
.qa .a { margin:1mm 0 0; }
.tag { display:inline-block; font-size:8pt; border-radius:99px; padding:0 2.5mm; background:var(--soft); color:var(--accent); margin-left:1.5mm; }
.nb { white-space:nowrap; }
code, .cmd { font-family:Consolas,"BIZ UDGothic",monospace; font-size:9pt; background:#f4f2ee; padding:.3mm 1.2mm; border-radius:1mm; }
pre.cmd { display:block; padding:2mm 3mm; white-space:pre-wrap; break-inside:avoid; }
.small { font-size:9pt; color:var(--muted); }

/* the same file on the web (kasane-sns.jp/guide) */
@media screen {
  body { max-width:820px; margin:0 auto; padding:16px; background:#fff; }
  .cover { height:auto; padding:40px 0; }
  h2 { margin-top:48px; }
  .step { grid-template-columns:1fr; } .shot { width:100%; max-width:300px; }
  .pair, .trio { grid-template-columns:1fr 1fr; }
  .toc { columns:1; }
}
