/* 画像→WebP一括変換（/webp/・/en/webp/ 共通） */
.tool .lede.wp-q { margin-bottom: 4px; color: var(--ink); font-weight: 500; }
.tool .lede.wp-lede { margin-bottom: 24px; }

/* ドロップ枠: マウスの画面は「ドラッグ&ドロップ」、触る画面と375px以下は「タップして選ぶ」 */
.drop .wp-t, .drop .wp-add { display: none; }
.drop .wp-sub { display: block; }
@media (hover: none) and (pointer: coarse), (max-width: 375px) {
  .drop .wp-m { display: none; }
  .drop .wp-t { display: inline; }
}
/* 変換したあとは「画像を足す」の細い帯に縮める（枠全体を押せるまま） */
/* スマホの最初の画面は、説明より先に押す場所を大きく見せる */
@media (max-width: 640px) {
  .drop:not(.is-compact) { min-height: 280px; display: flex; flex-direction: column; justify-content: center; }
}
.drop.is-compact { padding: 12px 16px; min-height: 0; }
.drop.is-compact strong { margin: 0; font-size: 15px; line-height: 1.5; }
.drop.is-compact .wp-m, .drop.is-compact .wp-t, .drop.is-compact .wp-sub { display: none !important; }
.drop.is-compact .wp-add { display: inline; }
.wp-skip { margin: 10px 0 0; font-size: 13px; line-height: 1.7; color: var(--ink); background: var(--paper); border: 1px solid var(--hairline); padding: 8px 12px; }
.wp-skip a { color: var(--accent); }

/* パンくず・節の見出し: 英大文字の等幅とダッシュの飾りをやめ、本文と同じ書体で読む（このページだけ） */
.tool .crumb.wp-crumb { font-family: inherit; font-size: 13px; letter-spacing: 0; text-transform: none; }
.tool .crumb.wp-crumb .no { font-family: var(--mono); margin-right: 2px; }
.tool .tool-main .section > h2 { font-family: inherit; font-size: 17px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--ink); margin-bottom: 12px; }
.tool .tool-main .section > h2::before { content: none; display: none; }

/* 使い方: 箱を3つ並べず、道具のすぐ下で読む短い番号つきの行にする */
ol.steps.wp-steps { display: block; border: 0; background: none; counter-reset: step; }
ol.steps.wp-steps li { display: grid; grid-template-columns: 2em 7.5em minmax(0, 1fr); align-items: baseline; padding: 6px 0; border: 0; font-size: 14px; color: var(--ink-soft); }
ol.steps.wp-steps li + li { border: 0; border-top: 1px dotted var(--hairline); }
ol.steps.wp-steps li::before { display: inline; margin: 0; font-size: 13px; }
ol.steps.wp-steps b { display: inline; margin: 0; font-size: 14px; }
@media (max-width: 640px) {
  ol.steps.wp-steps li { display: block; position: relative; padding-left: 2em; }
  ol.steps.wp-steps li::before { position: absolute; left: 0; top: 7px; }
  ol.steps.wp-steps b { display: block; }
}

/* 右の列の関連ツール: 本文の下の「ほかのツール」と同じものは出さず、絵を外して名前の行だけにする */
.tool-aside .related li:has(> a[href="../avif/"]), .tool-aside .related li:has(> a[href="../resize/"]) { display: none; }
.tool-aside .related .r-thumb { display: none; }
.tool-aside .related a { min-height: 44px; }

/* 結果 */
.wp-res, .panel.wp-in { scroll-margin-top: 72px; }
.wp-h { margin: 0 0 6px; font-size: 13px; font-weight: 500; color: var(--ink-soft); letter-spacing: .06em; }
.wp-sum { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.5; color: var(--ink); }
.wp-subsum { margin: 4px 0 0; font-size: 13px; color: var(--ink-soft); }
.wp-subsum:empty { display: none; }

