:root {
  --ink: #1f2530;
  --muted: #5d6673;
  --line: #e1e5eb;
  --bg-soft: #f6f8fa;
  --accent: #0b6bcb;
  --accent-ink: #ffffff;
  --danger: #b42318;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Yu Gothic UI", Meiryo, sans-serif;
  color: var(--ink);
  line-height: 1.7;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: #fff; }
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
figure { margin: 16px 0 20px; }
figure img { display: block; border: 1px solid var(--line); border-radius: 8px; }

.site-header { border-bottom: 1px solid var(--line); background: #fff; }
.site-header .inner, .site-footer .inner, main {
  max-width: 1180px; margin: 0 auto; padding: 0 20px;
}
.site-header .inner { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 24px; min-height: 56px; }
.logo { font-weight: 700; font-size: 18px; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.logo span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 14px; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; }

main { padding-top: 24px; padding-bottom: 48px; }
h1 { font-size: 26px; line-height: 1.35; margin: 0 0 6px; }
.lead { color: var(--muted); margin: 0 0 20px; }
h2 { font-size: 20px; margin: 40px 0 12px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
h3 { font-size: 16px; margin: 24px 0 8px; }
.prose { max-width: 760px; }
.prose li { margin: 4px 0; }
code { background: var(--bg-soft); padding: 1px 5px; border-radius: 4px; font-size: .92em; }
pre { background: var(--bg-soft); padding: 12px 14px; border-radius: 8px; overflow-x: auto; font-size: 13px; line-height: 1.5; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; vertical-align: top; }
th { background: var(--bg-soft); font-weight: 600; }

/* ツール */
.tool { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 20px; align-items: start; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; background: #fff; }
.panel h2 { font-size: 15px; margin: 0 0 8px; padding: 0; border: 0; }
.field-label { display: block; font-size: 13px; font-weight: 600; margin: 14px 0 4px; }
.field-label:first-child { margin-top: 0; }
textarea {
  width: 100%; min-height: 190px; resize: vertical; font: 13px/1.45 ui-monospace, SFMono-Regular, Consolas, monospace;
  border: 1px solid #c6ccd5; border-radius: 8px; padding: 8px; color: var(--ink);
}
input[type="text"] { width: 100%; font: inherit; font-size: 14px; border: 1px solid #c6ccd5; border-radius: 6px; padding: 5px 8px; }
select { font: inherit; font-size: 13px; padding: 4px 6px; border: 1px solid #c6ccd5; border-radius: 6px; background: #fff; }
.hint { font-size: 12px; color: var(--muted); margin: 4px 0 0; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.labels-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 8px; align-items: center; font-size: 13px; }

button, .button {
  font: inherit; font-size: 14px; padding: 7px 14px; border-radius: 8px; border: 1px solid #c6ccd5;
  background: #fff; color: var(--ink); cursor: pointer; text-decoration: none; display: inline-block;
}
button:hover:not(:disabled) { background: var(--bg-soft); }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
button.primary:hover { background: #0a5cae; }
button:disabled { opacity: .45; cursor: not-allowed; }
button.small { font-size: 13px; padding: 4px 10px; }

.errors { margin-top: 12px; border: 1px solid #f3c2bd; background: #fff5f4; color: var(--danger); border-radius: 8px; padding: 8px 12px; font-size: 13px; }
.errors p { margin: 0 0 4px; }
.errors ul { margin: 0; padding-left: 18px; }

.plot-wrap { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.plot { height: 560px; position: relative; background: #fff; }
.plot-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center;
  color: var(--muted); font-size: 14px; padding: 20px; pointer-events: none; z-index: 2;
}
.plot-toolbar { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 13px; }
.plot-toolbar .spacer { flex: 1; }
.plot-toolbar label { display: inline-flex; align-items: center; gap: 6px; }
.status { font-size: 13px; color: var(--muted); padding: 6px 2px 0; min-height: 1.7em; }
.confirm { margin-top: 0; padding: 10px 12px; border-top: 1px solid var(--line); background: #fffaeb; font-size: 13px; }
.confirm p { margin: 0 0 8px; }

/* 広告枠:設定するまでは何も表示しない */
.ad-slot { margin: 28px auto; text-align: center; min-height: 0; }
.ad-slot:empty { display: none; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.card { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card h3 { margin: 0 0 6px; font-size: 15px; }
.card p { margin: 0 0 10px; font-size: 14px; color: var(--muted); }
.steps { counter-reset: step; list-style: none; padding: 0; }
.steps li { counter-increment: step; position: relative; padding-left: 38px; margin: 12px 0; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 1px; width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center;
}
.note { background: var(--bg-soft); border-left: 3px solid var(--accent); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 14px; }
details { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin: 10px 0; }
details summary { font-weight: 600; cursor: pointer; }
details p { margin: 8px 0 0; }

.site-footer { border-top: 1px solid var(--line); background: var(--bg-soft); font-size: 13px; color: var(--muted); }
.site-footer .inner { padding-top: 18px; padding-bottom: 24px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.site-footer a { color: var(--muted); }

@media (max-width: 860px) {
  .tool { grid-template-columns: 1fr; }
  .plot { height: 380px; }
  h1 { font-size: 22px; }
}

.breadcrumb { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.breadcrumb a { color: var(--muted); }
.meta { font-size: 12px; color: var(--muted); }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { text-decoration: underline; }
