/* ============================================================
   ITKAGYO Tools 共通スタイル
   ------------------------------------------------------------
   ★ 横展開時に変更するのはこの1行だけ ★
   （Excel=＃217346 / CSV=例:#b45309 / 画像=例:#0e7490 など）
   ============================================================ */
:root {
  --accent: #b91c1c;
}

/* ---- 以下は変更不要（--accentから自動派生） ---- */
:root {
  --accent-dark: color-mix(in srgb, var(--accent), #000 25%);
  --accent-tint: color-mix(in srgb, var(--accent), #fff 92%);
  --accent-line: color-mix(in srgb, var(--accent), #fff 72%);

  --ink: #1c2024;
  --ink-soft: #5b636b;
  --bg: #ffffff;
  --paper-line: #e6e9ec;

  --font-body: "IBM Plex Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    sans-serif;
  --font-mono: "IBM Plex Mono", "Consolas", "Menlo", monospace;

  --radius: 6px;
  --maxw: 880px;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.8;
  font-size: 15px;
}

a {
  color: var(--accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- ヘッダー ---------- */
.site-header {
  border-bottom: 1px solid var(--paper-line);
  background: var(--bg);
}

.site-header .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header .brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.site-header .brand img {
  width: 36px;
  height: 36px;
  display: block;
}

.site-header .brand .name {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.02em;
}

.site-header .brand .name small {
  display: block;
  font-weight: 500;
  font-size: 11px;
  color: var(--ink-soft);
  letter-spacing: 0.08em;
}

.site-header .back-main {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-soft);
  text-decoration: none;
}

.site-header .back-main:hover {
  color: var(--accent);
}

/* ---------- ヒーロー（方眼＝セル罫線モチーフ） ---------- */
.hero {
  border-bottom: 1px solid var(--paper-line);
  background-image: linear-gradient(
      to right,
      color-mix(in srgb, var(--accent), #fff 90%) 1px,
      transparent 1px
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--accent), #fff 90%) 1px,
      transparent 1px
    );
  background-size: 32px 32px;
  background-position: center top;
}

.hero .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 48px 20px 44px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.4;
  letter-spacing: 0.01em;
}

.hero p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 14px;
  max-width: 560px;
}

.hero .formula-chip {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  padding: 2px 10px;
  margin-bottom: 14px;
}

/* ---------- メイン ---------- */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 8px 20px 56px;
}

.section-title {
  margin: 40px 0 4px;
  font-size: 18px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  line-height: 1.5;
}

.section-count {
  margin: 0 0 16px;
  padding-left: 14px;
  font-size: 12px;
  color: var(--ink-soft);
}

/* ---------- ツールカード ---------- */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.tool-card {
  display: block;
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  text-decoration: none;
  color: var(--ink);
  background: var(--bg);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--accent), transparent 85%);
}

.tool-card .fn {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--accent-dark);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: 4px;
  display: inline-block;
  padding: 1px 8px;
  margin-bottom: 8px;
}

.tool-card h3 {
  margin: 0 0 6px;
  font-size: 15px;
  line-height: 1.5;
}

.tool-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}

.tool-card.is-soon {
  opacity: 0.55;
  pointer-events: none;
}

.tool-card.is-soon .fn::after {
  content: " 準備中";
  font-family: var(--font-body);
}

/* ---------- ツールページ ---------- */
.breadcrumb {
  font-size: 12px;
  color: var(--ink-soft);
  margin: 20px 0 0;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.tool-page h1 {
  font-size: 24px;
  line-height: 1.4;
  margin: 14px 0 8px;
}

.tool-lead {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 24px;
}

.tool-panel {
  border: 1px solid var(--paper-line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 28px;
}

.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.field .hint {
  font-weight: 400;
  color: var(--ink-soft);
  font-size: 12px;
  margin-left: 6px;
}

.field input[type="text"],
.field input[type="number"],
.field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: var(--font-mono);
  border: 1px solid #c6ccd2;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
}

.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.field-row .field {
  flex: 1 1 200px;
}

/* 数式出力（シグネチャー要素） */
.formula-out {
  margin-top: 6px;
}

.formula-out .label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.formula-box {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.formula-box code {
  flex: 1 1 auto;
  font-family: var(--font-mono);
  font-size: 15px;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 12px 14px;
  overflow-x: auto;
  white-space: nowrap;
  color: var(--accent-dark);
}

.copy-btn {
  flex: 0 0 auto;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 0 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
}

.copy-btn:hover {
  background: var(--accent-dark);
}

.status-note {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 8px;
  min-height: 1.5em;
}

/* 解説 */
.tool-page h2 {
  font-size: 18px;
  border-left: 4px solid var(--accent);
  padding-left: 10px;
  margin: 36px 0 12px;
  line-height: 1.5;
}

.tool-page section p {
  margin: 0 0 12px;
}

.tool-page section ol,
.tool-page section ul {
  padding-left: 22px;
  margin: 0 0 12px;
}

.tool-page section li {
  margin-bottom: 6px;
}

.tool-page code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: 3px;
  padding: 0 5px;
}

/* ローカル処理の案内 */
.privacy-note {
  border: 1px solid var(--accent-line);
  background: var(--accent-tint);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  margin: 28px 0 0;
}

.privacy-note strong {
  color: var(--accent-dark);
}

/* ---------- フッター ---------- */
.site-footer {
  background: var(--accent-dark);
  color: #fff;
  margin-top: 56px;
}

.site-footer .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 20px 22px;
  font-size: 12.5px;
}

