:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1d2330;
  --muted: #5b6475;
  --line: #dde1e8;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --accent-soft: #e8f0fe;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 10px;
  --maxw: 1080px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151b; --surface: #1b2029; --text: #e6e9ef; --muted: #a2abbb; --line: #2e3542;
    --accent: #6ea8ff; --accent-ink: #0b1220; --accent-soft: #1d2a40; --danger: #ff8a80; --danger-soft: #3a1f1f;
    color-scheme: dark;
  }
}
* { 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 Kaku Gothic ProN", "Noto Sans JP", Meiryo, sans-serif;
  line-height: 1.7; font-size: 16px;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-top: 10px; padding-bottom: 10px; }
.logo { font-weight: 700; font-size: 1.15rem; color: var(--text); text-decoration: none; }
.logo small { display: block; font-weight: 400; font-size: .72rem; color: var(--muted); }
.header-search { margin-left: auto; display: flex; gap: 6px; flex: 1 1 240px; max-width: 360px; }
.header-search input { flex: 1; min-width: 0; }
nav.cats { overflow-x: auto; white-space: nowrap; border-top: 1px solid var(--line); }
nav.cats a { display: inline-block; padding: 8px 10px; color: var(--muted); text-decoration: none; font-size: .9rem; }
nav.cats a:hover, nav.cats a[aria-current] { color: var(--accent); }
main { padding: 20px 0 40px; }
h1 { font-size: 1.6rem; line-height: 1.35; margin: .2em 0 .4em; }
h2 { font-size: 1.25rem; margin: 1.8em 0 .6em; padding-bottom: .3em; border-bottom: 1px solid var(--line); }
h3 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.lead { color: var(--muted); margin-top: 0; }
.breadcrumb { font-size: .85rem; color: var(--muted); margin: 0 0 8px; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--muted); }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
input[type=text], input[type=number], input[type=date], input[type=search], input[type=url], select, textarea {
  font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%;
}
textarea { font-family: ui-monospace, SFMono-Regular, Consolas, "BIZ UDGothic", monospace; font-size: .92rem; resize: vertical; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.tp-btn { font: inherit; border: 1px solid var(--accent); background: var(--accent); color: var(--accent-ink); border-radius: 8px; padding: 8px 16px; cursor: pointer; }
.tp-btn-sub { background: transparent; color: var(--accent); }
.tp-btn[disabled] { opacity: .5; cursor: not-allowed; }
.tp-field { margin-bottom: 12px; }
.tp-field > label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
.tp-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0 12px; }
.tp-check { display: flex; align-items: center; gap: 6px; font-size: .92rem; margin: 6px 0 12px; }
.tp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 640px) { .tp-grid2 { grid-template-columns: 1fr; } }
.tp-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.tp-error { background: var(--danger-soft); color: var(--danger); border-radius: 8px; padding: 8px 12px; margin: 8px 0; }
.tp-output { margin-top: 8px; }
.tp-output-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.tp-label { font-weight: 600; font-size: .9rem; }
.tp-actions { display: flex; gap: 6px; }
.tp-actions .tp-btn { padding: 4px 10px; font-size: .85rem; }
.tp-stats { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
.tp-stats th, .tp-stats td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.tp-stats th { width: 45%; font-weight: 600; color: var(--muted); }
.tp-stats td { font-variant-numeric: tabular-nums; word-break: break-all; }
.tp-drop { border: 2px dashed var(--line); border-radius: var(--radius); padding: 20px; text-align: center; color: var(--muted); }
.tp-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.tp-filelist { list-style: none; padding: 0; margin: 8px 0; }
.tp-filelist li { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .9rem; }
.tp-filelist li span { flex: 1; word-break: break-all; }
.tp-preview { max-width: 100%; max-height: 360px; display: block; margin: 8px 0; border: 1px solid var(--line); }
.tp-mark { background: #ffe58a; color: #1d2330; border-radius: 2px; }
.tp-diff { font-family: ui-monospace, Consolas, monospace; font-size: .88rem; white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); border-radius: 8px; padding: 8px; background: var(--surface); }
.tp-diff .add { background: #d8f5dd; color: #0b4a17; display: block; }
.tp-diff .del { background: #fde2e1; color: #7a1712; display: block; }
.tp-qr canvas, .tp-qr img { image-rendering: pixelated; background: #fff; padding: 8px; }
.card-list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; }
.card a { display: block; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; text-decoration: none; color: var(--text); }
.card a:hover { border-color: var(--accent); }
.card-title { display: block; font-weight: 700; color: var(--accent); }
.card-desc { display: block; font-size: .88rem; color: var(--muted); margin-top: 2px; }
.hero { padding: 8px 0 4px; }
.hero form { display: flex; gap: 8px; max-width: 560px; }
.section-note { color: var(--muted); font-size: .88rem; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; }
.examples { width: 100%; border-collapse: collapse; font-size: .92rem; }
.examples th, .examples td { border: 1px solid var(--line); padding: 6px 8px; text-align: left; vertical-align: top; }
.examples td code, .examples td pre { white-space: pre-wrap; word-break: break-all; margin: 0; font-size: .88rem; }
.article-body { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 20px 20px; }
.article-body pre { overflow-x: auto; background: var(--bg); padding: 10px; border-radius: 8px; }
.article-body table { border-collapse: collapse; }
.article-body th, .article-body td { border: 1px solid var(--line); padding: 4px 8px; }
.site-footer { border-top: 1px solid var(--line); background: var(--surface); padding: 20px 0; font-size: .85rem; color: var(--muted); }
.site-footer a { color: var(--muted); margin-right: 12px; }
.meta-line { font-size: .82rem; color: var(--muted); }
.badge { display: inline-block; font-size: .75rem; border: 1px solid var(--line); border-radius: 99px; padding: 0 8px; color: var(--muted); }
@media (max-width: 480px) { h1 { font-size: 1.35rem; } .header-search { max-width: none; } }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 8px; top: 8px; background: var(--surface); padding: 6px 10px; z-index: 10; }
.table-wrap { overflow-x: auto; }
