/* AnyLab 共通スタイル */
:root {
  --bg: #eaf5fc;
  --surface: #ffffff;
  --ink: #24303d;
  --ink-2: #3c4a59;
  --muted: #667586;
  --rule: #dbe8f1;
  --primary: #1f8ad2;
  --primary-dark: #176fab;
  --primary-weak: #e3f1fb;
  --accent: #ff7a45;
  --accent-weak: #fff0e8;
  --yellow: #ffc93c;
  --yellow-weak: #fff6d9;

  /* 各ページから参照されている共通トークン */
  --paper: var(--bg);
  --paper-2: var(--surface);
  --c-bg: var(--bg);
  --c-surface: var(--surface);
  --c-text: var(--ink);
  --c-muted: var(--muted);
  --c-line: var(--rule);
  --c-primary: var(--primary);
  --c-primary-weak: var(--primary-weak);
  --c-dark: var(--ink);
  --c-accent: var(--accent);
  --c-accent-weak: var(--accent-weak);
  --c-love: #f0577c;
  --c-love-weak: #ffe8ee;
  --c-warn: #d63b2f;
  --sd-color: var(--primary);
  --sd-weak: var(--primary-weak);

  --radius: 16px;
  --radius-s: 10px;
  --shadow: 0 2px 0 rgba(36, 48, 61, .06), 0 8px 24px rgba(31, 138, 210, .08);
  --font: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
  --round: "Zen Maru Gothic", var(--font);
  --mono: "JetBrains Mono", "SFMono-Regular", "Consolas", "Menlo", monospace;
  --maxw: 1040px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--bg);
  font-feature-settings: "palt" 1;
}
img { max-width: 100%; height: auto; }
a { color: var(--primary-dark); text-underline-offset: 3px; }
a:hover { color: var(--accent); }
::selection { background: var(--yellow); color: var(--ink); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
main .container { max-width: 880px; }
body.home main .container { max-width: var(--maxw); }
.mono { font-family: var(--mono); letter-spacing: 0; }

/* ヘッダー */
.site-header { background: var(--surface); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 10; padding-top: env(safe-area-inset-top, 0px); }
.site-header .container { display: flex; align-items: center; justify-content: space-between; gap: 10px 20px; padding-block: 12px; flex-wrap: wrap; }
.site-logo { display: inline-flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 900; font-size: 1.4rem; color: var(--ink); text-decoration: none; line-height: 1; }
.site-logo::before { content: ""; width: 32px; height: 32px; flex-shrink: 0; background: url("/favicon.svg?v=2") center / contain no-repeat; }
.site-logo:hover { color: var(--ink); }
.site-nav { display: flex; gap: 6px; font-size: .88rem; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; padding: 6px 12px; border-radius: 99px; font-weight: 700; }
.site-nav a:hover { background: var(--primary-weak); color: var(--primary-dark); }

/* パンくず */
.breadcrumb { font-size: .78rem; color: var(--muted); padding-block: 16px 0; }
.breadcrumb ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; }
.breadcrumb li + li::before { content: "›"; margin-right: 4px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--primary); }

main { padding-block: 20px 64px; }

