:root {
  --bg: #f4f1ea;
  --surface: #ffffff;
  --surface-2: #ece6da;
  --text: #2b2620;
  --muted: #6e655a;
  --border: #d8cfbf;
  --accent: #4f8a2b;
  --accent-ink: #ffffff;
  --accent-soft: #e3efd6;
  --dirt: #7a5537;
  --link: #2f6fb0;
  --mark: #fff0a3;
  --tip-bg: #e6f2fb; --tip-bd: #3d8bd0;
  --warn-bg: #fdf0e1; --warn-bd: #d9822b;
  --note-bg: #efeaf8; --note-bd: #7b61c4;
  --code-bg: #2b2620; --code-text: #f1ebe0;
  --shadow: 0 1px 0 rgba(0,0,0,.04), 0 4px 14px rgba(60,40,20,.06);
  --add-bg: #e3f6dc; --add-ink: #2d6a1a; --del-bg: #fde4e1; --del-ink: #a8321f; --danger: #c0392b;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1a1815; --surface: #24211d; --surface-2: #2e2a25; --text: #ece6dc; --muted: #a59b8d;
    --border: #3d3832; --accent: #6db33f; --accent-ink: #10180a; --accent-soft: #2a3a1f; --dirt: #a87a55;
    --link: #7fb5ec; --mark: #5c5220; --tip-bg: #1d2a36; --warn-bg: #362818; --note-bg: #2a2438;
    --code-bg: #12100e; --shadow: 0 1px 0 rgba(0,0,0,.2);
    --add-bg: #1f3a1a; --add-ink: #8fd16a; --del-bg: #3e1f1b; --del-ink: #f08b7a; --danger: #f0786a;
  }
}
:root[data-theme="dark"] {
  --bg: #1a1815; --surface: #24211d; --surface-2: #2e2a25; --text: #ece6dc; --muted: #a59b8d;
  --border: #3d3832; --accent: #6db33f; --accent-ink: #10180a; --accent-soft: #2a3a1f; --dirt: #a87a55;
  --link: #7fb5ec; --mark: #5c5220; --tip-bg: #1d2a36; --warn-bg: #362818; --note-bg: #2a2438;
  --code-bg: #12100e; --shadow: 0 1px 0 rgba(0,0,0,.2);
  --add-bg: #1f3a1a; --add-ink: #8fd16a; --del-bg: #3e1f1b; --del-ink: #f08b7a; --danger: #f0786a;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.8 "Noto Sans JP", system-ui, sans-serif;
}
a { color: var(--link); }
img { max-width: 100%; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }

/* header */
.site-header {
  background: var(--accent); color: var(--accent-ink);
  border-bottom: 6px solid var(--dirt);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { white-space: nowrap; font-family: "DotGothic16", monospace; font-size: 24px; color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.logo-block { width: 22px; height: 22px; background: linear-gradient(var(--accent-soft) 0 35%, var(--dirt) 35%); box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); }
.site-header nav { display: flex; gap: 18px; }
.site-header nav a { color: inherit; text-decoration: none; font-weight: 500; opacity: .9; }
.site-header nav a:hover, .site-header nav a.on { opacity: 1; text-decoration: underline; text-underline-offset: 5px; }

main { padding-top: 28px; padding-bottom: 40px; min-height: 70vh; }
.site-footer { color: var(--muted); font-size: 13px; padding-bottom: 28px; border-top: 1px solid var(--border); padding-top: 20px; }
.footer-links { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 24px; }
.footer-links h2 { font-size: 13px; margin: 0 0 6px; color: var(--text); }
.footer-links ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px 12px; }
.footer-links a { color: var(--muted); }
.footer-links a:hover { color: var(--link); }
.footer-about { margin: 18px 0 0; line-height: 1.7; }

h1, h2, h3 { line-height: 1.4; }
.page-title { font-family: "DotGothic16", monospace; font-size: 30px; margin: 0 0 4px; font-weight: 400; }
.lead { color: var(--muted); margin: 0 0 22px; }

