/* PDFかんたんツール：お金の書類ツールの style.css を土台に、配色と部品を追加する */
:root {
  --accent: #e11d48;
  --accent-2: #f97316;
  --accent-soft: #ffe4e6;
  --grad: linear-gradient(135deg, #e11d48 0%, #f43f5e 45%, #f97316 100%);
}
@media (prefers-color-scheme: dark) {
  :root { --accent: #fb7185; --accent-2: #fdba74; --accent-soft: #3b1d26; }
}
.brand-mark { box-shadow: 0 4px 12px rgba(225, 29, 72, .35); }
.hero::before {
  background:
    radial-gradient(40% 50% at 20% 40%, rgba(244, 63, 94, .16), transparent 70%),
    radial-gradient(35% 45% at 80% 30%, rgba(249, 115, 22, .16), transparent 70%);
}

.pdf-main { max-width: 1000px; margin: 0 auto; padding: 8px 16px 24px; }
.pdf-main > .tool-cards { margin: 8px 0; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }

.dropzone {
  border: 2px dashed color-mix(in srgb, var(--accent) 45%, var(--line)); border-radius: var(--radius);
  background: color-mix(in srgb, var(--accent-soft) 55%, var(--panel)); padding: 32px 16px; text-align: center; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.dropzone:hover, .dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.drop-icon {
  width: 56px; height: 56px; margin: 0 auto 10px; border-radius: 16px; display: grid; place-items: center;
  background: var(--grad); color: #fff; font-size: 1.8rem; font-weight: 800; box-shadow: 0 6px 16px rgba(225, 29, 72, .3);
}
.drop-title { margin: 0; font-weight: 800; font-size: 1.05rem; }
.drop-sub { margin: 4px 0 0; color: var(--muted); font-size: .85rem; }

.btn {
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer; border-radius: 999px; padding: 12px 24px; min-height: 46px;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); text-decoration: none; display: inline-flex; align-items: center; justify-content: center;
}
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn.primary { background: var(--grad); border: 0; color: #fff; box-shadow: 0 6px 18px rgba(225, 29, 72, .3); }
.btn.primary:hover { color: #fff; filter: brightness(1.05); }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.actions-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.actions-row .primary { flex: 1 1 220px; }

.icon-btn {
  font: inherit; width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel);
  color: var(--text); cursor: pointer; font-weight: 700;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.del:hover { border-color: var(--ng); color: var(--ng); }

.filelist { list-style: none; padding: 0; margin: 16px 0 0; display: grid; gap: 8px; }
.file-item {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center;
  padding: 10px 12px; border-radius: var(--radius-sm); background: var(--panel-2);
}
.file-no { grid-row: span 2; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--grad); color: #fff; font-weight: 800; font-size: .85rem; }
.file-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { grid-column: 2; color: var(--muted); font-size: .8rem; }
.file-btns { grid-column: 3; grid-row: 1 / span 2; display: flex; gap: 4px; }

.thumbs { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin-top: 16px; }
.thumb {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 10px;
  border-radius: var(--radius-sm); background: var(--panel-2); border: 1px solid var(--line); text-decoration: none; color: var(--text);
}
.thumb img, .thumb canvas { max-width: 100%; max-height: 170px; object-fit: contain; background: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .15); transition: transform .2s; }
.thumb-img { height: 170px; display: grid; place-items: center; width: 100%; overflow: hidden; }
.thumb-no { position: absolute; top: 6px; left: 6px; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 8px; background: var(--grad); color: #fff; font-size: .78rem; font-weight: 800; display: grid; place-items: center; }
.thumb-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; }
.thumb-btns .icon-btn { width: 32px; height: 32px; }
.thumb-dl { font-size: .8rem; font-weight: 700; color: var(--accent); }
.thumb.deleted { opacity: .4; }
.thumb.deleted .thumb-img { outline: 3px solid var(--ng); outline-offset: -3px; }

.options { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; }
.options label { display: flex; flex-direction: column; gap: 4px; font-size: .82rem; font-weight: 600; color: var(--muted); flex: 1 1 200px; min-width: 0; }
.options select, .options input { max-width: 100%; min-width: 0;
  font: inherit; font-size: 1rem; color: var(--text); background: var(--panel-2); border: 1px solid transparent;
  border-radius: var(--radius-sm); padding: 9px 12px; min-height: 44px;
}
.options select:focus, .options input:focus { outline: none; border-color: var(--accent); background: var(--panel); }

.hint { margin: 14px 0 0; font-size: .85rem; color: var(--muted); }
.status { margin: 16px 0 0; padding: 10px 14px; border-radius: var(--radius-sm); background: var(--panel-2); font-size: .9rem; font-weight: 600; }
.status.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 10%, var(--panel)); }
.status.ng { color: var(--ng); background: color-mix(in srgb, var(--ng) 10%, var(--panel)); }
.results { margin-top: 12px; display: grid; gap: 8px; }
.result-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent-soft); }
.result-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.result-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-info span { font-size: .8rem; color: var(--muted); }
.options select, .options input { font-weight: 400; }
.form-embed { margin-top: 16px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.form-embed iframe { display: block; width: 100%; height: 1300px; border: 0; }
.breadcrumb { font-size: .82rem; color: var(--muted); margin-top: 16px; }
.breadcrumb a { color: var(--muted); }
/* 文字・署名の書き込み */
.sign-editor { margin-top: 16px; }
.sign-tools { display: grid; gap: 10px; }
.sign-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sign-row input[type=text] { flex: 1 1 220px; font: inherit; font-size: 1rem; min-height: 44px; padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); }
.sign-row .btn { padding: 10px 16px; min-height: 44px; font-size: .9rem; }
.mini { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.mini select, .mini input[type=range] { font: inherit; font-size: .95rem; min-height: 40px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--panel-2); color: var(--text); padding: 4px 8px; }
.check-line input { width: 18px; height: 18px; accent-color: var(--accent); }
.file-like { cursor: pointer; }
.page-nav { display: flex; align-items: center; justify-content: center; gap: 12px; margin: 14px 0 8px; font-weight: 700; font-family: var(--font-num); }
.stage-outer { display: flex; justify-content: center; overflow: hidden; padding: 8px 0; border-radius: var(--radius-sm); background: var(--panel-2); }
.sign-stage { position: relative; box-shadow: 0 2px 12px rgba(0, 0, 0, .18); touch-action: none; }
.sign-stage canvas { display: block; }
.sign-layer { position: absolute; inset: 0; }
.sign-item { position: absolute; cursor: move; touch-action: none; user-select: none; -webkit-user-drag: none; outline: 1px dashed rgba(225, 29, 72, .5); }
.sign-item.selected { outline: 2px solid var(--accent); }
.selected-tools { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 10px; }
.sign-modal { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, .45); display: grid; place-items: center; padding: 16px; }
.sign-modal[hidden] { display: none; }
.sign-modal-box { background: var(--panel); border-radius: var(--radius); padding: 18px; width: min(640px, 100%); box-shadow: var(--shadow-lg); }
.sign-modal-box canvas { width: 100%; height: auto; aspect-ratio: 600 / 220; background: #fff; border: 2px dashed var(--line); border-radius: var(--radius-sm); touch-action: none; margin-top: 8px; }
