/*
 * Self-contained palette so the tool looks the same inside any theme
 * (same approach as the other EducationalEngine generators).
 */
.ee-pdfs-app {
	--ee-pdfs-bg: #ffffff;
	--ee-pdfs-surface: #f1f5f9;
	--ee-pdfs-text: #1e293b;
	--ee-pdfs-muted: #52606d;
	--ee-pdfs-border: #cbd5e1;
	--ee-pdfs-accent: #1d4ed8;
	--ee-pdfs-accent-hover: #1e40af;
	--ee-pdfs-accent-soft: #eff6ff;
	--ee-pdfs-danger: #b91c1c;

	max-width: 1000px;
	margin: 0 auto 48px;
	padding: 24px;
	background: var(--ee-pdfs-bg);
	border: 1px solid var(--ee-pdfs-border);
	border-radius: 10px;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
	color: var(--ee-pdfs-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	line-height: 1.55;
}
.ee-pdfs-app * { box-sizing: border-box; }
.ee-pdfs-app button, .ee-pdfs-app input, .ee-pdfs-app select, .ee-pdfs-app textarea {
	font-family: inherit; box-shadow: none; text-shadow: none; background-image: none;
}
.ee-pdfs-app [hidden] { display: none !important; }

.ee-pdfs-quota-bar {
	display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: center;
	background: var(--ee-pdfs-surface); border: 1px solid var(--ee-pdfs-border); border-radius: 6px;
	padding: 10px 16px; margin-bottom: 16px; font-size: 0.9em;
}
.ee-pdfs-quota-label { font-weight: 700; }
.ee-pdfs-quota-count { color: var(--ee-pdfs-muted); }
.ee-pdfs-quota-count a { color: var(--ee-pdfs-accent); }

.ee-pdfs-tabs { display: flex; gap: 8px; margin-bottom: 20px; border-bottom: 1px solid var(--ee-pdfs-border); }
.ee-pdfs-tab {
	background: transparent !important; border: 0; border-bottom: 3px solid transparent; color: var(--ee-pdfs-muted) !important;
	padding: 8px 12px; font-weight: 600; cursor: pointer; margin-bottom: -1px;
}
.ee-pdfs-tab.is-active { color: var(--ee-pdfs-accent) !important; border-bottom-color: var(--ee-pdfs-accent); }
.ee-pdfs-panel { display: none; }
.ee-pdfs-panel.is-active { display: block; }

.ee-pdfs-form { max-width: 820px; }
.ee-pdfs-field { margin-bottom: 14px; flex: 1 1 0; min-width: 0; }
.ee-pdfs-field label, .ee-pdfs-label { display: block; font-weight: 600; font-size: 0.9em; margin-bottom: 4px; color: var(--ee-pdfs-text); }
.ee-pdfs-field input, .ee-pdfs-field select, .ee-pdfs-field textarea {
	width: 100%; padding: 8px 10px; height: auto; min-height: 40px; border: 1px solid var(--ee-pdfs-border); border-radius: 6px;
	background: #fff !important; color: var(--ee-pdfs-text) !important; font-size: 0.95em;
}
.ee-pdfs-row { display: flex; gap: 12px; flex-wrap: wrap; }
.ee-pdfs-row .ee-pdfs-field { min-width: 220px; }
.ee-pdfs-hint { font-size: 0.82em; color: var(--ee-pdfs-muted); margin: 4px 0 0; }
.ee-pdfs-hint:empty { display: none; }
.ee-pdfs-more { margin: 0 0 16px; }
.ee-pdfs-more summary { cursor: pointer; font-weight: 600; font-size: 0.9em; color: var(--ee-pdfs-accent); margin-bottom: 10px; }

.ee-pdfs-drop .ee-pdfs-picker {
	border: 2px dashed var(--ee-pdfs-border); border-radius: 8px; padding: 14px; background: var(--ee-pdfs-surface);
}
.ee-pdfs-drop .ee-pdfs-picker input[type="file"] { border: 0; background: transparent !important; padding: 0; min-height: 0; }
.ee-pdfs-drop .ee-pdfs-picker.is-dragover { border-color: var(--ee-pdfs-accent); background: var(--ee-pdfs-accent-soft); }
.ee-pdfs-file-name { display: block; font-weight: 600; font-size: 0.9em; margin-top: 6px; word-break: break-all; }
.ee-pdfs-file-name:empty { display: none; }
.ee-pdfs-file-name.is-error { color: var(--ee-pdfs-danger); }

.ee-pdfs-btn {
	display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 6px; cursor: pointer;
	border: 1px solid var(--ee-pdfs-border); background: #fff !important; color: var(--ee-pdfs-text) !important;
	font-weight: 600; font-size: 0.9em; text-decoration: none !important; line-height: 1.2;
}
.ee-pdfs-btn:hover { border-color: var(--ee-pdfs-accent); color: var(--ee-pdfs-accent) !important; }
.ee-pdfs-btn:focus-visible { outline: 2px solid var(--ee-pdfs-accent); outline-offset: 2px; }
.ee-pdfs-btn-primary { background: var(--ee-pdfs-accent) !important; border-color: var(--ee-pdfs-accent); color: #fff !important; padding: 10px 18px; font-size: 1em; }
.ee-pdfs-btn-primary:hover { background: var(--ee-pdfs-accent-hover) !important; color: #fff !important; }
.ee-pdfs-btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.ee-pdfs-btn-small { padding: 5px 10px; font-size: 0.82em; }
.ee-pdfs-cost-badge { background: rgba(255, 255, 255, 0.2); border-radius: 999px; padding: 2px 8px; font-size: 0.8em; }
.ee-pdfs-estimate { font-weight: 600; }

.ee-pdfs-status { margin: 14px 0 0; font-weight: 600; color: var(--ee-pdfs-accent); }
.ee-pdfs-status:empty { display: none; }
.ee-pdfs-status.is-error { color: var(--ee-pdfs-danger); }
.ee-pdfs-status.is-working::before {
	content: ""; display: inline-block; width: 12px; height: 12px; margin-right: 8px; vertical-align: -1px;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: ee-pdfs-spin 0.9s linear infinite;
}
@keyframes ee-pdfs-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .ee-pdfs-status.is-working::before { animation: none; } }
.ee-pdfs-result { margin-top: 18px; }

.ee-pdfs-list { list-style: none; padding: 0; margin: 0 0 16px; }
.ee-pdfs-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--ee-pdfs-border); }
.ee-pdfs-view-btn { background: none !important; border: 0; padding: 0; color: var(--ee-pdfs-accent) !important; font-weight: 600; cursor: pointer; text-align: left; }
.ee-pdfs-list-meta { color: var(--ee-pdfs-muted); font-size: 0.85em; }

