/* KATACHI — やわらかパステル */
:root {
  --ink: #3b3355;
  --ink-soft: #5d5578;
  --muted: #6b6385;
  --line: #e7e2f5;
  --bg: #fbf9ff;
  --card: #ffffff;
  --accent: #7a5cf0;
  --accent-dark: #5a3fd6;
  --accent-soft: #f3efff;
  --lavender: #e6defe;
  --lavender-mid: #b9a6ff;
  --mint: #d6f3e6;
  --mint-mid: #8fdcb8;
  --mint-ink: #1f5c43;
  --pink: #ffe1ea;
  --pink-ink: #8a2346;
  --warn-bg: #fff4dc;
  --warn: #7a5200;
  --error: #c0264f;
  --radius: 28px;
  --shadow: 0 20px 60px rgba(80, 60, 160, 0.12);
  --shadow-sm: 0 2px 10px rgba(80, 60, 160, 0.10);
  /* 丸ゴシック：入っている端末では丸ゴシックで表示し、無ければ通常のゴシックになる */
  font-family: "Zen Maru Gothic", "Hiragino Maru Gothic ProN", "ヒラギノ丸ゴ ProN", "BIZ UDPGothic", system-ui, -apple-system, "Hiragino Sans", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.75;
  -webkit-text-size-adjust: 100%;
}
* { box-sizing: border-box; }
body { margin: 0; overflow-x: clip; }
a { color: var(--accent-dark); }
a:hover { color: var(--accent); }
.wrap { max-width: 760px; margin: 0 auto; padding: 0 16px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; }
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
[hidden] { display: none !important; }

