/* ============================================================
   ツールページ（/tools/）固有の少量スタイル

   土台は style.css。計算機の枠は LP の料金シミュレーター（.sim__*）を
   そのまま使っているので、ここに書くのは次の3つだけ。
     1. レバー表（どこを直すと何本減るか）の見せ方
     2. 任意入力の折りたたみ（<details>）
     3. 出所注記などの小さい文字

   色は :root の変数だけを使う。ツール用の色は作らない。
   ============================================================ */

/* ---------- 入力まわり ---------- */

/* 2列に置きたい入力の組。狭いときは素直に1列へ落とす */
@media (min-width: 640px) {
  .tc-grid2 { grid-template-columns: 1fr 1fr; }
}

/* 率の入力に単位を添える。
   単位は .field ではなく入力欄そのものに紐づける。.field は grid item で
   行の高さまで伸びるため、.field の下端を基準にすると、背の低いほうの
   単位が入力欄の外へ出る */
.tc-unit { position: relative; display: block; }
.tc-unit .input { padding-right: 34px; }
.tc-unit::after {
  content: "%"; position: absolute; right: 12px; top: 50%;
  transform: translateY(-50%);
  font-size: 13px; color: var(--sub); pointer-events: none;
}
.tc-unit--day::after { content: "日"; }
.tc-unit--yen::after { content: "円"; }
.tc-unit--hon::after { content: "本"; }

/* 任意入力の折りたたみ。既定では閉じておき、必要な人だけ開く */
.tc-more { margin-top: 16px; border-top: 1px dashed var(--line); padding-top: 14px; }
.tc-more > summary {
  cursor: pointer; font-size: 13.5px; font-weight: 700; color: var(--brand);
  list-style: none; display: flex; align-items: center; gap: 6px;
}
.tc-more > summary::-webkit-details-marker { display: none; }
.tc-more > summary::before {
  content: ""; width: 7px; height: 7px; flex: none;
  border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s;
}
.tc-more[open] > summary::before { transform: rotate(45deg); }
.tc-more__body { margin-top: 14px; }

/* ---------- 結果 ---------- */

/* 必要架電数。単位を数字に食われないよう少し離す */
.tc-amount .unit {
  font-family: var(--jp); font-size: 15px; font-weight: 700; margin-left: 4px;
}

/* 人件費の行。本体の数字とは別の塊だと分かるよう薄く囲う */
.tc-cost {
  margin-top: 14px; padding: 12px 14px;
  background: var(--white); border: 1px solid var(--line); border-radius: 6px;
}
.tc-cost[hidden] { display: none; }
.tc-cost__k {
  font-size: 11.5px; font-weight: 700; color: var(--sub);
  letter-spacing: .04em; margin-bottom: 4px;
}
.tc-cost li { font-size: 13.5px; line-height: 1.85; }

/* レバー表。「両方」の行だけ .best で強調される（style.css 側の指定） */
.tc-levers th[scope="row"] { font-weight: 400; }
.tc-levers tr.best th[scope="row"] { font-weight: 700; }
/* 減った本数はマイナス表記なので、色で「良い方向」だと分かるようにする */
.tc-levers td:last-child { color: var(--brand); font-weight: 700; }

/* CTA の前に置く一文。数字が出ているときだけ表示する */
.tc-cta-lead { font-size: 13px; color: var(--sub); margin-bottom: 8px; line-height: 1.7 }
.tc-cta-lead[hidden] { display: none; }

/* URLコピー。CTAの隣に置く控えめなボタン */
.tc-share {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px;
  background: none; border: 1px solid var(--line); border-radius: 4px;
  padding: 7px 14px; font-size: 12.5px; color: var(--sub);
  font-family: inherit; cursor: pointer;
}
.tc-share:hover { border-color: var(--brand); color: var(--brand); }

/* JS が無いときだけ出す案内 */
.tc-noscript {
  margin: 0 20px 20px; padding: 12px 14px; font-size: 13px; line-height: 1.8;
  background: var(--alert-bg); border: 1px solid var(--alert); border-radius: 6px;
  color: var(--alert);
}
.tc-noscript[hidden] { display: none; }

