/* EC画像作成ツール（色の補正）の見た目。パソコンの画面（横幅1280px前後）向け */
:root {
  --main: #0E7C74;      /* 基本色（ティール） */
  --main-dark: #0a625c;
  --main-light: #e6f4f2;
  --warn: #D97706;      /* 注意（橙） */
  --warn-bg: #fff7e6;
  --error: #DC2626;     /* 失敗（赤） */
  --error-bg: #fef2f2;
  --ok: #15803D;        /* 成功（緑） */
  --ok-bg: #ecfdf3;
  --text: #1f2937;
  --sub: #6b7280;
  --line: #d1d5db;
  --bg: #f5f7f8;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; } /* 隠した欄は、ほかの書式より優先して隠す */

body {
  margin: 0;
  font-family: "Yu Gothic UI", "Meiryo", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

/* ===== 上の帯とタブ ===== */
.app-header {
  background: var(--main);
  color: #fff;
  padding: 14px 32px 0;
}
.app-header h1 { margin: 0 0 10px; font-size: 21px; font-weight: bold; }
.tabs { display: flex; gap: 4px; }
.tab {
  font: inherit;
  font-size: 15px;
  padding: 9px 22px;
  border: 0;
  border-radius: 8px 8px 0 0;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  cursor: pointer;
}
.tab:hover { background: rgba(255, 255, 255, 0.3); }
.tab[aria-selected="true"] { background: var(--bg); color: var(--main); font-weight: bold; }

main { max-width: 1240px; margin: 0 auto; padding: 20px 32px 48px; }
.lead { margin: 0 0 16px; }

/* ===== 手順のまとまり ===== */
.step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}
.step h2 { margin: 0 0 10px; font-size: 17px; display: flex; align-items: center; gap: 10px; }
.step h3 { margin: 12px 0 6px; font-size: 15px; }
.num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--main);
  color: #fff;
  font-size: 15px;
  flex-shrink: 0;
}
.hint { color: var(--sub); font-size: 14px; margin: 4px 0 10px; }
.row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 8px 0; }

