/* ==========================================================================
   cookalc.com 共通デザインシステム（キッチン道具の実用美テーマ）

   各ツールのCustomHTML「HTML+JavaScript」ボックスの先頭に、以下の1行を追加して読み込む:
     <link rel="stylesheet" href="/assets/css/cookalc-ui.css?v=20260826a">

   ここに置くのは「値まで完全に共通」なスタイルだけ。
   ツール固有の見た目（テーブルレイアウト・独自の可視化パーツ・数値表示の強調度など）は
   引き続き各ツールのCSSボックス（gohan.css / pan.css 等）に残す。
   新しいツールを追加するときは、まずこのファイルの `.ca-*` クラスと `--ca-*` 変数を
   使い、どうしても表現できない部分だけをそのツール用のCSSに書く。

   2026-08-26 新規作成（デザイン統一 Stage①）: pan.css / gohan.css に完全重複していた
   ルールをここへ集約した。色を1つ変えるのに複数ファイルを直す必要をなくすのが目的。
   このタイミングで、pan/gohan間で微妙にずれていた値（カード/ダイヤルの下余白・
   会員バッジのサイズ等）を1つに統一している（詳細は claude/ 内のStageメモ参照）。

   ⚠️ ピザ版（pizza.css / pizza_panel.html）はまだこの設計に乗せ替えていない
   （旧Tailwindベースの別デザインを意図的に維持中。pizza_migration_stage1.md 参照）。
   このファイルは読み込んでいないため、pizza.css 側の同名 `.ca-gate` 定義とは無関係。
   将来ピザ版を新デザインへ移植する際に、あわせてこのファイルに乗せ替える。
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Zen+Kaku+Gothic+New:wght@500;700;900&family=IBM+Plex+Mono:wght@500;700&display=swap');

:root {
  --ca-accent:       #fa9735;
  --ca-accent-dark:  #c26a12;
  --ca-accent-bg:    #fff8f0;
  --ca-accent-line:  #fbd9a8;

  --ca-accent2:      #8a9a5c;
  --ca-accent2-bg:   #eef1e3;
  --ca-accent2-dark: #52603a;

  --ca-bg:    #faf6ef;
  --ca-ink:   #2d2116;
  --ca-sub:   #5b4b3a;
  --ca-muted: #8a7a68;
  --ca-line:  #e6ddd0;
  --ca-warn:  #c05621;
  --ca-dial:  #2d2116;

  --ca-font: 'Zen Kaku Gothic New', 'Hiragino Kaku Gothic ProN',
             'Hiragino Sans', Meiryo, sans-serif;
  --ca-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

/* ---- 共通コンテナ（各ツールのルート要素に class="ca-tool" を付与する） ---- */
.ca-tool {
  max-width: 64rem;
  margin: 0 auto;
  padding: 1rem;
  background:
    radial-gradient(1200px 700px at 88% -12%, rgba(255,255,255,.55), transparent 60%),
    var(--ca-bg);
  color: var(--ca-ink);
  border-radius: .5rem;
  font-family: var(--ca-font);
  line-height: 1.7;
}
.ca-tool *, .ca-tool *::before, .ca-tool *::after { box-sizing: border-box; }

