/* ===========================================================
   共通スタイル
   設計方針: 「作業台」。装飾ではなく道具に見えること。
   影は使わない。角丸は 3px に統一。境界線で構造を示す。
   =========================================================== */

:root {
  --ink:      #13233B;
  --ink-2:    #55657F;
  --ink-3:    #8494AC;
  --paper:    #FFFFFF;
  --panel:    #EDF1F7;
  --panel-2:  #F7F9FC;
  --line:     #C9D5E4;
  --line-2:   #E2E9F2;
  --accent:   #2B44C7;
  --accent-d: #1E32A0;
  --ok:       #0E7A5F;
  --warn:     #A4341A;

  --r: 3px;
  --w: 960px;

  --f: system-ui, -apple-system, "Hiragino Kaku Gothic ProN",
       "Noto Sans JP", "Yu Gothic", Meiryo, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  font-family: var(--f);
  font-size: 16px;
  line-height: 1.9;
  color: var(--ink);
  background: var(--panel);
  font-feature-settings: "palt" 1;
}

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

/* ---------- 骨格 ---------- */

.wrap { max-width: var(--w); margin: 0 auto; padding: 0 16px; }

.site-head {
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.site-head__in {
  max-width: var(--w);
  margin: 0 auto;
  padding: 14px 16px;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}
.site-head__name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  color: var(--ink);
}
.site-head__nav { margin-left: auto; font-size: 14px; }
.site-head__nav a { text-decoration: none; }
.site-head__nav a:hover { text-decoration: underline; }

main { padding: 28px 0 56px; }

.site-foot {
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding: 24px 0;
  font-size: 14px;
  color: var(--ink-2);
}
.site-foot__in { max-width: var(--w); margin: 0 auto; padding: 0 16px; }
.site-foot a { margin-right: 18px; }

/* ---------- 見出し ---------- */

h1 {
  font-size: clamp(24px, 5vw, 32px);
  line-height: 1.4;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
}
h2 {
  font-size: 21px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  margin: 44px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
h3 { font-size: 17px; margin: 28px 0 8px; }

.lede { color: var(--ink-2); margin: 0 0 20px; font-size: 15px; }

/* ---------- 安心表記 ---------- */

.local {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: var(--paper);
  border: 1px solid var(--line);
  border-left: 3px solid var(--ok);
  border-radius: var(--r);
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.7;
  margin: 0 0 20px;
}
.local b { color: var(--ok); }

/* ===========================================================
   ツール本体
   =========================================================== */

.tool {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}
.tool > * + * { border-top: 1px solid var(--line-2); }

/* --- 投入エリア --- */

.drop {
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  background: var(--panel-2);
  transition: background .12s linear;
}
.drop:hover { background: #EFF3F9; }
.drop.is-over {
  background: #E6EBFA;
  box-shadow: inset 0 0 0 2px var(--accent);
}
.drop__main { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.drop__sub  { font-size: 13px; color: var(--ink-2); margin: 0; }

/* --- サムネイル一覧 --- */

.files { margin: 0; padding: 0; list-style: none; }
.files__bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--ink-2);
  background: var(--panel-2);
  border-bottom: 1px solid var(--line-2);
}
.files__bar strong { color: var(--ink); font-variant-numeric: tabular-nums; }
.files__clear {
  margin-left: auto;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: var(--r);
  padding: 3px 10px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}
.files__clear:hover { color: var(--warn); border-color: var(--warn); }

.files__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  padding: 12px 14px;
  margin: 0;
  list-style: none;
  max-height: 260px;
  overflow-y: auto;
}
.file { position: relative; }
.file__img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  background: var(--panel);
}
.file__name {
  font-size: 11px;
  line-height: 1.4;
  color: var(--ink-2);
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file__del {
  position: absolute;
  top: 3px; right: 3px;
  width: 22px; height: 22px;
  border: none;
  border-radius: 50%;
  background: rgba(19,35,59,.78);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  font-family: inherit;
}
.file__del:hover { background: var(--warn); }
.file.is-bad .file__img { border-color: var(--warn); opacity: .45; }

/* --- オプション --- */

.opts { padding: 16px 14px; }
.opts__title { font-size: 14px; font-weight: 700; margin: 0 0 10px; }

.presets { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px; }
.preset {
  font-family: inherit;
  font-size: 13px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  border-radius: var(--r);
  cursor: pointer;
  min-height: 36px;
}
.preset:hover { border-color: var(--accent); color: var(--accent); }
.preset.is-on {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.custom { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; }
.custom select, .custom input[type="number"] {
  font-family: inherit;
  font-size: 15px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  min-height: 44px;
}
.custom input[type="number"] { width: 110px; font-variant-numeric: tabular-nums; }

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 12px;
  cursor: pointer;
}
.check input { width: 18px; height: 18px; accent-color: var(--accent); }

/* --- 実行 --- */

.run-row { padding: 14px; }
.run {
  width: 100%;
  min-height: 52px;
  font-family: inherit;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .01em;
  color: #fff;
  background: var(--accent);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
}
.run:hover:not(:disabled) { background: var(--accent-d); }
.run:disabled { background: var(--ink-3); cursor: not-allowed; }

/* --- 進捗 --- */

.prog { padding: 14px; }
.prog__row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  margin-bottom: 8px;
}
.prog__count { font-variant-numeric: tabular-nums; font-weight: 700; }
.prog__stop {
  margin-left: auto;
  font-family: inherit;
  font-size: 13px;
  padding: 5px 12px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink-2);
  border-radius: var(--r);
  cursor: pointer;
  min-height: 32px;
}
.prog__stop:hover { color: var(--warn); border-color: var(--warn); }
.prog__track { height: 6px; background: var(--line-2); border-radius: 99px; overflow: hidden; }
.prog__bar { height: 100%; width: 0; background: var(--accent); transition: width .15s linear; }

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

