/* TRW Free PDF Toolkit. Every selector is scoped to .trw-pdf. */
.trw-pdf {
	--p-ink: #17302a;
	--p-muted: #50655e;
	--p-green: #0b7a52;
	--p-green-deep: #075a3c;
	--p-gold: #f2b52c;
	--p-wash: #edf5f0;
	--p-line: #cddcd4;
	--p-paper: #ffffff;
	--p-danger: #a8231b;
	--p-warn-bg: #fff5d9;
	--p-font: "Avenir Next", "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, system-ui, sans-serif;
	font-family: var(--p-font);
	color: var(--p-ink);
	font-size: 16px;
	line-height: 1.5;
	max-width: 1180px;
	margin: 0 auto 2.5em;
	text-align: left;
}
.trw-pdf *, .trw-pdf *::before, .trw-pdf *::after { box-sizing: border-box; }
.trw-pdf [hidden] { display: none !important; }
.trw-pdf p { margin: 0; }
.trw-pdf svg { flex: none; }

/* Header */
.trw-pdf .trw-pdf-head { margin-bottom: 18px; }
.trw-pdf .trw-pdf-title {
	font-family: var(--p-font); font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); line-height: 1.12;
	font-weight: 800; letter-spacing: -0.02em; color: var(--p-ink); margin: 0 0 10px; padding: 0;
}
.trw-pdf .trw-pdf-privacy {
	display: inline-flex; align-items: center; gap: 8px; background: var(--p-wash); color: var(--p-green-deep);
	border-radius: 999px; padding: 7px 14px 7px 12px; font-weight: 700; font-size: 0.92rem; line-height: 1.35;
}

