/* =========================================================
   labochro ― analylog と同系統のスタイル（白カード＋柔らかい影）
   キーカラーだけ analylog（青）と変えて、姉妹サイトと見分けがつくようにする
   ========================================================= */

:root {
  --key: #0e8a7d;
  --key-dark: #0a6b61;
  --key-soft: #e6f4f2;
  --text: #2b2b2b;
  --text-light: #6b7280;
  --heading: #1a2230;
  --bg: #f4f6f9;
  --card: #ffffff;
  --border: #e6e9ef;
  --ok: #1e7a44;
  --ok-bg: #e8f6ee;
  --ng: #b3261e;
  --ng-bg: #fdecea;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(20, 40, 80, .06);
  --shadow-hover: 0 10px 28px rgba(20, 40, 80, .13);
  --maxw: 1120px;
  --content-w: 800px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial,
    "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
/* .field 等の display:block 指定が [hidden] を上書きしてしまうのを防ぐ（JSでの表示・非表示切替に必須）。 */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.85;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--key); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ---------- ヘッダー ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px; height: 64px;
  display: flex; align-items: center; justify-content: space-between;
}
.site-brand { display: flex; flex-direction: column; line-height: 1.1; }
.site-brand:hover { text-decoration: none; }
.brand-name { font-size: 1.4rem; font-weight: 800; color: var(--heading); letter-spacing: .01em; }
.brand-accent { color: var(--key); }
.brand-sub { font-size: .62rem; color: var(--text-light); letter-spacing: .2em; }
.brand-kana { font-size: .56em; font-weight: 600; color: var(--text-light); margin-left: .6em; letter-spacing: .06em; }
.site-nav { display: flex; align-items: center; gap: 22px; }
.site-nav a { font-size: .9rem; font-weight: 700; color: var(--heading); }
.site-nav a:hover { color: var(--key); text-decoration: none; }
.nav-blog-sub { font-size: .7rem; font-weight: 600; color: var(--text-light); margin-left: .35em; }

/* ---------- ヒーロー ---------- */
.hero { background: linear-gradient(180deg, #ffffff 0%, var(--bg) 100%); }
.hero-inner { max-width: var(--maxw); margin: 0 auto; padding: 64px 24px 40px; text-align: center; }
.hero-title { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin: 0 0 12px; line-height: 1.3; }
.hero-tagline { font-size: 1.05rem; color: var(--text); margin: 0; font-weight: 600; }
.hero-desc { color: var(--text-light); max-width: 680px; margin: 12px auto 0; font-size: .95rem; }

/* ---------- セクション・カード ---------- */
.home { max-width: var(--maxw); margin: 0 auto; padding: 8px 24px 40px; }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.section-title { font-size: 1.4rem; font-weight: 800; color: var(--heading); margin: 0; padding-left: .6em; border-left: 5px solid var(--key); line-height: 1.4; }
.section-more { font-size: .85rem; font-weight: 700; color: var(--key); white-space: nowrap; }
.section-count { color: var(--text-light); font-size: .9rem; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 22px; }
.tool-card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s; overflow: hidden;
}
.tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.card-link { display: block; color: inherit; padding: 22px 22px 20px; height: 100%; }
.card-link:hover { text-decoration: none; }
.card-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.cat-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; color: #fff; background: var(--key);
  border-radius: 999px; padding: 2px 10px; letter-spacing: .04em;
}
.card-date { color: var(--text-light); font-size: .78rem; margin-left: auto; }
.card-title { font-size: 1.08rem; font-weight: 700; color: var(--heading); margin: 0 0 8px; line-height: 1.5; }
.card-excerpt { color: var(--text-light); font-size: .9rem; margin: 0 0 12px; }
.card-cta { font-size: .85rem; font-weight: 700; color: var(--key); }
.tools-note { color: var(--text-light); font-size: .9rem; margin-top: 28px; }