/* 増減率: 増えた＝赤系の警告・減った＝緑・同じ＝灰。色だけに頼らず符号と文字を付ける */
.wp-d { font-family: var(--mono); font-weight: 700; white-space: nowrap; font-feature-settings: "tnum"; }
.wp-d--up { color: #b91c1c; }
.wp-d--down { color: var(--ok); }
.wp-d--same { color: #6b7280; }
.wp-d-l { display: block; font-size: 11.5px; font-weight: 500; color: var(--ink-soft); white-space: nowrap; }

.wp-table { margin-top: 14px; }
.wp-table td { vertical-align: middle; }
.wp-table th, .wp-sz { white-space: nowrap; }
.wp-sz { font-family: var(--mono); font-feature-settings: "tnum"; }
.wp-c-name { max-width: 0; width: 42%; }
.wp-nm { display: flex; min-width: 0; white-space: nowrap; }
.wp-nm-b { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wp-nm-e { flex: none; }
.wp-c-act { text-align: right; white-space: nowrap; }
.wp-c-msg { color: var(--ink-soft); }
.is-fail .wp-c-msg { color: var(--ng); }
.wp-vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wp-b {
  display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 0 12px; margin-left: 6px;
  border: 1px solid var(--hairline-strong); background: var(--panel); color: var(--ink);
  font: inherit; font-size: 13px; white-space: nowrap; cursor: pointer;
}
.wp-b:first-child { margin-left: 0; }
.wp-b:hover:not([disabled]) { border-color: var(--ink); }
.wp-b[aria-pressed="true"] { border-color: var(--ink); background: var(--paper); font-weight: 600; }
.wp-b[disabled] { opacity: .45; cursor: not-allowed; }

.wp-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 18px; margin-top: 16px; }
/* 主ボタンは1つだけ茶色の塗り */
.btn.wp-main { background-color: var(--accent); border-color: var(--accent); min-height: 46px; padding: 10px 26px; font-weight: 600; white-space: nowrap; }
.btn.wp-main:hover { border-color: var(--accent-dark); }
.btn.wp-main[disabled] { background-color: #b6b1a5; border-color: #b6b1a5; }
.wp-clear { background: none; border: 0; padding: 8px 2px; font: inherit; font-size: 13.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.wp-clear[disabled] { color: var(--ink-soft); opacity: .5; cursor: not-allowed; }
.wp-bigger { margin: 16px 0 0; padding-left: 10px; border-left: 2px solid var(--hairline-strong); font-size: 13.5px; line-height: 1.7; color: var(--ink); }
.wp-bigger .wp-lossless { display: flex; margin: 8px 0 0; min-height: 40px; font-weight: 600; white-space: normal; text-align: left; }
.wp-grow { margin-top: 12px; }
.wp-status { margin: 10px 0 0; font-size: 13.5px; color: var(--ink); }
.wp-status::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 8px; border: 2px solid var(--hairline-strong); border-top-color: var(--ink); border-radius: 50%; vertical-align: -1px; animation: wp-spin .8s linear infinite; }
@keyframes wp-spin { to { transform: rotate(360deg); } }
.wp-done { margin: 10px 0 0; font-size: 13.5px; color: var(--ink); }
.wp-done:empty { display: none; }
.wp-done::before { content: "↓ "; color: var(--ink-soft); }

/* 見比べ（左＝元の画像・右＝WebP） */
.wp-cmp { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--hairline); --pos: 50%; }
.wp-cmp-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.wp-cmp-t { font-size: 13.5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.wp-cmp-view { position: relative; overflow: hidden; max-height: 60vh; background: repeating-conic-gradient(#f3f4f6 0 25%, #fff 0 50%) 0 0 / 16px 16px; border: 1px solid var(--hairline); }
.wp-cmp-inner { position: relative; width: fit-content; max-width: 100%; margin: 0 auto; }
.wp-cmp-inner img { display: block; width: auto; max-width: 100%; height: auto; max-height: 60vh; }
.wp-cmp-inner .wp-cmp-top { position: absolute; inset: 0; width: 100%; height: 100%; max-height: none; clip-path: inset(0 0 0 var(--pos)); }
.wp-cmp-line { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .35); pointer-events: none; }
.wp-cmp.is-zoom .wp-cmp-view { overflow: auto; }
.wp-cmp.is-zoom .wp-cmp-inner { width: max-content; max-width: none; }
.wp-cmp.is-zoom .wp-cmp-inner img { max-width: none; max-height: none; }
.wp-cmp.is-zoom .wp-cmp-inner .wp-cmp-top { width: 100%; height: 100%; }
.wp-cmp-pos { display: block; width: 100%; margin: 10px 0 4px; accent-color: var(--ink); }
.wp-cmp-cap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-family: var(--mono); font-size: 12.5px; color: var(--ink-soft); }
.wp-cmp-cap span { white-space: nowrap; }
.wp-cmp-cap .wp-d--up, .wp-cmp-cap .wp-d--down, .wp-cmp-cap .wp-d--same { font-weight: 600; }

.wp-next { margin: 18px 0 0; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 13.5px; line-height: 1.9; color: var(--ink-soft); }
.wp-next a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* シェア: 「結果を画像にする」は枠線だけ（塗りは主ボタン1つだけ） */
.ch-share-preview .wp-share-img { height: auto; }

/* 実例の表・出典 */
.wp-h3 { font-size: 14px; margin: 22px 0 6px; }
.wp-ex td:nth-child(n+2), .wp-ex th { white-space: nowrap; }
.wp-src { margin-top: 8px; line-height: 1.8; }
.wp-src a { color: var(--accent); }

/* AIエージェント節の見出しは文字だけ */
.section.wp-ai > h2::before { content: none; display: none; }

/* 狭い画面: 結果の表を1枚ごとのカードにする */
@media (max-width: 480px) {
  .wp-sum { font-size: 17px; }
  .wp-table thead { display: none; }
  .wp-table, .wp-table tbody { display: block; }
  .wp-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; padding: 12px 0; border-bottom: 1px solid var(--hairline); }
  table.result.wp-table td { display: block; padding: 0; border: 0; max-width: none; width: auto; }
  .wp-table .wp-c-name { grid-column: 1 / -1; font-weight: 600; }
  .wp-table .wp-c-in::before, .wp-table .wp-c-out::before { content: attr(data-l) " "; color: var(--ink-soft); font-size: 12px; white-space: nowrap; }
  table.result.wp-table .wp-c-d { grid-column: 1 / -1; display: flex; align-items: baseline; gap: 8px; }
  .wp-table .wp-d-l { display: inline; }
  .wp-table .wp-c-msg { grid-column: 1 / -1; }
  table.result.wp-table .wp-c-act { grid-column: 1 / -1; text-align: left; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
  .wp-table .wp-b { margin: 0; min-height: 40px; }
  .wp-table tr.is-fail .wp-c-in { grid-column: 1 / -1; }
  .btn.wp-main { flex: 1 1 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .wp-status::before { animation: none; }
}

/* 見本で試す（画像が手元に無いとき・入れる前だけ出す） */
.wp-try { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 10px; margin: 12px 0 0; font-size: 13px; }
.wp-try[hidden] { display: none; }
.wp-try-b { background: none; border: 0; padding: 6px 0; font: inherit; font-size: 13.5px; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; white-space: nowrap; }
.wp-try-b[disabled] { opacity: .5; cursor: wait; }
.wp-try-n { color: var(--ink-soft); }

/* 大きくなった知らせは、合計の文と表の数字に任せ、ここは太字・赤を使わない */
.wp-bigger b { font-weight: 500; }
/* 右の列の関連ツールは名前だけ（説明は本文の「ほかのツール」で読む） */
.tool-aside .related .r-desc { display: none; }

/* 形式の名前の途中で折り返さない（375pxで「（PNG /」と「JPEG・複数可）」に割れていた） */
.wp-nw { white-space: nowrap; }
.wp-gloss { margin-top: 10px; line-height: 1.8; }