.site-footer a {
  color: #fff;
  text-decoration: none;
  opacity: 0.9;
}

.site-footer a:hover {
  opacity: 1;
  text-decoration: underline;
}

/* 姉妹サイト行・共通リンク行 */
.footer-sites,
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 20px;
}

.footer-sites {
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid color-mix(in srgb, var(--accent-dark), #fff 25%);
}

.footer-sites .is-current {
  opacity: 0.55;
}

/* コピーライト（最下部・中央寄せ） */
.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 18px;
}

.site-footer .copyright {
  opacity: 0.75;
  font-size: 12.5px;
}

.site-footer .footer-icon {
  width: 70px;
  height: 70px;
  display: block;
}


/* ---------- レスポンシブ・アクセシビリティ ---------- */
@media (max-width: 560px) {
  .hero .inner {
    padding: 34px 16px 30px;
  }

  .hero h1 {
    font-size: 21px;
  }

  .formula-box {
    flex-direction: column;
  }

  .copy-btn {
    padding: 12px 20px;
  }

}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}

/* ---------- 条件行（＋−で追加・削除） ---------- */
.cond-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.cond-row .field {
  flex: 1 1 170px;
  margin-bottom: 0;
}

.cond-remove {
  flex: 0 0 auto;
  width: 40px;
  height: 42px;
  border: 1px solid #c6ccd2;
  background: var(--bg);
  color: var(--ink-soft);
  border-radius: var(--radius);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cond-remove:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.cond-remove:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.add-cond {
  background: var(--bg);
  border: 1px dashed var(--accent);
  color: var(--accent-dark);
  border-radius: var(--radius);
  padding: 9px 18px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-body);
  cursor: pointer;
  margin-bottom: 14px;
}

.add-cond:hover {
  background: var(--accent-tint);
}

/* ---------- 広告枠 ---------- */
.ad-box {
  margin: 32px 0;
  text-align: center;
}

.ad-label {
  display: block;
  font-size: 11px;
  color: var(--ink-soft);
  margin-bottom: 4px;
  text-align: left;
}

/* ---------- お問い合わせバンド（フッター手前・全ページ共通） ---------- */
.contact-band {
  background: var(--accent-tint);
  border-top: 1px solid var(--accent-line);
  margin-top: 56px;
}

.contact-band .inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 30px 20px;
  text-align: center;
}

.contact-band + .site-footer {
  margin-top: 0;
}

.contact-text {
  margin: 0 0 16px;
  font-size: 13.5px;
  color: var(--ink);
  line-height: 1.9;
}

.contact-links {
  display: flex;
  justify-content: center;
  gap: 14px;
}

.contact-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--accent-line);
  background: var(--bg);
  color: var(--accent-dark);
}

.contact-links a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}
/* ---------- テキスト変換系（textarea） ---------- */
.field textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 14px;
  font-family: var(--font-mono);
  border: 1px solid #c6ccd2;
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  min-height: 180px;
  resize: vertical;
  line-height: 1.6;
}

.text-io {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 700px) {
  .text-io {
    grid-template-columns: 1fr;
  }
}

.text-io .field {
  margin-bottom: 0;
}

.text-io .field textarea {
  min-height: 220px;
}

.io-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 6px;
}

.io-label-row label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 0;
}

.io-count {
  font-size: 11.5px;
  color: var(--ink-soft);
}

/* ---------- カラープレビュー（色見本・グラデーション枠・ピッカー） ---------- */
.color-swatch {
  display: inline-block;
  width: 100%;
  height: 60px;
  border-radius: var(--radius);
  border: 1px solid var(--paper-line);
}

.color-swatch-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 10px;
  margin: 10px 0;
}

.color-swatch-item {
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
}

.color-swatch-item .color-swatch {
  height: 48px;
  margin-bottom: 4px;
}

.preview-box {
  border: 1px solid var(--paper-line);
  border-radius: var(--radius);
  padding: 20px;
  min-height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

input[type="color"] {
  width: 44px;
  height: 42px;
  padding: 2px;
  border: 1px solid #c6ccd2;
  border-radius: var(--radius);
  background: var(--bg);
  cursor: pointer;
  flex: 0 0 auto;
}

.color-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.color-input-row input[type="text"] {
  flex: 1 1 auto;
}
