/* Pinterest Downloader – front end. Everything is scoped under .pdl so themes are not affected. */
.pdl {
	--pdl-accent: #e60023;
	--pdl-text: #333;
	--pdl-muted: #6b6b6b;
	--pdl-border: #dcdcdc;
	--pdl-bg: #fff;
	--pdl-soft: #f5f5f5;
	--pdl-radius: 6px;
	box-sizing: border-box;
	width: 100%;
	max-width: 1100px !important; /* Also when themes narrow page content. */
	margin: 0 auto;
	padding: 48px 16px;
	color: var(--pdl-text);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.5;
	text-align: left;
}
.pdl *, .pdl *::before, .pdl *::after { box-sizing: border-box; }
.pdl [hidden] { display: none !important; }
.pdl button { font-family: inherit; cursor: pointer; }
.pdl img, .pdl video { max-width: 100%; display: block; }
.pdl-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Hero */
.pdl-hero { max-width: 940px; margin: 0 auto; text-align: center; }
.pdl-title {
	margin: 0 0 6px;
	padding: 0;
	font-size: clamp(32px, 6vw, 64px);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -0.5px;
	color: var(--pdl-text);
	border: 0;
}
.pdl-title::before, .pdl-title::after { content: none; }
.pdl-subtitle { margin: 0 0 44px; font-size: clamp(17px, 2.6vw, 28px); color: #444; line-height: 1.35; }

/* Form */
.pdl-form { display: flex; align-items: stretch; width: 100%; margin: 0; }
.pdl-field { position: relative; flex: 1 1 auto; min-width: 0; }
.pdl .pdl-input {
	width: 100%;
	height: 60px;
	margin: 0;
	padding: 0 64px 0 18px;
	font-size: 20px;
	color: var(--pdl-text);
	background: var(--pdl-bg);
	border: 1px solid var(--pdl-border);
	border-right: 0;
	border-radius: var(--pdl-radius) 0 0 var(--pdl-radius);
	box-shadow: none;
	outline: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}
.pdl .pdl-input::placeholder { color: #b5b5b5; opacity: 1; }
.pdl .pdl-input:focus { border-color: #9a9a9a; box-shadow: inset 0 0 0 1px rgba(0,0,0,.04); }
.pdl-paste, .pdl-clear {
	position: absolute;
	top: 50%;
	right: 12px;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	padding: 0;
	margin: 0;
	color: #222;
	background: transparent;
	border: 0;
	border-radius: 50%;
	line-height: 1;
}
.pdl-paste:hover, .pdl-clear:hover { background: var(--pdl-soft); }
.pdl-clear { font-size: 30px; color: #777; }
.pdl-submit {
	position: relative;
	flex: 0 0 auto;
	min-width: 157px;
	height: 60px;
	margin: 0;
	padding: 0 26px;
	font-size: 22px;
	font-weight: 400;
	color: #fff;
	background: var(--pdl-accent);
	border: 0;
	border-radius: 0 var(--pdl-radius) var(--pdl-radius) 0;
	box-shadow: none;
	text-transform: none;
	letter-spacing: 0;
	transition: filter .15s ease;
}
.pdl-submit:hover, .pdl-submit:focus { filter: brightness(.92); color: #fff; background: var(--pdl-accent); }
.pdl-submit:disabled { cursor: wait; }
.pdl-spinner {
	display: none;
	width: 24px;
	height: 24px;
	margin: 0 auto;
	border: 3px solid rgba(255,255,255,.4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: pdl-spin .7s linear infinite;
}
.pdl-busy .pdl-submit-text { visibility: hidden; }
.pdl-busy .pdl-spinner { display: block; position: absolute; top: 50%; left: 50%; margin: -12px 0 0 -12px; }
@keyframes pdl-spin { to { transform: rotate(360deg); } }

.pdl-message { margin: 18px auto 0; padding: 12px 16px; max-width: 940px; font-size: 16px; border-radius: var(--pdl-radius); background: var(--pdl-soft); text-align: center; }
.pdl-message.pdl-error { color: #a4001a; background: #fdecee; }
.pdl-message.pdl-success { color: #0b6b2c; background: #e8f6ed; }

/* Result */
.pdl-result { margin-top: 36px; }
.pdl-result:empty { display: none; }
.pdl-card { max-width: 940px; margin: 0 auto; padding: 20px; background: var(--pdl-bg); border: 1px solid #eee; border-radius: 12px; box-shadow: 0 2px 18px rgba(0,0,0,.06); }
.pdl-pin { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 24px; align-items: start; }
.pdl-preview { position: relative; background: #111; border-radius: 10px; overflow: hidden; min-height: 120px; }
.pdl-preview img, .pdl-preview video { width: 100%; height: auto; max-height: 560px; object-fit: contain; margin: 0 auto; background: #111; }
.pdl-info h2 { margin: 0 0 6px; font-size: 22px; line-height: 1.3; font-weight: 600; color: var(--pdl-text); word-break: break-word; }
.pdl-meta { margin: 0 0 16px; color: var(--pdl-muted); font-size: 14px; }
.pdl-badge { display: inline-block; padding: 2px 10px; margin-right: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .4px; color: #fff; background: #111; border-radius: 20px; vertical-align: middle; }
.pdl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.pdl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 46px;
	padding: 10px 18px;
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: #fff;
	background: var(--pdl-accent);
	border: 0;
	border-radius: 24px;
	text-decoration: none;
	white-space: nowrap;
	transition: filter .15s ease, opacity .15s ease;
}
.pdl-btn:hover, .pdl-btn:focus { filter: brightness(.92); color: #fff; text-decoration: none; }
.pdl-btn:disabled { opacity: .6; cursor: not-allowed; }
.pdl-btn-light { color: var(--pdl-text); background: #efefef; }
.pdl-btn-light:hover, .pdl-btn-light:focus { color: var(--pdl-text); }
.pdl-btn-sm { min-height: 36px; padding: 6px 14px; font-size: 14px; }
.pdl-btn svg { width: 18px; height: 18px; flex: 0 0 auto; }
.pdl-link { color: var(--pdl-muted); font-size: 14px; }
.pdl-note { font-size: 14px; color: var(--pdl-muted); margin: 8px 0 0; }

/* Multi item (Idea pins, carousels) */
.pdl-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; margin-top: 20px; }
.pdl-item { background: var(--pdl-soft); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.pdl-item-media { position: relative; aspect-ratio: 2 / 3; background: #222; }
.pdl-item-media img, .pdl-item-media video { width: 100%; height: 100%; object-fit: cover; }
.pdl-item .pdl-btn { margin: 8px; }

/* Board */
.pdl-board-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pdl-board-head h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 600; color: var(--pdl-text); }
.pdl-toolbar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 0; margin-bottom: 12px; background: var(--pdl-bg); border-bottom: 1px solid #eee; }
.pdl-toolbar .pdl-count { margin-right: auto; font-size: 15px; color: var(--pdl-muted); }
.pdl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.pdl-tile { position: relative; background: var(--pdl-soft); border-radius: 12px; overflow: hidden; outline: 3px solid transparent; outline-offset: -3px; transition: outline-color .12s ease; }
.pdl-tile.is-selected { outline-color: var(--pdl-accent); }
.pdl-tile-img { position: relative; display: block; width: 100%; aspect-ratio: 3 / 4; background: #e7e7e7; cursor: pointer; }
.pdl-tile-img img { width: 100%; height: 100%; object-fit: cover; }
.pdl-tile-type { position: absolute; left: 8px; bottom: 8px; padding: 2px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; color: #fff; background: rgba(0,0,0,.65); border-radius: 12px; }
.pdl-check { position: absolute; top: 8px; left: 8px; z-index: 2; width: 26px; height: 26px; margin: 0; cursor: pointer; accent-color: var(--pdl-accent); }
.pdl-tile-foot { display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 8px; }
.pdl-tile-title { flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--pdl-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pdl-icon-btn { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0; color: #fff; background: var(--pdl-accent); border: 0; border-radius: 50%; }
.pdl-icon-btn svg { width: 18px; height: 18px; }
.pdl-icon-btn:disabled { opacity: .6; }
.pdl-more { display: flex; justify-content: center; padding: 24px 0 4px; }
.pdl-sentinel { height: 1px; }

/* Progress */
.pdl-progress { margin: 14px 0; padding: 14px 16px; background: var(--pdl-soft); border-radius: 10px; }
.pdl-progress-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; font-size: 15px; }
.pdl-bar { height: 10px; background: #e0e0e0; border-radius: 6px; overflow: hidden; }
.pdl-bar > span { display: block; height: 100%; width: 0; background: var(--pdl-accent); transition: width .25s ease; }

/* Modal preview for board tiles */
.pdl-modal { position: fixed; inset: 0; z-index: 999999; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.72); }
.pdl-modal .pdl-card { position: relative; width: 100%; max-height: calc(100vh - 32px); overflow: auto; }
.pdl-close { position: absolute; top: 8px; right: 8px; z-index: 3; width: 40px; height: 40px; padding: 0; font-size: 28px; line-height: 1; color: #333; background: #fff; border: 0; border-radius: 50%; box-shadow: 0 1px 6px rgba(0,0,0,.2); }

@media (max-width: 720px) {
	.pdl { padding: 28px 12px; }
	.pdl-subtitle { margin-bottom: 28px; }
	.pdl-form { flex-direction: column; gap: 10px; }
	.pdl .pdl-input { height: 56px; font-size: 17px; border-right: 1px solid var(--pdl-border); border-radius: var(--pdl-radius); }
	.pdl-submit { width: 100%; height: 56px; border-radius: var(--pdl-radius); font-size: 20px; }
	.pdl-pin { grid-template-columns: 1fr; }
	.pdl-card { padding: 14px; }
	.pdl-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.pdl-toolbar .pdl-count { width: 100%; }
}