/* 見出し・本文 */
.lab-no { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 700; color: var(--primary-dark); background: var(--surface); border: 1px solid var(--rule); border-radius: 99px; padding: 2px 12px 2px 4px; margin: 14px 0 0; }
.lab-no b { font-family: var(--mono); background: var(--primary); color: #fff; border-radius: 99px; padding: 0 8px; font-size: .72rem; }
h1 { font-family: var(--round); font-size: 1.9rem; font-weight: 900; line-height: 1.4; margin: 10px 0 14px; }
h2 { font-family: var(--round); font-size: 1.32rem; font-weight: 900; line-height: 1.5; margin: 52px 0 16px; display: flex; align-items: center; gap: 10px; }
h2::before { content: ""; flex-shrink: 0; width: 10px; height: 1.2em; border-radius: 99px; background: var(--primary); }
h3 { font-size: 1.05rem; font-weight: 700; margin: 28px 0 8px; }
p { margin: 0 0 14px; }
.lead { color: var(--ink-2); font-size: .98rem; }
.small { font-size: .82rem; color: var(--muted); }

.tool-hero { display: block; width: 100%; max-width: 400px; aspect-ratio: 16 / 10; margin: 4px auto 20px; border-radius: var(--radius); box-shadow: var(--shadow); }

.card { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.card + .card { margin-top: 20px; }

/* トップ：ヒーロー */
.hero { padding-block: 16px 0; }
.hero .container { max-width: var(--maxw); }
.hero-box { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; gap: 24px; background: var(--surface); border-radius: 20px; padding: 14px 28px; box-shadow: var(--shadow); }
.hero-box > * { position: relative; z-index: 1; }
.hero-text { flex: 0 1 auto; min-width: 0; }
.hero-art { flex: 0 0 auto; width: 104px; padding: 6px; border-radius: 50%; background: var(--yellow-weak); }
.hero h1 { font-size: 1.45rem; line-height: 1.45; margin: 0 0 2px; }
.hero h1 em { font-style: normal; background: linear-gradient(transparent 62%, var(--yellow) 62%); }
.hero p { margin: 0; color: var(--ink-2); max-width: 40em; font-size: .9rem; line-height: 1.7; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding: 0; list-style: none; }
.hero-meta li { font-size: .8rem; font-weight: 700; color: var(--primary-dark); background: var(--primary-weak); border-radius: 99px; padding: 3px 12px; }

/* トップ：カテゴリ */
.cat-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
.cat-nav a { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); background: var(--surface); border: 1px solid var(--rule); border-radius: 99px; padding: 8px 16px; font-weight: 700; font-size: .9rem; box-shadow: 0 2px 0 rgba(36,48,61,.05); }
.cat-nav a .mono { font-size: .72rem; color: #fff; background: var(--primary); border-radius: 99px; padding: 0 7px; font-weight: 700; }
.cat-nav a:hover { border-color: var(--primary); color: var(--primary-dark); }
.cat-head { display: flex; align-items: baseline; justify-content: space-between; gap: 4px 16px; flex-wrap: wrap; margin: 48px 0 16px; }
.cat-head h2 { margin: 0; }
.cat-head p { margin: 0; font-size: .85rem; color: var(--muted); }

/* ツールカード */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 18px; }
.tool-card { display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); border: 1px solid var(--rule); transition: transform .15s, box-shadow .15s; }
.tool-card:hover { transform: translateY(-3px); box-shadow: 0 2px 0 rgba(36,48,61,.06), 0 14px 30px rgba(31,138,210,.16); color: var(--ink); }
.tool-card .thumb { display: block; width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: var(--primary-weak); }
.tool-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.tool-card .meta { display: flex; align-items: center; gap: 6px; }
.tool-card .no { font-family: var(--mono); font-size: .7rem; font-weight: 700; color: var(--muted); }
.tool-card .tag { font-size: .7rem; font-weight: 700; color: var(--primary-dark); background: var(--primary-weak); border-radius: 99px; padding: 1px 9px; }
.tool-card h3 { font-family: var(--round); margin: 0; font-size: 1.02rem; line-height: 1.5; }
.tool-card p { margin: 0; font-size: .84rem; color: var(--muted); line-height: 1.7; }

/* 新着 */
.new-list { list-style: none; margin: 0; padding: 6px 20px; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid var(--rule); }
.new-list li { display: grid; grid-template-columns: 6.5em 4.5em 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--rule); font-size: .92rem; }
.new-list li:last-child { border-bottom: none; }
.new-list .mono { font-size: .76rem; color: var(--muted); padding-top: 3px; }
.new-list .no { color: var(--primary); font-weight: 700; }
.new-list a { font-weight: 700; text-decoration: none; color: var(--ink); }
.new-list a:hover { color: var(--primary); }