/* Summary view. */
.ee-pdfs-item { max-width: 860px; }
.ee-pdfs-doc-type { text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75em; font-weight: 700; color: var(--ee-pdfs-accent); margin: 0 0 2px; }
.ee-pdfs-item-header h3 { margin: 0 0 4px; }
.ee-pdfs-citation { font-size: 0.9em; font-style: italic; margin: 0 0 4px; }
.ee-pdfs-item-meta { color: var(--ee-pdfs-muted); font-size: 0.88em; margin: 0 0 6px; word-break: break-word; }
.ee-pdfs-permalink { font-size: 0.85em; margin: 0 0 10px; }

.ee-pdfs-toolbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--ee-pdfs-border); }
.ee-pdfs-toolbar-label { font-size: 0.82em; color: var(--ee-pdfs-muted); }
.ee-pdfs-export-status { font-size: 0.82em; color: var(--ee-pdfs-muted); }
.ee-pdfs-export-status.is-error { color: var(--ee-pdfs-danger); font-weight: 600; }

.ee-pdfs-theme { background: var(--ee-pdfs-accent-soft); border-left: 4px solid var(--ee-pdfs-accent); border-radius: 0 8px 8px 0; padding: 14px 18px; margin: 0 0 6px; }
.ee-pdfs-theme h4 { margin: 0 0 6px; font-size: 0.8em; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ee-pdfs-accent); }
.ee-pdfs-headline { font-size: 1.12em; font-weight: 700; margin: 0 0 8px; }
.ee-pdfs-theme p:last-child { margin-bottom: 0; }

.ee-pdfs-section { margin: 22px 0 0; }
.ee-pdfs-section h4 { margin: 0 0 8px; }
.ee-pdfs-section ul, .ee-pdfs-section ol { margin: 0; padding-left: 22px; }
.ee-pdfs-section li { margin: 4px 0; }
.ee-pdfs-takeaways li::marker { color: var(--ee-pdfs-accent); }

.ee-pdfs-part { border: 1px solid var(--ee-pdfs-border); border-radius: 8px; margin: 0 0 8px; padding: 0 14px; background: #fff; }
.ee-pdfs-part summary { cursor: pointer; font-weight: 700; padding: 10px 0; list-style-position: outside; }
.ee-pdfs-part[open] summary { border-bottom: 1px solid var(--ee-pdfs-surface); margin-bottom: 8px; }
.ee-pdfs-part p { margin: 0 0 8px; }
.ee-pdfs-part ul { margin-bottom: 10px; }
.ee-pdfs-part-num {
	display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 22px; border-radius: 999px;
	background: var(--ee-pdfs-surface); color: var(--ee-pdfs-muted); font-size: 0.78em; margin-right: 4px;
}

.ee-pdfs-terms { margin: 0; display: grid; grid-template-columns: minmax(120px, 28%) 1fr; gap: 6px 14px; }
.ee-pdfs-terms dt { font-weight: 700; }
.ee-pdfs-terms dd { margin: 0; }
.ee-pdfs-data-table { width: 100%; border-collapse: collapse; font-size: 0.93em; }
.ee-pdfs-data-table th, .ee-pdfs-data-table td { text-align: left; vertical-align: top; padding: 7px 10px; border-bottom: 1px solid var(--ee-pdfs-border); }
.ee-pdfs-data-table th { background: var(--ee-pdfs-surface); font-size: 0.85em; }
.ee-pdfs-data-table td:first-child { font-weight: 700; white-space: nowrap; }

.ee-pdfs-upsells { margin-top: 24px; }
.ee-pdfs-disclaimer { font-size: 0.8em; color: var(--ee-pdfs-muted); margin-top: 16px; }

@media (max-width: 600px) {
	.ee-pdfs-app { padding: 16px; }
	.ee-pdfs-row .ee-pdfs-field { min-width: 100%; }
	.ee-pdfs-terms { grid-template-columns: 1fr; gap: 2px; }
	.ee-pdfs-terms dd { margin-bottom: 8px; }
	.ee-pdfs-data-table td:first-child { white-space: normal; }
}