/* ---------- 本文 ---------- */

/* カテゴリ21行の表。母数の列は数字なので右寄せ */
.tc-cat-table td:not(:first-child) { text-align: right; font-family: var(--num); }
.tc-cat-table tbody tr.is-all th,
.tc-cat-table tbody tr.is-all td { background: var(--surface); font-weight: 700; }

/* 出所一覧。参考文献なので小さく、行間は広めに */
.tc-sources { font-size: 12.5px; color: var(--sub); line-height: 1.9; }
.tc-sources li { padding: 3px 0 3px 18px; position: relative; }
.tc-sources li::before {
  content: ""; position: absolute; left: 4px; top: 12px;
  width: 5px; height: 5px; border-radius: 50%; background: var(--sub);
}

/* ============================================================
   .page の既定を打ち消す

   このページは本文に .page（h2に左線、p/li 15px、ul は disc、
   table は薄い枠）を使っている。その指定が計算機とデータ表にも
   かかってしまう。

   .page p / .page li は (0-2-0) で、.sim__amount など (0-1-0) に
   勝つ。メディアクエリや記述順では覆せないので、同じ .page
   スコープで書き直す必要がある。
   ============================================================ */

/* 計算機 */
.page .sim__amount { font-size: 34px; line-height: 1.15; margin-bottom: 0; }
.page .sim__head p { font-size: 12.5px; margin-bottom: 0; }
.page .sim__pick { margin-bottom: 4px; }
.page .sim__foot p { margin-bottom: 0; }
.page .sim__meta { list-style: none; padding-left: 0; margin-bottom: 0; }
.page .sim__meta li {
  font-size: 13.5px; line-height: 1.75; margin-bottom: 0; padding: 3px 0 3px 18px;
}
.page .tc-cost ul { list-style: none; padding-left: 0; margin-bottom: 0; }
.page .tc-cost li { font-size: 13.5px; line-height: 1.85; margin-bottom: 0; }
.page .tc-cta-lead { margin-bottom: 8px; }
.page .tc-noscript { margin-bottom: 20px; }

