/* tools/build_pages.py で作る静的ページの共通スタイル。配色・ヘッダーは計算機（src/App.tsx）とそろえる */
:root {
  --bg: #fbf5e6; --panel: #ffffff; --text: #333333; --sub: #7a7468; --accent: #2f8fd6;
  --heading: #eb9b34; --border: #e6e0d4; --row: #fdfaf2;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a202c; --panel: #2d3748; --text: #e2e8f0; --sub: #a0aec0; --accent: #63b3ed;
    --heading: #fbd38d; --border: #4a5568; --row: #283141;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1a202c; --panel: #2d3748; --text: #e2e8f0; --sub: #a0aec0; --accent: #63b3ed;
  --heading: #fbd38d; --border: #4a5568; --row: #283141;
  color-scheme: dark;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.7 system-ui, -apple-system, "Segoe UI", "Hiragino Sans", "Noto Sans JP", sans-serif;
}
a { color: var(--accent); }
.wrap { max-width: 1100px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
main.wrap { padding-block: 0 48px; }

/* ヘッダーは public/header.css（計算機と共通） */
header.site-header { padding-top: 20px; }

h1 { color: var(--heading); font-size: 24px; line-height: 1.3; margin: 8px 0 8px; text-wrap: balance; }
h2 { font-size: 20px; margin: 32px 0 8px; text-wrap: balance; }
h3 { font-size: 16px; margin: 20px 0 4px; }
.meta { color: var(--sub); font-size: 13px; }
.tools { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; max-width: none; }
.tools li { max-width: none; background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; }
.tools a { font-weight: 700; font-size: 16px; text-decoration: none; }
.tools p { margin: 4px 0 0; font-size: 13px; color: var(--sub); }

/* 表は狭い画面でも最低限の幅を保ち、はみ出す分は枠の中で横スクロールする */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--border); border-radius: 12px; background: var(--panel); margin-top: 16px; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
table.recipes { min-width: 600px; }
table.materials { min-width: 760px; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--border); }
th { background: var(--panel); font-size: 12px; letter-spacing: .04em; color: var(--sub); white-space: nowrap; }
tr:nth-child(even) td { background: var(--row); }
td.name { min-width: 11em; }
td.src { min-width: 9em; }
td.uses { min-width: 18em; }
td.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td .en { display: block; color: var(--sub); font-size: 12px; }
td ul { margin: 0; padding: 0; list-style: none; }
td li { white-space: nowrap; }
td li .qty { font-variant-numeric: tabular-nums; color: var(--sub); }
:target td { outline: 2px solid var(--accent); outline-offset: -2px; }
footer.site { border-top: 1px solid var(--border); color: var(--sub); font-size: 13px; }
footer.site .wrap { padding-block: 20px; }
