/* Flatten PDF */
.tool-wrapper[data-tool="flatten-pdf"] { width: 100%; max-width: 1000px; margin: 0 auto; padding: 0 20px; box-sizing: border-box; }
.flt-app { display: flex; flex-direction: column; gap: 20px; margin-top: 8px; }
.flt-busy { margin: 16px auto; text-align: center; color: #475569; font-weight: 500; }
.flt-report h3, .flt-result h3 { font-size: 1.05rem; margin: 0 0 10px; }
.flt-table-wrap { overflow-x: auto; }
.flt-table { width: 100%; border-collapse: collapse; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; font-size: .95rem; }
.flt-table th, .flt-table td { padding: 10px 12px; border-bottom: 1px solid #eef0f3; text-align: start; vertical-align: top; }
.flt-table tr:last-child th, .flt-table tr:last-child td { border-bottom: 0; }
.flt-table th { width: 38%; font-weight: 600; color: #1f2937; }
.flt-table td { color: #374151; word-break: break-word; }
.flt-table td div + div { margin-top: 4px; }
.flt-bad { color: #b42318; font-weight: 600; }
.flt-ok { color: #067647; }
.flt-warn { color: #a15c07; font-weight: 600; }
.flt-info { color: #475569; }
.flt-warnings { background: #fffaeb; border: 1px solid #fedf89; border-radius: 10px; padding: 12px 14px; color: #7a4a00; }
.flt-warnings p { margin: 0; }
.flt-warnings p + p { margin-top: 8px; }
.flt-opts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px 20px; }
.flt-opts label { display: flex; gap: 8px; align-items: flex-start; line-height: 1.4; cursor: pointer; }
.flt-opts input { margin-top: 3px; width: 17px; height: 17px; flex: 0 0 auto; }
.flt-opts small { display: block; color: #64748b; }
.flt-result { background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 10px; padding: 14px 16px; }
.flt-result p { margin: 0 0 8px; }
.flt-done { font-weight: 600; color: #067647; }
.tool-wrapper[data-tool="flatten-pdf"] .info-note { margin-top: 18px; }

html[data-theme="dark"] .flt-table, html[data-theme="dark-contrast"] .flt-table { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .flt-table th, html[data-theme="dark"] .flt-table td,
html[data-theme="dark-contrast"] .flt-table th, html[data-theme="dark-contrast"] .flt-table td { border-color: #334155; color: #e2e8f0; }
html[data-theme="dark"] .flt-bad, html[data-theme="dark-contrast"] .flt-bad { color: #fca5a5; }
html[data-theme="dark"] .flt-ok, html[data-theme="dark-contrast"] .flt-ok { color: #86efac; }
html[data-theme="dark"] .flt-warn, html[data-theme="dark-contrast"] .flt-warn { color: #fcd34d; }
html[data-theme="dark"] .flt-info, html[data-theme="dark-contrast"] .flt-info,
html[data-theme="dark"] .flt-busy, html[data-theme="dark-contrast"] .flt-busy { color: #cbd5e1; }
html[data-theme="dark"] .flt-warnings, html[data-theme="dark-contrast"] .flt-warnings { background: #3a2a06; border-color: #854d0e; color: #fde68a; }
html[data-theme="dark"] .flt-result, html[data-theme="dark-contrast"] .flt-result { background: #052e16; border-color: #166534; color: #dcfce7; }
html[data-theme="dark"] .flt-opts small, html[data-theme="dark-contrast"] .flt-opts small { color: #94a3b8; }
@media (max-width: 600px) { .flt-table th { width: 42%; } .flt-table th, .flt-table td { padding: 8px; } }
.flt-app .action-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin: 0 auto; }
.flt-app .file-box, .flt-app .tool-settings { display: block; margin: 0 auto; }
.flt-app .file-row { display: flex; align-items: center; gap: 12px; }
.flt-app .file-name { font-weight: 600; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.flt-app .file-size { color: #64748b; white-space: nowrap; }
.flt-app .remove-file { background: none; border: 0; color: #dc2626; cursor: pointer; font-size: 1rem; padding: 4px; }
.flt-app > * { width: 100%; max-width: 960px; margin-left: auto; margin-right: auto; box-sizing: border-box; }
.flt-list { list-style: none; margin: 0; padding: 0; background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; }
.flt-list li { padding: 10px 14px; border-bottom: 1px solid #eef0f3; }
.flt-list li:last-child { border-bottom: 0; }
.flt-item { color: #1f2937; font-weight: 600; }
.flt-none { color: #475569; }
.flt-result .flt-list { margin-top: 6px; }
.flt-result .flt-list .flt-none { color: #067647; }
html[data-theme="dark"] .flt-list, html[data-theme="dark-contrast"] .flt-list { background: #1e293b; border-color: #334155; }
html[data-theme="dark"] .flt-list li, html[data-theme="dark-contrast"] .flt-list li { border-color: #334155; }
html[data-theme="dark"] .flt-item, html[data-theme="dark-contrast"] .flt-item { color: #e2e8f0; }
html[data-theme="dark"] .flt-none, html[data-theme="dark-contrast"] .flt-none { color: #cbd5e1; }
html[data-theme="dark"] .flt-result .flt-list .flt-none, html[data-theme="dark-contrast"] .flt-result .flt-list .flt-none { color: #86efac; }
html[data-theme="dark"] .flt-done, html[data-theme="dark-contrast"] .flt-done { color: #86efac; }
html[data-theme="dark"] .flt-result a, html[data-theme="dark-contrast"] .flt-result a { color: #93c5fd; }
