:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2733;
  --muted: #626d7d;
  --border: #e3e7ee;
  --accent: #2f6df6;
  --accent-weak: #eaf1ff;
  --ok: #1f9d5b;
  --warn: #d64545;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(20, 30, 50, .08), 0 8px 24px rgba(20, 30, 50, .06);
  --maxw: 960px;
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN",
    "Yu Gothic", "Meiryo", "Segoe UI", Roboto, sans-serif;
  line-height: 1.75;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* header */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 60px; }
.brand { font-weight: 700; font-size: 18px; color: var(--text); }
.brand:hover { text-decoration: none; }
.nav { margin-left: auto; display: flex; gap: 18px; font-size: 15px; }

/* hero */
.hero { padding: 48px 0 24px; }
.hero h1 { font-size: 30px; line-height: 1.4; margin: 0 0 12px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0; }

/* cards */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin: 24px 0; }
@media (max-width: 680px) { .grid { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow);
}
.card h3 { margin: 0 0 8px; font-size: 19px; }
.card p { margin: 0 0 14px; color: var(--muted); font-size: 15px; }

.badge {
  display: inline-block; font-size: 12px; color: var(--accent);
  background: var(--accent-weak); padding: 2px 10px; border-radius: 999px; margin-bottom: 10px;
}

/* buttons */
.btn {
  display: inline-block; cursor: pointer; border: 1px solid var(--accent);
  background: var(--accent); color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 15px; font-weight: 600; line-height: 1; text-align: center;
}
.btn:hover { text-decoration: none; opacity: .92; }
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.small { padding: 6px 12px; font-size: 13px; border-radius: 8px; }

/* main */
main { padding: 28px 0 56px; }
.page-title { font-size: 26px; margin: 8px 0 6px; }
.lead { color: var(--muted); margin: 0 0 24px; }
.section { margin: 30px 0; }
.section h2 { font-size: 20px; border-left: 4px solid var(--accent); padding-left: 10px; }
.prose p { margin: 0 0 12px; }
.prose ul { padding-left: 1.3em; }

/* tool shell */
.tool {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); margin: 18px 0;
}
.field { margin: 0 0 14px; }
.field label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.field input[type=text], .field textarea, .field select {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 15px; font-family: inherit; background: #fff; color: var(--text);
}
.field textarea { resize: vertical; min-height: 68px; }
.row { display: flex; gap: 12px; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }

.presets { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 14px; }

.status { font-size: 14px; padding: 8px 12px; border-radius: 8px; margin: 10px 0; }
.status.ok { background: #eaf7ef; color: var(--ok); }
.status.err { background: #fdecec; color: var(--warn); }

.result-box {
  background: var(--accent-weak); border: 1px solid #d6e2ff;
  border-radius: 10px; padding: 14px 16px; font-size: 16px; margin: 10px 0;
}

table.times { width: 100%; border-collapse: collapse; font-size: 15px; }
table.times th, table.times td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--border); }
table.times th { color: var(--muted); font-weight: 600; width: 44px; }

/* canvas */
.canvas-wrap { text-align: center; background: #f0f2f6; border-radius: 10px; padding: 16px; margin: 10px 0; overflow: hidden; }
[data-ogp-canvas] { max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.swatch { width: 30px; height: 30px; border-radius: 50%; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--border); cursor: pointer; }
.swatch.active { box-shadow: 0 0 0 2px var(--accent); }

/* related links */
.related { display: flex; flex-wrap: wrap; gap: 8px; }
.related a {
  font-size: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: 999px; padding: 6px 14px;
}

/* footer */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 26px 0; margin-top: 40px; }
.site-footer .container { color: var(--muted); font-size: 14px; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.site-footer .nav { margin-left: auto; }

/* code blocks */
pre {
  background: #101826; color: #e6edf7; padding: 14px 16px; border-radius: 10px;
  overflow-x: auto; font-size: 13.5px; line-height: 1.6;
}
pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
code {
  background: var(--accent-weak); color: #24427e; padding: 1px 6px;
  border-radius: 5px; font-size: .92em;
}

.note { font-size: 13px; color: var(--muted); }
.breadcrumb { font-size: 13px; color: var(--muted); margin: 6px 0 14px; }
.breadcrumb a { color: var(--muted); }
