:root {
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #eef1f7;
  --text: #1b2130;
  --muted: #5b6478;
  --border: #d9deea;
  --accent: #1f6feb;
  --accent-soft: #e3edff;
  --ok: #1a7f37;
  --ok-soft: #dcf5e3;
  --ng: #c62828;
  --ng-soft: #fde4e4;
  --warn: #9a6700;
  --warn-soft: #fff4d6;
  --term-bg: #0e1420;
  --term-text: #d5e1f5;
  --term-prompt: #5fd38d;
  --radius: 10px;
  --mono: "Cascadia Code", "Consolas", "Menlo", monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f131b;
    --surface: #171c27;
    --surface-2: #1f2633;
    --text: #e6eaf2;
    --muted: #9aa4b8;
    --border: #2c3445;
    --accent: #5b9dff;
    --accent-soft: #1b2a45;
    --ok: #4cc172;
    --ok-soft: #15301f;
    --ng: #ff6b6b;
    --ng-soft: #3a1a1d;
    --warn: #e3b341;
    --warn-soft: #3a2f12;
  }
}
:root[data-theme="dark"] {
  --bg: #0f131b;
  --surface: #171c27;
  --surface-2: #1f2633;
  --text: #e6eaf2;
  --muted: #9aa4b8;
  --border: #2c3445;
  --accent: #5b9dff;
  --accent-soft: #1b2a45;
  --ok: #4cc172;
  --ok-soft: #15301f;
  --ng: #ff6b6b;
  --ng-soft: #3a1a1d;
  --warn: #e3b341;
  --warn-soft: #3a2f12;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", system-ui, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}
a { color: var(--accent); }
code, pre, kbd { font-family: var(--mono); }
code { background: var(--surface-2); padding: 1px 6px; border-radius: 5px; font-size: .92em; }

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.site-header .inner {
  max-width: 1080px; margin: 0 auto; padding: 10px 16px;
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
}
.brand { font-weight: 700; text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 8px; }
.brand .logo { width: 28px; height: 28px; border-radius: 7px; background: var(--accent); color: #fff; display: grid; place-items: center; font-size: 15px; }
.site-header nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.site-header nav a { text-decoration: none; color: var(--muted); padding: 4px 10px; border-radius: 6px; font-size: 14px; }
.site-header nav a:hover, .site-header nav a.active { background: var(--accent-soft); color: var(--accent); }
.theme-btn { border: 1px solid var(--border); background: var(--surface-2); color: var(--text); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-size: 14px; }

main { max-width: 1080px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.8rem; line-height: 1.35; margin: 8px 0 12px; }
h2 { font-size: 1.3rem; margin: 36px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }
h3 { font-size: 1.08rem; margin: 22px 0 8px; }
.lead { color: var(--muted); font-size: 1.02rem; }

.hero {
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
  border: 1px solid var(--border); border-radius: 14px;
  padding: 28px 24px; margin-bottom: 28px;
}
.hero h1 { font-size: 2rem; }

.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; display: flex; flex-direction: column; gap: 8px;
}
a.card { text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card .tag { font-size: 12px; color: var(--accent); font-weight: 600; letter-spacing: .03em; }
.card h3 { margin: 0; }
.card p { margin: 0; color: var(--muted); font-size: 14px; }
.card .status { font-size: 13px; margin-top: auto; color: var(--muted); }
.card .status.done { color: var(--ok); font-weight: 600; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin: 16px 0; }
.two-col { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
@media (max-width: 780px) { .two-col { grid-template-columns: 1fr; } }

.note { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; margin: 14px 0; }
.note.warn { border-color: var(--warn); background: var(--warn-soft); }
.note.ok { border-color: var(--ok); background: var(--ok-soft); }
.note.ng { border-color: var(--ng); background: var(--ng-soft); }

.steps { counter-reset: s; padding-left: 0; list-style: none; }
.steps li { counter-increment: s; position: relative; padding-left: 36px; margin: 8px 0; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; display: grid; place-items: center; }

button, .btn {
  font: inherit; font-size: 14px; cursor: pointer;
  border: 1px solid var(--accent); background: var(--accent); color: #fff;
  border-radius: 7px; padding: 7px 14px;
}
button.secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
button.ok { background: var(--ok); border-color: var(--ok); }
button.ng { background: var(--ng); border-color: var(--ng); }
button:disabled { opacity: .5; cursor: default; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 10px 0; }

input[type=text], input[type=password], input[type=url], textarea, select {
  font: inherit; width: 100%; padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
}
textarea { font-family: var(--mono); font-size: 14px; line-height: 1.55; resize: vertical; tab-size: 2; }
label { font-size: 14px; color: var(--muted); }

.code-editor { min-height: 220px; white-space: pre; overflow-x: auto; }
pre.code { background: var(--term-bg); color: var(--term-text); padding: 14px; border-radius: 8px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; margin: 10px 0; }

.terminal {
  background: var(--term-bg); color: var(--term-text); font-family: var(--mono);
  border-radius: 10px; padding: 12px 14px; font-size: 13.5px; height: 360px; overflow-y: auto;
  border: 1px solid #222b3b;
}
.terminal .line { white-space: pre-wrap; word-break: break-all; }
.terminal .prompt { color: var(--term-prompt); }
.terminal .err { color: #ff8a8a; }
.terminal .hl { color: #ffd479; }
.terminal .input-row { display: flex; gap: 6px; }
.terminal input {
  flex: 1; background: transparent; border: none; outline: none; color: var(--term-text);
  font: inherit; padding: 0;
}

.result { padding: 10px 14px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.result.ok { background: var(--ok-soft); color: var(--ok); border: 1px solid var(--ok); }
.result.ng { background: var(--ng-soft); color: var(--ng); border: 1px solid var(--ng); }
.result.info { background: var(--surface-2); border: 1px solid var(--border); }
.result ul { margin: 6px 0 0; padding-left: 20px; }

.meter { height: 10px; background: var(--surface-2); border-radius: 6px; overflow: hidden; border: 1px solid var(--border); }
.meter > span { display: block; height: 100%; width: 0; transition: width .2s, background .2s; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th, table.t td { border-bottom: 1px solid var(--border); padding: 8px; text-align: left; vertical-align: top; }
table.t th { color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }

.msg {
  background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font-size: 14.5px;
}
.msg .from { font-size: 12.5px; color: var(--muted); margin-bottom: 4px; }
.msg .body { white-space: pre-wrap; word-break: break-all; }

.progress-bar { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.progress-bar .meter { flex: 1; max-width: 320px; }

.checklist label { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; color: var(--text); font-size: 15px; cursor: pointer; }
.checklist input { margin-top: 6px; }

.pill { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 99px; border: 1px solid var(--border); color: var(--muted); }
.pill.red { color: var(--ng); border-color: var(--ng); }
.pill.green { color: var(--ok); border-color: var(--ok); }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 13px; text-align: center; padding: 20px 16px; }

details { background: var(--surface-2); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
details summary { cursor: pointer; font-weight: 600; font-size: 14px; }

@media (max-width: 600px) {
  .site-header { position: static; }
  .site-header .inner { gap: 8px; }
  .site-header nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; }
  .site-header nav a { white-space: nowrap; }
  .theme-btn { margin-left: auto; }
  h1 { font-size: 1.45rem; }
  .hero h1 { font-size: 1.6rem; }
  .terminal { height: 300px; font-size: 12.5px; }
}