/* レバー表（.sim__table）。.page table の枠・背景・th幅を戻す */
.page .sim__table { border: 0; margin-bottom: 0; }
.page .sim__table th, .page .sim__table td {
  border: 1px solid var(--line); padding: 8px 10px; text-align: right; vertical-align: middle;
}
.page .sim__table thead th { background: #F0F2F4; text-align: center; width: auto; }
.page .sim__table tbody th { text-align: left; width: auto; background: var(--white); }
.page .sim__table tr.best th, .page .sim__table tr.best td { background: var(--surface); }

/* データ表（.dtable）。見出し行はブランド色に戻す */
.page .dtable { border: 0; margin-bottom: 0; }
.page .dtable th, .page .dtable td {
  padding: 12px 14px; text-align: right; vertical-align: middle;
}
.page .dtable thead th {
  background: var(--brand); color: var(--white); text-align: center; width: auto;
}
.page .dtable thead th:first-child { background: var(--brand-dark); }
.page .dtable tbody th { text-align: left; width: auto; background: var(--white); }

/* 出所一覧。disc を消して自前の点に戻す */
.page .tc-sources { list-style: none; padding-left: 0; }
.page .tc-sources li { font-size: 12.5px; line-height: 1.9; margin-bottom: 0; }

/* 言葉と式の対応表。数字の表ではないので左寄せで読ませる */
.page .tc-def td { text-align: left; font-family: var(--num); }

/* ============================================================
   PDF透かしツール／道具箱ハブ
   ============================================================ */

/* ---------- ハブ ---------- */
.page .tc-hub__l { list-style: none; padding-left: 0; margin: 22px 0 0; }
.tc-hub__i { margin-bottom: 14px; }
.tc-hub__i > a {
  display: flex; gap: 16px; align-items: flex-start;
  border: 1px solid var(--line); border-radius: 10px; padding: 18px 20px;
  text-decoration: none; color: inherit; transition: border-color .15s, box-shadow .15s;
}
.tc-hub__i > a:hover { border-color: var(--brand); box-shadow: var(--shadow); }
.tc-hub__ic { flex: none; width: 34px; height: 34px; color: var(--brand); }
.tc-hub__ic svg { width: 100%; height: 100%; }
.tc-hub__b b { display: block; font-size: 16.5px; margin-bottom: 4px; color: var(--brand); }
.tc-hub__b span { font-size: 14px; line-height: 1.8; color: var(--sub); }

/* ---------- 投入エリア ---------- */
.tc-drop {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  border: 2px dashed var(--line); border-radius: 10px; padding: 30px 20px;
  text-align: center; cursor: pointer; background: #FCFDFD;
  transition: border-color .15s, background .15s;
}
.tc-drop:hover, .tc-drop:focus-visible, .tc-drop.is-over {
  border-color: var(--brand); background: var(--surface); outline: none;
}
.tc-drop svg { width: 30px; height: 30px; color: var(--brand); }
.tc-drop b { font-size: 15.5px; }
.tc-drop span { font-size: 12.5px; color: var(--sub); line-height: 1.7 }

/* ---------- ファイル一覧 ---------- */
.tc-files { margin-top: 18px; }
.tc-files__h { font-size: 12.5px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.page .tc-flist { list-style: none; padding-left: 0; margin: 0; }
.tc-f {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px;
  margin-bottom: 6px; background: var(--white); font-size: 13.5px;
}
.tc-f__n { flex: 1 1 200px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-f__st { font-size: 12.5px; color: var(--sub); }
.tc-f__a { display: flex; gap: 8px; }
.tc-f.is-error { border-color: var(--alert); background: var(--alert-bg); }
.tc-f.is-error .tc-f__st { color: var(--alert); }

/* ---------- 文言チップ ---------- */
.tc-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.tc-chip {
  border: 1px solid var(--line); background: var(--white); border-radius: 999px;
  padding: 7px 15px; font-size: 13.5px; font-family: inherit; cursor: pointer;
  color: var(--text); transition: border-color .12s, background .12s, color .12s;
}
.tc-chip:hover { border-color: var(--brand); }
.tc-chip[aria-checked="true"] { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 700; }

.tc-missing {
  margin-top: 8px; font-size: 13px; line-height: 1.75;
  color: var(--alert); background: var(--alert-bg);
  border: 1px solid var(--alert); border-radius: 6px; padding: 9px 12px;
}
.tc-missing[hidden] { display: none; }
.tc-missing b { font-size: 15px; }

/* ---------- 設定 ---------- */
.tc-opts { display: grid; gap: 16px; margin-top: 18px; }
@media (min-width: 620px) { .tc-opts { grid-template-columns: 1fr 1fr; } }
.tc-radios { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.tc-radios label { display: inline-flex; align-items: center; gap: 5px; font-size: 13.5px; cursor: pointer; }
.tc-radios--color .tc-sw {
  /* inline のままだと width/height が効かず縦棒に潰れる */
  display: inline-block; flex: none;
  width: 13px; height: 13px; border-radius: 3px;
  background: var(--c); border: 1px solid rgba(0,0,0,.15);
}
.tc-range { width: 100%; accent-color: var(--brand); }
.tc-range-in { margin-top: 8px; }
.tc-range-in:disabled { background: #F4F5F6; color: var(--sub); }

/* ---------- 仕上がりの目安 ---------- */
.tc-pv { margin-top: 20px; }
.tc-pv__k { font-size: 12.5px; font-weight: 700; color: var(--sub); margin-bottom: 6px; }
.tc-pv__page {
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 1 / 1.414;
  margin: 0 auto; background: var(--white);
  border: 1px solid var(--line); border-radius: 3px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}
.tc-pv__page.is-tile { display: grid; grid-template-columns: repeat(3, 1fr); align-content: space-around; }
.tc-wm { font-weight: 700; white-space: nowrap; pointer-events: none; }
.tc-wm--center { position: absolute; left: 50%; top: 50%; transform-origin: center; }
.tc-wm--top { position: absolute; left: 50%; top: 9px; transform: translateX(-50%); font-size: 13px; }
.tc-wm--bottom { position: absolute; left: 50%; bottom: 9px; transform: translateX(-50%); font-size: 13px; }
.tc-wm--tile { font-size: 11px; justify-self: center; }
.tc-wm--sub { font-size: .42em; font-weight: 400; }
.tc-wm--sub.tc-wm--top { top: 26px; font-size: 9px; }
.tc-wm--sub.tc-wm--bottom { bottom: 26px; font-size: 9px; }

/* ---------- 案内 ---------- */
.tc-note {
  margin-top: 12px; padding: 9px 12px; border-radius: 6px;
  font-size: 13px; line-height: 1.75; border: 1px solid var(--line);
}
.tc-note[hidden] { display: none; }
.tc-note--warn, .tc-note--error { color: var(--alert); background: var(--alert-bg); border-color: var(--alert); }

/* ツール本体は .page の既定を打ち消す（詳細度のため .page スコープで書く） */
.page .tc-tool .sim__body { padding: 20px; }
.page .tc-tool ol, .page .tc-tool ul { margin: 0; padding-left: 0; }
.page .tc-tool li { font-size: 13.5px; }
.page .tc-pv__page p { margin: 0; }

/* hidden属性は UA の display:none だが、.tc-share{display:inline-flex} のような
   クラス指定に負ける。ツール内は個別に書かず、まとめて効かせる */
.page-tool [hidden] { display: none !important; }

/* ---------- ツール手前のビフォー・アフター図 ---------- */
.tc-ba { margin: 22px 0 6px; padding: 0; }
.tc-ba__fig { width: 100%; height: auto; display: block; max-width: 560px; margin: 0 auto; }

/* ---------- 完了の受け取り口（押したボタンのすぐ下） ---------- */
.tc-done {
  margin-top: 12px; padding: 14px 16px;
  border: 1px solid var(--ok, #1a7f4b); border-radius: 8px; background: #F2FAF5;
}
.page .tc-done__h {
  display: flex; align-items: center; gap: 7px; margin: 0 0 10px;
  font-size: 14px; font-weight: 700; color: #1a7f4b;
}
.tc-done__h svg { width: 18px; height: 18px; flex: none; color: #1a7f4b; }
.tc-done__a { display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px; }
.tc-done__a .btn { flex: 1 1 200px; text-align: center; }
/* .tc-share には他所向けの margin-top が付いているので、ここでは外す。
   付いたままだと「共有」だけ背が低くなり、並びがそろわない */
.tc-done__a .tc-share { margin-top: 0; padding-top: 0; padding-bottom: 0; justify-content: center; }
.tc-done__f {
  flex: 1 1 100%; font-size: 12.5px; color: var(--sub); margin: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* 複数ファイルのとき、完了欄に出す個別の受け取り口 */
.tc-done__each { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; margin-top: 2px; }
.tc-done__one {
  text-align: left; background: none; border: 1px solid var(--line); border-radius: 5px;
  padding: 8px 12px; font-family: inherit; font-size: 13px; color: var(--brand);
  cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tc-done__one:hover { border-color: var(--brand); background: var(--surface); }

/* 一覧から外すボタン（容量の右） */
.tc-f__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; flex: none; padding: 0;
  background: none; border: 1px solid var(--line); border-radius: 5px;
  color: var(--sub); cursor: pointer;
}
.tc-f__x svg { width: 14px; height: 14px; }
.tc-f__x:hover:not(:disabled) { border-color: var(--alert); color: var(--alert); background: var(--alert-bg); }
.tc-f__x:disabled { opacity: .35; cursor: default; }