/* ヘッダー */
.site-header { position: relative; z-index: 2; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.logo:hover { color: var(--ink); }
.logo-mark { width: 34px; height: 34px; }
.logo-mark .lm-a { fill: var(--lavender-mid); }
.logo-mark .lm-b { fill: var(--mint-mid); opacity: .92; }
.logo-text { font-weight: 900; letter-spacing: .1em; font-size: 1.25rem; }
.site-nav { display: flex; gap: 8px; }
.site-nav a { color: var(--ink); text-decoration: none; font-weight: 700; font-size: .88rem; background: #fff; padding: 8px 16px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.site-nav a:hover { color: var(--accent-dark); }

/* ヒーロー */
.hero { position: relative; padding: 20px 0 8px; text-align: center; }
.blobs { position: absolute; z-index: -1; top: -72px; left: 50%; transform: translateX(-50%); width: 100vw; height: 640px; pointer-events: none; }
.blob-a { fill: var(--lavender); }
.blob-b { fill: var(--mint); }
.blob-c { fill: var(--pink); }
.hero h1 { font-size: clamp(1.75rem, 6vw, 3.1rem); line-height: 1.35; font-weight: 900; margin: 0 0 10px; letter-spacing: .02em; }
.hero .accent { color: var(--accent); }
.lead { margin: 0 auto; max-width: 34em; color: var(--ink-soft); font-weight: 700; }
.badges { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 0; margin: 16px 0 0; list-style: none; }
.badges li { font-weight: 700; font-size: .82rem; padding: 4px 14px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-dark); }
.badges li:nth-child(5n+2) { background: var(--mint); color: var(--mint-ink); }
.badges li:nth-child(5n+3) { background: var(--pink); color: var(--pink-ink); }

/* 端末内で完結することを伝える枠 */
.local-only { display: flex; gap: 14px; align-items: flex-start; max-width: 700px; margin: 18px auto 0; padding: 16px 20px; text-align: left; background: var(--mint); border-radius: 24px; }
.local-only-icon { flex: none; width: 34px; height: 34px; fill: none; stroke: var(--mint-ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.local-only-title { margin: 0 0 2px; font-weight: 900; color: var(--mint-ink); font-size: 1.02rem; line-height: 1.5; }
.local-only-text { margin: 0; font-size: .9rem; color: #2f4d41; }
.local-only-text a { white-space: nowrap; color: var(--mint-ink); font-weight: 700; }

/* カード */
.card { background: var(--card); border-radius: var(--radius); padding: 24px; margin: 24px 0; box-shadow: var(--shadow); }
.card h2 { font-size: 1.15rem; font-weight: 900; margin: 0 0 12px; }
.alert { background: var(--warn-bg); color: var(--warn); padding: 12px 16px; border-radius: 16px; }

/* ステップ */
.step + .step { border-top: 2px dashed var(--line); margin-top: 22px; padding-top: 22px; }
.step-title { display: flex; align-items: center; gap: 10px; font-size: 1.1rem; font-weight: 900; margin: 0 0 14px; }
.step-no { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .95rem; flex: none; }

/* ファイル選択 */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  min-height: 180px; padding: 24px; text-align: center; cursor: pointer;
  border: 2px dashed var(--lavender-mid); border-radius: 24px; background: var(--accent-soft);
  transition: border-color .15s, background .15s, transform .15s;
}
.dropzone:hover, .dropzone.dragging, .dropzone:focus-within { border-color: var(--accent); background: #ece5ff; }
.dropzone.dragging { transform: scale(1.01); }
.dz-icon { width: 56px; height: 56px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dz-main { font-weight: 900; font-size: 1.15rem; color: var(--accent-dark); }
.dz-button { display: inline-block; font-weight: 700; background: var(--accent); color: #fff; border-radius: 999px; padding: 10px 28px; margin: 4px 0; }
.dz-formats { font-size: .82rem; color: var(--ink-soft); }
.dz-sub { font-size: .82rem; color: var(--muted); }
.loading { margin: 10px 0 0; color: var(--muted); font-size: .9rem; }
.label-note { font-weight: 400; font-size: .85rem; color: var(--muted); }

/* 選んだファイルの一覧 */
.inputs { border-radius: 24px; background: var(--accent-soft); padding: 10px; border: 2px dashed transparent; transition: border-color .15s; }
.inputs.dragging { border-color: var(--accent); }
.input-list { list-style: none; margin: 0; padding: 0; max-height: 360px; overflow: auto; }
.input-item { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 18px; background: #fff; }
.input-item + .input-item { margin-top: 6px; }
.input-thumb { position: relative; flex: none; width: 56px; height: 56px; display: grid; place-items: center; background: var(--lavender); border-radius: 12px; overflow: hidden; }
.input-thumb span { font-size: .7rem; font-weight: 700; color: var(--accent-dark); }
.input-thumb canvas { position: absolute; inset: 0; margin: auto; display: none; background: #fff; }
.input-thumb canvas.ready { display: block; }
.input-info { flex: 1; min-width: 0; }
.input-name { margin: 0; font-weight: 700; font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-meta { margin: 0; font-size: .8rem; color: var(--muted); }
.input-tools { display: flex; gap: 4px; flex: none; }
.icon-button { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--accent-soft); color: var(--ink); font-size: 1rem; cursor: pointer; }
.icon-button:hover:not(:disabled) { background: var(--lavender); }
.icon-button:disabled { opacity: .35; cursor: default; }
.input-total { margin: 8px 6px 0; font-size: .85rem; color: var(--ink-soft); }
.input-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 4px 2px; }
.link-button { background: none; border: 0; padding: 0; color: var(--accent-dark); text-decoration: underline; font: inherit; font-size: .9rem; cursor: pointer; }
.password { margin-top: 12px; }
.password .row { display: flex; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.password input { flex: 1; min-width: 160px; }

/* フォーム */
.field { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.field legend, .label { display: block; font-weight: 900; margin-bottom: 8px; padding: 0; }
.choices { display: grid; gap: 8px; }
.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.format-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.format-choices .choice:first-child { grid-column: 1 / -1; }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice span {
  display: flex; flex-direction: column; justify-content: center; min-height: 52px; height: 100%;
  padding: 8px 10px; text-align: center; border-radius: 16px; background: var(--accent-soft); color: var(--ink);
  transition: background .12s, color .12s, transform .12s;
}
.choice small { color: var(--muted); font-size: .76rem; line-height: 1.4; }
.choice:hover span { background: var(--lavender); }
.choice input:checked + span { background: var(--accent); color: #fff; }
.choice input:checked + span small { color: #ece6ff; }
.choice input:focus-visible + span { outline: 3px solid rgba(122, 92, 240, .4); outline-offset: 2px; }
.choice.disabled { cursor: not-allowed; }
.choice.disabled span { opacity: .45; }
select, input[type="text"], input[type="password"] {
  width: 100%; font: inherit; font-size: 16px; /* iOSの自動ズーム防止 */
  padding: 11px 14px; border: 2px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink);
}
select:focus, input[type="text"]:focus, input[type="password"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(122, 92, 240, .15); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.hint { margin: 6px 0 0; color: var(--muted); font-size: .85rem; }
.error { margin: 8px 0 0; color: var(--error); font-size: .9rem; font-weight: 700; white-space: pre-line; }
.range-input { margin-top: 10px; }

/* 同意・ボタン */
.consent { display: flex; align-items: flex-start; gap: 10px; padding: 12px 16px; border-radius: 16px; background: var(--accent-soft); cursor: pointer; margin-bottom: 14px; font-weight: 700; }
.consent input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.btn { display: block; width: 100%; font: inherit; font-weight: 900; border-radius: 20px; cursor: pointer; border: 0; }
.btn-main { background: var(--accent); color: #fff; font-size: 1.15rem; letter-spacing: .1em; padding: 16px; box-shadow: 0 8px 20px rgba(122, 92, 240, .35); transition: transform .12s, box-shadow .12s, background .12s; }
.btn-main:hover:not(:disabled) { background: var(--accent-dark); transform: translateY(-1px); }
.btn-main:disabled { background: #cfc6ef; box-shadow: none; cursor: not-allowed; }
.btn-sub { background: #fff; color: var(--ink); border: 2px solid var(--line); padding: 9px 18px; width: auto; font-weight: 700; border-radius: 999px; font-size: .95rem; letter-spacing: 0; }
.btn-sub:hover { border-color: var(--lavender-mid); }

/* 進捗・結果 */
.progress { margin-top: 16px; text-align: center; }
.bar { height: 12px; background: var(--accent-soft); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--lavender-mid), var(--accent)); border-radius: 999px; transition: width .2s; }
.progress-text { margin: 8px 0; font-weight: 700; }
.progress .btn-sub { margin: 0 auto; }
.result { margin-top: 16px; padding: 18px; border-radius: 24px; background: var(--mint); }
.result-title { margin: 0 0 10px; font-weight: 900; color: var(--mint-ink); }
.result .btn-main { background: #2f9e6e; box-shadow: 0 8px 20px rgba(47, 158, 110, .3); letter-spacing: .02em; }
.result .btn-main:hover:not(:disabled) { background: #23845a; }
.notices { margin: 0 0 10px; padding-left: 1.2em; color: var(--warn); font-size: .9rem; }
.file-list { margin-top: 12px; }
.file-list summary { cursor: pointer; color: var(--mint-ink); font-weight: 700; }
.file-list ul { margin: 8px 0 0; padding-left: 1.2em; max-height: 260px; overflow: auto; }
.file-list li { word-break: break-all; }

/* 情報セクション */
.info p, .info li { color: var(--ink-soft); }
.recommend { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .92rem; }
.recommend th, .recommend td { padding: 10px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.recommend th { background: var(--accent-soft); font-size: .85rem; }
.recommend th:first-child { border-radius: 12px 0 0 12px; }
.recommend th:last-child { border-radius: 0 12px 12px 0; }
.recommend td:first-child { width: 42%; font-weight: 700; color: var(--ink); }
.more { margin: 12px 0 0; text-align: right; }
.points { padding-left: 1.2em; margin: 0; }
.points li + li { margin-top: 8px; }

/* 文書ページ */
.doc { padding-bottom: 8px; }
.doc h1 { font-size: 1.6rem; font-weight: 900; margin: 20px 0 4px; }
.doc .updated { color: var(--muted); font-size: .88rem; margin: 0 0 8px; }
.doc h2 { font-size: 1.12rem; font-weight: 900; margin: 30px 0 10px; display: inline-block; background: var(--accent-soft); padding: 4px 16px; border-radius: 999px; }
.doc h3 { font-size: 1rem; margin: 18px 0 6px; }
.doc p, .doc li { color: var(--ink-soft); }
.doc ol, .doc ul { padding-left: 1.4em; }
.doc dl dt { font-weight: 900; margin-top: 14px; color: var(--ink); }
.doc dl dd { margin: 4px 0 0; color: var(--ink-soft); }
.doc table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .9rem; margin: 8px 0; background: #fff; border-radius: 16px; overflow: hidden; box-shadow: var(--shadow-sm); }
.doc th, .doc td { padding: 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.doc th { background: var(--accent-soft); }
.doc .table-scroll { overflow-x: auto; }
.doc .note { font-size: .85rem; color: var(--muted); }

/* 広告枠（「広告」と明記する） */
.ad-slot { margin: 20px 0; min-height: 100px; text-align: center; }
.ad-slot::before { content: "広告"; display: block; font-size: .72rem; color: var(--muted); margin-bottom: 4px; text-align: left; }
.ad-convert { margin: 24px 0 0; }
.ad-side { margin-top: 20px; }
.ad-preview { background: repeating-linear-gradient(45deg, #efeaff, #efeaff 10px, #f8f6ff 10px, #f8f6ff 20px); border: 2px dashed var(--lavender-mid); border-radius: 16px; min-height: 250px; display: flex !important; flex-direction: column; }
.ad-preview::after { content: attr(data-label); margin: auto; color: var(--muted); font-size: .85rem; }

/* 広告ブロッカーの検出 */
.kt-probe { position: absolute; left: -10000px; top: 0; width: 2px; height: 2px; }
.adgate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(59, 51, 85, .55); backdrop-filter: blur(3px); }
.adgate-box { width: min(520px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: #fff; border-radius: 28px; padding: 28px 26px; box-shadow: var(--shadow); text-align: center; }
.adgate-icon { width: 48px; height: 48px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.adgate-box h2 { margin: 6px 0 10px; font-size: 1.25rem; font-weight: 900; }
.adgate-box p, .adgate-box li { color: var(--ink-soft); text-align: left; }
.adgate-box ol { margin: 0 0 12px; padding-left: 1.4em; }
.adgate-note { font-size: .85rem; background: var(--accent-soft); border-radius: 14px; padding: 10px 12px; }
.adgate-more { text-align: center !important; margin: 10px 0 0; font-size: .9rem; }

/* フッター */
.site-footer { margin-top: 40px; padding: 28px 0 44px; background: #f4f1fd; font-size: .88rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--ink-soft); }
.copy { color: var(--muted); margin: 12px 0 0; }

@media (max-width: 959px) {
  /* スマホは変換ボタン下の1枠だけ（広告が続けて並ばないように） */
  .ad-side, .ad-slot[data-ad-slot="below-tool"] { display: none !important; }
}
@media (max-width: 420px) {
  .card { padding: 18px; border-radius: 24px; }
  .cols-3 .choice small { display: none; }
  .site-nav a { padding: 6px 12px; }
}

/* ---- PC（幅960px以上）：左にファイル、右に設定の2列 ---- */
@media (min-width: 960px) {
  .wrap { max-width: 1120px; padding: 0 24px; }
  .wrap.doc { max-width: 800px; }
  .header-inner { height: 88px; }
  .hero { padding: 28px 0 12px; }
  .hero h1 { font-size: 3.25rem; }
  .lead { font-size: 1.1rem; }
  .tool { display: grid; grid-template-columns: 400px minmax(0, 1fr); column-gap: 40px; align-items: start; padding: 36px; border-radius: 36px; }
  .tool > .step:nth-child(1) { grid-column: 1; grid-row: 1 / span 2; position: sticky; top: 20px; }
  .tool > .step:nth-child(2) { grid-column: 2; grid-row: 1; border-top: 0; margin-top: 0; padding-top: 0; }
  .tool > .step:nth-child(3) { grid-column: 2; grid-row: 2; }
  .dropzone { min-height: 340px; gap: 12px; }
  .dz-main { font-size: 1.4rem; }
  .format-choices { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .format-choices .choice:first-child { grid-column: auto; }
  .info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 24px 0; }
  .info-grid .card { margin: 0; }
  .recommend td:first-child { width: 48%; }
  .ad-convert { display: none !important; }
}
