
:root {
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --bg: #f7f8fb;
  --surface: #ffffff;
  --surface-2: #f1f3f9;
  --border: #e3e6ef;
  --text: #1a1d29;
  --text-soft: #5a6072;
  --text-faint: #8b91a4;
  --accent-soft: #eef0fe;
  --ok: #16a34a;
  --ng: #dc2626;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(20, 24, 40, .06), 0 1px 3px rgba(20, 24, 40, .04);
  --shadow: 0 4px 16px rgba(20, 24, 40, .08);
  --shadow-lg: 0 12px 40px rgba(20, 24, 40, .12);
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
  --mono: "SF Mono", SFMono-Regular, ui-monospace, Menlo, Consolas, "Courier New", monospace;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-2: #1f2330;
    --border: #2a2f3d;
    --text: #e9ebf2;
    --text-soft: #a8aec0;
    --text-faint: #727890;
    --accent-soft: #20223a;
    --shadow-sm: 0 1px 2px rgba(0,0,0,.3);
    --shadow: 0 4px 16px rgba(0,0,0,.4);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.5);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---- Header ---- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; gap: 16px; height: 62px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.15rem; color: var(--text); letter-spacing: -.02em; }
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: var(--brand-grad);
  display: grid; place-items: center; color: #fff; font-weight: 900; font-size: .95rem;
  box-shadow: var(--shadow-sm);
}
.brand-name b { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.brand-sub { color: var(--text-faint); font-weight: 600; font-size: .92rem; }
.header-spacer { flex: 1; }
.header-link { color: var(--text-soft); font-weight: 600; font-size: .9rem; }

/* ---- Footer ---- */
.site-footer { border-top: 1px solid var(--border); margin-top: 64px; padding: 36px 0; color: var(--text-soft); font-size: .88rem; background: var(--surface); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center; }
.footer-cats { display: flex; flex-wrap: wrap; gap: 6px 16px; }

/* ---- Hero ---- */
.hero { padding: 52px 0 30px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 5vw, 2.7rem); line-height: 1.25; margin: 0 0 14px; letter-spacing: -.03em; }
.hero h1 .grad { background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero p { color: var(--text-soft); max-width: 620px; margin: 0 auto; font-size: 1.05rem; }
.badges { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-top: 20px; }
.badge { background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 14px; font-size: .82rem; color: var(--text-soft); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---- Search ---- */
.search-wrap { max-width: 560px; margin: 26px auto 0; position: relative; }
.search-wrap input {
  width: 100%; padding: 14px 18px 14px 46px; font-size: 1rem; font-family: var(--font);
  border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--text);
  box-shadow: var(--shadow-sm); transition: border-color .15s, box-shadow .15s;
}
.search-wrap input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--accent-soft); }
.search-wrap::before { content: "🔍"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); opacity: .5; }

/* ---- Category sections ---- */
.cat-section { margin-top: 44px; }
.cat-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.cat-head .emoji { font-size: 1.4rem; }
.cat-head h2 { font-size: 1.3rem; margin: 0; letter-spacing: -.02em; }
.cat-head .count { color: var(--text-faint); font-size: .85rem; font-weight: 600; }
.cat-desc { color: var(--text-soft); font-size: .9rem; margin: -8px 0 18px; }

/* ---- Tool grid / cards ---- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card {
  display: flex; align-items: flex-start; gap: 12px; padding: 16px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform .14s ease, box-shadow .14s ease, border-color .14s; color: var(--text);
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--brand) 40%, var(--border)); text-decoration: none; }
.tool-card .ico { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.2rem; }
.tool-card .tc-title { font-weight: 700; font-size: .98rem; letter-spacing: -.01em; }
.tool-card .tc-desc { color: var(--text-soft); font-size: .82rem; line-height: 1.55; margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.no-result { text-align: center; color: var(--text-faint); padding: 40px; display: none; }

/* ---- Breadcrumb ---- */
.breadcrumb { padding: 22px 0 0; font-size: .85rem; color: var(--text-faint); }
.breadcrumb a { color: var(--text-soft); }

/* ---- Tool page ---- */
.tool-head { padding: 16px 0 8px; }
.tool-head h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: 6px 0 8px; letter-spacing: -.02em; display: flex; align-items: center; gap: 12px; }
.tool-head h1 .ico { width: 44px; height: 44px; border-radius: 11px; background: var(--accent-soft); display: grid; place-items: center; font-size: 1.4rem; flex: none; }
.tool-head p { color: var(--text-soft); margin: 0; max-width: 760px; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); padding: 20px; margin-top: 20px; }

.io-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .io-grid { grid-template-columns: 1fr; } }
.io-block { display: flex; flex-direction: column; }
.io-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-weight: 700; font-size: .9rem; color: var(--text-soft); }

