/* API の使い方 */
.wrap { max-width: 1040px; margin: 0 auto; padding: 0 28px; }
@media (max-width: 560px) { .wrap { padding: 0 18px; } }

/* --- Hero: 取扱説明書の表紙 + 動くコンソール ---------------------------------- */
.cover { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 40px; align-items: center; padding: 3vh 0 40px; }
@media (max-width: 860px) { .cover { grid-template-columns: 1fr; } }
.cover h1 { margin: 0 0 18px; font-family: var(--display); font-size: clamp(34px, 4.6vw, 54px); line-height: 1.15; }
.cover h1 span { color: var(--brass-ink); }
.cover h1 .nw { white-space: nowrap; }
.cover h1 .nw:first-child { color: inherit; }
.cover p { margin: 0 0 14px; color: var(--muted); }
.edition { display: inline-flex; gap: 10px; align-items: center; padding: 4px 12px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em; color: var(--muted); border: 1px solid var(--line-2); border-radius: 999px; }
.edition b { color: var(--brass-ink); font-weight: 700; }

.console {
  position: relative;
  padding: 44px 18px 18px;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.7;
  color: #e9e3d6;
  background: #0c0b08;
  border-radius: 16px;
  box-shadow: 0 30px 60px -30px var(--shadow), inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  min-height: 250px;
  overflow: hidden;
}
.console::before { content: "VAULT CONSOLE"; position: absolute; top: 14px; left: 18px; font-size: 10px; letter-spacing: 0.3em; color: #8e8a80; }
.console-dial { position: absolute; top: 10px; right: 14px; width: 26px; height: 26px; animation: spin 6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.console-lines { margin: 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.console-lines .p { color: #ffb547; }
.console-lines .c { color: #8a8576; }
.console-lines .k { color: #8df0b0; }
.cursor { display: inline-block; width: 8px; height: 1.1em; vertical-align: -0.2em; background: #ffb547; animation: blink 1s steps(1) infinite; }

/* --- キーワードの入力 (扉の液晶と同じ見た目) -------------------------------------- */
.keyplate {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  margin-bottom: 8px;
  background: var(--panel);
  border: 1px solid var(--line-2);
  border-radius: 16px;
}
@media (max-width: 640px) { .keyplate { grid-template-columns: 1fr; } }
.keyplate label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.2em; color: var(--muted); }
.lcd {
  width: 100%;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #ffb547;
  text-shadow: 0 0 10px rgba(255, 181, 71, 0.6);
  caret-color: #ffb547;
  background: #0c0b08;
  border: 0;
  border-radius: 8px;
  box-shadow: inset 0 2px 10px #000;
}
.lcd::placeholder { color: #5a4f3a; text-shadow: none; }
.lcd:focus { outline: none; box-shadow: inset 0 2px 10px #000, 0 0 0 2px var(--brass); }
.key-note { margin: 0 0 30px; font-size: 13px; color: var(--muted); }
.key-note b { color: var(--err); font-weight: 600; }
.key-problem { margin-top: -22px; color: var(--err); }

/* --- 切り替えバー: やりたいこと (下線のタブ) + OS (2 択のスイッチ) --------------- */
.panel-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px 24px;
  margin: 0 -28px;
  padding: 10px 28px 0;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-2);
}
@media (max-width: 560px) { .panel-bar { margin: 0 -18px; padding: 8px 18px 0; } }
.positions { display: flex; gap: 6px; }
.positions button {
  position: relative;
  padding: 12px 14px 14px;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  transition: color .2s;
}
.positions button::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--brass); transform: scaleX(0); transition: transform .35s var(--ease); }
.positions button:hover { color: var(--text); }
.positions button[aria-selected="true"] { color: var(--text); }
.positions button[aria-selected="true"]::after { transform: scaleX(1); }

.lever { display: inline-flex; margin-bottom: 9px; padding: 3px; background: var(--steel); border-radius: 10px; }
.lever button { padding: 6px 12px; font-size: 13px; font-weight: 700; color: var(--muted); background: none; border: 0; border-radius: 7px; cursor: pointer; transition: color .2s, background .2s, box-shadow .2s; }
.lever button[aria-pressed="true"] { color: var(--text); background: var(--panel); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25); }

/* --- 本文 ------------------------------------------------------------------- */
.doc { padding-top: 10px; }
.doc[data-os="unix"] [data-os="windows"], .doc[data-os="windows"] [data-os="unix"] { display: none; }
.doc[data-current="spec"] .os-intro { display: none; }

/* はじめに: 手順と同じ並びで、番号の代わりに小さな見出しを置く */
.caution { display: grid; grid-template-columns: 96px minmax(0, 1fr); padding: 30px 0; border-bottom: 1px solid var(--line); }
.caution-head { padding-top: 3px; font-size: 13px; font-weight: 700; color: var(--brass-ink); }
.caution-body p { margin: 0 0 10px; color: var(--muted); }
.caution-body p:last-child { margin-bottom: 0; }
.caution-body strong { color: var(--text); }
@media (max-width: 640px) { .caution { grid-template-columns: 1fr; gap: 6px; } }

/* 手順: 囲みを使わず、左の列に大きな白抜きの番号を置く */
.page {
  position: relative;
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  padding: 34px 0 26px;
  border-bottom: 1px solid var(--line);
  opacity: 0;
  transform: translateY(30px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.page > * { grid-column: 2; min-width: 0; }
.page.is-in { opacity: 1; transform: none; }
.page-head { display: contents; }
.plate {
  grid-column: 1;
  grid-row: 1 / span 20;
  align-self: start;
  font-family: var(--display);
  font-size: 46px;
  font-weight: 700;
  line-height: 1;
  color: transparent;
  -webkit-text-stroke: 1.2px var(--muted);
  transition: color .5s, -webkit-text-stroke-color .5s;
}
.page.is-in .plate { color: color-mix(in srgb, var(--brass) 14%, transparent); -webkit-text-stroke-color: var(--brass-ink); }
.page h2 { grid-column: 2; margin: 4px 0 10px; }
@media (max-width: 640px) {
  .page, .caution { grid-template-columns: 52px minmax(0, 1fr); }
  .caution { grid-template-columns: 1fr; }
  .plate { font-size: 30px; }
}
.page h2 { font-size: 21px; }
.page h3 { margin: 22px 0 6px; font-size: 16px; }
.page p, .page li { color: var(--muted); }
.page strong { color: var(--text); }
.page p code, .page li code, .page td code { padding: 0.1em 0.4em; font-family: var(--mono); font-size: 0.88em; color: var(--text); background: var(--steel); border-radius: 4px; }


/* コマンド */
.code { position: relative; margin: 10px 0 14px; }
.code pre {
  margin: 0;
  padding: 14px 92px 14px 16px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.65;
  color: #e9e3d6;
  background: var(--code-bg);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.07);
}
.code pre::before { content: "$ "; color: #ffb547; }
.code .cont { color: #8a8576; }
.code.is-json pre::before { content: none; }
.code [data-kw] { color: #ffb547; }
.copy {
  position: absolute;
  top: 8px;
  right: 8px;
  min-height: 30px;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1a1206;
  background: #ffb547;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  transition: transform .2s var(--spring);
}
.copy:hover { transform: scale(1.06); }
.copy.is-done { color: #0b2a1c; background: #8df0b0; }

.scroll-x { overflow-x: auto; }
.table { width: 100%; font-size: 14px; border-collapse: collapse; }
.table th, .table td { padding: 9px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.table th { white-space: nowrap; color: var(--text); }
.table td { color: var(--muted); }

.back-to { display: flex; justify-content: center; margin: 40px 0 10px; }