/* Dashboard */
.trw-pdf ul.trw-pdf-cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 560px) { .trw-pdf ul.trw-pdf-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .trw-pdf ul.trw-pdf-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 1100px) { .trw-pdf ul.trw-pdf-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.trw-pdf ul.trw-pdf-cards li { margin: 0; padding: 0; }
.trw-pdf a.trw-pdf-card {
	display: flex; align-items: center; gap: 14px; height: 100%; min-height: 76px;
	padding: 14px 16px; border: 1px solid var(--p-line); border-radius: 14px; background: var(--p-paper);
	color: var(--p-ink); text-decoration: none; box-shadow: none;
	transition: border-color .15s ease, background-color .15s ease;
}
.trw-pdf a.trw-pdf-card:hover { border-color: var(--p-green); background: #f7fbf9; color: var(--p-ink); }
.trw-pdf .trw-pdf-card-icon, .trw-pdf .trw-pdf-tool-icon {
	display: inline-flex; align-items: center; justify-content: center; flex: none;
	width: 48px; height: 48px; border-radius: 12px; background: var(--p-wash); color: var(--p-green-deep);
}
.trw-pdf .trw-pdf-card-text { display: flex; flex-direction: column; min-width: 0; }
.trw-pdf .trw-pdf-card-name { font-weight: 800; font-size: 1.05rem; line-height: 1.25; }
.trw-pdf .trw-pdf-card-desc { color: var(--p-muted); font-size: 0.9rem; line-height: 1.4; margin-top: 2px; }
@media (max-width: 559px) {
	.trw-pdf ul.trw-pdf-cards { gap: 8px; }
	.trw-pdf a.trw-pdf-card { min-height: 0; padding: 10px 12px; gap: 12px; border-radius: 12px; }
	.trw-pdf .trw-pdf-card-icon { width: 42px; height: 42px; border-radius: 10px; }
	.trw-pdf .trw-pdf-card-name { font-size: 1rem; }
	.trw-pdf .trw-pdf-card-desc { font-size: 0.86rem; line-height: 1.35; }
}

/* Tool panel */
.trw-pdf .trw-pdf-tool { border: 1px solid var(--p-line); border-radius: 18px; padding: 14px 16px 18px; background: var(--p-paper); }
@media (min-width: 700px) { .trw-pdf .trw-pdf-tool { padding: 18px 26px 24px; } }
.trw-pdf button.trw-pdf-back {
	display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -6px; padding: 8px 10px 8px 4px; min-height: 40px;
	background: none; border: 0; border-radius: 10px; color: var(--p-green-deep); font: inherit; font-weight: 700; font-size: 0.95rem;
	cursor: pointer; box-shadow: none; text-transform: none; letter-spacing: 0;
}
.trw-pdf button.trw-pdf-back:hover { background: var(--p-wash); color: var(--p-ink); }
.trw-pdf .trw-pdf-tool-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.trw-pdf .trw-pdf-tool-title { font-family: var(--p-font); font-size: 1.5rem; line-height: 1.2; font-weight: 800; margin: 0; padding: 0; color: var(--p-ink); letter-spacing: -0.01em; }
.trw-pdf .trw-pdf-tool-desc { color: var(--p-muted); }
.trw-pdf .trw-pdf-tool-body.is-busy { cursor: progress; }

/* Drop zone */
.trw-pdf .trw-pdf-drop {
	position: relative; border: 2px dashed #9dbdae; border-radius: 16px; background: var(--p-wash);
	padding: 26px 16px; text-align: center; transition: background-color .15s ease, border-color .15s ease;
}
.trw-pdf .trw-pdf-drop.is-compact { padding: 14px; }
.trw-pdf .trw-pdf-drop.is-compact .trw-pdf-drop-hint { display: none; }
.trw-pdf .trw-pdf-drop.is-over { background: #dcefe4; border-color: var(--p-green); }
.trw-pdf .trw-pdf-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.trw-pdf .trw-pdf-drop-hint { margin-top: 10px; color: var(--p-muted); font-size: 0.92rem; }
.trw-pdf .trw-pdf-desktop-only { display: none; }
@media (hover: hover) and (pointer: fine) { .trw-pdf .trw-pdf-desktop-only { display: inline; } }

/* Buttons */
.trw-pdf .trw-pdf-btn,
.trw-pdf a.trw-pdf-btn,
.trw-pdf button.trw-pdf-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 10px 20px; margin: 0; width: auto;
	border: 2px solid transparent; border-radius: 12px;
	font-family: var(--p-font); font-size: 1rem; font-weight: 700; line-height: 1.2;
	letter-spacing: 0; text-transform: none; text-decoration: none; text-shadow: none; box-shadow: none;
	cursor: pointer; -webkit-tap-highlight-color: transparent;
	transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.trw-pdf button.trw-pdf-btn--primary { background: var(--p-green); color: #fff; }
.trw-pdf button.trw-pdf-btn--primary:hover { background: var(--p-green-deep); color: #fff; }
.trw-pdf button.trw-pdf-btn--big { min-height: 58px; padding: 12px 28px; font-size: 1.12rem; border-radius: 14px; }
.trw-pdf .trw-pdf-drop.is-compact button.trw-pdf-btn--big { min-height: 48px; font-size: 1rem; background: var(--p-paper); color: var(--p-green-deep); border-color: var(--p-green); }
.trw-pdf button.trw-pdf-btn--wide { width: 100%; min-height: 56px; font-size: 1.1rem; }
.trw-pdf button.trw-pdf-btn--secondary { background: var(--p-paper); color: var(--p-green-deep); border-color: var(--p-green); }
.trw-pdf button.trw-pdf-btn--secondary:hover { background: var(--p-wash); color: var(--p-green-deep); }
.trw-pdf button.trw-pdf-btn--ghost { background: transparent; color: var(--p-muted); border-color: var(--p-line); }
.trw-pdf button.trw-pdf-btn--ghost:hover { background: var(--p-wash); color: var(--p-ink); }
.trw-pdf button.trw-pdf-btn--tool { min-height: 42px; padding: 7px 12px; font-size: 0.92rem; background: var(--p-paper); color: var(--p-ink); border: 2px solid var(--p-line); border-radius: 10px; }
.trw-pdf button.trw-pdf-btn--tool:hover { border-color: var(--p-green); background: var(--p-wash); color: var(--p-ink); }
.trw-pdf a.trw-pdf-btn--small { min-height: 42px; padding: 8px 16px; font-size: 0.95rem; border-radius: 10px; background: var(--p-green); color: #fff; flex: none; }
.trw-pdf a.trw-pdf-btn--small:hover { background: var(--p-green-deep); color: #fff; }
.trw-pdf button.trw-pdf-btn:disabled { opacity: .45; cursor: not-allowed; }
.trw-pdf button:focus-visible, .trw-pdf a:focus-visible, .trw-pdf input:focus-visible, .trw-pdf select:focus-visible, .trw-pdf summary:focus-visible {
	outline: 3px solid var(--p-gold); outline-offset: 2px;
}
.trw-pdf button.trw-pdf-link {
	background: none; border: 0; padding: 6px 2px; margin: 0; min-height: 0; box-shadow: none; text-transform: none;
	color: var(--p-green-deep); font: inherit; font-weight: 700; font-size: 0.92rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer;
}
.trw-pdf button.trw-pdf-link:hover { background: none; color: var(--p-ink); }
.trw-pdf button.trw-pdf-link:disabled { opacity: .4; cursor: not-allowed; text-decoration: none; }
.trw-pdf button.trw-pdf-icon-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; min-height: 40px;
	padding: 0; margin: 0; border: 0; border-radius: 10px; background: transparent; color: var(--p-ink); cursor: pointer; box-shadow: none;
}
.trw-pdf button.trw-pdf-icon-btn:hover { background: var(--p-wash); color: var(--p-green-deep); }
.trw-pdf button.trw-pdf-icon-btn.is-danger:hover { color: var(--p-danger); }
.trw-pdf button.trw-pdf-icon-btn:disabled { opacity: .3; cursor: default; background: transparent; }

/* Messages */
.trw-pdf .trw-pdf-msg { margin: 12px 2px 0; font-size: 0.96rem; }
.trw-pdf .trw-pdf-msg:empty { display: none; }
.trw-pdf .trw-pdf-msg--ok { color: var(--p-green-deep); font-weight: 700; }
.trw-pdf .trw-pdf-msg--warn { background: var(--p-warn-bg); padding: 10px 14px; border-radius: 10px; }
.trw-pdf .trw-pdf-msg--error { background: #fde8e6; color: #7a1712; padding: 10px 14px; border-radius: 10px; font-weight: 600; }
.trw-pdf .trw-pdf-help { color: var(--p-muted); font-size: 0.88rem; margin-top: 6px; }
.trw-pdf .trw-pdf-field-error { color: var(--p-danger); font-size: 0.9rem; margin-top: 6px; font-weight: 600; }
.trw-pdf .trw-pdf-meta { color: var(--p-muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }

/* File info & sortable list */
.trw-pdf .trw-pdf-info:empty { display: none; }
.trw-pdf .trw-pdf-info { margin-top: 14px; }
.trw-pdf .trw-pdf-filecard { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--p-line); border-bottom: 1px solid var(--p-line); }
.trw-pdf .trw-pdf-filebadge { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 52px; border-radius: 6px 14px 6px 6px; background: var(--p-ink); color: #fff; font-weight: 800; font-size: 0.78rem; flex: none; }
.trw-pdf .trw-pdf-result-name { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trw-pdf ul.trw-pdf-sortlist { list-style: none; margin: 0; padding: 0; }
.trw-pdf ul.trw-pdf-sortlist:empty { display: none; }
.trw-pdf li.trw-pdf-sortitem {
	display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px;
	margin: 0; padding: 10px 0; border-bottom: 1px solid var(--p-line); background: var(--p-paper);
}
.trw-pdf li.trw-pdf-sortitem:first-child { border-top: 1px solid var(--p-line); }
.trw-pdf li.trw-pdf-sortitem.is-dragging { opacity: .4; }
.trw-pdf li.trw-pdf-sortitem.is-target { box-shadow: inset 0 3px 0 var(--p-green); }
.trw-pdf .trw-pdf-sortnum { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--p-wash); color: var(--p-green-deep); font-weight: 800; font-size: 0.85rem; }
.trw-pdf img.trw-pdf-sortthumb { width: 48px; height: 48px; object-fit: cover; border-radius: 8px; margin: 0; }
.trw-pdf li.trw-pdf-sortitem.has-thumb { grid-template-columns: 28px 48px minmax(0, 1fr) auto; }
.trw-pdf .trw-pdf-sortinfo { min-width: 0; }
.trw-pdf .trw-pdf-sortctrl { display: flex; gap: 2px; }

/* Options */
.trw-pdf .trw-pdf-options { margin-top: 16px; display: grid; gap: 16px; }
.trw-pdf fieldset.trw-pdf-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.trw-pdf fieldset.trw-pdf-field legend, .trw-pdf .trw-pdf-label {
	display: block; float: none; width: auto; padding: 0; margin: 0 0 8px; font-weight: 800; font-size: 1rem; color: var(--p-ink);
}
.trw-pdf .trw-pdf-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.trw-pdf .trw-pdf-chips label { position: relative; margin: 0; cursor: pointer; }
.trw-pdf .trw-pdf-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
.trw-pdf .trw-pdf-chips span {
	display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 8px 14px;
	border: 2px solid var(--p-line); border-radius: 12px; font-weight: 700; font-size: 0.92rem; line-height: 1.2;
	color: var(--p-ink); background: var(--p-paper); transition: border-color .15s ease, background-color .15s ease;
}
.trw-pdf .trw-pdf-chips input:checked + span { border-color: var(--p-green); background: var(--p-wash); color: var(--p-green-deep); }
.trw-pdf .trw-pdf-chips input:focus-visible + span { outline: 3px solid var(--p-gold); outline-offset: 2px; }
.trw-pdf .trw-pdf-chips input:disabled + span { opacity: .45; cursor: not-allowed; }
.trw-pdf input.trw-pdf-input, .trw-pdf select.trw-pdf-select, .trw-pdf textarea.trw-pdf-input {
	width: 100%; min-height: 48px; margin: 0; padding: 8px 12px; border: 2px solid var(--p-line); border-radius: 12px;
	background: var(--p-paper); color: var(--p-ink); font: inherit; font-size: 1rem; box-shadow: none;
}
.trw-pdf input.trw-pdf-input:focus, .trw-pdf select.trw-pdf-select:focus { border-color: var(--p-green); }
.trw-pdf input.trw-pdf-input[aria-invalid="true"] { border-color: var(--p-danger); }
.trw-pdf input[type="color"].trw-pdf-input { width: 64px; padding: 3px; }
.trw-pdf .trw-pdf-range { display: grid; grid-template-columns: 1fr auto; align-items: center; column-gap: 10px; }
.trw-pdf .trw-pdf-range .trw-pdf-label { margin: 0; }
.trw-pdf .trw-pdf-range output { font-weight: 800; color: var(--p-green-deep); font-variant-numeric: tabular-nums; }
.trw-pdf input[type="range"] {
	grid-column: 1 / -1; width: 100%; height: 32px; margin: 4px 0 0; padding: 0; background: transparent; border: 0; box-shadow: none;
	-webkit-appearance: none; appearance: none; accent-color: var(--p-green);
}
.trw-pdf input[type="range"]::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: #dbe7e0; }
.trw-pdf input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 28px; height: 28px; margin-top: -10px; border-radius: 50%; background: var(--p-green); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--p-green-deep); }
.trw-pdf input[type="range"]::-moz-range-track { height: 8px; border-radius: 999px; background: #dbe7e0; }
.trw-pdf input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; background: var(--p-green); border: 4px solid #fff; box-shadow: 0 0 0 1px var(--p-green-deep); }
.trw-pdf .trw-pdf-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }

/* Actions & progress */
.trw-pdf .trw-pdf-actions { margin-top: 20px; }
.trw-pdf .trw-pdf-progress { margin-top: 12px; }
.trw-pdf .trw-pdf-progress progress { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; overflow: hidden; background: #e2ebe6; -webkit-appearance: none; appearance: none; accent-color: var(--p-green); }
.trw-pdf .trw-pdf-progress progress::-webkit-progress-bar { background: #e2ebe6; border-radius: 999px; }
.trw-pdf .trw-pdf-progress progress::-webkit-progress-value { background: var(--p-green); border-radius: 999px; }
.trw-pdf .trw-pdf-progress progress::-moz-progress-bar { background: var(--p-green); border-radius: 999px; }
.trw-pdf .trw-pdf-progress-text { color: var(--p-muted); font-size: 0.92rem; margin-top: 6px; }
.trw-pdf .trw-pdf-foot { display: flex; justify-content: flex-end; margin-top: 18px; }

/* Results */
.trw-pdf .trw-pdf-results { margin-top: 20px; padding: 16px; border-radius: 14px; background: var(--p-wash); }
.trw-pdf .trw-pdf-results-summary p { font-weight: 700; margin-bottom: 8px; }
.trw-pdf .trw-pdf-results-summary .trw-pdf-help { font-weight: 400; }
.trw-pdf ul.trw-pdf-results-list { list-style: none; margin: 0 0 12px; padding: 0; max-height: 420px; overflow-y: auto; }
.trw-pdf ul.trw-pdf-results-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 10px 0; border-bottom: 1px solid var(--p-line); }
.trw-pdf ul.trw-pdf-results-list li:last-child { border-bottom: 0; }
.trw-pdf .trw-pdf-result-info { min-width: 0; }
.trw-pdf .trw-pdf-saved { display: inline-block; background: var(--p-gold); color: #2b2200; font-weight: 800; padding: 1px 8px; border-radius: 6px; }

/* Size comparison bar (Compress) */
.trw-pdf .trw-pdf-meter { position: relative; height: 12px; border-radius: 999px; background: #d6e4dc; overflow: hidden; margin: 6px 0 10px; }
.trw-pdf .trw-pdf-meter span { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--p-green); }

/* Page grid */
.trw-pdf .trw-pdf-toolbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.trw-pdf .trw-pdf-gridwrap { margin-top: 4px; }
.trw-pdf ul.trw-pdf-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
@media (min-width: 700px) { .trw-pdf ul.trw-pdf-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); } }
.trw-pdf li.trw-pdf-tile { margin: 0; padding: 8px; border: 2px solid var(--p-line); border-radius: 12px; background: var(--p-paper); }
.trw-pdf li.trw-pdf-tile.is-rotated { border-color: var(--p-gold); }
.trw-pdf li.trw-pdf-tile.is-selected { border-color: var(--p-green); background: var(--p-wash); }
.trw-pdf li.trw-pdf-tile.is-dragging { opacity: .4; }
.trw-pdf li.trw-pdf-tile.is-target { box-shadow: -4px 0 0 var(--p-green); }
.trw-pdf .trw-pdf-thumb { position: relative; width: 100%; aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; border-radius: 6px; background: #f3f6f4; }
.trw-pdf .trw-pdf-thumb:not(.is-loaded)::after { content: ""; width: 22px; height: 22px; border: 3px solid #b9cdc3; border-right-color: transparent; border-radius: 50%; animation: trw-pdf-spin .8s linear infinite; position: absolute; }
.trw-pdf .trw-pdf-thumb.is-failed::after { display: none; }
.trw-pdf .trw-pdf-thumb-inner { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; transition: transform .2s ease; }
.trw-pdf .trw-pdf-thumb img { max-width: 100%; max-height: 100%; width: auto; height: auto; margin: 0; box-shadow: 0 0 0 1px #d4ded9; background: #fff; }
.trw-pdf .trw-pdf-thumb img:not([src]) { display: none; }
.trw-pdf label.trw-pdf-tile-select { display: block; position: relative; margin: 0; cursor: pointer; }
.trw-pdf input.trw-pdf-tile-check { position: absolute; top: 6px; left: 6px; z-index: 2; width: 24px; height: 24px; margin: 0; accent-color: var(--p-green); }
.trw-pdf .trw-pdf-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-top: 6px; min-height: 22px; }
.trw-pdf .trw-pdf-tile-label { font-size: 0.85rem; font-weight: 700; }
.trw-pdf .trw-pdf-tile-badge { font-size: 0.75rem; font-weight: 800; background: var(--p-gold); color: #2b2200; padding: 0 6px; border-radius: 6px; }
.trw-pdf .trw-pdf-tile-actions { display: flex; justify-content: center; gap: 4px; margin-top: 4px; }
@keyframes trw-pdf-spin { to { transform: rotate(360deg); } }

/* Metadata table */
.trw-pdf table.trw-pdf-meta-table { width: 100%; border-collapse: collapse; margin: 0; font-size: 0.95rem; border: 0; }
.trw-pdf table.trw-pdf-meta-table th, .trw-pdf table.trw-pdf-meta-table td { text-align: left; vertical-align: top; padding: 9px 8px 9px 0; border: 0; border-bottom: 1px solid var(--p-line); background: none; }
.trw-pdf table.trw-pdf-meta-table th { width: 38%; font-weight: 700; color: var(--p-muted); }
.trw-pdf table.trw-pdf-meta-table td { word-break: break-word; }
.trw-pdf .trw-pdf-notset { color: var(--p-muted); font-style: italic; }

/* Page content */
.trw-pdf .trw-pdf-content { margin-top: 48px; max-width: 760px; }
.trw-pdf .trw-pdf-content section { margin-bottom: 34px; }
.trw-pdf .trw-pdf-content h2 { font-family: var(--p-font); font-size: clamp(1.3rem, 1.1rem + 1vw, 1.65rem); line-height: 1.2; font-weight: 800; letter-spacing: -0.01em; color: var(--p-ink); margin: 0 0 12px; }
.trw-pdf .trw-pdf-content p { margin: 0 0 12px; font-size: 1.02rem; line-height: 1.65; }
.trw-pdf ol.trw-pdf-steps { margin: 0 0 12px; padding-left: 1.4em; }
.trw-pdf ol.trw-pdf-steps li { margin: 0 0 8px; padding-left: 4px; line-height: 1.6; }
.trw-pdf .trw-pdf-faq details { border-bottom: 1px solid var(--p-line); }
.trw-pdf .trw-pdf-faq details:first-of-type { border-top: 1px solid var(--p-line); }
.trw-pdf .trw-pdf-faq summary { cursor: pointer; list-style: none; padding: 14px 32px 14px 0; position: relative; font-weight: 700; font-size: 1.02rem; line-height: 1.4; }
.trw-pdf .trw-pdf-faq summary::-webkit-details-marker { display: none; }
.trw-pdf .trw-pdf-faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2.5px solid var(--p-green); border-bottom: 2.5px solid var(--p-green); transform: rotate(45deg); transition: transform .15s ease; }
.trw-pdf .trw-pdf-faq details[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.trw-pdf .trw-pdf-faq details p { padding: 0 0 14px; margin: 0; color: #2e4740; }
.trw-pdf .trw-pdf-more ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 620px) { .trw-pdf .trw-pdf-more ul { grid-template-columns: 1fr 1fr; } }
.trw-pdf .trw-pdf-more li { margin: 0; padding: 16px 18px; border: 1px solid var(--p-line); border-left: 5px solid var(--p-gold); border-radius: 10px; }
.trw-pdf .trw-pdf-more a { font-weight: 800; color: var(--p-green-deep); text-decoration: underline; text-underline-offset: 3px; font-size: 1.05rem; }
.trw-pdf .trw-pdf-more a:hover { color: var(--p-ink); }
.trw-pdf .trw-pdf-more p { margin: 6px 0 0; font-size: 0.95rem; color: var(--p-muted); line-height: 1.5; }

@media (prefers-reduced-motion: reduce) {
	.trw-pdf *, .trw-pdf *::before, .trw-pdf *::after { animation: none !important; transition: none !important; }
}

/* ======================= 1.1.0: PDF Reader & Viewer ======================= */
.trw-pdf .trw-pdf-result-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; flex: none; }
.trw-pdf button.trw-pdf-btn--preview { min-height: 42px; padding: 8px 14px; font-size: 0.95rem; border-radius: 10px; background: var(--p-paper); color: var(--p-green-deep); border: 2px solid var(--p-green); }
.trw-pdf button.trw-pdf-btn--preview:hover { background: var(--p-wash); color: var(--p-green-deep); }
@media (max-width: 519px) {
	.trw-pdf ul.trw-pdf-results-list li:has(.trw-pdf-result-actions) { flex-wrap: wrap; }
	.trw-pdf .trw-pdf-result-actions { width: 100%; justify-content: stretch; }
	.trw-pdf .trw-pdf-result-actions > button.trw-pdf-btn,
	.trw-pdf .trw-pdf-result-actions > a.trw-pdf-btn { flex: 1 1 0; min-width: 0; padding-left: 8px; padding-right: 8px; text-align: center; }
}

.trw-pdf .trw-pdf-viewer-stage:empty { display: none; }
.trw-pdf .trw-pdf-viewer-stage { margin-top: 14px; }
.trw-pdf .trw-pdfv {
	display: flex; flex-direction: column; height: min(82vh, 980px); min-height: 420px;
	border: 1px solid var(--p-line); border-radius: 14px; overflow: hidden; background: #e7eeea; outline: none;
}
.trw-pdf .trw-pdfv.is-fullscreen, .trw-pdf .trw-pdfv:fullscreen { height: 100vh; border-radius: 0; border: 0; }
.trw-pdf .trw-pdfv.is-expanded { position: fixed; inset: 0; z-index: 2147483001; height: auto; min-height: 0; margin: 0 !important; border: 0; border-radius: 0;
	padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0); }
.trw-pdf .trw-pdfv-bar {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px;
	padding: 6px 8px; background: var(--p-paper); border-bottom: 1px solid var(--p-line); flex: none;
}
.trw-pdf .trw-pdfv-group { display: flex; align-items: center; gap: 2px; }
.trw-pdf .trw-pdfv-btn, .trw-pdf button.trw-pdfv-btn, .trw-pdf a.trw-pdfv-btn {
	display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; min-height: 44px;
	margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--p-ink);
	box-shadow: none; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.trw-pdf button.trw-pdfv-btn:hover, .trw-pdf a.trw-pdfv-btn:hover { background: var(--p-wash); color: var(--p-green-deep); }
.trw-pdf button.trw-pdfv-btn.is-on { background: var(--p-wash); color: var(--p-green-deep); box-shadow: inset 0 0 0 2px var(--p-green); }
.trw-pdf button.trw-pdfv-btn:disabled { opacity: .35; cursor: default; background: transparent; }
.trw-pdf .trw-pdfv-pagewrap { display: inline-flex; align-items: center; gap: 4px; margin: 0 2px; font-weight: 700; font-variant-numeric: tabular-nums; }
.trw-pdf input.trw-pdfv-page {
	width: 3.2em; min-height: 40px; height: 40px; padding: 4px; margin: 0; text-align: center;
	border: 2px solid var(--p-line); border-radius: 8px; background: #fff; color: var(--p-ink); font: inherit; font-weight: 700; box-shadow: none;
}
.trw-pdf input.trw-pdfv-page:focus { border-color: var(--p-green); }
.trw-pdf .trw-pdfv-of { color: var(--p-muted); white-space: nowrap; }
.trw-pdf .trw-pdfv-zoom { min-width: 3.4em; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--p-green-deep); }
.trw-pdf .trw-pdfv-searchbar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; background: var(--p-wash); border-bottom: 1px solid var(--p-line); flex: none; margin: 0; }
.trw-pdf input.trw-pdfv-search-input {
	flex: 1 1 auto; min-width: 0; min-height: 42px; margin: 0; padding: 6px 12px; border: 2px solid var(--p-line); border-radius: 10px;
	background: #fff; color: var(--p-ink); font: inherit; box-shadow: none;
}
.trw-pdf input.trw-pdfv-search-input:focus { border-color: var(--p-green); }
.trw-pdf .trw-pdfv-search-info { font-size: 0.88rem; color: var(--p-muted); white-space: nowrap; font-variant-numeric: tabular-nums; max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
.trw-pdf .trw-pdfv-body { position: relative; display: flex; flex: 1 1 auto; min-height: 0; }
.trw-pdf .trw-pdfv-scroll { flex: 1 1 auto; min-width: 0; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; outline: none; overscroll-behavior: contain; }
.trw-pdf .trw-pdfv-pages { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 12px; width: max-content; min-width: 100%; box-sizing: border-box; }
.trw-pdf .trw-pdfv-page { position: relative; flex: none; background: #fff; box-shadow: 0 1px 3px rgba(23,48,42,.25); }
.trw-pdf .trw-pdfv-page:not(.is-rendered)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 24px; height: 24px; margin: -12px; border: 3px solid #c3d4cb; border-right-color: transparent; border-radius: 50%; animation: trw-pdf-spin .8s linear infinite; }
.trw-pdf canvas.trw-pdfv-canvas { display: block; width: 100%; height: 100%; }
.trw-pdf .trw-pdfv-hit { position: absolute; background: rgba(242,181,44,.45); border-radius: 2px; pointer-events: none; mix-blend-mode: multiply; }
.trw-pdf .trw-pdfv-hit.is-current { background: rgba(11,122,82,.45); box-shadow: 0 0 0 2px var(--p-green); }
.trw-pdf .trw-pdfv-msg { position: absolute; left: 50%; top: 40%; transform: translate(-50%, -50%); max-width: 90%; padding: 12px 16px; border-radius: 10px; background: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.12); font-weight: 600; text-align: center; }
.trw-pdf .trw-pdfv-msg.is-error { background: #fde8e6; color: #7a1712; }
.trw-pdf .trw-pdfv-side { flex: none; width: 150px; overflow-y: auto; background: var(--p-paper); border-right: 1px solid var(--p-line); }
.trw-pdf ol.trw-pdfv-side-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 8px; }
.trw-pdf ol.trw-pdfv-side-list li { margin: 0; padding: 0; }
.trw-pdf button.trw-pdfv-side-item {
	display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; margin: 0; padding: 6px;
	border: 2px solid transparent; border-radius: 10px; background: transparent; color: var(--p-ink); font: inherit; font-size: 0.85rem; font-weight: 700; cursor: pointer; box-shadow: none; min-height: 0;
}
.trw-pdf button.trw-pdfv-side-item:hover { background: var(--p-wash); color: var(--p-ink); }
.trw-pdf button.trw-pdfv-side-item.is-current { border-color: var(--p-green); background: var(--p-wash); }
.trw-pdf .trw-pdfv-side-thumb { display: flex; align-items: center; justify-content: center; width: 100%; aspect-ratio: 3 / 4; background: #eef3f0; }
.trw-pdf .trw-pdfv-side-thumb img { max-width: 100%; max-height: 100%; margin: 0; box-shadow: 0 0 0 1px #d4ded9; background: #fff; }
.trw-pdf .trw-pdfv-side-thumb img:not([src]) { display: none; }
.trw-pdf .trw-pdfv-break { display: none; }
@media (max-width: 759px) {
	.trw-pdf .trw-pdfv { height: 78vh; min-height: 380px; }
	/* Two tidy rows on phones: pages + search on top, zoom + actions below */
	.trw-pdf .trw-pdfv-bar { justify-content: space-between; gap: 4px 2px; padding: 4px 6px; }
	.trw-pdf .trw-pdfv-group { display: contents; }
	.trw-pdf .trw-pdfv-thumbs-btn { order: 1; }
	.trw-pdf .trw-pdfv-prev { order: 2; }
	.trw-pdf .trw-pdfv-pagewrap { order: 3; }
	.trw-pdf .trw-pdfv-next { order: 4; }
	.trw-pdf .trw-pdfv-search-btn { order: 5; }
	.trw-pdf .trw-pdfv-break { display: block; order: 6; flex-basis: 100%; height: 0; }
	.trw-pdf .trw-pdfv-out { order: 7; }
	.trw-pdf .trw-pdfv-zoom { order: 8; min-width: 3em; }
	.trw-pdf .trw-pdfv-in { order: 9; }
	.trw-pdf .trw-pdfv-fit { order: 10; }
	.trw-pdf .trw-pdfv-full { order: 11; }
	.trw-pdf .trw-pdfv-print { order: 12; }
	.trw-pdf .trw-pdfv-download { order: 13; }
	.trw-pdf .trw-pdfv-close { order: 14; }
}
@media (max-width: 699px) {
	/* Let the reader use the full width of the tool panel */
	.trw-pdf .trw-pdf-tool .trw-pdfv { margin: 0 -16px; border-radius: 0; border-left: 0; border-right: 0; }
}
@media (max-width: 759px) {
	.trw-pdf .trw-pdfv-btn, .trw-pdf button.trw-pdfv-btn, .trw-pdf a.trw-pdfv-btn { width: 42px; }
	.trw-pdf .trw-pdfv-side { position: absolute; left: 0; top: 0; bottom: 0; z-index: 3; width: 140px; box-shadow: 4px 0 16px rgba(0,0,0,.18); }
}

/* Preview pop-up (full screen) */
html.trw-pdf-modal-open, html.trw-pdf-modal-open body { overflow: hidden !important; }
.trw-pdf.trw-pdf-modal {
	position: fixed; inset: 0; z-index: 2147483000; max-width: none; margin: 0; display: flex; flex-direction: column; background: var(--p-paper);
	padding: env(safe-area-inset-top, 0) env(safe-area-inset-right, 0) env(safe-area-inset-bottom, 0) env(safe-area-inset-left, 0);
}
.trw-pdf .trw-pdf-modal-head { flex: none; padding: 10px 16px 6px; }
.trw-pdf .trw-pdf-modal-title { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trw-pdf.trw-pdf-modal .trw-pdfv { flex: 1 1 auto; height: auto; min-height: 0; border-radius: 0; border-left: 0; border-right: 0; border-bottom: 0; }
.trw-pdf button.trw-pdfv-btn.trw-pdfv-close { background: var(--p-ink); color: #fff; margin-left: 4px; }
.trw-pdf button.trw-pdfv-btn.trw-pdfv-close:hover { background: var(--p-green-deep); color: #fff; }

/* Printing (1.1.1): pages are printed from a separate print document, never from this webpage. */
.trw-pdf .trw-pdfv-msg.trw-pdfv-printready { display: flex; flex-direction: column; align-items: center; gap: 10px; }