/* filters */
.search {
  width: 100%; font: inherit; padding: 12px 14px; border: 2px solid var(--border);
  background: var(--surface); color: var(--text); border-radius: 6px;
}
.search:focus { outline: none; border-color: var(--accent); }
.filters { display: grid; gap: 8px; margin: 14px 0 22px; }
.filter-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-label { font-size: 13px; color: var(--muted); width: 84px; flex-shrink: 0; }
.chip {
  font: inherit; font-size: 13px; padding: 3px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
}
.chip:hover { border-color: var(--accent); }
.chip.on { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* cards */
.count { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.card {
  display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 8px;
  padding: 16px 18px; text-decoration: none; color: inherit; box-shadow: var(--shadow);
  transition: transform .12s, border-color .12s;
}
.card:hover { transform: translateY(-2px); border-color: var(--accent); }
.card h3 { margin: 0; font-size: 18px; }
.card p { margin: 6px 0 10px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.cat { font-size: 12px; color: var(--dirt); font-weight: 700; white-space: nowrap; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.tag { font-size: 12px; padding: 1px 8px; border-radius: 4px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.tag.ver { background: var(--accent-soft); }
a.tag:hover { outline: 1px solid var(--accent); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border-radius: 8px; border: 1px dashed var(--border); }

/* article */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumb a { color: var(--muted); }
.article { display: grid; grid-template-columns: 1fr 280px; gap: 28px; align-items: start; }
.article-main { min-width: 0; }
.infobox { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; position: sticky; top: 16px; }
.infobox-title { background: var(--dirt); color: #fff; padding: 8px 14px; font-weight: 700; }
.infobox img { display: block; width: 100%; background: var(--surface-2); }
.infobox dl { margin: 0; padding: 6px 14px 12px; }
.infobox dt { font-size: 12px; color: var(--muted); margin-top: 10px; }
.infobox dd { margin: 2px 0 0; font-size: 14px; word-break: break-all; }
.toc { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 18px; margin: 18px 0; display: inline-block; min-width: 220px; }
.toc strong { font-size: 13px; color: var(--muted); }
.toc ol { margin: 4px 0 0; padding-left: 20px; font-size: 14px; }

/* markdown */
.md h2 { font-size: 22px; border-bottom: 3px solid var(--accent); padding-bottom: 4px; margin: 34px 0 12px; }
.md h3 { font-size: 18px; border-left: 5px solid var(--dirt); padding-left: 10px; margin: 26px 0 10px; }
.md h4, .md h5 { font-size: 16px; margin: 20px 0 8px; }
.md p { margin: 0 0 14px; }
.md strong { font-weight: 700; }
.md mark { background: var(--mark); color: inherit; padding: 0 2px; }
.md code { background: var(--surface-2); padding: 1px 6px; border-radius: 4px; font-size: .9em; font-family: Consolas, monospace; }
.md pre { background: var(--code-bg); color: var(--code-text); padding: 14px 16px; border-radius: 6px; overflow-x: auto; }
.md pre code { background: none; padding: 0; color: inherit; }
.md ul, .md ol { padding-left: 24px; margin: 0 0 14px; }
.md li > ul, .md li > ol { margin: 0; }
.md hr { border: 0; border-top: 2px dashed var(--border); margin: 26px 0; }
.md blockquote { margin: 0 0 14px; padding: 8px 16px; border-left: 4px solid var(--border); color: var(--muted); background: var(--surface); }
.md .callout { color: var(--text); border-left-width: 5px; border-radius: 0 6px 6px 0; }
.md .callout-title { font-weight: 700; font-size: 14px; }
.md .callout.tip { background: var(--tip-bg); border-color: var(--tip-bd); }
.md .callout.warn { background: var(--warn-bg); border-color: var(--warn-bd); }
.md .callout.note { background: var(--note-bg); border-color: var(--note-bd); }
.md .callout p:last-child { margin-bottom: 0; }
.table-wrap { overflow-x: auto; margin: 0 0 16px; }
.md table { border-collapse: collapse; background: var(--surface); font-size: 14px; }
.md th, .md td { border: 1px solid var(--border); padding: 6px 12px; text-align: left; }
.md th { background: var(--surface-2); }
.md img { border-radius: 6px; }
.md a.missing { color: var(--danger); }

.help-table td { vertical-align: top; }
.help-table pre { margin: 0; white-space: pre-wrap; }

/* buttons / misc */
.btn {
  display: inline-flex; align-items: center; gap: 4px; font: inherit; font-size: 14px; font-weight: 500;
  padding: 6px 14px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface);
  color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn:disabled { opacity: .6; cursor: wait; }
.btns { display: flex; gap: 8px; flex-wrap: wrap; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--link); text-decoration: underline; cursor: pointer; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.loading { padding: 60px; text-align: center; color: var(--muted); }
.page-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.page-tools { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.page-tools .crumb, .page-tools .page-title { margin: 0; }
.page-foot { margin-top: 36px; padding-top: 12px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted); }
.card-meta { margin-top: 10px; font-size: 12px; color: var(--muted); }
.tag.loader { background: var(--surface); border: 1px solid var(--border); }
.filter-label small { font-size: 11px; }
.badge { display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--text); vertical-align: middle; }
.badge.new { background: var(--mark); }
.delta { font-size: 13px; font-variant-numeric: tabular-nums; color: var(--muted); }
.delta.plus { color: var(--add-ink); }
.delta.minus { color: var(--del-ink); }
.notice { background: var(--warn-bg); border-left: 4px solid var(--warn-bd); padding: 10px 14px; border-radius: 0 6px 6px 0; margin-bottom: 16px; }

/* edit form */
.edit-form { display: grid; gap: 16px; margin-top: 16px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 16px 18px; }
.panel h2 { font-size: 16px; margin: 0 0 12px; }
.panel h2 small { font-weight: 400; color: var(--muted); font-size: 13px; margin-left: 8px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.field { display: grid; gap: 4px; }
.field.wide { grid-column: 1 / -1; }
.field > span { font-size: 13px; font-weight: 500; }
.field small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.req { font-size: 10px; background: var(--danger); color: #fff; padding: 0 5px; border-radius: 3px; margin-left: 4px; font-weight: 500; }
.field input, .editor textarea {
  font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--bg); color: var(--text); width: 100%;
}
.field input:focus, .editor textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; }
.pick { display: grid; grid-template-columns: 120px 1fr; gap: 8px; padding: 8px 0; border-top: 1px dashed var(--border); }
.pick:first-of-type { border-top: 0; }
.pick-label { font-size: 13px; font-weight: 500; padding-top: 3px; }
.pick-row { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-row .chip.on::before { content: "✓ "; }
.toolbar { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
.toolbar button {
  font: inherit; font-size: 13px; min-width: 34px; height: 32px; padding: 0 8px; cursor: pointer;
  border: 1px solid var(--border); border-radius: 5px; background: var(--surface-2); color: var(--text);
}
.toolbar button:nth-child(1) { font-weight: 700; }
.toolbar button:nth-child(2) { font-style: italic; }
.toolbar button:nth-child(3) { text-decoration: line-through; }
.toolbar button:hover { border-color: var(--accent); }
.editor { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.editor-tabs { display: none; gap: 4px; }
.editor-tabs button {
  font: inherit; font-size: 14px; padding: 6px 14px; cursor: pointer; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted); border-radius: 6px 6px 0 0; border-bottom: 0;
}
.editor-tabs button.on { background: var(--accent-soft); color: var(--text); font-weight: 500; }
.editor textarea { min-height: 480px; resize: vertical; font-family: Consolas, "Noto Sans JP", monospace; font-size: 14px; line-height: 1.7; }
.preview { border: 1px dashed var(--border); border-radius: 6px; padding: 4px 16px; min-height: 480px; max-height: 70vh; overflow-y: auto; background: var(--bg); }
.form-error { color: var(--danger); margin: 10px 0; min-height: 1em; }
.save-panel .btns { justify-content: flex-end; }

/* history / diff */
table.history, table.meta-diff { border-collapse: collapse; width: 100%; background: var(--surface); font-size: 14px; }
.history th, .history td, .meta-diff th, .meta-diff td { border-bottom: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.history thead th, .meta-diff thead th { background: var(--surface-2); font-size: 13px; }
.meta-diff td.d-del { background: var(--del-bg); color: var(--del-ink); }
.meta-diff td.d-add { background: var(--add-bg); color: var(--add-ink); }
.rev-meta { margin: 0 0 16px; }
.rev-tabs { display: flex; margin-top: 8px; }
.rev-pane { border-top: 2px solid var(--accent-soft); padding-top: 8px; }
.rev-pane h3 { font-size: 16px; margin: 18px 0 8px; }
.diff { background: var(--surface); border: 1px solid var(--border); border-radius: 6px; overflow-x: auto; font-family: Consolas, "Noto Sans JP", monospace; font-size: 13px; line-height: 1.6; }
.d-line { white-space: pre-wrap; word-break: break-all; padding-right: 10px; }
.d-mark { display: inline-block; width: 24px; text-align: center; color: var(--muted); user-select: none; }
.d-line.d-add { background: var(--add-bg); color: var(--add-ink); }
.d-line.d-del { background: var(--del-bg); color: var(--del-ink); }
.d-skip { text-align: center; color: var(--muted); background: var(--surface-2); font-size: 12px; }
.recent { list-style: none; padding: 0; margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; }
.recent li { padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
.recent li:last-child { border-bottom: 0; }
.recent .muted { font-size: 13px; }

/* admin */
.site-banner { background: var(--warn-bg); border-bottom: 1px solid var(--warn-bd); text-align: center; padding: 6px 16px; font-size: 14px; font-weight: 500; }
.btn.danger { color: var(--danger); }
.btn.danger:hover { border-color: var(--danger); }
.btn[aria-disabled="true"] { color: var(--muted); cursor: default; }
.btn[aria-disabled="true"]:hover { border-color: var(--border); }
.danger-text { color: var(--danger); }
.badge.admin { background: #f6e08a; color: #5a4300; }
.notice.lock { background: var(--note-bg); border-color: var(--note-bd); }
.linkish.ban { font-size: 12px; color: var(--danger); margin-left: 6px; }
.admin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; margin-top: 8px; }
.admin-grid ul { margin: 0; padding-left: 20px; font-size: 14px; }
.admin-grid li { margin-bottom: 4px; }
.modal-bg { position: fixed; inset: 0; background: rgba(20,15,10,.55); display: grid; place-items: center; z-index: 50; padding: 16px; }
.modal { background: var(--surface); border-radius: 10px; padding: 22px 24px; width: min(360px, 100%); display: grid; gap: 12px; box-shadow: 0 12px 40px rgba(0,0,0,.3); border-top: 6px solid var(--dirt); }
.modal h2 { margin: 0; font-family: "DotGothic16", monospace; font-weight: 400; font-size: 22px; }
.modal .field.inline { grid-template-columns: 36px 1fr; align-items: center; }
.modal .field.inline > span { font-family: "DotGothic16", monospace; font-size: 16px; }
.modal.wide { width: min(760px, 100%); max-height: 90vh; overflow-y: auto; }
.modal select, .modal textarea { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); width: 100%; }
.modal .field input { font: inherit; font-size: 15px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; background: var(--bg); color: var(--text); width: 100%; }
.modal .form-error { margin: 0; }
.modal .btns { justify-content: flex-end; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 10px 18px; border-radius: 8px; z-index: 60; font-size: 14px; box-shadow: 0 6px 20px rgba(0,0,0,.25); }

/* header search */
.header-search input {
  font: inherit; font-size: 14px; width: 190px; padding: 5px 10px; border-radius: 6px;
  border: 1px solid rgba(255,255,255,.35); background: rgba(255,255,255,.15); color: var(--accent-ink);
}
.header-search input::placeholder { color: var(--accent-ink); opacity: .75; }
.header-search input:focus { outline: none; background: var(--surface); color: var(--text); }
.nav-badge { display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px; border-radius: 9px; background: var(--danger); color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.small { font-size: 13px; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0 10px; }
.section-head h2, .section-title { font-size: 18px; margin: 0; }
.section-title { margin: 28px 0 12px; }
.home-articles { margin-bottom: 8px; }
.search-row { display: flex; gap: 8px; }
.search-row .search { flex: 1; }
.search-page-form { display: flex; gap: 8px; margin: 12px 0 18px; }
.search-page-form .search { flex: 1; }
.results { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.results li { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 16px; }
.results p { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
.results mark { background: var(--mark); color: inherit; }
.card-icon { float: right; width: 44px; height: 44px; object-fit: cover; border-radius: 8px; margin: 0 0 6px 10px; background: var(--surface-2); }
.article-card { border-left: 4px solid var(--dirt); }
.article.no-box { grid-template-columns: 1fr; max-width: 820px; }
.page-foot { display: flex; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.report-link { color: var(--muted); font-size: 13px; }
.report-link:hover { color: var(--danger); }
.badge.warn { background: var(--warn-bg); border: 1px solid var(--warn-bd); }

/* edit: fetch / upload */
.input-with-btn { display: flex; gap: 6px; }
.input-with-btn input { flex: 1; min-width: 0; }
.fetch-box { background: var(--accent-soft); border-radius: 8px; padding: 12px 14px 4px; margin-bottom: 14px; }
.fetch-box p { margin: 6px 0 8px; }
.downloads-note { margin-top: 8px; }
.fetch-table { border-collapse: collapse; width: 100%; font-size: 14px; }
.fetch-table th, .fetch-table td { border-bottom: 1px solid var(--border); padding: 6px 8px; text-align: left; vertical-align: top; word-break: break-word; }
.fetch-table thead th { background: var(--surface-2); font-size: 12px; }
.fetch-icon { width: 28px; height: 28px; vertical-align: middle; border-radius: 4px; }

/* recipe */
.recipe {
  display: inline-block; margin: 4px 0 16px; padding: 10px 14px 12px; border-radius: 6px;
  background: #c6c6c6; border: 3px solid; border-color: #fff #555 #555 #fff; color: #3f3f3f;
}
.r-label { display: block; font-family: "DotGothic16", monospace; font-size: 14px; margin-bottom: 6px; }
.r-body { display: flex; align-items: center; gap: 12px; }
.r-grid { display: grid; grid-template-columns: repeat(3, 56px); gap: 2px; }
.r-furnace { display: grid; justify-items: center; gap: 2px; }
.r-fire { font-size: 22px; line-height: 1; }
.r-arrow { font-size: 26px; color: #6b6b6b; }
.slot {
  position: relative; width: 56px; height: 56px; display: flex; align-items: center; justify-content: center; text-align: center;
  background: #8b8b8b; border: 2px solid; border-color: #373737 #fff #fff #373737; color: #fff;
  font-size: 11px; line-height: 1.2; padding: 2px; overflow: hidden; word-break: break-all; text-shadow: 1px 1px 0 #3f3f3f;
}
.slot.out { width: 72px; height: 72px; font-size: 12px; }
.slot.blank { background: #8b8b8b; }
.slot img { max-width: 100%; max-height: 100%; image-rendering: pixelated; border-radius: 0; }
.slot a { color: #fff7a8; }
.slot .count { position: absolute; right: 3px; bottom: 1px; font-size: 14px; color: #fff; }

/* admin */
.reports-panel { margin: 8px 0 16px; border-color: var(--danger); }
.reports { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.reports li { border-bottom: 1px dashed var(--border); padding-bottom: 10px; }
.reports p { margin: 4px 0 6px; white-space: pre-wrap; }
.image-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; }
.image-grid figure { margin: 0; font-size: 12px; color: var(--muted); }
.image-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; background: var(--surface-2); }
.panel + .panel { margin-top: 16px; }

@media (max-width: 760px) {
  .header-search { width: 100%; }
  .header-search input { width: 100%; }
  .r-grid { grid-template-columns: repeat(3, 46px); }
  .slot { width: 46px; height: 46px; font-size: 10px; }
  .slot.out { width: 58px; height: 58px; }
  .r-body { gap: 8px; }
  .article { grid-template-columns: 1fr; }
  .infobox { position: static; order: -1; }
  .page-title { font-size: 24px; }
  .filter-label { width: 100%; }
  .grid { grid-template-columns: 1fr; }
  .page-head { flex-direction: column; }
  .fields { grid-template-columns: 1fr; }
  .pick { grid-template-columns: 1fr; }
  .editor { grid-template-columns: 1fr; gap: 0; }
  .editor-tabs { display: flex; }
  .editor .preview { display: none; }
  .editor[data-show="preview"] textarea { display: none; }
  .editor[data-show="preview"] .preview { display: block; }
  .header-inner { height: auto; min-height: 56px; flex-wrap: wrap; gap: 4px 12px; padding-top: 8px; padding-bottom: 8px; }
  .site-header nav { gap: 4px 12px; font-size: 14px; flex-wrap: wrap; }
  .logo { font-size: 20px; }
}

/* 画像のドラッグ＆ドロップ・本文中の画像 */
.editor textarea.drop { outline: 3px dashed var(--accent); outline-offset: -3px; background: var(--accent-soft); }
.md img { max-width: 100%; height: auto; display: inline-block; vertical-align: middle; }

/* トップのサイト紹介 */
.hero {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px 28px; margin-bottom: 24px;
  padding: 24px 26px; border-radius: 10px; border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface) 70%);
  box-shadow: var(--shadow);
}
.hero-title { font-family: "DotGothic16", monospace; font-weight: 400; font-size: 34px; margin: 0; line-height: 1.2; }
.hero-sub { margin: 6px 0 10px; font-weight: 700; color: var(--dirt); }
.hero-text { margin: 0 0 12px; font-size: 15px; line-height: 1.85; }
.hero-stats { display: flex; gap: 16px; margin-bottom: 14px; font-size: 14px; color: var(--muted); }
.hero-stats b { font-size: 22px; color: var(--text); margin-right: 2px; font-variant-numeric: tabular-nums; }
.hero-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; align-content: center; }
.hero-points li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 10px 14px; font-size: 14px; line-height: 1.6; }
.hero-points b { display: block; font-size: 15px; }
.hp-icon { font-size: 22px; line-height: 1.2; }
.hero-tags { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; padding-top: 4px; border-top: 1px dashed var(--border); }
.hero-tags .muted { margin-right: 4px; }
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; padding: 18px 16px; }
  .hero-title { font-size: 26px; }
}

/* 検索：Wikiの外（Modrinth / CurseForge） */
.external { margin-top: 28px; }
.external h2 { font-size: 18px; margin: 0 0 4px; }
.ext-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.ext-col h3 { font-size: 15px; margin: 0 0 8px; padding-bottom: 4px; border-bottom: 2px solid var(--border); }
.ext-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.ext-list li { display: grid; grid-template-columns: 40px 1fr auto; gap: 10px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; }
.ext-icon { width: 40px; height: 40px; border-radius: 6px; object-fit: cover; background: var(--surface-2); display: block; }
.ext-main { min-width: 0; }
.ext-main .muted.small:last-child { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.ext-act .btn { font-size: 13px; padding: 4px 10px; }
@media (max-width: 760px) {
  .ext-cols { grid-template-columns: 1fr; }
  .ext-list li { grid-template-columns: 36px 1fr; }
  .ext-act { grid-column: 1 / -1; }
}
