.tn-pdft-tool {
  --pdft-paper: #faf6ee; --pdft-wash: #f5efdf; --pdft-ink: #1a1208; --pdft-muted: #5a4a30;
  --pdft-line: #b8a888; --pdft-soft: #ddd4be; --pdft-button: #ede6d4; --pdft-hover: #dfd4bb;
  --pdft-primary: #1a1208; --pdft-primary-hover: #5a3018; --pdft-primary-text: #faf6ee; --pdft-accent: #a83d00;
  --pdft-sheet: #fffdf8;
  min-width: 0; border: 1px solid var(--pdft-line); background: var(--pdft-paper); color: var(--pdft-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif; font-size: 14px; line-height: 1.5;
}
body:is([data-scheme="dark"], [data-scheme="inverse"], [data-scheme="auto"][data-d="dark"], [data-scheme="auto"][data-l="dark"]) .tn-pdft-tool,
html[data-scheme="dark"] body:not([data-scheme="light"]) .tn-pdft-tool {
  --pdft-paper: #241d12; --pdft-wash: #322a1a; --pdft-ink: #f7ead1; --pdft-muted: #c3b492;
  --pdft-line: #826744; --pdft-soft: #574a37; --pdft-button: #2f2115; --pdft-hover: #3a2a1b;
  --pdft-primary: #6a3b1f; --pdft-primary-hover: #824826; --pdft-primary-text: #f7ead1; --pdft-accent: #e8823f;
  --pdft-sheet: #1d170e;
}
@media (prefers-color-scheme: dark) {
  body[data-scheme="auto"] .tn-pdft-tool {
    --pdft-paper: #241d12; --pdft-wash: #322a1a; --pdft-ink: #f7ead1; --pdft-muted: #c3b492;
    --pdft-line: #826744; --pdft-soft: #574a37; --pdft-button: #2f2115; --pdft-hover: #3a2a1b;
    --pdft-primary: #6a3b1f; --pdft-primary-hover: #824826; --pdft-primary-text: #f7ead1; --pdft-accent: #e8823f;
    --pdft-sheet: #1d170e;
  }
}
.tn-pdft-tool *, .tn-pdft-tool *::before, .tn-pdft-tool *::after { box-sizing: border-box; }
.tn-pdft-tool [hidden] { display: none !important; }
.tn-pdft-tool :is(p, figure, figcaption, dl, dt, dd, fieldset, legend, ul, li) { margin: 0; padding: 0; }
.tn-pdft-tool :is(fieldset, legend) { min-width: 0; border: 0; }
.tn-pdft-tool .tn-pdft-sr { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.tn-pdft-tool .tn-pdft-drop { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 170px; padding: 24px 20px; border-bottom: 1px solid var(--pdft-line); background: var(--pdft-wash); }
.tn-pdft-tool .tn-pdft-drop > div { min-width: 0; }
.tn-pdft-tool .tn-pdft-drop-title { margin-bottom: 10px; font-size: 23px; font-weight: 800; line-height: 1.4; color: var(--pdft-ink); overflow-wrap: anywhere; }
.tn-pdft-tool .tn-pdft-drop p + p { color: var(--pdft-muted); }
.tn-pdft-tool #pdftLimit { margin-top: 8px; }
.tn-pdft-tool .tn-pdft-dragging { outline: 2px dashed var(--pdft-accent); outline-offset: -6px; }
.tn-pdft-tool .tn-pdft-picker { display: grid; flex: 0 1 300px; gap: 8px; width: 100%; max-width: 340px; }
.tn-pdft-tool .tn-pdft-picker label { display: block; margin: 0; font-size: 13px; font-weight: 700; }
.tn-pdft-tool #pdftFile { display: block; width: 100%; max-width: 100%; min-width: 0; min-height: 38px; margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); font-family: inherit; font-size: 12px; line-height: 38px; box-shadow: none; }
.tn-pdft-tool .tn-pdft-btn,
.tn-pdft-tool #pdftFile::file-selector-button {
  display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto;
  height: 38px; min-height: 38px; margin: 0; padding: 0 12px; border: 1px solid var(--pdft-line); border-radius: 0;
  background: var(--pdft-button); color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink);
  font-family: "Courier New", monospace; font-size: 13px; font-weight: 900; line-height: 1; letter-spacing: 0; text-transform: none;
  text-align: center; text-decoration: none; white-space: nowrap; box-shadow: none; cursor: pointer; outline: none;
}
.tn-pdft-tool #pdftFile::file-selector-button { margin-right: 8px; background: var(--pdft-primary); color: var(--pdft-primary-text); -webkit-text-fill-color: var(--pdft-primary-text); }
.tn-pdft-tool .tn-pdft-btn--primary { background: var(--pdft-primary); color: var(--pdft-primary-text); -webkit-text-fill-color: var(--pdft-primary-text); }
.tn-pdft-tool .tn-pdft-btn--icon { width: 38px; padding: 0; font-size: 20px; }
.tn-pdft-tool .tn-pdft-btn:hover:not(:disabled) { background: var(--pdft-hover); }
.tn-pdft-tool .tn-pdft-btn--primary:hover:not(:disabled), .tn-pdft-tool #pdftFile:hover::file-selector-button { background: var(--pdft-primary-hover); }
.tn-pdft-tool :is(button, input, select, textarea, a):focus-visible { outline: 2px solid var(--pdft-accent); outline-offset: 2px; }
.tn-pdft-tool :is(button, input, select, textarea):disabled, .tn-pdft-tool fieldset:disabled :is(label, .tn-pdft-field-label) { opacity: .5; cursor: not-allowed; }
.tn-pdft-tool .tn-pdft-buttons { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.tn-pdft-tool .tn-pdft-file-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 18px; border-bottom: 1px solid var(--pdft-line); }
.tn-pdft-tool .tn-pdft-file-meta { display: grid; grid-template-columns: minmax(0, 1fr) repeat(3, auto); flex: 1; gap: 12px 22px; min-width: 0; }
.tn-pdft-tool .tn-pdft-file-meta > div { min-width: 0; }
.tn-pdft-tool .tn-pdft-file-meta dt { margin-bottom: 3px; font-size: 12px; font-weight: 600; color: var(--pdft-muted); }
.tn-pdft-tool #pdftName { overflow-wrap: anywhere; font-weight: 700; }
.tn-pdft-tool :is(.tn-pdft-notice, .tn-pdft-errors) { padding: 12px 18px; border-bottom: 1px solid var(--pdft-line); border-left: 3px solid var(--pdft-accent); background: var(--pdft-wash); color: var(--pdft-ink); overflow-wrap: anywhere; }
.tn-pdft-tool .tn-pdft-errors:empty { display: none; }
.tn-pdft-tool .tn-pdft-progress { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--pdft-line); }
.tn-pdft-tool .tn-pdft-progress-bar { flex: 1 1 240px; height: 8px; border: 1px solid var(--pdft-line); background: var(--pdft-wash); }
.tn-pdft-tool .tn-pdft-progress-bar span { display: block; width: 0; height: 100%; background: var(--pdft-accent); }
.tn-pdft-tool #pdftProgressText { font-size: 13px; }
.tn-pdft-tool .tn-pdft-options { display: grid; grid-template-columns: minmax(200px, 1.1fr) auto minmax(0, 1.4fr); align-items: start; gap: 14px 24px; padding: 16px 18px; border-bottom: 1px solid var(--pdft-line); }
.tn-pdft-tool .tn-pdft-field { display: grid; gap: 6px; min-width: 0; }
.tn-pdft-tool .tn-pdft-field > label, .tn-pdft-tool .tn-pdft-field-label { margin: 0; font-size: 12px; font-weight: 700; color: var(--pdft-muted); }
.tn-pdft-tool #pdftPages {
  display: block; width: 100%; min-width: 0; height: 38px; min-height: 38px; margin: 0; padding: 8px 10px; border: 1px solid var(--pdft-line); border-radius: 0;
  background: var(--pdft-paper); color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); box-shadow: none; outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif; font-size: 14px; font-weight: 600; line-height: 1.5; font-variant-numeric: lining-nums tabular-nums; letter-spacing: normal;
}
.tn-pdft-tool #pdftPages[aria-invalid="true"] { border-color: var(--pdft-accent); }
.tn-pdft-tool #pdftPages::placeholder { color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); font-weight: 400; opacity: .35; }
.tn-pdft-tool .tn-pdft-segment { display: flex; flex-wrap: wrap; }
.tn-pdft-tool .tn-pdft-segment label { position: relative; display: block; margin: 0; cursor: pointer; }
.tn-pdft-tool .tn-pdft-segment label + label { margin-left: -1px; }
.tn-pdft-tool .tn-pdft-segment input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.tn-pdft-tool .tn-pdft-segment span {
  display: flex; align-items: center; justify-content: center; height: 38px; padding: 0 14px; border: 1px solid var(--pdft-line); background: var(--pdft-button); color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink);
  font-family: "Courier New", monospace; font-size: 13px; font-weight: 900; white-space: nowrap;
}
.tn-pdft-tool .tn-pdft-segment input:checked + span { position: relative; z-index: 1; border-color: var(--pdft-primary); background: var(--pdft-primary); color: var(--pdft-primary-text); -webkit-text-fill-color: var(--pdft-primary-text); }
.tn-pdft-tool .tn-pdft-segment input:focus-visible + span { outline: 2px solid var(--pdft-accent); outline-offset: 2px; }
.tn-pdft-tool .tn-pdft-checks { grid-template-columns: repeat(2, minmax(0, max-content)); column-gap: 18px; }
.tn-pdft-tool .tn-pdft-checks .tn-pdft-field-label { grid-column: 1 / -1; }
.tn-pdft-tool .tn-pdft-check { display: flex; align-items: center; gap: 8px; min-height: 30px; margin: 0; font-size: 14px; font-weight: 600; cursor: pointer; }
.tn-pdft-tool input[type="checkbox"] { display: inline-block; flex: 0 0 18px; width: 18px; height: 18px; min-width: 18px; margin: 0; padding: 0; appearance: auto; border-radius: 0; accent-color: var(--pdft-accent); box-shadow: none; }
.tn-pdft-tool .tn-pdft-caption { font-size: 12px; line-height: 1.6; color: var(--pdft-muted); overflow-wrap: anywhere; }
.tn-pdft-tool .tn-pdft-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 18px; border-bottom: 1px solid var(--pdft-soft); background: var(--pdft-wash); }
.tn-pdft-tool .tn-pdft-view { display: flex; align-items: center; gap: 8px; min-width: 0; }
.tn-pdft-tool .tn-pdft-view label { margin: 0; font-size: 12px; font-weight: 700; color: var(--pdft-muted); }
.tn-pdft-tool #pdftView {
  width: 230px; min-width: 0; max-width: 100%; height: 38px; margin: 0; padding: 0 30px 0 10px; border: 1px solid var(--pdft-line); border-radius: 0;
  background-color: var(--pdft-paper); color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); box-shadow: none;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif; font-size: 14px; font-weight: 600; font-variant-numeric: lining-nums tabular-nums;
}
.tn-pdft-tool .tn-pdft-panes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px 18px; }
.tn-pdft-tool .tn-pdft-panes[data-view="page"] { grid-template-columns: minmax(0, 380px) minmax(0, 1fr); }
.tn-pdft-tool .tn-pdft-preview { display: grid; align-content: start; gap: 8px; min-width: 0; }
.tn-pdft-tool .tn-pdft-preview-stage { display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 540px; padding: 10px; overflow: hidden; border: 1px solid var(--pdft-soft); background: var(--pdft-wash); color: var(--pdft-muted); text-align: center; font-size: 12px; }
.tn-pdft-tool .tn-pdft-preview-stage canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 520px; border: 1px solid var(--pdft-soft); border-radius: 0; background: #fff; }
.tn-pdft-tool .tn-pdft-result { min-width: 0; }
.tn-pdft-tool #pdftOutput {
  display: block; width: 100%; min-width: 0; height: 520px; min-height: 260px; max-height: 80vh; margin: 0; padding: 16px 18px; resize: vertical;
  border: 1px solid var(--pdft-line); border-radius: 0; background: var(--pdft-sheet); color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); box-shadow: none; outline: none;
  font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif; font-size: 15px; font-weight: 400; line-height: 1.75; letter-spacing: normal;
  white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
}
.tn-pdft-tool:is([data-state="empty"], [data-state="error"], [data-state="loading"]) #pdftOutput { height: 200px; min-height: 160px; }
.tn-pdft-tool #pdftOutput::placeholder { color: var(--pdft-ink); -webkit-text-fill-color: var(--pdft-ink); opacity: .45; }
.tn-pdft-tool .tn-pdft-stats { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 20px; padding: 0 18px 14px; }
.tn-pdft-tool #pdftSummary { font-size: 15px; }
.tn-pdft-tool #pdftStatus { flex: 1 1 320px; min-width: 0; color: var(--pdft-muted); text-align: right; overflow-wrap: anywhere; }
.tn-pdft-tool .tn-pdft-warnings { list-style: none; }
.tn-pdft-tool .tn-pdft-warnings:empty { display: none; }
.tn-pdft-tool .tn-pdft-warnings li { padding: 10px 18px; border-top: 1px solid var(--pdft-soft); border-left: 3px solid var(--pdft-accent); background: var(--pdft-wash); overflow-wrap: anywhere; }
.tn-pdft-tool .tn-pdft-final-note { padding: 12px 18px 16px; border-top: 1px solid var(--pdft-line); }
.tn-pdft-tool .tn-pdft-noscript { padding: 16px 18px; border-top: 1px solid var(--pdft-line); }
.tn-pdft-tool .tn-pdft-number { font-family: -apple-system, BlinkMacSystemFont, "Pretendard", "Segoe UI", system-ui, sans-serif; font-weight: 800; font-variant-numeric: lining-nums tabular-nums; letter-spacing: normal; }
.tn-pdft-page .tn-pdft-responsive-ad { width: 100%; min-height: 90px; height: auto !important; max-height: none !important; margin: 24px auto; background: transparent; border: 0; overflow: visible; }
.tn-pdft-page .tn-pdft-responsive-ad--top { margin-top: 54px; }
@media (max-width: 1000px) {
  .tn-pdft-tool .tn-pdft-options { grid-template-columns: minmax(0, 1fr) auto; }
  .tn-pdft-tool .tn-pdft-checks { grid-column: 1 / -1; }
  .tn-pdft-tool .tn-pdft-panes[data-view="page"] { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .tn-pdft-tool .tn-pdft-drop { flex-direction: column; align-items: flex-start; gap: 18px; }
  .tn-pdft-tool .tn-pdft-picker { flex-basis: auto; }
  .tn-pdft-tool .tn-pdft-file-row { flex-direction: column; align-items: flex-start; gap: 12px; }
  .tn-pdft-tool .tn-pdft-file-meta { width: 100%; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tn-pdft-tool .tn-pdft-filename { grid-column: 1 / -1; }
  .tn-pdft-tool .tn-pdft-options { grid-template-columns: minmax(0, 1fr); }
  .tn-pdft-tool .tn-pdft-checks { grid-template-columns: minmax(0, 1fr); }
  .tn-pdft-tool .tn-pdft-panes[data-view="page"] { grid-template-columns: minmax(0, 1fr); }
  .tn-pdft-tool .tn-pdft-preview-stage { min-height: 220px; max-height: 360px; }
  .tn-pdft-tool .tn-pdft-preview-stage canvas { max-height: 340px; }
  .tn-pdft-tool #pdftOutput { height: 420px; }
  .tn-pdft-tool #pdftStatus { text-align: left; }
}
@media (max-width: 600px) {
  .tn-pdft-tool .tn-pdft-drop { padding: 20px 12px; }
  .tn-pdft-tool .tn-pdft-drop-title { font-size: 21px; }
  .tn-pdft-tool :is(.tn-pdft-file-row, .tn-pdft-options, .tn-pdft-toolbar, .tn-pdft-panes, .tn-pdft-stats, .tn-pdft-progress, .tn-pdft-final-note, .tn-pdft-notice, .tn-pdft-errors, .tn-pdft-warnings li) { padding-left: 10px; padding-right: 10px; }
  .tn-pdft-tool .tn-pdft-view { width: 100%; }
  .tn-pdft-tool #pdftView { flex: 1 1 auto; width: auto; }
  .tn-pdft-tool .tn-pdft-toolbar .tn-pdft-buttons { width: 100%; }
  .tn-pdft-tool .tn-pdft-toolbar .tn-pdft-buttons .tn-pdft-btn { flex: 1 1 auto; padding: 0 8px; }
  .tn-pdft-tool .tn-pdft-segment { width: 100%; }
  .tn-pdft-tool .tn-pdft-segment label { flex: 1 1 auto; }
  .tn-pdft-tool .tn-pdft-segment span { padding: 0 6px; }
  .tn-pdft-tool #pdftOutput { height: 360px; padding: 12px; font-size: 15px; }
  .tn-pdft-page .tn-pdft-responsive-ad--top { margin-top: 48px; }
}
@media (prefers-reduced-motion: reduce) {
  .tn-pdft-tool * { scroll-behavior: auto; transition: none; }
}