.sister-box {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 24px 26px; border-left: 6px solid #2f80ed; /* analylog のキーカラー */
}
.sister-label { font-size: .75rem; font-weight: 700; color: var(--text-light); letter-spacing: .1em; margin: 0 0 4px; }
.sister-name { font-size: 1.3rem; font-weight: 800; margin: 0 0 6px; }
.sister-name a { color: var(--heading); }
.sister-name .brand-accent { color: #2f80ed; }
.sister-desc { margin: 0; color: var(--text-light); font-size: .92rem; }

/* ---------- 単ページ（固定ページ・ツール） ---------- */
.single { max-width: var(--content-w); margin: 0 auto; padding: 36px 24px 72px; }
.breadcrumb { font-size: .8rem; color: var(--text-light); margin-bottom: 22px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.breadcrumb a { color: var(--text-light); }
.breadcrumb a:hover { color: var(--key); }
.breadcrumb .current { color: var(--text); }
.single-header { margin-bottom: 26px; }
.single-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; color: var(--text-light); font-size: .8rem; }
.single-title { font-size: 1.8rem; line-height: 1.45; font-weight: 800; color: var(--heading); margin: 0 0 16px; }
.single-lead { background: var(--key-soft); border-radius: 10px; padding: 16px 18px; color: #2c4a45; font-size: .92rem; line-height: 1.8; margin: 0; }

.post-body { font-size: 1rem; line-height: 1.95; color: var(--text); overflow-wrap: break-word; }
.post-body h2 {
  font-size: 1.35rem; font-weight: 800; color: var(--heading); margin: 2.4em 0 1em;
  padding: .55em .8em; background: var(--key-soft); border-left: 5px solid var(--key); border-radius: 0 6px 6px 0; line-height: 1.5;
}
.post-body h3 { font-size: 1.12rem; font-weight: 700; color: var(--heading); margin: 1.8em 0 .8em; padding-left: .7em; border-left: 4px solid var(--key); line-height: 1.5; }
.post-body p { margin: 1.2em 0; }
.post-body a { color: var(--key); text-decoration: underline; text-underline-offset: 2px; word-break: break-word; }
.post-body ul, .post-body ol { margin: 1.2em 0; padding-left: 1.6em; }
.post-body li { margin: .5em 0; }
.post-body strong { color: var(--heading); font-weight: 700; }
.post-body code { background: #eef1f5; padding: .15em .4em; border-radius: 4px; font-size: .92em; font-family: var(--mono); }
.post-body table { display: block; width: max-content; max-width: 100%; overflow-x: auto; border-collapse: collapse; margin: 1.6em 0; font-size: .92rem; border: 1px solid var(--border); border-radius: 10px; }
.post-body th, .post-body td { padding: 11px 14px; border-bottom: 1px solid var(--border); text-align: left; }
.post-body thead th { background: var(--key); color: #fff; font-weight: 700; }

.standard-note { background: #fbfcfd; border: 1px dashed #c9d3dc; border-radius: 10px; padding: 12px 16px; font-size: .88rem; color: #52606d; }
.formula-list dt { font-weight: 700; color: var(--heading); margin-top: 1.2em; }
.formula-list dd { margin: .4em 0 0 0; padding-left: 1em; border-left: 3px solid var(--border); }
.formula-list code { display: inline-block; font-size: 1em; padding: .3em .6em; margin: .2em 0; background: #f7f9fb; }
.source-list li, .related-list li { margin: .7em 0; }

.single-footer { margin-top: 48px; text-align: center; }
.btn-back {
  display: inline-block; background: var(--key); color: #fff; font-weight: 700; padding: 12px 28px;
  border-radius: 999px; box-shadow: 0 4px 14px rgba(14, 138, 125, .35); transition: background .2s, transform .2s;
}
.btn-back:hover { background: var(--key-dark); text-decoration: none; transform: translateY(-2px); }

/* ---------- 計算フォーム・結果 ---------- */
.calc-form { margin: 22px 0; }
.calc-group {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 22px 16px; margin: 0 0 18px; min-width: 0;
}
.calc-group legend { font-weight: 700; color: var(--heading); padding: 0 8px; }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0 22px; }
.calc-grid .calc-group { margin-bottom: 18px; }
.field { display: block; margin-bottom: 14px; }
.field-label { display: block; font-size: .88rem; font-weight: 700; color: var(--heading); margin-bottom: 6px; }
.field-req { color: #c0392b; font-size: .78rem; font-weight: 700; margin-left: 4px; }
.field-opt { color: var(--text-light); font-size: .78rem; font-weight: 500; margin-left: 4px; }
.field-help { color: var(--text-light); font-size: .85rem; margin: 0 0 10px; }
.unit { color: var(--text-light); font-weight: 500; font-size: .8rem; margin-left: 4px; }
.calc-form input[type="number"], .calc-form input[type="text"], .calc-form input[type="email"], .calc-form textarea, .calc-form select,
.contact-form input[type="text"], .contact-form input[type="email"], .contact-form textarea {
  width: 100%; max-width: 100%; font-family: inherit; font-size: 1rem; color: var(--text); background: var(--card);
  border: 1px solid var(--border); border-radius: 10px; padding: 10px 14px; outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.calc-form textarea { font-family: var(--mono); font-size: .95rem; line-height: 1.6; resize: vertical; }
.calc-form input:focus, .calc-form textarea:focus, .calc-form select:focus, .contact-form input:focus, .contact-form textarea:focus {
  border-color: var(--key); box-shadow: 0 0 0 3px var(--key-soft);
}
.calc-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin: 6px 0 4px; }
.form-submit {
  display: inline-block; font-family: inherit; font-size: 1rem; font-weight: 700; color: #fff;
  background: linear-gradient(180deg, var(--key), var(--key-dark)); border: none; border-radius: 999px;
  padding: 11px 30px; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease;
}
.form-submit:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.btn-ghost {
  font-family: inherit; font-size: .9rem; font-weight: 700; color: var(--key); background: transparent;
  border: 1px solid var(--key); border-radius: 999px; padding: 9px 20px; cursor: pointer;
}
.btn-ghost:hover { background: var(--key-soft); }
.calc-error { background: var(--ng-bg); border: 1px solid #f1b9b4; color: var(--ng); border-radius: 10px; padding: 11px 14px; font-size: .92rem; margin: 10px 0 0; }
.calc-result { margin: 10px 0 0; }
.result-title { font-size: 1.2rem; font-weight: 800; color: var(--heading); margin: 0 0 10px; padding-left: .6em; border-left: 5px solid var(--key); }
.post-body .result-table { display: table; width: 100%; margin: .6em 0 1em; background: var(--card); }
.post-body .result-table th { width: 38%; background: #f7f9fc; color: var(--heading); font-weight: 700; vertical-align: top; }
.post-body .result-table td strong { font-size: 1.15em; color: var(--key-dark); }
.post-body .gradient-table th { width: auto; }
.sub { color: var(--text-light); font-size: .85rem; }
.judge { display: inline-block; font-size: .8rem; font-weight: 700; border-radius: 999px; padding: 2px 10px; margin-left: 8px; vertical-align: middle; }
.judge-ok { background: var(--ok-bg); color: var(--ok); }
.judge-ng { background: var(--ng-bg); color: var(--ng); }
.result-note { color: var(--text-light); font-size: .85rem; }

/* ---------- お問い合わせ ---------- */
.contact-form { margin: 22px 0 8px; }
.contact-form .field { margin-bottom: 18px; }
.contact-form textarea { resize: vertical; line-height: 1.7; }
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-notice { border-radius: 10px; padding: 13px 16px; font-size: .92rem; margin: 0 0 18px; }
.form-success { background: var(--ok-bg); border: 1px solid #b6e0c6; color: var(--ok); }
.form-privacy { color: var(--text-light); font-size: .85rem; margin-top: 18px; }

/* 404 */
.notfound { max-width: 600px; margin: 0 auto; padding: 90px 24px; text-align: center; }
.notfound h1 { font-size: 4rem; color: var(--key); margin: 0 0 8px; }

/* ---------- フッター ---------- */
.site-footer { background: #1a2230; color: #cdd5e0; margin-top: 40px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; padding: 42px 24px; text-align: center; }
.footer-brand { font-size: 1.3rem; font-weight: 800; color: #fff; margin: 0 0 2px; }
.footer-kana { font-size: .78rem; font-weight: 600; color: #fff; opacity: .75; margin: 0 0 8px; letter-spacing: .06em; }
.footer-note { color: #9aa6b6; font-size: .88rem; margin: 0 auto 18px; max-width: 560px; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 8px 22px; justify-content: center; margin: 0 0 16px; }
.footer-nav a { color: #aeb8c6; font-size: .82rem; }
.footer-nav a:hover { color: #fff; text-decoration: none; }
.footer-copy { color: #6b7686; font-size: .78rem; margin: 0; }

/* ---------- 粘度予測ツール（フォーム・診断・グラフ） ---------- */
.visc-fieldset { margin: 0 0 18px; }
.visc-fieldset[hidden] { display: none; }
.visc-radio-row { display: flex; gap: 18px; flex-wrap: wrap; margin: 4px 0 10px; }
.visc-radio-row label { display: flex; align-items: center; gap: 6px; font-size: .9rem; font-weight: 600; color: var(--heading); }
.visc-summary { cursor: pointer; font-weight: 700; color: var(--key); font-size: .9rem; margin: 4px 0 12px; }
.visc-summary:hover { text-decoration: underline; }
.visc-warnings { background: #fff7e6; border: 1px solid #f0d9a6; border-radius: 10px; padding: 12px 16px; margin: 14px 0; }
.visc-warnings ul { margin: 6px 0 0; padding-left: 1.3em; }
.visc-warnings li { margin: .3em 0; font-size: .88rem; color: #7a5b12; }
.visc-diag { font-size: .86rem; color: var(--text-light); }
.visc-diag code { background: #eef1f5; border-radius: 4px; padding: .1em .35em; }
.visc-chart-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 16px 0; }
#viscosity-chart { width: 100%; position: relative; }
.visc-axis-toggle { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text-light); margin-bottom: 4px; width: auto; }
.visc-axis-toggle input { width: auto; }
.visc-chart-svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.visc-grid { stroke: #e2e6ec; stroke-width: 1; }
.visc-axis-label { fill: var(--text-light); font-size: 10px; }
.visc-axis-title { fill: var(--text-light); font-size: 11px; font-weight: 700; }
.visc-line { fill: none; stroke: var(--key); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.visc-marker-ring { fill: var(--card); }
.visc-marker { fill: var(--key); }
.visc-hit { fill: transparent; cursor: pointer; }
.visc-hit:focus { outline: none; }
.visc-hit:focus + .visc-end-label, .visc-hit:hover { opacity: .9; }
.visc-end-label { fill: var(--heading); font-size: 11px; font-weight: 700; }
.visc-tooltip {
  position: absolute; transform: translate(-50%, -120%); background: var(--heading); color: #fff;
  border-radius: 8px; padding: 6px 10px; font-size: .8rem; line-height: 1.4; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-hover); z-index: 5;
}
.visc-tooltip-value { font-weight: 700; }
.visc-tooltip-sub { color: #cdd5e0; font-size: .74rem; }
.csv-download { display: inline-flex; align-items: center; gap: 6px; }
.visc-checkbox-field { display: flex; align-items: flex-start; gap: 8px; }
.visc-checkbox-field input { width: auto; margin-top: 3px; flex: 0 0 auto; }
.visc-checkbox-field span { flex: 1 1 auto; min-width: 0; }
.result-table-scroll { max-height: 320px; overflow-y: auto; overflow-x: auto; }

/* ---------- chain-fit チャート（[η] vs M の log-log 散布図＋フィット曲線） ---------- */
.cf-chart-wrap { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; margin: 16px 0; }
#chain-fit-chart { width: 100%; position: relative; }
.cf-chart-svg { width: 100%; height: auto; display: block; font-family: var(--font); }
.cf-grid { stroke: #e2e6ec; stroke-width: 1; }
.cf-axis-label { fill: var(--text-light); font-size: 10px; }
.cf-axis-title { fill: var(--text-light); font-size: 11px; font-weight: 700; }
.cf-line { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cf-marker-ring { fill: var(--card); }
.cf-x-mark { stroke-width: 2; }
.cf-hit { fill: transparent; cursor: pointer; }
.cf-hit:focus { outline: none; }
.cf-legend { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 8px; font-size: .82rem; color: var(--text-light); }
.cf-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.cf-legend-swatch { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.cf-tooltip {
  position: absolute; transform: translate(-50%, -120%); background: var(--heading); color: #fff;
  border-radius: 8px; padding: 6px 10px; font-size: .8rem; line-height: 1.4; pointer-events: none;
  white-space: nowrap; box-shadow: var(--shadow-hover); z-index: 5;
}
.cf-tooltip-value { font-weight: 700; }
.cf-tooltip-sub { color: #cdd5e0; font-size: .74rem; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 640px) {
  .hero-title { font-size: 1.6rem; }
  .hero-inner { padding: 44px 20px 32px; }
  .header-inner { padding: 0 16px; }
  .brand-kana { display: none; }
  .site-nav { gap: 14px; }
  .card-grid { grid-template-columns: 1fr; }
  .single-title { font-size: 1.4rem; }
  .post-body h2 { font-size: 1.2rem; }
  .single, .home { padding-left: 16px; padding-right: 16px; }
  .calc-group { padding: 14px 16px 12px; }
  .post-body .result-table th { width: 42%; }
}
