:root {
  --primary: #4f46e5; --primary-dark: #4338ca; --accent: #6366f1;
  --surface: #fff; --text: #0f172a; --text-2: #475569; --text-3: #64748b;
  --border: #e2e8f0; --glow: rgba(79,70,229,0.08); --r: 14px; --r-sm: 10px;
  --sidebar-width: 248px; --anchor-offset: 24px;
}
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Segoe UI", sans-serif;
  background: #fff;
  color: var(--text); line-height: 1.75; font-size: 15px; -webkit-font-smoothing: antialiased; min-height: 100vh;
}
a { color: var(--primary-dark); }
code { font-family: "SF Mono", Menlo, Consolas, monospace; font-size: .9em; background: rgba(99,102,241,0.08); padding: 1px 6px; border-radius: 5px; }

[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; }
.skip-link { position: fixed; top: 8px; left: 12px; z-index: 30; padding: 8px 14px; background: #fff; border: 1px solid var(--primary); border-radius: 6px; transform: translateY(-160%); }
.skip-link:focus { transform: none; }
.brand { font-weight: 800; font-size: 14px; color: var(--text); text-decoration: none; line-height: 1.6; }
.mobile-header { display: none; }
.menu-toggle { font: inherit; font-size: 13px; font-weight: 700; padding: 7px 12px; color: var(--text); background: #fff; border: 1px solid var(--border); border-radius: 8px; cursor: pointer; flex-shrink: 0; }
.topnav { position: fixed; inset: 0 auto 0 0; width: var(--sidebar-width); z-index: 20; overflow-y: auto; overscroll-behavior: contain; background: #f8fafc; border-right: 1px solid var(--border); }
.topnav-in { padding: 28px 18px; }
.topnav .brand { display: block; padding: 0 8px 22px; }
.nav-group + .nav-group { margin-top: 22px; }
.nav-group-title { padding: 0 10px; margin-bottom: 6px; color: var(--text-3); font-size: 11px; font-weight: 700; letter-spacing: .08em; }
.topnav a.nl { display: block; padding: 8px 10px; margin: 2px 0; border-radius: 7px; font-size: 13px; color: var(--text-2); text-decoration: none; overflow-wrap: anywhere; }
.topnav a.nl:hover { color: var(--primary-dark); background: #eef2ff; }
.topnav a.nl.on, .topnav a.nl[aria-current="page"] { color: var(--primary-dark); font-weight: 700; background: #e8eaff; }

.page { width: calc(100% - var(--sidebar-width)); max-width: 980px; margin-left: var(--sidebar-width); padding: 40px 40px 80px; min-width: 0; overflow-wrap: anywhere; }
.page-toc { margin-bottom: 28px; padding: 14px 18px; border: 1px solid var(--border); border-radius: var(--r-sm); background: #f8fafc; font-size: 12.5px; }
.toc-title { font-size: 11px; font-weight: 700; color: var(--text-3); margin-bottom: 6px; }
.page-toc ol { padding-left: 20px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; row-gap: 4px; }
.page-toc a { color: var(--text-2); text-underline-offset: 3px; }
.page-toc a:hover { color: var(--primary-dark); }
.page [id], .page [data-panel] { scroll-margin-top: var(--anchor-offset); }
body[data-standalone] [data-panel] + [data-panel] { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--border); }
.js body[data-standalone] [data-panel] { margin-top: 0; padding-top: 0; border-top: 0; }
.hero.home-hero { text-align: left; margin-bottom: 28px; }
.hero.home-hero .sub { margin-left: 0; }
.hero.home-hero .tag { letter-spacing: 0; }
.home-note { color: var(--text-2); font-size: 12.5px; margin: 12px 0 16px; }
.home-section .section-hd { margin-top: 30px; }
.home-section .btn-row { justify-content: flex-start; margin-top: 0; }
.home-section .section-hd .ico-wrap { color: #fff; font-size: 13px; width: 32px; height: 32px; border-radius: 8px; }
@media (min-width: 1400px) {
  .page { margin-left: calc(var(--sidebar-width) + (100vw - var(--sidebar-width) - 980px) / 2); }
}
.hero { text-align: center; margin-bottom: 40px; }
.hero .tag { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--border); padding: 6px 16px; border-radius: 100px; font-size: 12px; font-weight: 600; color: var(--primary); letter-spacing: 1px; margin-bottom: 18px; }
.hero .tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.hero h1 { font-size: 32px; font-weight: 800; line-height: 1.35; letter-spacing: -0.3px; margin-bottom: 14px; }
.hero .sub { color: var(--text-2); font-size: 15px; max-width: 720px; margin: 0 auto; }
.btn-row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.btn { display: inline-block; padding: 11px 22px; border-radius: 12px; font-weight: 700; font-size: 14px; text-decoration: none; border: 1px solid var(--border); background: #fff; color: var(--text); cursor: pointer; font-family: inherit; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn:hover { transform: translateY(-1px); }

.glass { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.process { padding: 32px; margin-bottom: 24px; }
.process h3.blk { font-size: 16px; font-weight: 700; margin: 26px 0 10px; }
.process h3.blk:first-child { margin-top: 0; }
.process p.body, .process ul.body, .process ol.body { color: var(--text-2); font-size: 14px; line-height: 1.85; margin-bottom: 14px; }
.process ul.body, .process ol.body { padding-left: 22px; }
.process ul.body li, .process ol.body li { margin-bottom: 4px; }
.statement { padding: 26px 30px; margin-bottom: 24px; font-size: 15px; line-height: 1.95; border-left: 4px solid var(--primary); }

.section-hd { display: flex; align-items: center; gap: 14px; margin: 44px 0 18px; }
.section-hd:first-of-type { margin-top: 8px; }
.section-hd .ico-wrap { width: 42px; height: 42px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; color: #fff; background: var(--primary); }
.section-hd .ico-wrap.green { background: linear-gradient(135deg, #10b981, #059669); }
.section-hd .ico-wrap.orange { background: linear-gradient(135deg, #f59e0b, #d97706); }
.section-hd .ico-wrap.pink { background: linear-gradient(135deg, #ec4899, #f43f5e); }
.section-hd .ico-wrap.blue { background: linear-gradient(135deg, #3b82f6, #6366f1); }
.section-hd .ico-wrap.slate { background: linear-gradient(135deg, #64748b, #475569); }
.section-hd h2 { font-size: 21px; font-weight: 700; }
.section-hd .sec-sub { font-size: 12.5px; color: var(--text-3); font-weight: 500; }

.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 12px; margin-bottom: 20px; }
.card { background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); padding: 18px 20px; min-width: 0; }
a.card { text-decoration: none; color: inherit; display: block; transition: all .2s; }
a.card:hover { background: #fff; box-shadow: 0 4px 20px var(--glow); transform: translateY(-2px); }
.card .card-title { font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.card .card-body { color: var(--text-2); font-size: 13px; line-height: 1.7; }
.card ol, .card ul { padding-left: 18px; color: var(--text-2); font-size: 13px; }
.card .lbl { font-size: 11px; font-weight: 700; letter-spacing: 1px; color: var(--primary); margin-bottom: 4px; }

.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
.flow .card { position: relative; }
.flow .card:not(:last-child)::after { content: '→'; position: absolute; right: -12px; top: 50%; transform: translateY(-50%); color: var(--primary); font-weight: 800; }

.tbl-wrap { max-width: 100%; overflow-x: auto; margin-bottom: 20px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #fff; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { background: linear-gradient(135deg, #eef2ff, #e0e7ff); color: var(--primary-dark); font-weight: 600; text-align: left; padding: 11px 13px; white-space: nowrap; border-bottom: 2px solid rgba(99,102,241,0.15); }
table.tbl td { padding: 10px 13px; border-bottom: 1px solid var(--border); color: var(--text-2); line-height: 1.65; vertical-align: top; }
table.tbl tr:last-child td { border-bottom: none; }
table.tbl td strong { color: var(--text); }
table.tbl td:first-child { min-width: 96px; }

.box { border-radius: var(--r-sm); padding: 16px 20px; margin-bottom: 18px; font-size: 13.5px; line-height: 1.8; display: flex; gap: 12px; align-items: flex-start; }
.box .box-ico { width: 24px; height: 24px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 13px; flex-shrink: 0; margin-top: 1px; }
.box.info { background: linear-gradient(135deg, #eff6ff, #dbeafe); border: 1px solid rgba(59,130,246,0.2); color: #1e40af; }
.box.info .box-ico { background: rgba(59,130,246,0.15); }
.box.success { background: linear-gradient(135deg, #f0fdf4, #dcfce7); border: 1px solid rgba(16,185,129,0.2); color: #166534; }
.box.success .box-ico { background: rgba(16,185,129,0.15); }
.box.error { background: linear-gradient(135deg, #fef2f2, #fee2e2); border: 1px solid rgba(239,68,68,0.2); color: #991b1b; }
.box.error .box-ico { background: rgba(239,68,68,0.15); }
.box.warn { background: linear-gradient(135deg, #fffbeb, #fef3c7); border: 1px solid rgba(234,179,8,0.3); color: #78350f; }
.box.warn .box-ico { background: rgba(234,179,8,0.2); }

.checklist { background: linear-gradient(135deg, #eef2ff, #e0e7ff); border: 1px solid rgba(99,102,241,0.15); border-radius: var(--r-sm); padding: 18px 22px; margin-bottom: 20px; }
.checklist .ck-title { font-size: 13px; font-weight: 700; color: var(--primary-dark); margin-bottom: 8px; }
.checklist ol, .checklist ul { padding-left: 20px; font-size: 13.5px; }
.checklist li { margin-bottom: 3px; }

pre.code { background: #1e293b; color: #e2e8f0; border-radius: var(--r-sm); padding: 18px 20px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.7; overflow-x: auto; margin-bottom: 18px; white-space: pre-wrap; word-break: break-word; }
.prompt-wrap { position: relative; margin-bottom: 18px; }
.prompt-wrap pre.code { margin-bottom: 0; max-height: 520px; overflow: auto; }
.prompt-label { display: inline-flex; max-width: 100%; overflow-wrap: anywhere; font-size: 12px; font-weight: 700; color: var(--primary-dark); background: rgba(99,102,241,0.08); border: 1px solid rgba(99,102,241,0.15); border-bottom: none; border-radius: 8px 8px 0 0; padding: 5px 14px; }
.prompt-wrap .prompt-label + .copy-btn + pre.code { border-top-left-radius: 0; }
.copy-btn { position: absolute; top: 38px; right: 12px; background: rgba(99,102,241,0.9); color: #fff; border: none; border-radius: 8px; padding: 6px 14px; font-size: 12px; font-weight: 600; cursor: pointer; font-family: inherit; z-index: 2; }
.prompt-wrap.nolabel .copy-btn { top: 10px; }

details.acc[id], .section-hd[id], section[id] { scroll-margin-top: var(--anchor-offset); }
details.acc { background: #fff; border: 1px solid var(--border); border-radius: var(--r-sm); margin-bottom: 10px; min-width: 0; }
details.acc > summary { cursor: pointer; padding: 14px 18px; font-weight: 700; font-size: 14.5px; list-style: none; display: flex; flex-wrap: wrap; overflow-wrap: anywhere; justify-content: space-between; gap: 12px; }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: '＋'; color: var(--primary); }
details.acc[open] > summary::after { content: '－'; }
details.acc > summary .s { font-weight: 400; color: var(--text-3); font-size: 12.5px; margin-left: auto; }
details.acc .tbl td:first-child { width: 150px; white-space: nowrap; }
details.acc > .acc-body { padding: 0 18px 16px; }

.pill { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 9px; border-radius: 99px; margin-right: 4px; white-space: nowrap; }
.pill.err { background: #fee2e2; color: #991b1b; }
.pill.warn { background: #fef3c7; color: #92400e; }
.pill.info { background: #e0e7ff; color: #3730a3; }
.pill.ok { background: #dcfce7; color: #166534; }

.vt-controls { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; font-size: 13px; }
.vt-controls select, .vt-controls input { font-family: inherit; font-size: 13px; padding: 7px 10px; border-radius: 8px; border: 1px solid var(--border); background: #fff; }
textarea.vt-input { width: 100%; min-height: 220px; font-family: "SF Mono", Menlo, Consolas, monospace; font-size: 12px; padding: 14px; border-radius: var(--r-sm); border: 1px solid var(--border); background: #0f172a; color: #e2e8f0; margin-bottom: 12px; }
.vt-summary { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-bottom: 12px; }
.vt-summary .card { padding: 10px 14px; text-align: center; }
.vt-summary .n { font-size: 20px; font-weight: 800; color: var(--primary-dark); }
.vt-summary .t { font-size: 12px; color: var(--text-2); }

.footer-note { text-align: center; color: var(--text-3); font-size: 12px; margin-top: 56px; line-height: 1.9; }
.footer-note a { color: var(--text-2); }

.page[id] { scroll-margin-top: var(--anchor-offset); }
.section-hd > div, .box > div, .vt-controls > * { min-width: 0; }
.vt-controls > *, .vt-controls input, .vt-controls select { max-width: 100%; }
.prompt-wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; min-width: 0; }
.prompt-label { display: block; width: fit-content; min-width: 0; grid-column: 1; grid-row: 1; word-break: break-word; }
.prompt-wrap .copy-btn { position: static; grid-column: 2; grid-row: 1; align-self: start; margin: 0 0 6px 8px; }
.prompt-wrap pre.code { grid-column: 1 / -1; grid-row: 2; min-width: 0; max-width: 100%; }
details.acc > summary .s { min-width: 0; max-width: 100%; overflow-wrap: anywhere; }
details.acc > summary::after { flex-shrink: 0; }

@media (max-width: 1000px) {
  :root { --anchor-offset: 88px; }
  .mobile-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; position: sticky; top: 0; z-index: 25; height: 72px; padding: 12px 16px; background: #fff; border-bottom: 1px solid var(--border); }
  .mobile-header .brand { font-size: 13px; min-width: 0; overflow-wrap: anywhere; }
  .topnav { position: static; width: 100%; border-right: 0; border-bottom: 1px solid var(--border); }
  .topnav-in { padding: 18px 16px; }
  .topnav .brand { display: none; }
  .nav-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .nav-group + .nav-group { margin-top: 0; }
  .js .topnav { display: none; position: fixed; top: 72px; bottom: 0; width: min(340px, 100%); box-shadow: 8px 0 24px rgba(15,23,42,0.1); }
  .js .nav-links { display: block; }
  .js .nav-group + .nav-group { margin-top: 22px; }
  .js body.menu-open .topnav { display: block; }
  .page { width: 100%; max-width: 900px; margin: 0 auto; padding: 28px 24px 72px; }
}
@media (max-width: 680px) {
  .page { padding: 24px 16px 64px; }
  .hero h1 { font-size: 24px; }
  .hero .tag { padding: 5px 10px; }
  .page-toc ol { grid-template-columns: minmax(0, 1fr); }
  .flow { grid-template-columns: 1fr; }
  .flow .card:not(:last-child)::after { content: '↓'; right: 50%; top: auto; bottom: -16px; transform: none; }
  .process, .statement { padding: 22px 18px; }
  .btn { max-width: 100%; padding: 10px 16px; }
  .prompt-label { padding: 5px 10px; }
  details.acc > .acc-body { padding: 0 12px 12px; }
}
