/* jidodesk 共通スタイル（モバイル優先・ライト/ダーク両対応） */
:root {
  --bg: #f7f7f5;
  --surface: #ffffff;
  --text: #1f2328;
  --muted: #5f6670;
  --border: #d8dbe0;
  --accent: #1f6feb;
  --accent-text: #ffffff;
  --accent-soft: #e8f0fe;
  --warn-bg: #fff4e5;
  --warn-text: #7a4b00;
  --error: #c62828;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --surface: #1e2125;
    --text: #e6e8eb;
    --muted: #9aa1ab;
    --border: #353a41;
    --accent: #5b9dff;
    --accent-text: #0b1220;
    --accent-soft: #1d2a3d;
    --warn-bg: #3a2c12;
    --warn-text: #f3cf8a;
    --error: #ff7b7b;
  }
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  font-size: 16px;
  line-height: 1.7;
}
a { color: var(--accent); }
.container { max-width: 760px; margin: 0 auto; padding: 0 16px; }
main.container { padding-top: 16px; padding-bottom: 32px; }

/* ヘッダ・フッタ */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; }
.site-header .brand { font-weight: 700; font-size: 1.15rem; text-decoration: none; color: var(--text); }
.site-header nav a { text-decoration: none; font-size: 0.95rem; }
.site-footer { border-top: 1px solid var(--border); margin-top: 32px; padding: 20px 0 28px; font-size: 0.875rem; color: var(--muted); }
.site-footer ul { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* 見出し・本文 */
h1 { font-size: 1.5rem; line-height: 1.4; margin: 8px 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 8px; }
h3 { font-size: 1rem; margin: 16px 0 6px; }
.lead { color: var(--muted); margin: 0 0 16px; }
.small { font-size: 0.875rem; color: var(--muted); }

/* カード */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.card h2, .card h3 { margin-top: 0; }
.card-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .card-grid { grid-template-columns: 1fr 1fr; } }
a.card { display: block; text-decoration: none; color: inherit; margin: 0; }
a.card:hover, a.card:focus-visible { border-color: var(--accent); }
.badge { display: inline-block; font-size: 0.75rem; padding: 0 8px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); margin-left: 6px; vertical-align: middle; }
.badge.muted { background: transparent; border: 1px solid var(--border); color: var(--muted); }

/* フォーム */
.field { margin: 12px 0; }
.field > label, .field > .label { display: block; font-weight: 600; font-size: 0.9rem; margin-bottom: 4px; }
input[type="date"], input[type="number"], input[type="text"], input[type="month"], select, textarea {
  width: 100%; max-width: 100%; font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; min-height: 44px;
}
textarea { min-height: 96px; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0; font-weight: normal; }
.check input { width: 20px; height: 20px; margin: 0; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 600px) { .row.cols-2 { grid-template-columns: 1fr 1fr; } }
.inline { display: flex; gap: 8px; align-items: center; }
.inline input { width: 6em; }

/* ボタン */
.btn { display: inline-block; font: inherit; font-weight: 600; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-text); border-radius: 8px; padding: 8px 16px; min-height: 44px; cursor: pointer; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* タブ */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs button { font: inherit; background: none; border: none; border-bottom: 3px solid transparent; color: var(--muted); padding: 10px 12px; cursor: pointer; white-space: nowrap; min-height: 44px; }
.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
[role="tabpanel"][hidden] { display: none; }

/* 結果表示 */
.result { background: var(--accent-soft); border-radius: var(--radius); padding: 12px 16px; margin: 12px 0; }
.result .big { font-size: 1.5rem; font-weight: 700; line-height: 1.4; }
.result:empty { display: none; }
.result table { width: 100%; border-collapse: collapse; font-size: 0.9rem; margin-top: 8px; }
.result th, .result td { text-align: left; padding: 4px 6px; border-bottom: 1px solid var(--border); vertical-align: top; }
.scroll { max-height: 280px; overflow-y: auto; }
.warn { background: var(--warn-bg); color: var(--warn-text); border-radius: 8px; padding: 8px 12px; margin: 8px 0; font-size: 0.9rem; }
.error { color: var(--error); font-weight: 600; }

/* 広告枠のプレースホルダ */
.ad-slot { height: 90px; border: 2px dashed var(--border); border-radius: 8px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 0.8rem; margin: 16px 0; }

details > summary { cursor: pointer; font-weight: 600; }

/* ブログ（site/blog/ は tools/build-blog.mjs が生成する） */
.site-header nav { display: flex; gap: 16px; }
.post-list { display: grid; gap: 12px; }
.post-list .card h2 { font-size: 1.05rem; margin: 0 0 4px; }
.post-list .card p { margin: 0 0 4px; }
.post-meta { margin: 0 0 8px; }
.post-tags .badge { margin-left: 6px; }
.post-body h2 { font-size: 1.2rem; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.post-body blockquote { margin: 12px 0; padding: 4px 12px; border-left: 4px solid var(--border); color: var(--muted); }
.post-body code { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 0.9em; background: var(--accent-soft); border-radius: 4px; padding: 0 4px; }
.post-body pre { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px; overflow-x: auto; line-height: 1.5; }
.post-body pre code { background: none; padding: 0; }
.table-wrap { overflow-x: auto; margin: 12px 0; }
.post-body table { border-collapse: collapse; font-size: 0.9rem; min-width: 60%; }
.post-body th, .post-body td { border: 1px solid var(--border); padding: 4px 8px; text-align: left; vertical-align: top; }
.post-body th { background: var(--surface); }
.post-body .al-r { text-align: right; }
.post-body .al-c { text-align: center; }
.post-related .card { margin-top: 8px; }
.post-related .card h3 { margin-bottom: 4px; }
.post-back { margin-top: 24px; }