/* ===== ボタン ===== */
.btn {
  display: inline-block;
  font: inherit;
  padding: 8px 18px;
  border: 1px solid var(--main);
  border-radius: 6px;
  background: var(--main);
  color: #fff;
  cursor: pointer;
}
.btn:hover { background: var(--main-dark); }
.btn:disabled { background: #9ca3af; border-color: #9ca3af; cursor: not-allowed; }
.btn-sub { background: #fff; color: var(--main); }
.btn-sub:hover { background: var(--main-light); }
.btn-small { padding: 4px 12px; font-size: 14px; }
.btn-big { font-size: 17px; padding: 12px 28px; font-weight: bold; }
.btn-delete { background: #fff; color: var(--error); border-color: var(--error); }
.btn-delete:hover { background: var(--error-bg); }

/* ===== ファイルを入れる場所 ===== */
.drop {
  border: 2px dashed var(--main);
  border-radius: 10px;
  background: var(--main-light);
  padding: 22px;
  text-align: center;
}
.drop p { margin: 0 0 10px; color: var(--main-dark); font-weight: bold; }
.drop.dragover { background: #c9ebe6; }
.drop-small { padding: 14px; }
.file-info { margin: 8px 0 0; color: var(--sub); }
.file-info:empty { display: none; }

/* ===== 写真と選んだ範囲 ===== */
.photo-wrap { position: relative; display: inline-block; line-height: 0; border: 1px solid var(--line); background: #e5e7eb; }
.photo-wrap canvas { display: block; }
.overlay { position: absolute; left: 0; top: 0; cursor: crosshair; }

.compare { display: flex; gap: 16px; flex-wrap: wrap; }
.compare figure { margin: 0; }
.compare figcaption { font-weight: bold; margin-bottom: 4px; }
.compare canvas { display: block; border: 1px solid var(--line); max-width: 540px; height: auto; }

.card-line { font-size: 18px; font-weight: bold; margin: 4px 0 10px; }
.card-line .mark-ok { color: var(--ok); }
.card-line .mark-ng { color: var(--error); }

/* ===== 赤い枠・黄色い枠 ===== */
.error-box {
  border: 2px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-weight: bold;
}
.warn-box {
  border: 2px solid var(--warn);
  background: var(--warn-bg);
  color: #92400e;
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0 12px;
}
.warn-box ul { margin: 0; padding-left: 20px; }
.warn-box p { margin: 0 0 4px; font-weight: bold; color: var(--warn); }

/* ===== 基準の欄 ===== */
.cal-box { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cal-now { flex: 1; min-width: 320px; padding: 10px 14px; border-radius: 8px; background: var(--main-light); border-left: 5px solid var(--main); }
.cal-now.none { background: #f3f4f6; border-left-color: #9ca3af; color: var(--sub); }
.cal-now .cal-name { font-weight: bold; font-size: 16px; }
.cal-now .cal-detail { font-size: 13px; color: var(--sub); }

/* ===== まとめて補正 ===== */
.file-list-head { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.file-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 260px; overflow-y: auto; }
.file-list li { display: flex; align-items: center; gap: 12px; padding: 5px 8px; border-bottom: 1px solid #eef0f2; }
.file-list li:nth-child(odd) { background: #fafafa; }
.file-list .fname { flex: 1; word-break: break-all; }
.file-list .fsize { color: var(--sub); font-size: 13px; white-space: nowrap; }
.file-list .fkind { font-size: 13px; color: var(--sub); white-space: nowrap; }
.file-list .fkind.bad { color: var(--error); font-weight: bold; }

.save-mode { margin: 12px 0 0; padding: 8px 12px; background: var(--main-light); border-radius: 6px; font-weight: bold; }
.progress { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.progress-bar { flex: 1; max-width: 480px; height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden; }
.progress-fill { height: 100%; width: 0; background: var(--main); transition: width 0.2s; }
#batch-progress-text { font-weight: bold; font-size: 16px; }

.result-list { list-style: none; margin: 0; padding: 0; }
.result-list li {
  display: grid;
  grid-template-columns: minmax(200px, 2fr) 72px minmax(240px, 3fr);
  gap: 12px;
  align-items: start;
  padding: 8px 10px;
  border-bottom: 1px solid #eef0f2;
  cursor: pointer;
}
.result-list li:nth-child(odd) { background: #fafafa; }
.result-list li:hover { background: var(--main-light); }
.result-list li.selected { background: #c9ebe6; }
.result-list .rname { word-break: break-all; font-weight: bold; }
.result-list .rmsg { font-size: 14px; }
.badge {
  display: inline-block;
  text-align: center;
  padding: 1px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  color: #fff;
}
.badge-ok { background: var(--ok); }
.badge-warning { background: #CA8A04; }
.badge-error { background: var(--error); }
.rmsg.warning { color: #92400e; }
.rmsg.error { color: var(--error); }

.compare-area { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line); }

/* ===== 数値チェック ===== */
.points { border-collapse: collapse; margin-top: 14px; min-width: 760px; }
.points th, .points td { border-bottom: 1px solid #eef0f2; padding: 6px 10px; text-align: left; }
.points th { background: var(--main-light); font-size: 14px; }
.points tbody tr:nth-child(even) { background: #fafafa; }
.points .pnum {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--main); color: #fff; font-size: 13px; font-weight: bold;
}
.points .val { font-family: Consolas, "Yu Gothic UI", monospace; white-space: nowrap; }
.points .none { color: var(--sub); }
.name-input { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; width: 260px; }
.num-input { font: inherit; padding: 5px 8px; border: 1px solid var(--line); border-radius: 6px; width: 90px; }

.radios { display: flex; gap: 24px; margin-bottom: 10px; }
.radios label { cursor: pointer; font-weight: bold; }
.sub-box { padding: 10px 14px; border-left: 4px solid var(--main); background: #fafafa; border-radius: 0 6px 6px 0; }
.sub-box .photo-wrap { margin: 6px 0 10px; }

.check-results { list-style: none; margin: 0 0 12px; padding: 0; }
.check-results li { padding: 6px 10px; border-bottom: 1px solid #eef0f2; font-size: 16px; }
.check-results li.pass { color: var(--ok); }
.check-results li.fail { color: var(--error); font-weight: bold; }
.check-results li.pending { color: var(--sub); }
.check-results .note { display: block; font-size: 13px; color: var(--sub); font-weight: normal; }
.copied { color: var(--ok); font-weight: bold; }
#check-report-text { width: 100%; max-width: 760px; font: inherit; padding: 8px; }

/* 失敗した行の詳しい理由（折りたたみ） */
.rdetail { margin-top: 4px; font-size: 13px; }
.rdetail summary { cursor: pointer; color: var(--sub); }
.rdetail pre {
  margin: 4px 0 0;
  padding: 6px 8px;
  background: #f3f4f6;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  color: var(--text);
}

/* ===== 色合わせ（基準に寄せる） ===== */
.fit-knobs { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin: 10px 0; }
.knob { display: inline-flex; align-items: center; gap: 6px; background: var(--main-light); border-radius: 999px; padding: 4px 8px 4px 14px; }
.knob-name { font-weight: bold; margin-right: 4px; }
.knob-val { min-width: 54px; text-align: center; font-variant-numeric: tabular-nums; }
.knob-btn {
  width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--main);
  background: #fff; color: var(--main); font-size: 18px; line-height: 1; cursor: pointer;
}
.knob-btn:hover { background: var(--main); color: #fff; }
.fit-effect { margin: 6px 0 10px; font-weight: bold; }
.check-label { display: inline-flex; align-items: center; gap: 6px; }
.hint-inline { color: var(--sub); font-size: 13px; margin-left: 4px; }
.result-list li.static { cursor: default; }
.result-list li.static:hover { background: inherit; }

/* 4. 色の微調整 */
.points-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.points-list li { display: inline-flex; align-items: center; gap: 6px; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 8px; }
.points-list .name-input { width: 140px; }
.check-results li.plain { border-left-color: var(--main); background: #fff; }
.warn-inline { color: var(--warn); font-weight: bold; margin: 6px 0; }
