/* style.css — 画像一括リサイズ＆変換ツール（作業台）専用スタイル
   色はサイト共通の CSS 変数（--fg / --bg / --muted / --muted-fg / --border）を使う。書体はサイト共通の指定を継承し、ここでは指定しない。
   白・黒・灰色中心、角丸は控えめ、グラデーションなし。枠線は最小限にし、余白と文字の濃淡で区切る。
   比較ビュー（暗室）だけは暗い色と暗い市松模様。 */

.ib-wrap {
  --ib-ink: hsl(var(--fg));
  --ib-ink2: hsl(var(--muted-fg));
  --ib-ink3: hsl(var(--muted-fg) / .72);
  --ib-hair: hsl(var(--border));
  --ib-paper: hsl(var(--bg));
  --ib-paper2: hsl(var(--muted));
  --ib-dark: #161616;
  --ib-chk: #222222;
  --ib-va: #3d6bff;
  --ib-vb: #16a394;
  --ib-good: #1f9d55;
  --ib-bad: #d6453d;
  --ib-radius: 3px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ib-ink);
  font-variant-numeric: tabular-nums;
  position: relative;
  min-width: 0;
}
/* 画像が0枚の間は入口だけ、1枚以上あるときは作業台だけを表示する */
.ib-wrap:not(.has-files) .ib-app { display: none; }
.ib-wrap.has-files .ib-entry { display: none; }
.dark .ib-wrap {
  --ib-dark: #080808;
  --ib-chk: #131313;
  --ib-va: #6b8cff;
  --ib-vb: #2cc9b6;
  --ib-good: #4ade80;
  --ib-bad: #f87171;
}
.ib-wrap [hidden] { display: none !important; }
.ib-wrap input { font: inherit; color: inherit; }
.ib-wrap button { cursor: pointer; }
/* サイト共通の aside（カード風・sticky）の見た目を作業台では使わない */
.ib-wrap aside { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; border-radius: 0; padding: 0; height: auto; position: static; box-shadow: none; border: 0; margin: 0; }
.ib-wrap .num { font-variant-numeric: tabular-nums; }
.ib-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ib-hint { font-size: 11px; color: var(--ib-ink3); line-height: 1.5; margin: 0; }
.ib-l { font-size: 11px; color: var(--ib-ink2); }
.ib-sp { flex: 1; }
.ib-link { border: 0; background: none; padding: 0; font-size: 12px; color: var(--ib-ink2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--ib-ink3); white-space: nowrap; }
.ib-link:hover { color: var(--ib-ink); }
.ib-link:disabled { opacity: .4; cursor: not-allowed; text-decoration: none; }
.ib-link-danger:hover { color: var(--ib-bad); }
.ib-fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.ib-fieldset:disabled { opacity: .55; }

/* ---------- 上部：ツール名・プライバシー・統計 ---------- */
.ib-head { display: flex; align-items: baseline; gap: 20px; padding: 2px 0 10px; flex-wrap: wrap; }
.ib-head h1 { font-size: 17px; font-weight: 700; margin: 0; letter-spacing: .01em; color: var(--ib-ink); line-height: 1.4; }
.ib-lock { border: 0; background: none; padding: 0; font-size: 12px; color: var(--ib-ink2); white-space: nowrap; }
.ib-lock::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--ib-good); margin-right: 6px; vertical-align: 1px; }
.ib-lock:hover { color: var(--ib-ink); }
.ib-stats { margin-left: auto; display: flex; gap: 18px; font-size: 11px; color: var(--ib-ink3); flex-wrap: wrap; align-items: baseline; }
.ib-stats b { font-weight: 500; color: var(--ib-ink2); margin-left: 4px; }
.ib-stats-note { font-size: 10px; color: var(--ib-ink3); margin: 0; }
.ib-privacy-panel { max-width: 44em; padding: 10px 14px; margin: 0 0 10px; border: 1px solid var(--ib-hair); border-radius: var(--ib-radius); background: var(--ib-paper); font-size: 12px; line-height: 1.7; }
.ib-privacy-panel p { margin: 0 0 6px; }
.ib-privacy-panel p:last-child { margin-bottom: 0; }
.ib-notices { display: flex; flex-direction: column; gap: 4px; margin: 0 0 10px; }
.ib-notice { display: flex; align-items: flex-start; gap: 8px; padding: 6px 10px; border-left: 2px solid var(--ib-bad); background: var(--ib-paper2); font-size: 12px; line-height: 1.5; word-break: break-all; }
.ib-notice-text { flex: 1; }
.ib-notice-close { flex-shrink: 0; border: 0; background: none; padding: 0; color: var(--ib-ink3); font-size: 11px; }
.ib-notice-close:hover { color: var(--ib-ink); }
.ib-notices-tools { display: flex; justify-content: flex-end; }