textarea, input[type=text], input[type=number], select {
  font-family: var(--font); font-size: .98rem; color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px 14px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
textarea { min-height: 200px; resize: vertical; line-height: 1.7; }
textarea.mono, input.mono { font-family: var(--mono); }
textarea:focus, input:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--accent-soft); }
select { cursor: pointer; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%238b91a4' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 34px; }

/* ---- Options ---- */
.options { display: flex; flex-wrap: wrap; gap: 14px 22px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > .field-label { font-size: .82rem; font-weight: 700; color: var(--text-soft); }
.field-inline { display: flex; align-items: center; gap: 8px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label, .check-label { display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; font-size: .86rem; cursor: pointer; font-weight: 600; color: var(--text-soft); transition: all .12s; }
.radio-row label:has(input:checked) { background: var(--accent-soft); border-color: var(--brand); color: var(--brand); }
.check-label:has(input:checked) { background: var(--accent-soft); border-color: var(--brand); color: var(--brand); }
.radio-row input, .check-label input { accent-color: var(--brand); }
.field input[type=number], .field input[type=text]:not(.radio-row input) { min-width: 120px; }

/* ---- Buttons ---- */
.btn { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font); font-weight: 700; font-size: .9rem; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--border); background: var(--surface-2); color: var(--text); cursor: pointer; transition: all .13s; }
.btn:hover { background: var(--accent-soft); }
.btn-primary { background: var(--brand-grad); color: #fff; border: none; box-shadow: var(--shadow-sm); }
.btn-primary:hover { filter: brightness(1.06); opacity: 1; }
.btn-sm { padding: 5px 12px; font-size: .8rem; }
.btn-copy.copied { background: var(--ok); color: #fff; border-color: var(--ok); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* ---- Stats (counter) ---- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 18px; }
.stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 14px 16px; }
.stat .s-label { font-size: .78rem; color: var(--text-faint); font-weight: 600; }
.stat .s-value { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.stat .s-hint { font-size: .73rem; color: var(--text-faint); margin-top: 2px; }

/* ---- Result rows (calc) ---- */
.result-list { display: flex; flex-direction: column; gap: 1px; background: var(--border); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.result-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; background: var(--surface); padding: 14px 16px; }
.result-row .r-label { color: var(--text-soft); font-size: .9rem; font-weight: 600; }
.result-row .r-value { font-weight: 800; font-size: 1.1rem; text-align: right; word-break: break-all; font-variant-numeric: tabular-nums; }
.result-row .r-hint { display: block; font-size: .72rem; color: var(--text-faint); font-weight: 500; }
.color-swatch { width: 100%; height: 64px; border-radius: var(--radius-sm); border: 1px solid var(--border); margin-bottom: 14px; }

/* ---- diff ---- */
.diff-out { font-family: var(--mono); font-size: .9rem; white-space: pre-wrap; line-height: 1.6; }
.diff-add { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); display: block; padding: 0 6px; border-radius: 4px; }
.diff-del { background: color-mix(in srgb, var(--ng) 16%, transparent); color: var(--ng); display: block; padding: 0 6px; border-radius: 4px; text-decoration: line-through; }
.diff-eq { display: block; padding: 0 6px; color: var(--text-soft); }
mark { background: color-mix(in srgb, var(--brand) 30%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* ---- image tools ---- */
.file-drop { display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 36px 20px; text-align: center; cursor: pointer; transition: all .15s; background: var(--surface-2); }
.file-drop:hover, .file-drop.drag { border-color: var(--brand); background: var(--accent-soft); }
.file-drop-inner { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--text-soft); font-weight: 600; }
.img-stage { margin-top: 18px; text-align: center; background: repeating-conic-gradient(var(--surface-2) 0% 25%, var(--surface) 0% 50%) 50% / 20px 20px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 16px; }
.img-stage img { max-width: 100%; max-height: 460px; border-radius: 4px; box-shadow: var(--shadow); }
.big-color { width: 140px; height: 140px; border: none; border-radius: var(--radius); cursor: pointer; background: none; padding: 0; box-shadow: var(--shadow); }
.big-color::-webkit-color-swatch-wrapper { padding: 0; }
.big-color::-webkit-color-swatch { border: 1px solid var(--border); border-radius: var(--radius); }

/* ---- Related / SEO body ---- */
.tool-note { margin-top: 24px; color: var(--text-soft); font-size: .92rem; }
.related h3 { font-size: 1.05rem; margin: 0 0 12px; }
.privacy-note { display: inline-flex; align-items: center; gap: 6px; color: var(--ok); font-size: .82rem; font-weight: 600; margin-top: 14px; }

/* ---- SEO content / FAQ ---- */
.tool-content h2, .faq h2, .related h3 { letter-spacing: -.02em; }
.tool-content h2, .faq h2 { font-size: 1.25rem; margin: 0 0 14px; }
.tool-content p { color: var(--text-soft); margin: 0 0 12px; }
.faq-item { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: var(--surface); overflow: hidden; }
.faq-item summary { cursor: pointer; padding: 15px 18px; font-weight: 700; font-size: .95rem; list-style: none; position: relative; padding-right: 44px; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "＋"; position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--text-faint); font-weight: 400; transition: transform .2s; }
.faq-item[open] summary::after { content: "−"; }
.faq-item summary:hover { color: var(--brand); }
.faq-a { padding: 0 18px 16px; color: var(--text-soft); font-size: .92rem; line-height: 1.75; }

/* ---- 依頼ボード (/request) ---- */
.req-hero { padding-bottom: 8px; }
.req-section { margin-top: 8px; }
.req-section-head { display: flex; align-items: baseline; gap: 10px; margin: 28px 0 14px; }
.req-section-head h2 { font-size: 1.3rem; margin: 0; letter-spacing: -.02em; }
.req-count { color: var(--text-faint); font-size: .9rem; font-weight: 600; }
.req-empty { color: var(--text-soft); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; text-align: center; }
.req-list { display: grid; gap: 16px; }
.req-card { background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--border); border-radius: var(--radius); padding: 18px 20px; }
.req-card.req-high { border-left-color: var(--ng, #e11d48); }
.req-card.req-medium { border-left-color: var(--brand); }
.req-card.req-low { border-left-color: var(--text-faint); }
.req-card.req-done { opacity: .7; }
.req-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.req-badge { font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px; color: #fff; }
.req-badge-high { background: var(--ng, #e11d48); }
.req-badge-medium { background: var(--brand); }
.req-badge-low { background: var(--text-faint); }
.req-date { color: var(--text-faint); font-size: .8rem; }
.req-title { font-size: 1.1rem; margin: 0 0 8px; letter-spacing: -.01em; }
.req-summary { color: var(--text-soft); font-size: .92rem; line-height: 1.7; margin: 0 0 14px; }
.req-block { margin-top: 14px; }
.req-block-h { font-size: .82rem; font-weight: 700; color: var(--text-faint); margin: 0 0 8px; }
.req-todos { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.req-todo label { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: .92rem; line-height: 1.6; }
.req-todo input { margin-top: 3px; width: 16px; height: 16px; flex: none; accent-color: var(--brand); }
.req-todo input:checked + span { color: var(--text-faint); text-decoration: line-through; }
.req-copy { border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; }
.req-copy-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); }
.req-copy-label { font-size: .82rem; font-weight: 600; color: var(--text-soft); }
.req-copy-btn { padding: 4px 12px; font-size: .8rem; }
.req-copy-btn.copied { color: var(--ok); border-color: var(--ok); }
.req-copy-pre { margin: 0; padding: 12px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .88rem; white-space: pre-wrap; word-break: break-all; background: var(--surface); }
.req-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.req-links a { font-size: .9rem; }
.req-archive { margin-top: 28px; }
.req-archive > summary { cursor: pointer; font-weight: 700; color: var(--text-soft); padding: 10px 0; }
.req-archive > summary:hover { color: var(--brand); }
.req-archive .req-list { margin-top: 12px; }

/* 文脈オファー(CTA) — ツール下部。広告表記付き・控えめ */
.offer-tag { display: inline-block; font-size: .68rem; font-weight: 700; color: var(--text-faint); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; margin-bottom: 8px; letter-spacing: .04em; }
.offer-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; transition: border-color .15s, transform .15s; }
.offer-card:hover { border-color: var(--brand); transform: translateY(-1px); }
.offer-body { display: flex; flex-direction: column; gap: 3px; }
.offer-label { font-size: 1rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.offer-sub { font-size: .85rem; color: var(--text-faint); }
.offer-arrow { font-size: 1.2rem; color: var(--brand); flex: none; }

/* 監査証跡（出典・鮮度・改訂履歴）— ADR-0011 */
.source-trail h2 { font-size: 1.05rem; margin: 0 0 10px; }
.src-meta { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: .9rem; color: var(--text-soft); }
.src-changelog { margin-top: 10px; }
.src-changelog > summary { cursor: pointer; font-size: .9rem; color: var(--text-soft); font-weight: 600; }
.src-changelog ul { margin: 8px 0 0; padding-left: 18px; font-size: .88rem; color: var(--text-soft); display: grid; gap: 4px; }
.src-changelog time { color: var(--text-faint); font-variant-numeric: tabular-nums; }
