@charset "UTF-8";

:root{
  --bg:#FFFFFF;
  --ink-strong:#10243C;
  --ink:#1B2430;
  --ink-weak:#4A5766;
  --ink-faint:#6B7684;
  --red:#D93A3A;
  --red-face:#FDEAEA;
  --yellow:#E0A92B;
  --yellow-face:#FDF5E0;
  --blue:#4B7FC4;
  --blue-light:#6F9AD6;
  --blue-face:#E9F0FB;
  --gray:#B9BEC4;
  --gray-face:#F0F1F2;
  --green:#1F7A44;
  --green-face:#E6F3EA;
  --font:"Hiragino Sans","Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;
  --mono:"SFMono-Regular",Consolas,"Hiragino Sans","Noto Sans JP",monospace;
}

*{box-sizing:border-box;}

html{scroll-behavior:smooth;scroll-padding-top:24px;}

body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family:var(--font);
  font-size:17px;
  line-height:1.85;
  font-weight:500;
  -webkit-text-size-adjust:100%;
}

.wrap{
  max-width:880px;
  margin:0 auto;
  padding-left:24px;
  padding-right:24px;
}

a{color:#2C5E9E;overflow-wrap:anywhere;word-break:break-word;}
a:hover{color:var(--blue);}

/* ---- header ---- */
.page-head{
  border-bottom:3px solid var(--gray-face);
  padding-block:48px 40px;
}
.eyebrow{
  margin:0 0 12px;
  font-size:15px;
  font-weight:700;
  color:var(--red);
  letter-spacing:.04em;
}
.page-head h1{
  margin:0 0 8px;
  font-size:34px;
  line-height:1.45;
  font-weight:900;
  color:var(--ink-strong);
  letter-spacing:.01em;
}
.page-head h1::after{
  content:"";
  display:block;
  width:120px;
  height:8px;
  background:var(--red);
  border-radius:999px;
  margin-top:20px;
}
.lead{
  margin:18px 0 0;
  font-size:17px;
  color:var(--ink);
}

/* ---- toc ---- */
.toc{
  margin:40px 0 0;
  background:var(--blue-face);
  border:3px solid #D4E1F3;
  border-radius:24px;
  padding:28px 32px;
}
.toc-title{
  margin:0 0 12px;
  font-size:19px;
  font-weight:900;
  color:var(--ink-strong);
}
.toc ol{
  margin:0;
  padding-left:0;
  list-style:none;
  counter-reset:none;
}
.toc li{margin:6px 0;}
.toc a{
  font-weight:700;
  text-decoration:none;
  border-bottom:2px solid transparent;
}
.toc a:hover{border-bottom-color:var(--blue-light);}

/* ---- intro card ---- */
.intro-card{
  margin:40px 0 0;
  background:var(--gray-face);
  border-radius:24px;
  padding:28px 32px;
}
.intro-card h2{
  margin:0 0 12px;
  font-size:20px;
  font-weight:900;
  color:var(--ink-strong);
}
.intro-card p{margin:0 0 12px;}
.intro-card p:last-child{margin-bottom:0;}

/* ---- sections ---- */
.sec{
  margin-top:64px;
  padding-top:8px;
}
.sec h2{
  display:flex;
  align-items:center;
  gap:16px;
  margin:0 0 4px;
  font-size:26px;
  line-height:1.5;
  font-weight:900;
  color:var(--ink-strong);
}
.sec h2 .num{
  flex:0 0 auto;
  width:44px;
  height:44px;
  border-radius:999px;
  background:var(--blue);
  color:#FFFFFF;
  font-size:20px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}
.sec .sub{
  margin:0 0 18px 60px;
  font-size:15px;
  font-weight:700;
  color:var(--ink-faint);
}
.sec > p{margin:16px 0;}
.h3{
  margin:36px 0 12px;
  font-size:19px;
  font-weight:900;
  color:var(--ink-strong);
  padding-left:14px;
  border-left:6px solid var(--blue-light);
}
.minilabel{
  margin:24px 0 8px;
  font-size:15px;
  font-weight:700;
  color:var(--ink-weak);
}
.cap{
  margin:8px 0 0;
  font-size:14px;
  color:var(--ink-faint);
}

/* ---- steps ---- */
.steps{
  margin:16px 0;
  padding-left:0;
  list-style:none;
  counter-reset:step;
}
.steps li{
  position:relative;
  counter-increment:step;
  padding:12px 0 12px 46px;
  border-bottom:2px solid var(--gray-face);
}
.steps li:last-child{border-bottom:none;}
.steps li::before{
  content:counter(step);
  position:absolute;
  left:0;
  top:14px;
  width:30px;
  height:30px;
  border-radius:999px;
  background:var(--blue-face);
  color:var(--blue);
  font-size:15px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
}

/* ---- note ---- */
.note{
  margin:20px 0;
  background:var(--gray-face);
  border-radius:16px;
  padding:22px 26px;
}
.note.warn{
  background:var(--yellow-face);
  border:2px solid #EFD9A4;
}
.note p{margin:0 0 10px;}
.note p:last-child{margin-bottom:0;}
.src{
  font-size:14px;
  color:var(--ink-faint);
  word-break:break-all;
}

/* ---- phase ---- */
.phase{
  display:flex;
  align-items:stretch;
  gap:16px;
  margin:20px 0;
}
.phase-card{
  flex:1 1 0;
  background:#FFFFFF;
  border:3px solid var(--blue-face);
  border-radius:24px;
  padding:24px 26px;
}
.phase-label{
  margin:0 0 6px;
  font-size:14px;
  font-weight:900;
  letter-spacing:.08em;
  color:var(--blue);
}
.phase-card h3{
  margin:0 0 10px;
  font-size:20px;
  font-weight:900;
  color:var(--ink-strong);
}
.phase-card p{margin:0;font-size:16px;}
.phase-arrow{
  flex:0 0 auto;
  align-self:center;
  color:var(--gray);
  font-size:22px;
}

/* ---- screenshots ---- */
.shot{
  margin:20px 0 28px;
}
.shot img{
  display:block;
  width:100%;
  max-width:100%;
  height:auto;
  border:2px solid #DDE1E6;
  border-radius:12px;
  background:var(--gray-face);
}
.shot figcaption{
  margin-top:10px;
  font-size:14px;
  line-height:1.75;
  color:var(--ink-weak);
}

/* ---- code ---- */
.codebox{
  margin:16px 0 28px;
  border:2px solid #DDE1E6;
  border-radius:16px;
  overflow:hidden;
  background:#FBFBFC;
}
.codebar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 16px;
  background:var(--gray-face);
  border-bottom:2px solid #DDE1E6;
}
.codelabel{
  font-size:14px;
  font-weight:700;
  color:var(--ink-weak);
}
.btnset{display:flex;gap:8px;}
.btn{
  font-family:var(--font);
  font-size:14px;
  font-weight:700;
  color:#FFFFFF;
  background:var(--blue);
  border:none;
  border-radius:999px;
  padding:8px 18px;
  cursor:pointer;
  line-height:1.4;
}
.btn:hover{background:#3F6FB0;}
.btn:active{transform:translateY(1px);}
.btn:focus-visible{outline:3px solid var(--yellow);outline-offset:2px;}
.btn.is-done{background:var(--green);}
.btn-dl{background:var(--ink-weak);}
.btn-dl:hover{background:#3A4653;}

.codebox pre{
  margin:0;
  padding:20px 22px;
  overflow-x:auto;
  background:#FBFBFC;
}
.codebox code{
  font-family:var(--mono);
  font-size:15px;
  line-height:1.9;
  color:var(--ink);
  white-space:pre-wrap;
  word-break:break-word;
  overflow-wrap:anywhere;
  tab-size:4;
}
/* タブ区切りの出力例だけは、列がずれないよう折り返さず横スクロールさせる */
.codebox-scroll code{
  white-space:pre;
  word-break:normal;
  overflow-wrap:normal;
}
code.inline{
  font-family:var(--mono);
  font-size:.95em;
  background:var(--gray-face);
  border-radius:6px;
  padding:2px 8px;
}

/* ---- table ---- */
.tablewrap{
  overflow-x:auto;
  border:2px solid #DDE1E6;
  border-radius:16px;
  max-width:100%;
}
.tablewrap:focus-visible{outline:3px solid var(--yellow);outline-offset:2px;}
table.out{
  border-collapse:collapse;
  min-width:1100px;
  font-size:14px;
  line-height:1.7;
}
table.out th,
table.out td{
  border-bottom:2px solid #E6E9EC;
  border-right:2px solid #E6E9EC;
  padding:12px 14px;
  text-align:left;
  vertical-align:top;
}
table.out th{
  background:var(--gray-face);
  font-weight:700;
  color:var(--ink-strong);
  white-space:nowrap;
}
table.out tr:last-child td{border-bottom:none;}
table.out th:last-child,
table.out td:last-child{border-right:none;}

/* ---- footer ---- */
.page-foot{
  margin-top:72px;
  padding-block:32px 44px;
  border-top:3px solid var(--gray-face);
  color:var(--ink-faint);
  font-size:15px;
}
.page-foot p{margin:0 0 4px;}

/* ---- toast ---- */
.toast{
  position:fixed;
  left:50%;
  bottom:28px;
  transform:translateX(-50%) translateY(16px);
  background:var(--ink-strong);
  color:#FFFFFF;
  font-size:15px;
  font-weight:700;
  padding:12px 24px;
  border-radius:999px;
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
  z-index:50;
}
.toast.is-show{
  opacity:1;
  transform:translateX(-50%) translateY(0);
}

/* ---- responsive ---- */
@media (max-width:640px){
  body{font-size:16px;}
  .wrap{padding-left:16px;padding-right:16px;}
  .page-head{padding-block:32px 28px;}
  .page-head h1{font-size:25px;}
  .lead{font-size:16px;}
  .toc,.intro-card{padding:22px 20px;border-radius:18px;}
  .sec{margin-top:48px;}
  .sec h2{font-size:21px;gap:12px;}
  .sec h2 .num{width:36px;height:36px;font-size:17px;}
  .sec .sub{margin-left:48px;}
  .phase{flex-direction:column;}
  .phase-arrow{transform:rotate(90deg);align-self:center;}
  .codebar{flex-direction:column;align-items:flex-start;gap:10px;}
  .codebox pre{padding:16px;}
  .codebox code{font-size:14px;}
  .note{padding:18px 18px;}
}