/* ドラッグ中の画面全体の案内 */
.ib-drop { position: fixed; inset: 0; z-index: 90; display: none; align-items: center; justify-content: center; background: rgba(17, 17, 17, .55); color: #fff; font-size: 22px; font-weight: 500; letter-spacing: .04em; pointer-events: none; }
body.ib-dragging .ib-drop { display: flex; }

/* ---------- 作業台 ---------- */
.ib-app {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 300px;
  grid-template-rows: minmax(0, 1fr) auto;
  grid-template-areas: "list stage side" "list bar side";
  height: max(620px, calc(100vh - 11rem));
  border-top: 1px solid var(--ib-hair);
  border-bottom: 1px solid var(--ib-hair);
  background: var(--ib-paper);
  max-width: 100%;
  min-width: 0;
}
.ib-list { grid-area: list; display: flex; flex-direction: column; min-height: 0; min-width: 0; border-right: 1px solid var(--ib-hair); }
.ib-stage { grid-area: stage; }
.ib-side { grid-area: side; overflow-y: auto; overflow-x: hidden; min-height: 0; min-width: 0; border-left: 1px solid var(--ib-hair); }
.ib-bar { grid-area: bar; min-width: 0; }
@media (max-width: 1000px) {
  .ib-app { grid-template-columns: 1fr; grid-template-rows: 64vh auto auto auto; grid-template-areas: "stage" "bar" "side" "list"; height: auto; }
  .ib-list { border-right: 0; border-top: 1px solid var(--ib-hair); max-height: 360px; }
  .ib-side { border-left: 0; overflow: visible; }
  .ib-stats { margin-left: 0; }
}

/* ---------- 左：画像一覧 ---------- */
.ib-lhead { display: flex; align-items: center; gap: 10px; padding: 12px 14px 6px; }
.ib-lhead b { font-size: 12px; font-weight: 500; color: var(--ib-ink2); white-space: nowrap; }
.ib-lsub { display: flex; gap: 10px; padding: 0 14px 6px; }
.ib-lsub .ib-link { font-size: 11px; }
.ib-rows { overflow-y: auto; flex: 1; position: relative; padding: 0 6px; --ib-row-h: 56px; }
.ib-rows.has-results { --ib-row-h: 68px; }
.ib-rows-spacer { position: relative; width: 100%; }
.ib-row { position: absolute; left: 0; right: 0; height: var(--ib-row-h); display: grid; grid-template-columns: 44px minmax(0, 1fr) 16px; gap: 10px; align-items: center; padding: 6px 8px; border-radius: var(--ib-radius); cursor: pointer; box-sizing: border-box; }
.ib-row:hover { background: var(--ib-paper2); }
.ib-row.is-active { background: var(--ib-paper2); }
.ib-row.is-active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; background: var(--ib-ink); }
.ib-row:focus-visible { outline: 2px solid var(--ib-va); outline-offset: -2px; }
.ib-thumb { position: relative; width: 44px; height: 44px; border-radius: 2px; background: var(--ib-hair); display: flex; align-items: center; justify-content: center; color: var(--ib-ink3); font-size: 11px; overflow: visible; }
.ib-thumb img { width: 44px; height: 44px; object-fit: cover; display: block; border-radius: 2px; }
.ib-chk { position: absolute; left: -4px; top: -4px; width: 14px; height: 14px; margin: 0; accent-color: var(--ib-ink); opacity: 0; cursor: pointer; z-index: 1; }
.ib-row:hover .ib-chk, .ib-row.is-active .ib-chk, .ib-chk:checked, .ib-rows.has-sel .ib-chk { opacity: 1; }
.ib-row-text { min-width: 0; }
.ib-nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; font-weight: 500; }
.ib-mt { font-size: 11px; color: var(--ib-ink2); line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-mt .ib-sz { margin-left: 7px; }
.ib-mt .ib-res { display: block; color: var(--ib-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ib-mt .ib-res .good { color: var(--ib-good); }
.ib-mt .ib-res .bad { color: var(--ib-bad); }
.ib-mt .ib-err { color: var(--ib-bad); display: block; white-space: normal; line-height: 1.3; }
.ib-mt .ib-dl { border: 0; background: none; padding: 0 2px; margin-left: 4px; font-size: 11px; line-height: 1; color: var(--ib-ink2); border-radius: 2px; box-shadow: inset 0 0 0 1px var(--ib-hair); }
.ib-mt .ib-dl:hover { color: var(--ib-ink); box-shadow: inset 0 0 0 1px var(--ib-ink); }
.ib-x { border: 0; background: none; color: var(--ib-ink3); padding: 0; font-size: 15px; line-height: 1; opacity: 0; width: 16px; height: 20px; }
.ib-row:hover .ib-x, .ib-row.is-active .ib-x { opacity: 1; }
.ib-x:hover { color: var(--ib-bad); }
.ib-lfoot { padding: 8px 14px 10px; font-size: 11px; color: var(--ib-ink3); }

/* ---------- 中央：比較ビュー（暗室） ---------- */
.ib-stage {
  position: relative; min-width: 0; min-height: 0; overflow: hidden; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  container-type: inline-size;
  background-color: var(--ib-dark);
  background-image: linear-gradient(45deg, var(--ib-chk) 25%, transparent 25%, transparent 75%, var(--ib-chk) 75%), linear-gradient(45deg, var(--ib-chk) 25%, transparent 25%, transparent 75%, var(--ib-chk) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
.ib-stage.is-panning { cursor: grabbing; }
.ib-layer { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ib-layer img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; display: block; -webkit-user-drag: none; }
.ib-stage.is-px .ib-layer img { image-rendering: pixelated; }
.ib-split { position: absolute; top: 0; bottom: 0; width: 20px; margin-left: -10px; cursor: ew-resize; z-index: 4; touch-action: none; }
.ib-split::before { content: ""; position: absolute; left: 9px; top: 0; bottom: 0; width: 2px; background: rgba(255, 255, 255, .92); }
#split1 { z-index: 5; }
.ib-split.h { top: auto; bottom: auto; right: 0; width: auto; height: 20px; margin-left: 0; margin-top: -10px; cursor: ns-resize; }
.ib-split.h::before { left: 0; right: 0; top: 9px; bottom: auto; width: auto; height: 2px; }
.ib-knob { position: absolute; top: 50%; left: -7px; width: 34px; height: 34px; margin-top: -17px; border-radius: 50%; background: #fff; border: 0; padding: 0; box-shadow: 0 2px 10px rgba(0, 0, 0, .35); display: flex; align-items: center; justify-content: center; cursor: ew-resize; }
.ib-knob::before, .ib-knob::after { content: ""; width: 0; height: 0; border: 5px solid transparent; }
.ib-knob::before { border-right-color: #111; margin-right: 3px; }
.ib-knob::after { border-left-color: #111; margin-left: 3px; }
.ib-split.h .ib-knob { left: 50%; top: -7px; margin-top: 0; margin-left: -17px; cursor: ns-resize; flex-direction: column; }
.ib-split.h .ib-knob::before { border-right-color: transparent; border-bottom-color: #111; margin: 0 0 3px; }
.ib-split.h .ib-knob::after { border-left-color: transparent; border-top-color: #111; margin: 3px 0 0; }
.ib-knob:focus-visible { outline: 3px solid var(--ib-va); outline-offset: 3px; }

/* 画像上のラベル：3つの枠を固定幅にして、数字が変わっても大きさが変わらない */
.ib-tag { position: absolute; top: 12px; transform: translateX(-50%); z-index: 3; pointer-events: none; display: grid; grid-template-columns: auto 8ch 7ch; align-items: baseline; column-gap: 10px; padding: 5px 10px; border-radius: var(--ib-radius); background: rgba(10, 10, 10, .72); color: #fff; white-space: nowrap; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); font-variant-numeric: tabular-nums; }
.ib-tag .tn { font-size: 12px; font-weight: 500; display: flex; align-items: center; gap: 6px; }
.ib-tag.a .tn::before, .ib-tag.b .tn::before { content: ""; width: 8px; height: 8px; border-radius: 2px; flex-shrink: 0; }
.ib-tag.a .tn::before { background: var(--ib-va); }
.ib-tag.b .tn::before { background: var(--ib-vb); }
.ib-tag .ts, .ib-tag .td { font-size: 12px; text-align: right; transition: opacity .15s; }
.ib-tag .td.good { color: #7ee2a0; }
.ib-tag .td.bad { color: #ff8f86; }
.ib-tag.wait .ts, .ib-tag.wait .td { opacity: .35; }
#tagO { grid-template-columns: auto 8ch; }
#tagO .td { display: none; }

/* 比較ビューに浮かぶ操作部品 */
.ib-float { position: absolute; z-index: 6; }
.ib-modesw { bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; background: rgba(10, 10, 10, .78); border-radius: 999px; padding: 4px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ib-modesw button { border: 0; background: transparent; color: #bdbdbd; padding: 7px 16px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; }
.ib-modesw button:hover { color: #fff; }
.ib-modesw button[aria-pressed="true"] { background: #fff; color: #111; }
.ib-modesw button small { font-size: 11px; font-weight: 400; opacity: .65; margin-left: 6px; }
.ib-zoom { right: 14px; bottom: 16px; display: flex; align-items: center; background: rgba(10, 10, 10, .78); border-radius: 999px; padding: 3px; -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.ib-zoom button { border: 0; background: transparent; color: #d6d6d6; font-size: 12px; min-width: 28px; height: 28px; padding: 0 8px; border-radius: 999px; }
.ib-zoom button:hover { background: rgba(255, 255, 255, .12); color: #fff; }
.ib-pct { color: #fff; font-size: 12px; min-width: 44px; text-align: center; }
.ib-zsep { width: 1px; height: 14px; background: rgba(255, 255, 255, .2); margin: 0 3px; }
.ib-mhint { left: 50%; bottom: 62px; transform: translateX(-50%); color: rgba(255, 255, 255, .55); font-size: 11px; white-space: nowrap; pointer-events: none; max-width: calc(100% - 28px); overflow: hidden; text-overflow: ellipsis; }
.ib-mm { position: absolute; left: 14px; bottom: 16px; z-index: 6; border-radius: var(--ib-radius); overflow: hidden; box-shadow: 0 2px 12px rgba(0, 0, 0, .5); background: #000; cursor: pointer; touch-action: none; line-height: 0; }
.ib-mm img { display: block; width: 140px; height: auto; opacity: .75; -webkit-user-drag: none; user-select: none; pointer-events: none; }
.ib-mmv { position: absolute; border: 1.5px solid #fff; box-shadow: 0 0 0 999px rgba(0, 0, 0, .35); pointer-events: none; }
/* 比較ビューの幅に応じて、浮かぶ操作部品が重ならないように配置を変える（画面幅ではなく比較ビュー自身の幅で判定） */
@container (max-width: 1000px) {
  .ib-zoom { bottom: 58px; }
  .ib-mhint { bottom: 100px; }
}
@container (max-width: 720px) {
  .ib-modesw button { padding: 6px 10px; }
  .ib-modesw button small { display: none; }
  .ib-zoom { right: 8px; }
  .ib-mm { display: none; }
}
@container (max-width: 520px) {
  .ib-tag { grid-template-columns: auto 7ch 6ch; column-gap: 6px; padding: 4px 8px; }
  .ib-tag .tn, .ib-tag .ts, .ib-tag .td { font-size: 11px; }
  #tagO { grid-template-columns: auto 7ch; left: 8px !important; transform: none; }
  #tagA, #tagB { left: auto !important; right: 8px; transform: none; }
}

/* ---------- 右：設定 ---------- */
.ib-vblock { padding: 18px 20px 16px; border-bottom: 1px solid var(--ib-hair); }
.ib-vhead { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.ib-vbadge { width: 8px; height: 8px; border-radius: 2px; font-size: 0; }
.ib-vblock[data-k="A"] .ib-vbadge { background: var(--ib-va); }
.ib-vblock[data-k="B"] .ib-vbadge { background: var(--ib-vb); }
.ib-vtitle { font-size: 12px; font-weight: 700; letter-spacing: .06em; }
.ib-ro { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ib-bsize { font-size: 14px; color: var(--ib-ink2); }
.ib-meter { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: 2px; }
.ib-right { display: flex; align-items: baseline; gap: 8px; }
.ib-big { display: flex; align-items: baseline; gap: 3px; position: relative; }
.ib-reels { display: inline-flex; font-weight: 500; font-size: 32px; line-height: 1.1; height: 1.1em; overflow: hidden; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.ib-reel { display: inline-block; height: 1.1em; overflow: hidden; }
.ib-strip { display: flex; flex-direction: column; transition: transform .55s cubic-bezier(.2, 1.35, .35, 1); }
.ib-strip span { height: 1.1em; display: block; text-align: center; }
.ib-unit { font-size: 13px; color: var(--ib-ink2); }
.ib-meter.wait .ib-reels { opacity: .35; }
.ib-delta { font-size: 12px; font-weight: 600; min-width: 7ch; text-align: right; }
.ib-delta.good { color: var(--ib-good); }
.ib-delta.bad { color: var(--ib-bad); }
.ib-bars { display: grid; gap: 3px; margin: 10px 0 18px; }
.ib-bars div { height: 3px; background: var(--ib-hair); border-radius: 2px; overflow: hidden; }
.ib-bars i { display: block; height: 100%; background: var(--ib-ink3); transition: width .45s ease; }
.ib-bars .me i { background: var(--ib-ink); }
.ib-bars .me.over i { background: var(--ib-bad); }
.ib-flabel { font-size: 11px; color: var(--ib-ink2); margin-bottom: 6px; display: inline-flex; align-items: center; gap: 4px; }
.ib-seg { display: flex; gap: 14px; border-bottom: 1px solid var(--ib-hair); flex-wrap: wrap; }
.ib-seg button { border: 0; background: none; padding: 6px 0 7px; font-size: 13px; color: var(--ib-ink2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.ib-seg button:hover { color: var(--ib-ink); }
.ib-seg button[aria-pressed="true"] { color: var(--ib-ink); font-weight: 700; border-bottom-color: var(--ib-ink); }
.ib-seg button:disabled { color: var(--ib-ink3); text-decoration: line-through; cursor: not-allowed; }
.ib-fmthint { font-size: 11px; color: var(--ib-ink3); margin-top: 6px; }
.ib-fmthint:empty { display: none; }
.ib-qrow { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; flex-wrap: wrap; min-width: 0; }
.ib-qrow .ib-flabel { margin: 0; }
.ib-qval { font-size: 20px; font-weight: 500; min-width: 3ch; }
.ib-qzone { font-size: 11px; color: var(--ib-ink2); }
.ib-qsteps { margin-left: auto; display: flex; gap: 2px; }
.ib-qsteps button { border: 0; background: none; color: var(--ib-ink2); font-size: 11px; padding: 2px 5px; border-radius: var(--ib-radius); font-variant-numeric: tabular-nums; }
.ib-qsteps button:hover { background: var(--ib-paper2); color: var(--ib-ink); }
.ib-slider { position: relative; height: 28px; margin-top: 2px; }
.ib-track { position: absolute; left: 0; right: 0; top: 13px; height: 2px; border-radius: 2px; background: var(--ib-hair); overflow: hidden; }
.ib-track .fill { display: block; height: 100%; background: var(--ib-ink); }
.ib-slider input { position: absolute; inset: 0; width: 100%; height: 28px; margin: 0; background: transparent; -webkit-appearance: none; appearance: none; cursor: pointer; }
.ib-slider input::-webkit-slider-runnable-track { height: 28px; background: transparent; }
.ib-slider input::-moz-range-track { height: 28px; background: transparent; }
.ib-slider input::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; margin-top: 6px; border-radius: 50%; background: var(--ib-ink); border: 3px solid var(--ib-paper); box-shadow: 0 0 0 1px var(--ib-ink); }
.ib-slider input::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--ib-ink); border: 3px solid var(--ib-paper); box-shadow: 0 0 0 1px var(--ib-ink); }
.ib-slider input:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 4px hsl(var(--primary) / .45); }
.ib-slider.off { opacity: .3; pointer-events: none; }
.ib-ends { display: flex; justify-content: space-between; font-size: 11px; color: var(--ib-ink3); }
.ib-ends.off { opacity: .4; }
.ib-advice { display: none; margin-top: 12px; font-size: 12px; color: var(--ib-bad); line-height: 1.6; }
.ib-advice.on { display: block; }
.ib-shared { padding: 18px 20px; border-bottom: 1px solid var(--ib-hair); }
.ib-shared h3 { font-size: 12px; font-weight: 700; letter-spacing: .06em; margin: 0 0 10px; display: flex; align-items: center; gap: 6px; }
.ib-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.ib-chips-sub { margin-top: 6px; }
.ib-chip { border: 1px solid var(--ib-hair); background: var(--ib-paper); border-radius: var(--ib-radius); padding: 4px 9px; font-size: 12px; color: var(--ib-ink2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.ib-chip:hover { border-color: var(--ib-ink3); color: var(--ib-ink); }
.ib-chip[aria-pressed="true"] { background: var(--ib-ink); color: var(--ib-paper); border-color: var(--ib-ink); }
.ib-chip:disabled { opacity: .4; cursor: not-allowed; }
.ib-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.ib-input { border: 0; border-bottom: 1px solid var(--ib-hair); background: transparent; padding: 3px 2px; font-size: 12px; color: var(--ib-ink); width: 6.5em; min-width: 0; border-radius: 0; }
.ib-input:focus { outline: none; border-bottom-color: var(--ib-ink); }
.ib-input-text { width: 8em; }
.ib-input-xs { width: 3.5em; }
.ib-color { width: 28px; height: 22px; padding: 0; border: 1px solid var(--ib-hair); border-radius: var(--ib-radius); background: transparent; cursor: pointer; }
.ib-dims { margin-top: 10px; font-size: 12px; color: var(--ib-ink2); overflow-wrap: anywhere; }
.ib-details { padding: 14px 20px 16px; border-bottom: 1px solid var(--ib-hair); }
.ib-details summary { cursor: pointer; font-size: 12px; font-weight: 700; letter-spacing: .06em; color: var(--ib-ink2); list-style: none; display: flex; align-items: center; gap: 8px; }
.ib-details summary::-webkit-details-marker { display: none; }
.ib-details summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .15s; }
.ib-details[open] summary::before { transform: rotate(45deg); }
.ib-details-body { display: flex; flex-direction: column; gap: 14px; margin-top: 12px; }
.ib-field { display: flex; flex-direction: column; gap: 6px; }
.ib-field .ib-line { margin-top: 0; }
.ib-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; cursor: pointer; }
.ib-check input { accent-color: var(--ib-ink); width: 14px; height: 14px; margin: 0; }
.ib-check input:disabled + span { opacity: .5; }
.ib-meta-note { padding: 12px 20px 18px; font-size: 11px; color: var(--ib-ink3); line-height: 1.6; margin: 0; overflow-wrap: anywhere; }
.ib-vblock, .ib-shared, .ib-details { min-width: 0; }

/* ---------- 入口（画像が0枚のときだけ表示） ---------- */
.ib-entry { max-width: 980px; margin: 0 auto; padding: 36px 0 28px; min-width: 0; }
.ib-eyebrow { font-size: 12px; color: var(--ib-ink2); letter-spacing: .08em; margin: 0 0 14px; }
.ib-entry-title { font-size: clamp(28px, 4.2vw, 44px); line-height: 1.25; font-weight: 700; margin: 0 0 30px; letter-spacing: .01em; color: var(--ib-ink); }
.ib-entry-title span { color: var(--ib-ink3); }
.ib-dz { position: relative; display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 28px; padding: 34px 40px; border: 1.5px dashed var(--ib-ink3); border-radius: 6px; background: var(--ib-paper); color: var(--ib-ink); cursor: pointer; transition: border-color .15s, background .15s; }
.ib-dz:hover, .ib-dz:focus-visible, body.ib-dragging .ib-dz { border-color: var(--ib-ink); border-style: solid; background: var(--ib-paper2); outline: none; }
.ib-dz svg { width: 84px; height: 84px; display: block; }
.ib-dz-main { font-size: 20px; font-weight: 700; margin: 0 0 6px; }
.ib-dz-sub { font-size: 13px; color: var(--ib-ink2); margin: 0; }
.ib-dz-sub u { color: var(--ib-ink); text-underline-offset: 3px; }
.ib-dz kbd { font-family: inherit; font-size: 12px; border: 1px solid var(--ib-hair); border-bottom-width: 2px; border-radius: 3px; padding: 0 6px; background: var(--ib-paper); color: var(--ib-ink); }
.ib-safe { display: flex; align-items: center; gap: 8px; margin: 14px 2px 0; font-size: 13px; color: var(--ib-ink2); }
.ib-safe::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ib-good); flex: none; }
.ib-samples { margin-top: 46px; }
.ib-samples h3 { font-size: clamp(22px, 3vw, 30px); font-weight: 700; margin: 0 0 6px; letter-spacing: .01em; color: var(--ib-ink); }
.ib-samples-note { font-size: 12px; color: var(--ib-ink2); margin: 0 0 18px; }
.ib-sgrid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.ib-scard { border: 0; background: none; padding: 0; text-align: left; cursor: pointer; color: inherit; font: inherit; min-width: 0; }
.ib-scard:disabled { cursor: default; }
.ib-scard .th { aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; position: relative; background-color: var(--ib-paper2); background-image: linear-gradient(45deg, var(--ib-hair) 25%, transparent 25%, transparent 75%, var(--ib-hair) 75%), linear-gradient(45deg, var(--ib-hair) 25%, transparent 25%, transparent 75%, var(--ib-hair) 75%); background-size: 14px 14px; background-position: 0 0, 7px 7px; }
.ib-scard img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .35s ease; }
.ib-scard:not(:disabled):hover img, .ib-scard:focus-visible img { transform: scale(1.04); }
.ib-scard:focus-visible { outline: 2px solid var(--ib-ink); outline-offset: 4px; border-radius: 4px; }
.ib-scard .go2 { position: absolute; right: 8px; bottom: 8px; font-size: 11px; font-weight: 700; background: var(--ib-ink); color: var(--ib-paper); padding: 3px 9px; border-radius: 999px; opacity: 0; transform: translateY(4px); transition: .2s; }
.ib-scard:not(:disabled):hover .go2, .ib-scard:focus-visible .go2 { opacity: 1; transform: none; }
.ib-scard .sl { font-size: 13px; font-weight: 700; margin: 10px 0 1px; }
.ib-scard .sm { font-size: 11px; color: var(--ib-ink2); }
.ib-scard .sz { font-size: 13px; margin-top: 6px; display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.ib-scard .sz .a { color: var(--ib-ink2); }
.ib-scard .sz .b { font-weight: 700; }
.ib-scard .sz .d { font-size: 12px; font-weight: 700; color: var(--ib-good); }
.ib-scard .sz .d.bad { color: var(--ib-bad); }
.ib-scard .sz .wait { color: var(--ib-ink3); }
.ib-steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--ib-hair); }
.ib-steps div { font-size: 12px; color: var(--ib-ink2); line-height: 1.7; }
.ib-steps b { display: block; font-size: 13px; color: var(--ib-ink); margin-bottom: 2px; }
.ib-steps i { font-style: normal; font-size: 11px; color: var(--ib-ink3); margin-right: 6px; }
@media (max-width: 760px) {
  .ib-sgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ib-dz { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 28px 18px; }
  .ib-steps { grid-template-columns: 1fr; }
}

/* ツールチップ（共通 .tooltip-wrap に「タップで開く」と左寄せの補正を足す） */
.ib-tip .tooltip-icon { font-family: inherit; }
.ib-tip.is-open .tooltip-body { display: block; }
.ib-tip .tooltip-body { pointer-events: auto; left: 0; transform: none; }
.ib-tip .tooltip-body::after { left: .75rem; transform: none; }

/* ---------- 中央下：一括変換バー ---------- */
.ib-bar { display: flex; flex-direction: column; border-top: 1px solid var(--ib-hair); }
.ib-bar-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.ib-bar-row + .ib-bar-row { padding-top: 0; }
.ib-sum { font-size: 12px; color: var(--ib-ink2); white-space: nowrap; }
.ib-ab { font-size: 12px; color: var(--ib-ink2); }
.ib-zipf { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--ib-ink3); }
.ib-zip { border: 0; border-bottom: 1px solid var(--ib-hair); background: transparent; padding: 4px 2px; width: 180px; font-size: 12px; color: var(--ib-ink); border-radius: 0; }
.ib-zip:focus { outline: none; border-bottom-color: var(--ib-ink); }
.ib-go { border: 0; border-radius: var(--ib-radius); padding: 10px 16px; background: var(--ib-ink); color: var(--ib-paper); font-weight: 700; font-size: 13px; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.ib-go:hover { opacity: .88; }
.ib-go:disabled { opacity: .35; cursor: not-allowed; }
.ib-go.b { background: transparent; color: var(--ib-ink); box-shadow: inset 0 0 0 1.5px var(--ib-ink); }
.ib-go i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; }
.ib-go.a i { background: var(--ib-va); }
.ib-go.b i { background: var(--ib-vb); }
.ib-progress { font-size: 12px; color: var(--ib-ink2); }
.ib-progress-bar { flex: 1 1 160px; height: 2px; background: var(--ib-hair); border-radius: 2px; overflow: hidden; min-width: 80px; }
.ib-progress-fill { height: 100%; width: 0; background: var(--ib-ink); transition: width .15s; }
.ib-progress-file { font-size: 11px; color: var(--ib-ink3); max-width: 24em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ib-result-text { font-size: 12px; color: var(--ib-ink); }
.ib-result-text .good { color: var(--ib-good); }
.ib-result-text .bad { color: var(--ib-bad); }
.ib-stale { font-size: 11px; color: var(--ib-bad); }
.ib-fail-list { list-style: none; padding: 0 16px 10px !important; margin: 0; font-size: 11px; color: var(--ib-ink2); }
.ib-fail-list li { margin: 0 0 3px; word-break: break-all; }
.ib-fail-list li span { color: var(--ib-bad); }

/* ---------- 変換履歴 ---------- */
.ib-history { margin-top: 28px; }
.ib-section-title { font-size: 14px; font-weight: 700; margin: 0 0 8px; }
.ib-history-list { list-style: none; padding: 0 !important; margin: 0; font-size: 12px; }
.ib-history-list li { padding: 6px 0; border-bottom: 1px solid var(--ib-hair); margin: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.ib-history-list li span:first-child { color: var(--ib-ink2); }
.ib-history-empty { color: var(--ib-ink3); font-size: 12px; margin: 0; }
.ib-history-tools { margin-top: 8px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }

/* ---------- 解説・ヘルプ・FAQ（作業台の下・折りたたまない） ---------- */
.ib-help { margin: 48px auto 0; max-width: 720px; font-size: 14px; line-height: 1.85; }
.ib-help h2 { font-size: 18px; font-weight: 700; margin: 36px 0 10px; color: var(--ib-ink); }
.ib-help h2:first-child { margin-top: 0; }
.ib-help h3 { font-size: 14px; font-weight: 700; margin: 22px 0 6px; color: var(--ib-ink); }
.ib-help p, .ib-help li { font-size: 14px; line-height: 1.85; color: var(--ib-ink); }
.ib-help p { margin: 0 0 10px; }
.ib-help ul, .ib-help ol { margin: 6px 0 12px; }
.ib-help a { color: hsl(var(--primary)); text-decoration: underline; }
.ib-help table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0 12px; }
.ib-help th, .ib-help td { border-top: 1px solid var(--ib-hair); padding: 8px 8px 8px 0; text-align: left; vertical-align: top; line-height: 1.6; }
.ib-help th { font-weight: 600; white-space: nowrap; color: var(--ib-ink2); }
.ib-credit { font-size: 11px; color: var(--ib-ink3); margin-top: 32px; line-height: 1.7; }

@media (prefers-reduced-motion: reduce) {
  .ib-strip, .ib-bars i, .ib-tag .ts, .ib-tag .td, .ib-progress-fill { transition: none !important; }
}
