:root { --navy:#17365d; --blue:#2864a7; --gold:#e6bf56; --bg:#eef3f8; --surface:#fff; --line:#dbe3ec; --text:#182230; --muted:#667386; --danger:#c43f45; }
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { margin:0; color:var(--text); background:var(--bg); font-family:"Yu Gothic UI","Hiragino Sans",sans-serif; }
button,input,select,summary { font:inherit; }
button { cursor:pointer; }
.app-header { min-height:72px; padding:13px 22px; color:#fff; background:linear-gradient(120deg,#142d4c,#214d7d); display:flex; align-items:center; justify-content:space-between; box-shadow:0 3px 16px rgba(19,43,72,.22); }
.eyebrow { color:rgba(255,255,255,.58); font-size:10px; letter-spacing:.14em; }
h1 { margin:2px 0 0; font-size:19px; }
.app-title-row { display:flex; align-items:baseline; gap:9px; }
.app-version { color:#fff; font-size:12px; font-weight:700; padding:2px 9px; border-radius:999px; background:rgba(255,255,255,.18); border:1px solid rgba(255,255,255,.35); white-space:nowrap; }
.header-actions { display:flex; gap:8px; }
.header-button { border:1px solid rgba(255,255,255,.55); border-radius:8px; background:#fff; color:var(--navy); padding:9px 14px; font-weight:700; }
.header-button.subtle { background:rgba(255,255,255,.1); color:#fff; }
.layout { width:100%; max-width:1680px; margin:auto; padding:18px; display:grid; grid-template-columns:minmax(0,1fr) 350px; gap:18px; align-items:start; }
.workspace,.panel { background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:0 5px 18px rgba(32,52,75,.06); }
.workspace { min-width:0; min-height:650px; padding:18px; display:flex; align-items:center; justify-content:center; overflow:hidden; }
.dropzone { width:100%; min-height:540px; border:2px dashed #b7c5d4; border-radius:12px; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:10px; color:var(--muted); outline:none; transition:.15s; }
.dropzone:hover,.dropzone:focus,.dropzone.drag { border-color:var(--blue); background:#f7faff; color:var(--navy); }
.drop-icon { font-size:50px; }
.dropzone strong { font-size:16px; }
.paste-target { display:flex; flex-direction:column; align-items:center; gap:6px; margin:6px 0; padding:18px 28px; border:2px solid var(--blue); border-radius:12px; background:#fff; color:var(--navy); cursor:pointer; transition:.15s; }
.paste-target:hover,.paste-target:focus { background:#eef5ff; box-shadow:0 2px 10px rgba(23,105,170,.18); }
.paste-target .paste-target-icon { font-size:26px; line-height:1; }
.paste-target strong { font-size:15px; }
.paste-target small { font-size:11px; color:var(--muted); }
.paste-target.ready { border-color:#1a8f4c; background:#f0fbf4; }
.paste-target.ready small { color:#1a8f4c; }
.dropzone span,.dropzone small { font-size:12px; }
.editor { width:100%; display:grid; grid-template-columns:minmax(0,1.4fr) minmax(240px,.6fr); gap:18px; align-items:start; }
.pane-title { margin-bottom:9px; color:var(--navy); font-size:12px; font-weight:700; }
#crop-area { position:relative; margin:auto; max-width:100%; overflow:hidden; border-radius:6px; line-height:0; background:#e7edf4; user-select:none; touch-action:none; cursor:crosshair; }
#crop-image { display:block; max-width:100%; }
#crop-box { position:absolute; z-index:3; box-sizing:border-box; border:2px solid var(--gold); box-shadow:0 0 0 9999px rgba(0,0,0,.38); pointer-events:auto; cursor:move; touch-action:none; }
.resize-handle { position:absolute; width:17px; height:17px; border:2px solid #fff; border-radius:3px; background:var(--gold); z-index:4; pointer-events:auto; }
.corner-nw { left:2px; top:2px; cursor:nwse-resize; }
.corner-ne { right:2px; top:2px; cursor:nesw-resize; }
.corner-sw { left:2px; bottom:2px; cursor:nesw-resize; }
.corner-se { right:2px; bottom:2px; cursor:nwse-resize; }
.stage-hint { margin-top:9px; text-align:center; color:var(--muted); font-size:11px; line-height:1.5; }
#result-image { display:block; max-width:100%; max-height:430px; box-shadow:0 4px 14px rgba(0,0,0,.15); }
.result-meta { margin-top:9px; color:var(--muted); font-size:11px; line-height:1.6; text-align:center; }
.panel { padding:17px; }
.info { padding:10px 12px; border:1px solid var(--line); border-radius:9px; background:#f7f9fc; color:var(--muted); font-size:12px; line-height:1.6; }
.workflow-tabs { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-top:12px; }
.workflow-tabs button { min-height:54px; padding:8px; border:1.5px solid var(--line); border-radius:9px; background:#fff; color:var(--muted); font-size:11px; font-weight:700; line-height:1.35; }
.workflow-tabs button span { display:inline-flex; width:20px; height:20px; margin-right:4px; border-radius:50%; align-items:center; justify-content:center; background:#e9eef4; color:var(--navy); }
.workflow-tabs button.active { border-color:var(--navy); background:#edf4fc; color:var(--navy); box-shadow:inset 0 0 0 1px var(--navy); }
.workflow-tabs button.active span { background:var(--navy); color:#fff; }
.workflow-tabs button:disabled { background:#f3f5f7; }
.workflow-note { margin:6px 2px 0; color:var(--muted); font-size:10px; text-align:center; }
.workflow-next-card { margin-top:12px; padding:13px; border:2px solid var(--navy); border-radius:10px; background:#f3f8fe; }
.workflow-next-card strong { display:block; color:var(--navy); font-size:14px; }
.workflow-next-card p { margin:6px 0 0; color:var(--muted); font-size:11px; line-height:1.55; }
.workflow-next-card .primary-button { margin-top:10px; font-size:13px; }
.settings-section { padding:17px 0; border-bottom:1px solid var(--line); }
.settings-section.last { border:0; padding-bottom:0; }
h2 { margin:0 0 11px; color:var(--navy); font-size:13px; }
.dimension-row,.inline-row { display:flex; align-items:end; gap:8px; }
.dimension-row label { flex:1; color:var(--muted); font-size:11px; }
input[type=number],input[type=text],input[type=url],input[type=password],textarea,select { width:100%; margin-top:6px; padding:9px 10px; border:1.5px solid var(--line); border-radius:8px; background:#fff; outline:none; }
input:focus,textarea:focus,select:focus { border-color:var(--blue); }
textarea { min-height:72px; max-height:320px; overflow-y:hidden; resize:none; line-height:1.6; transition:height .12s ease; }
.check { display:flex; align-items:center; gap:6px; margin-top:9px; font-size:12px; }
.presets,.tool-row { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }
.presets button,.tool-button { padding:6px 8px; border:1px solid var(--line); border-radius:7px; background:#fff; color:var(--muted); font-size:11px; }
.presets button:hover,.tool-button:hover { border-color:var(--blue); color:var(--blue); }
.custom-preset-row { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:6px; align-items:end; margin-top:9px; }
.custom-preset-row input { margin-top:0; }
.custom-presets:empty { display:none; }
.custom-presets button { display:inline-flex; gap:5px; align-items:center; }
.custom-presets button .remove { color:var(--danger); font-weight:800; }
.multi-export-grid { display:grid; grid-template-columns:1fr 1fr; gap:7px; }
.multi-export-grid label { display:flex; align-items:center; gap:6px; padding:7px 8px; border:1px solid var(--line); border-radius:7px; color:var(--muted); font-size:11px; }
.emoji-palette { display:flex; flex-wrap:wrap; gap:5px; margin-top:10px; }
.emoji-palette button { min-width:36px; padding:5px; border:1px solid var(--line); border-radius:7px; background:#fff; font-family:"Segoe UI Emoji","Yu Gothic UI",sans-serif; font-size:20px; line-height:1.2; }
.emoji-palette button:hover { border-color:var(--blue); background:#edf4fc; }
.layer-list { display:flex; flex-direction:column; gap:5px; max-height:230px; overflow:auto; }
.layer-item { display:grid; grid-template-columns:auto auto minmax(0,1fr); gap:5px; align-items:center; padding:6px; border:1px solid var(--line); border-radius:7px; background:#fff; }
.layer-item.selected { border-color:var(--blue); background:#edf4fc; }
.layer-item button { padding:3px 5px; border:0; background:transparent; color:var(--muted); }
.layer-item .layer-name { overflow:hidden; text-align:left; text-overflow:ellipsis; white-space:nowrap; }
.layer-item .layer-name strong { display:block; color:var(--navy); font-size:11px; }
.layer-item .layer-name small { color:var(--muted); font-size:9px; }
.layer-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:8px; }
.layer-actions .tool-button { flex:1; }
.inline-row input { flex:1; }
.inline-row select { width:75px; }
.help { margin:7px 0 0; color:var(--muted); font-size:10px; line-height:1.5; }
.segments { display:flex; overflow:hidden; border:1.5px solid var(--line); border-radius:8px; }
.segments button { flex:1; padding:8px 4px; border:0; border-right:1px solid var(--line); background:#fff; color:var(--muted); font-size:12px; font-weight:700; }
.segments button:last-child { border:0; }
.segments button.active { background:var(--navy); color:#fff; }
.slider-label { margin-top:11px; display:flex; justify-content:space-between; color:var(--muted); font-size:11px; }
input[type=range] { width:100%; accent-color:var(--navy); }
.field-label { display:block; margin-bottom:13px; color:var(--muted); font-size:11px; line-height:1.5; }
.primary-button,.secondary-button { width:100%; margin-top:9px; padding:11px; border-radius:8px; font-weight:700; }
.primary-button { border:0; background:var(--navy); color:#fff; }
.secondary-button { border:1px solid var(--line); background:#fff; color:var(--navy); }
.compact-button { margin-top:10px; padding:8px 10px; }
button:disabled { opacity:.45; cursor:not-allowed; }
.busy { position:fixed; left:50%; top:50%; z-index:20; min-width:190px; padding:18px 22px; transform:translate(-50%,-50%); border:1px solid var(--line); border-radius:14px; background:rgba(255,255,255,.96); display:flex; flex-direction:column; gap:8px; align-items:center; justify-content:center; color:var(--navy); box-shadow:0 12px 42px rgba(20,45,76,.24); }
.busy[hidden] { display:none; }
.busy span { color:var(--muted); font-size:12px; }
.spinner { width:38px; height:38px; border:4px solid #cad6e4; border-top-color:var(--blue); border-radius:50%; animation:spin .8s linear infinite; }
body.busy-active header,body.busy-active main { pointer-events:none; }
@keyframes spin { to { transform:rotate(360deg); } }
.toast { position:fixed; left:50%; bottom:24px; transform:translate(-50%,12px); padding:11px 18px; border-radius:9px; background:var(--navy); color:#fff; opacity:0; pointer-events:none; transition:.2s; box-shadow:0 7px 22px rgba(0,0,0,.2); font-size:12px; }
.toast.show { opacity:1; transform:translate(-50%,0); }
.toast.error { background:var(--danger); }
.pdf-editor { width:100%; min-width:0; min-height:540px; }
.pdf-pagebar { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:8px; margin-bottom:12px; }
.workspace-mode-label { margin-right:6px; padding:7px 10px; border-radius:7px; color:var(--navy); background:#edf4fc; font-size:12px; }
.pdf-pagebar-divider { width:1px; height:26px; margin:0 3px; background:var(--line); }
.pdf-zoom-button { min-width:38px; padding-left:10px; padding-right:10px; font-size:17px; font-weight:800; }
#pdf-zoom-label { min-width:48px; text-align:center; }
#pdf-pan.active,#workspace-crop.active { border-color:var(--navy); background:var(--navy); color:#fff; }
.preview-button { border-color:var(--navy); color:var(--navy); font-weight:700; }
.pdf-stage-scroll { width:100%; max-width:100%; min-width:0; min-height:560px; max-height:calc(100vh - 190px); padding:16px; overflow:auto; border:1px solid var(--line); border-radius:10px; background:#dce3eb; display:flex; align-items:flex-start; justify-content:safe center; }
#pdf-stage { position:relative; flex:0 0 auto; margin:0; box-shadow:0 4px 18px rgba(0,0,0,.2); line-height:0; background:#fff; }
#pdf-canvas,#pdf-overlay { display:block; }
#pdf-overlay { position:absolute; z-index:2; inset:0; cursor:crosshair; touch-action:none; }
#pdf-overlay.transform-mode:not(.pan-mode) { pointer-events:none; }
#pdf-stage.pan-active .resize-handle { pointer-events:none; }
#pdf-overlay.select-mode { cursor:default; }
#pdf-overlay.pan-mode { cursor:grab; }
#pdf-overlay.pan-mode.panning { cursor:grabbing; }
.pdf-tools { flex-wrap:wrap; }
.pdf-tools button { min-width:33.333%; }
.pdf-option-row { display:grid; grid-template-columns:1fr 72px; gap:10px; align-items:end; }
.pdf-option-row input[type=color] { width:100%; height:36px; margin-top:5px; padding:2px; border:1.5px solid var(--line); border-radius:8px; background:#fff; }
.danger-button { color:var(--danger); }
#pdf-settings select { width:100%; margin-top:5px; padding:8px 9px; border:1.5px solid var(--line); border-radius:8px; background:#fff; }
.redact-warning { margin:0 0 7px; padding:8px 10px; border-radius:8px; color:#fff; background:#252a31; font-weight:700; }
.selection-actions { padding:13px; border:1px solid #9ebce0; border-radius:10px; background:#f4f8fd; }
.selection-button-row { display:grid; grid-template-columns:1fr auto; gap:8px; align-items:center; margin-top:10px; }
.selection-button-row .primary-button { margin:0; }
.rich-text-toolbar { display:grid; grid-template-columns:1fr 1.35fr; gap:7px; margin:0 0 10px; }
.rich-text-toolbar .tool-button,.rich-format-row .tool-button,.rich-link-box .tool-button { min-height:36px; }
.rich-text-toolbar .tool-button.active { border-color:var(--navy); background:var(--navy); color:#fff; }
.rich-bold { font-weight:800; }
.rich-underline { font-weight:700; text-decoration:underline; }
.rich-format-row { display:grid; grid-template-columns:1fr 1fr; gap:8px; align-items:end; margin-bottom:12px; color:var(--muted); font-size:11px; }
.rich-format-row input[type=number] { height:36px; }
.rich-format-row input[type=color] { width:100%; height:36px; margin-top:6px; padding:2px; border:1.5px solid var(--line); border-radius:8px; background:#fff; }
.rich-link-box { padding:11px; margin-bottom:12px; border:1px solid var(--line); border-radius:9px; background:#f8fafc; }
.rich-link-box .field-label { margin-bottom:7px; }
.rich-link-box .tool-button { width:100%; }
.primary-text-settings { margin-bottom:14px; padding:10px; border:1px solid #b8cce5; border-radius:9px; background:#f4f8fd; }
.primary-text-settings .field-label { margin:10px 0 0; }
.image-decoration-options { margin:-3px 0 12px; padding:10px; border:1px solid var(--line); border-radius:9px; background:#fff8e7; }
.preview-dialog { width:min(94vw,1280px); max-width:none; padding:0; border:0; border-radius:14px; background:#fff; box-shadow:0 18px 70px rgba(0,0,0,.35); }
.preview-dialog::backdrop { background:rgba(16,31,49,.72); }
.preview-dialog-header { padding:13px 16px; display:flex; align-items:center; justify-content:space-between; color:#fff; background:var(--navy); }
.preview-dialog-header .tool-button { color:var(--navy); background:#fff; }
.preview-dialog-frame { min-height:65vh; max-height:78vh; padding:22px; overflow:auto; display:flex; align-items:center; justify-content:center; background:repeating-conic-gradient(#e9eef4 0 25%,#f8fafc 0 50%) 50%/20px 20px; }
.preview-dialog-frame #result-image { max-width:100%; max-height:72vh; }
.preview-dialog .result-meta { padding:12px 16px 16px; }
.pdf-organize-section { padding-top:10px; }
.pdf-organizer-dialog { width:min(96vw,1180px); height:min(92vh,900px); max-width:none; padding:0; border:0; border-radius:14px; background:#f5f7fa; box-shadow:0 18px 70px rgba(0,0,0,.38); }
.pdf-organizer-dialog::backdrop { background:rgba(16,31,49,.75); }
.pdf-organizer-header { padding:15px 18px; display:flex; align-items:center; justify-content:space-between; color:#fff; background:var(--navy); }
.pdf-organizer-header > div { display:flex; flex-direction:column; gap:2px; }
.pdf-organizer-header strong { font-size:16px; }
.pdf-organizer-header span { color:#cbd9e8; font-size:11px; }
.pdf-organizer-header .tool-button { color:var(--navy); background:#fff; }
.pdf-organizer-toolbar { padding:14px 18px 7px; display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.pdf-organizer-toolbar .secondary-button { width:auto; min-width:210px; margin:0; }
.pdf-organizer-guide { margin:0; padding:0 18px 11px; color:var(--muted); font-size:11px; }
.pdf-page-grid { min-height:330px; max-height:calc(92vh - 260px); padding:14px 18px 20px; overflow:auto; display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:13px; align-content:start; border-top:1px solid var(--line); border-bottom:1px solid var(--line); background:#e8edf3; }
.pdf-page-card { position:relative; min-width:0; padding:8px; border:2px solid transparent; border-radius:10px; background:#fff; box-shadow:0 2px 7px rgba(25,45,68,.13); cursor:grab; }
.pdf-page-card:active { cursor:grabbing; }
.pdf-page-card.selected { border-color:var(--blue); }
.pdf-page-card.dragging { opacity:.45; }
.pdf-page-card.drag-target { border-color:var(--navy); transform:translateY(-2px); }
.pdf-page-thumbnail { width:100%; aspect-ratio:3/4; display:flex; align-items:center; justify-content:center; overflow:hidden; border:1px solid var(--line); border-radius:6px; background:#fff; }
.pdf-page-thumbnail canvas { max-width:100%; max-height:100%; display:block; }
.pdf-page-loading { color:var(--muted); font-size:11px; line-height:1.5; text-align:center; }
.pdf-page-card-meta { padding:7px 1px 3px; display:flex; align-items:flex-start; gap:6px; }
.pdf-page-card-meta input { margin-top:2px; }
.pdf-page-card-label { min-width:0; flex:1; }
.pdf-page-card-label strong,.pdf-page-card-label small { display:block; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.pdf-page-card-label strong { color:var(--navy); font-size:11px; }
.pdf-page-card-label small { margin-top:2px; color:var(--muted); font-size:9px; }
.pdf-page-card-actions { display:grid; grid-template-columns:1fr 1fr auto; gap:5px; }
.pdf-page-card-actions button { min-width:0; padding:5px; }
.pdf-page-card-actions .danger-button { font-weight:800; }
.pdf-organizer-footer { padding:13px 18px 17px; display:flex; gap:16px; align-items:center; justify-content:space-between; background:#fff; }
.pdf-organizer-summary { min-width:140px; color:var(--navy); font-size:12px; font-weight:700; }
.pdf-organizer-actions { display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; }
.pdf-organizer-actions .primary-button,.pdf-organizer-actions .secondary-button { width:auto; margin:0; padding:9px 13px; }
summary { margin:2px 0 12px; color:var(--blue); cursor:pointer; font-weight:700; }
.rich-text-toolbar select { margin-top:0; }
@media (max-width:1000px) { .layout { grid-template-columns:1fr; } .panel { width:100%; } .editor { grid-template-columns:1fr; } .pdf-organizer-footer { align-items:stretch; flex-direction:column; } .pdf-organizer-actions { justify-content:stretch; } .pdf-organizer-actions button { flex:1; } }

/* 墨消しの確認 */
.redaction-dialog { width:min(94vw,720px); max-width:none; padding:0; border:0; border-radius:14px; background:#fff; box-shadow:0 18px 70px rgba(0,0,0,.35); }
.redaction-dialog::backdrop { background:rgba(16,31,49,.72); }
.redaction-header { padding:13px 18px; color:#fff; background:var(--navy); }
.redaction-body { padding:18px; max-height:62vh; overflow:auto; line-height:1.8; }
.redaction-body p { margin:0 0 12px; }
.redaction-body .warn { padding:12px 14px; border-radius:10px; background:#fff5f5; border:1px solid #f3c9c9; color:#8a2020; }
.redaction-body .note { padding:12px 14px; border-radius:10px; background:#f1f5fb; border:1px solid #d5e0ee; }
.redaction-choice { display:flex; gap:10px; flex-wrap:wrap; margin:14px 0 4px; }
.redaction-choice button { flex:1 1 220px; }
.redaction-list { margin:12px 0; padding:0; list-style:none; }
.redaction-list li { padding:10px 12px; border:1px solid var(--line); border-radius:10px; margin-bottom:8px; background:#fafbfd; }
.redaction-list .where { font-size:12px; color:#5a6b80; }
.redaction-list .found { font-weight:700; word-break:break-all; }
.redaction-list .empty { color:#8a2020; font-weight:700; }
.redaction-fixed { padding:10px 12px; border:1px solid var(--line); border-radius:10px; background:#eef1f5; color:#4a5a6d; white-space:pre-wrap; word-break:break-all; }
.redaction-body textarea { width:100%; min-height:96px; padding:10px 12px; border:1px solid var(--line); border-radius:10px; font:inherit; }
.redaction-footer { display:flex; gap:10px; justify-content:flex-end; padding:14px 18px; border-top:1px solid var(--line); }
.redaction-footer .primary-button { width:auto; padding:10px 26px; }