/* フォーム */
.form-row { margin-bottom: 18px; }
.form-row > label, .form-label { display: block; font-weight: 700; font-size: .92rem; margin-bottom: 6px; }
label { font-size: .92rem; }
input[type="number"], input[type="text"], input[type="email"], select, textarea {
  width: 100%; font: inherit; font-size: 16px; padding: 11px 14px; border: 1.5px solid #cfe0ec; border-radius: var(--radius-s); background: #f8fcff; color: var(--ink);
}
input[type="number"] { font-family: var(--mono); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: 0 0 0 3px var(--primary-weak); }
.inline-inputs { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.inline-inputs input { width: 110px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-family: var(--round); font-weight: 900; padding: 14px 32px; border-radius: 99px; border: none; cursor: pointer; background: var(--primary) !important; color: #fff; text-decoration: none; box-shadow: 0 4px 0 var(--primary-dark); transition: transform .1s, box-shadow .1s, filter .15s; }
.btn:hover { color: #fff; filter: brightness(1.06); }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--primary-dark); }
.btn-outline { background: var(--surface) !important; color: var(--primary-dark); box-shadow: 0 0 0 2px var(--primary) inset, 0 4px 0 var(--rule); }
.btn-outline:hover { color: var(--primary-dark); }
.btn-x { background: #111 !important; box-shadow: 0 4px 0 #000; }
.btn-small { padding: 6px 16px; font-size: .85rem; box-shadow: 0 3px 0 var(--rule), 0 0 0 2px var(--primary) inset; }
.btn-block { width: 100%; }

/* 結果表示 */
.result { margin-top: 28px; }
.result-highlight { background: var(--yellow-weak); border: 2px solid var(--yellow); border-radius: var(--radius); padding: 22px; text-align: center; }
.result-highlight .label { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.result-highlight .value { font-family: var(--round); font-size: 2.2rem; font-weight: 900; color: var(--ink); line-height: 1.35; }
.result-highlight .sub { font-size: .88rem; }
.diff-good { color: #1f8a4c; font-weight: 700; }
.diff-bad { color: var(--c-warn); font-weight: 700; }

.table-wrap { overflow-x: auto; margin: 12px 0; border-radius: var(--radius-s); border: 1px solid var(--rule); }
table { width: 100%; border-collapse: collapse; font-size: .88rem; background: var(--surface); }
th, td { border-bottom: 1px solid var(--rule); padding: 10px 12px; text-align: left; vertical-align: top; }
tr:last-child td, tr:last-child th { border-bottom: none; }
thead th { background: var(--primary-weak); color: var(--ink); }
th { font-weight: 700; white-space: nowrap; }
td.num, th.num { text-align: right; white-space: nowrap; font-family: var(--mono); font-size: .85rem; }

.note { background: var(--primary-weak); border-radius: var(--radius-s); padding: 14px 18px; font-size: .88rem; }
.note p:last-child { margin-bottom: 0; }

/* 目次 */
.toc { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius); padding: 18px 22px; font-size: .9rem; box-shadow: var(--shadow); }
.toc strong { font-family: var(--round); }
.toc ol { margin: 6px 0 0; padding-left: 1.6em; }
.toc li::marker { font-family: var(--mono); color: var(--primary); font-weight: 700; }
.toc a { text-decoration: none; }

.cta-box { border: 2px solid var(--accent); background: var(--accent-weak); border-radius: var(--radius); padding: 20px; margin-top: 24px; }
.cta-box h3 { margin-top: 0; color: var(--accent); }

/* FAQ */
.faq details { background: var(--surface); border: 1px solid var(--rule); border-radius: var(--radius-s); padding: 14px 18px; margin: 0 0 10px; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; gap: 10px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::before { content: "Q"; flex-shrink: 0; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: #fff; font-family: var(--round); font-size: .8rem; margin-top: 2px; }
.faq details p { margin: 10px 0 0; padding-left: 34px; }

/* フッター */
.site-footer { background: var(--ink); color: #b7c2cd; font-size: .84rem; margin-top: 24px; }
.site-footer .container { padding-block: 36px; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { color: var(--yellow); }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; list-style: none; margin: 0 0 18px; padding: 0; }
.footer-pr { margin: 0 0 8px; font-size: .78rem; }
.copyright { margin: 0; color: #8795a3; font-size: .78rem; }

/* アフィリエイト（PR）ボックス：ツールの結果やコラムの下に置く */
.pr-notice { font-size: .74rem; color: var(--muted); margin: 10px 0 0; }
.pr-box { background: var(--yellow-weak); border: 2px solid var(--yellow); border-radius: var(--radius); padding: 18px 20px; margin: 28px 0; }
.pr-head { display: flex; align-items: center; gap: 8px; font-family: var(--round); font-weight: 900; font-size: 1.05rem; margin-bottom: 4px; }
.pr-tag { font-family: var(--mono); font-size: .7rem; font-weight: 700; color: var(--muted); border: 1px solid currentColor; border-radius: 4px; padding: 1px 6px; line-height: 1.4; }
.pr-lead { font-size: .88rem; color: var(--ink-2); margin: 0 0 12px; }
.pr-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--surface); border-radius: var(--radius-s); padding: 14px 16px; margin-top: 10px; color: var(--ink); text-decoration: none; box-shadow: 0 2px 0 rgba(36, 48, 61, .06); }
.pr-item:hover { color: var(--ink); box-shadow: 0 0 0 2px var(--primary) inset; }
.pr-item .ttl { font-weight: 900; }
.pr-go { flex-shrink: 0; font-family: var(--round); font-weight: 900; font-size: .88rem; color: #fff; background: var(--accent); border-radius: 99px; padding: 8px 18px; }
.pr-box img[width="1"] { position: absolute; width: 1px; height: 1px; }

/* 共通診断エンジン（shindan.js） */
.sd-progress { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 58px); background: var(--surface); padding: 8px 0; z-index: 2; font-size: .8rem; font-weight: 700; color: var(--muted); }
.sd-progress-bar { height: 8px; background: var(--primary-weak); border-radius: 99px; overflow: hidden; margin-top: 4px; }
.sd-progress-bar span { display: block; height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .2s; }
.sd-q { padding: 18px 0; border-bottom: 1px dashed var(--rule); }
.sd-q:last-child { border-bottom: none; }
.sd-q-text { font-weight: 700; margin-bottom: 10px; }
.sd-q-text .num { font-family: var(--mono); color: #fff; background: var(--primary); border-radius: 6px; padding: 0 6px; margin-right: 8px; font-size: .78rem; }
.sd-choices { display: grid; gap: 8px; }
.sd-choices label { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border: 1.5px solid var(--rule); border-radius: var(--radius-s); cursor: pointer; font-size: .92rem; background: #f8fcff; transition: border-color .1s, background .1s; }
.sd-choices label:hover { border-color: #9ccbea; }
.sd-choices label:has(input:checked) { border-color: var(--primary); background: var(--primary-weak); font-weight: 700; }
.sd-choices input { accent-color: var(--primary); flex-shrink: 0; width: 18px; height: 18px; }
.sd-result-head { text-align: center; padding: 8px 0 16px; border-bottom: 1px dashed var(--rule); }
.sd-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--yellow-weak); font-size: 2.6rem; line-height: 1; margin: 10px 0 8px; }
.sd-name { font-family: var(--round); font-size: 1.8rem; font-weight: 900; color: var(--ink); margin: 0; line-height: 1.4; }
.sd-catch { font-weight: 700; margin: 8px 0 0; color: var(--primary-dark); }
.sd-ratio { margin: 18px 0 6px; }
.sd-ratio-row { display: grid; grid-template-columns: 10em 1fr 3em; gap: 10px; align-items: center; font-size: .82rem; margin-bottom: 8px; }
.sd-ratio-row .bar { height: 10px; background: var(--primary-weak); border-radius: 99px; overflow: hidden; }
.sd-ratio-row .bar span { display: block; height: 100%; background: var(--primary); border-radius: 99px; }
.sd-ratio-row .pct { text-align: right; color: var(--muted); font-family: var(--mono); }
.sd-share { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 28px; }
.sd-types { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.sd-types .card { padding: 16px; margin: 0; }
.sd-types h3 { margin: 0 0 4px; font-size: 1rem; }
.sd-types p { margin: 0; font-size: .86rem; }

/* 計算ツール共通 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.unit-input { display: flex; align-items: center; gap: 8px; }
.unit-input input, .unit-input select { flex: 1; }
.unit-input span { white-space: nowrap; color: var(--muted); font-size: .88rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.stat { background: var(--surface); border: 1.5px solid var(--rule); border-radius: var(--radius-s); padding: 12px; text-align: center; }
.stat .label { font-size: .78rem; color: var(--muted); font-weight: 700; }
.stat .value { font-family: var(--round); font-size: 1.15rem; font-weight: 900; }
details.schedule summary { cursor: pointer; font-weight: 700; margin-top: 16px; color: var(--primary-dark); }

/* コラム */
.article-meta { display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: .8rem; color: var(--muted); margin: -4px 0 16px; }
.summary-box { background: var(--yellow-weak); border: 2px solid var(--yellow); border-radius: var(--radius); padding: 16px 20px; margin: 20px 0; }
.summary-box .ttl { font-family: var(--round); font-weight: 900; margin-bottom: 6px; }
.summary-box ul { margin: 0; padding-left: 1.3em; }
.summary-box li + li { margin-top: 4px; }
.big-num { font-family: var(--round); font-weight: 900; color: var(--primary-dark); font-size: 1.1em; }
.tool-link-box { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 2px solid var(--primary); border-radius: var(--radius); padding: 14px 18px; margin: 28px 0; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tool-link-box img { width: 120px; border-radius: var(--radius-s); flex-shrink: 0; }
.tool-link-box .lbl { font-size: .75rem; font-weight: 700; color: var(--primary-dark); }
.tool-link-box .ttl { font-family: var(--round); font-weight: 900; font-size: 1.05rem; }
.tool-link-box:hover { color: var(--ink); border-color: var(--accent); }
.tool-card .tag.col { background: var(--yellow-weak); color: #8a6100; }

[hidden] { display: none !important; }

@media (max-width: 600px) {
  h1 { font-size: 1.5rem; }
  .hero h1 { font-size: 1.3rem; }
  .hero-box { padding: 18px 18px 16px; }
  .hero-box { gap: 10px; padding: 12px 14px; }
  .hero-art { width: 64px; padding: 4px; }
  .hero h1 { font-size: 1.1rem; }
  .hero p { display: none; }
  .cat-nav a { padding: 5px 12px; font-size: .82rem; }
  .hero-meta li:last-child { display: none; }
  .card { padding: 18px; }
  .result-highlight .value { font-size: 1.75rem; }
  .grid2 { grid-template-columns: 1fr; }
  .tool-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .tool-card .body { padding: 10px 12px 14px; }
  .tool-card h3 { font-size: .92rem; }
  .tool-card p { display: none; }
  .new-list li { grid-template-columns: 4em 1fr; }
  .new-list li .date { display: none; }
  .sd-ratio-row { grid-template-columns: 7.5em 1fr 2.6em; }
  .site-nav a { padding: 4px 8px; }
  .tool-link-box img { width: 84px; }
}