.result { padding: 16px 14px; }
.result__head { font-size: 15px; margin: 0 0 12px; font-variant-numeric: tabular-nums; }
.result__head b { color: var(--ok); }
.result__head .ng { color: var(--warn); }

.dl {
  display: inline-block;
  min-height: 50px;
  line-height: 50px;
  padding: 0 24px;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--ok);
  border: none;
  border-radius: var(--r);
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.dl:hover { background: #0B6450; }

.result__list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line-2);
  max-height: 240px;
  overflow-y: auto;
  font-size: 13px;
}
.result__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-bottom: 1px solid var(--line-2);
}
.result__item span:first-child {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.result__size { color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.result__item.is-bad { color: var(--warn); }

/* --- 通知 --- */

.notice {
  padding: 11px 14px;
  font-size: 14px;
  line-height: 1.6;
  background: #FDF0EC;
  color: var(--warn);
  border-left: 3px solid var(--warn);
}
.notice:empty { display: none; padding: 0; border: none; }

/* ===========================================================
   本文・解説
   =========================================================== */

.doc { max-width: 660px; }
.doc p { margin: 0 0 14px; }
.doc ol, .doc ul { margin: 0 0 14px; padding-left: 1.4em; }
.doc li { margin-bottom: 6px; }
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 0 0 16px; }
.doc th, .doc td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.doc th { background: var(--panel-2); font-weight: 700; white-space: nowrap; }

.faq { margin: 0 0 10px; border-bottom: 1px solid var(--line-2); }
.faq summary { cursor: pointer; padding: 11px 0; font-weight: 700; font-size: 15px; }
.faq summary::marker { color: var(--accent); }
.faq p { margin: 0 0 12px; font-size: 15px; }

/* ---------- 関連ツール ---------- */

.related { list-style: none; margin: 0; padding: 0; }
.related li { border-bottom: 1px solid var(--line-2); }
.related a {
  display: block;
  padding: 13px 2px;
  text-decoration: none;
  color: var(--ink);
}
.related a:hover { color: var(--accent); }
.related b { font-size: 15px; display: block; }
.related span { font-size: 13px; color: var(--ink-2); }

/* ---------- トップのツール一覧 ---------- */

.catalog { list-style: none; margin: 0 0 8px; padding: 0; }
.catalog li { border-bottom: 1px solid var(--line-2); }
.catalog a, .catalog .soon {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 14px 2px;
  text-decoration: none;
  color: var(--ink);
}
.catalog a:hover { color: var(--accent); }
.catalog .soon { color: var(--ink-3); }
.catalog b { font-size: 16px; }
.catalog span { font-size: 13px; color: var(--ink-2); }
.catalog .soon span { color: var(--ink-3); }
.catalog .tag {
  margin-left: auto;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
}

/* ---------- 広告枠 ---------- */

.ad { margin: 28px 0; min-height: 1px; }

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

@media (max-width: 600px) {
  body { font-size: 15px; }
  .drop { padding: 32px 16px; }
  .files__grid { grid-template-columns: repeat(auto-fill, minmax(74px, 1fr)); }
}

/* ---------- 結果の表（情報系ツール） ---------- */
.table-scroll { overflow-x: auto; margin: 0 0 14px; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th, table.data td {
  border: 1px solid var(--line-2);
  padding: 7px 9px;
  text-align: left;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.data th { background: var(--panel-2); font-weight: 700; }

/* ---------- 色見本 ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px,1fr)); gap: 8px; margin: 0 0 14px; }
.swatch { border: 1px solid var(--line-2); border-radius: var(--r); overflow: hidden; }
.swatch__chip { height: 54px; }
.swatch__code {
  font-size: 13px; padding: 6px 8px; text-align: center;
  font-variant-numeric: tabular-nums; cursor: pointer; background: var(--paper);
}
.swatch__code:hover { color: var(--accent); }

/* ---------- 編集台（モザイクなどの対話ツール） ---------- */
.stage { padding: 14px; background: var(--panel-2); text-align: center; }
.stage__canvas {
  max-width: 100%; height: auto; border: 1px solid var(--line);
  border-radius: var(--r); background: #fff; touch-action: none; cursor: crosshair;
}
.stage__hint { font-size: 13px; color: var(--ink-2); margin: 8px 0 0; }
.stage__nav { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 10px; font-size: 14px; }
.stage__nav button {
  font-family: inherit; font-size: 14px; padding: 7px 14px; min-height: 40px;
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: var(--r); cursor: pointer;
}
.stage__nav button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.stage__nav button:disabled { color: var(--ink-3); cursor: not-allowed; }

/* ---------- 並べ替え（結合・PDF化） ---------- */
.file__up {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border: none; border-radius: 50%;
  background: rgba(19,35,59,.78); color: #fff;
  font-size: 13px; line-height: 1; cursor: pointer; font-family: inherit;
}
.file__up:hover { background: var(--accent); }

.file__ord {
  position: absolute; top: 3px; left: 3px;
  min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 11px; background: var(--accent); color: #fff;
  font-size: 12px; line-height: 22px; text-align: center;
  font-variant-numeric: tabular-nums;
}
.file__move {
  position: absolute; bottom: 20px; left: 0; right: 0;
  display: flex; justify-content: space-between; padding: 0 3px;
}
.file__move button {
  width: 24px; height: 24px; border: none; border-radius: var(--r);
  background: rgba(19,35,59,.72); color: #fff; font-size: 13px; line-height: 1;
  cursor: pointer; font-family: inherit;
}
.file__move button:hover { background: var(--accent); }
.file__move button:disabled { opacity: .25; cursor: not-allowed; }