/* スクリーンリーダー専用（視覚的に隠すが読み上げには残す） */
.ca-sr {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ---- 見出し ---- */
.ca-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap; margin-bottom: 1.75rem;
}
.ca-head-icon {
  width: 2.75rem; height: 2.75rem; border-radius: .7rem;
  background: var(--ca-accent-bg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: .75rem;
}
.ca-eyebrow {
  font-size: .7rem; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase; color: var(--ca-muted);
  margin: 0 0 .25rem;
}
.ca-head h1 {
  font-size: 1.5rem; font-weight: 900; color: var(--ca-ink);
  margin: 0 0 .5rem; line-height: 1.3;
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem;
}
@media (min-width: 768px) { .ca-head h1 { font-size: 1.75rem; } }
.ca-head p { margin: 0; color: var(--ca-sub); font-size: .95rem; max-width: 34em; }

.ca-badge {
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 auto; white-space: nowrap; line-height: 1;
  font-size: .75rem; padding: .25rem .75rem;
  border-radius: 9999px; font-weight: 700; color: #fff;
  background: var(--ca-accent);
  box-shadow: 0 1px 2px rgba(0,0,0,.08);
  vertical-align: middle;
}

/* ---- ラベル（<label>タグに加え、グループ見出し用の<span class="ca-label">にも使う） ---- */
.ca-tool label,
.ca-label {
  display: block;
  font-size: .875rem;
  font-weight: 700;
  color: var(--ca-sub);
  margin-bottom: .5rem;
}

/* ---- ステップ見出し ---- */
.ca-step { display: flex; align-items: center; gap: .625rem; margin: 0 0 1.25rem; }
.ca-step-num {
  width: 1.5rem; height: 1.5rem; border-radius: 9999px; flex: 0 0 auto;
  background: var(--ca-ink); color: #f3ece1;
  font-family: var(--ca-mono); font-size: .75rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.ca-step-num.is-onDark { background: #f3ece1; color: var(--ca-ink); }
.ca-step-label {
  font-size: .95rem; font-weight: 700; color: var(--ca-sub);
  margin: 0; letter-spacing: .01em;
}
.ca-step-label.is-onDark { color: rgba(243,236,225,.85); }

/* ---- カード ---- */
.ca-card {
  position: relative;
  background: #fffdfa;
  padding: 1.5rem 1.5rem 1.375rem;
  border-radius: .75rem;
  border: 1px solid var(--ca-line);
  margin-bottom: 1.5rem;
}
.ca-card::before {
  content: '';
  position: absolute; left: 1.5rem; top: 0;
  width: 2rem; height: 4px;
  background: rgba(45,33,22,.12);
  border-radius: 0 0 3px 3px;
}

/* ---- 結果ダイヤル（暗背景の強調ボックス） ---- */
.ca-dial {
  background: var(--ca-dial);
  color: #f3ece1;
  border-radius: .75rem;
  padding: 1.5rem 1.5rem 1.375rem;
  margin-bottom: 1.5rem;
}

/* ---- フォーム部品の共通ベース ---- */
.ca-tool input[type="number"],
.ca-tool input[type="text"],
.ca-tool select {
  width: 100%;
  font-size: 1.15rem;
  padding: .65rem .5rem;
  height: auto;
  border: 1px solid #d9cdbb;
  border-radius: .4rem;
  background: #fff;
  color: var(--ca-ink);
  font-family: inherit;
  font-weight: 700;
}
.ca-tool input:focus-visible,
.ca-tool select:focus-visible,
.ca-tool button:focus-visible {
  outline: 2px solid var(--ca-accent);
  outline-offset: 2px;
}

/* ---- ボタン ---- */
.ca-btn, .ca-btn-sub {
  border: 0; border-radius: .4rem; cursor: pointer;
  font-size: .875rem; font-weight: 700; font-family: inherit;
  padding: .65rem 1.25rem;
  transition: background-color .15s ease;
}
.ca-btn {
  background: var(--ca-accent); color: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.1);
}
.ca-btn:hover { background: #e8862a; }
.ca-btn-sub {
  background: #fff; color: var(--ca-sub);
  border: 1px solid #d9cdbb;
}
.ca-btn-sub:hover { background: #fbf7f0; }

/* ---- 注記・エラー ---- */
.ca-disclaimer {
  font-size: .8125rem; color: var(--ca-muted); text-align: center;
  margin: 1.5rem 0 .5rem; padding-top: 1.25rem;
  border-top: 1px solid var(--ca-line);
}
.ca-error {
  background: #fff5f5; border: 1px solid #feb2b2; color: #9b2c2c;
  padding: .875rem 1rem; border-radius: .4rem;
  font-size: .9rem; font-weight: 700; margin-bottom: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .ca-tool *, .ca-tool *::before, .ca-tool *::after {
    transition: none !important; animation: none !important;
  }
}

/* ==========================================================================
   会員登録の案内モーダル（tier.js の CookalcTier.showGate() が生成する共通パーツ）
   全ツール共通。このファイルを読み込んでいれば、tier.js を使うツールは
   追加のCSS記述なしでこのモーダルが正しく表示される。
   ========================================================================== */
.ca-gate {
  position: fixed; inset: 0; z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  font-family: var(--ca-font);
}
.ca-gate[hidden] { display: none; }

.ca-gate-backdrop {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
}
.ca-gate-box {
  position: relative;
  background: #fffdfa;
  border-radius: .75rem;
  border-top: 4px solid var(--ca-accent);
  padding: 1.75rem 1.5rem 1.5rem;
  max-width: 26rem; width: 100%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,.2);
}
.ca-gate-icon {
  width: 3rem; height: 3rem; margin: 0 auto 1rem;
  background: #fff8f0; color: #c26a12;
  border-radius: 9999px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}
.ca-gate-title {
  font-size: 1.125rem; font-weight: 700; color: #2d2116;
  margin: 0 0 .75rem;
}
.ca-gate-msg {
  font-size: .9rem; color: #5b4b3a; line-height: 1.7;
  margin: 0 0 1.25rem;
}
.ca-gate-actions {
  display: flex; flex-direction: column; gap: .625rem;
}
@media (min-width: 480px) {
  .ca-gate-actions { flex-direction: row; }
  .ca-gate-actions > * { flex: 1; }
}
.ca-gate-close, .ca-gate-cta {
  display: flex; align-items: center; justify-content: center;
  padding: .75rem 1rem; border-radius: .4rem;
  font-size: .9rem; font-weight: 700; font-family: inherit;
  cursor: pointer; text-decoration: none; border: 0;
}
.ca-gate-close { background: #f1ece3; color: #5b4b3a; }
.ca-gate-close:hover { background: #e6ddd0; }
.ca-gate-cta { background: var(--ca-accent); color: #fff; }
.ca-gate-cta:hover { background: #e8862a; color: #fff; }
.ca-gate-cta[hidden] { display: none; }
