.tool-steps .is-complete { color: #9fb1c5; }
.tool-steps .is-complete span {
	border-color: #24c875;
	background: rgba(36, 200, 117, .1);
	color: #35dc8a;
}
.tool-steps .is-complete:not(:last-child)::after { background: #24c875; }

.hpdf-back-button {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 15px;
	border: 1px solid #303c4d;
	border-radius: 11px;
	background: #141d28;
	color: #f2f5f8;
	font-size: .82rem;
	font-weight: 800;
}
.hpdf-back-button:hover { border-color: #536176; color: #fff; }

.hpdf-ocr {
	width: min(1200px, calc(100vw - 44px));
	margin: 0 0 80px 50%;
	border: 1px solid #2c3949;
	border-radius: 22px;
	background: #101924;
	box-shadow: 0 28px 80px rgba(0, 0, 0, .32);
	transform: translateX(-50%);
	overflow: hidden;
}
.hpdf-ocr[hidden], .hpdf-ocr [hidden] { display: none !important; }
.hpdf-ocr:focus { outline: none; }

.hpdf-ocr__topbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 17px 20px;
	border-bottom: 1px solid #293545;
	background: #0d1620;
}
.hpdf-ocr__document { display: flex; align-items: center; min-width: 0; gap: 12px; }
.hpdf-ocr__document > span:last-child { display: grid; min-width: 0; gap: 3px; }
.hpdf-ocr__document strong { overflow: hidden; color: #f5f7fa; text-overflow: ellipsis; white-space: nowrap; }
.hpdf-ocr__document small { color: #8d9aaa; }
.hpdf-ocr__file-icon {
	display: grid;
	place-items: center;
	flex: 0 0 42px;
	width: 42px;
	height: 48px;
	border-radius: 8px 8px 11px 11px;
	background: #ff1f2d;
	color: white;
	font-size: .62rem;
	font-weight: 950;
}
.hpdf-ocr__new,
.hpdf-ocr__cancel,
.hpdf-ocr__text-toolbar button,
.hpdf-ocr__finish-actions button,
.hpdf-ocr__finish-actions a {
	min-height: 40px;
	padding: 0 14px;
	border: 1px solid #354459;
	border-radius: 10px;
	background: #15202d;
	color: #e8edf3;
	cursor: pointer;
	font: inherit;
	font-size: .78rem;
	font-weight: 800;
	text-decoration: none;
}
.hpdf-ocr__new:hover,
.hpdf-ocr__cancel:hover,
.hpdf-ocr__text-toolbar button:hover,
.hpdf-ocr__finish-actions button:hover,
.hpdf-ocr__finish-actions a:hover { border-color: #61718a; background: #1b2938; color: #fff; }

.hpdf-ocr__body {
	display: grid;
	grid-template-columns: minmax(0, 1.08fr) minmax(340px, .92fr);
	min-height: 550px;
}
.hpdf-ocr__preview {
	min-width: 0;
	padding: 18px;
	border-right: 1px solid #293545;
	background: #202b38;
}
.hpdf-ocr__preview-label {
	display: flex;
	justify-content: space-between;
	margin-bottom: 12px;
	color: #c5cfda;
	font-size: .76rem;
	font-weight: 800;
}
.hpdf-ocr__preview-label small { color: #8d9aaa; font: inherit; }
.hpdf-ocr__canvas-wrap {
	display: flex;
	align-items: flex-start;
	justify-content: center;
	height: 490px;
	padding: 18px;
	border-radius: 13px;
	background: #18222e;
	overflow: auto;
}
.hpdf-ocr__canvas-wrap canvas {
	display: block;
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: none;
	background: #fff;
	box-shadow: 0 12px 38px rgba(0, 0, 0, .28);
}

.hpdf-ocr__control {
	display: flex;
	align-items: center;
	padding: 36px;
	background: linear-gradient(145deg, #111b27, #0d1620);
}
.hpdf-ocr__control > div { width: 100%; }
.hpdf-ocr__eyebrow {
	margin: 0 0 10px;
	color: #ff5360;
	font-size: .72rem;
	font-weight: 900;
	letter-spacing: .18em;
	text-transform: uppercase;
}
.hpdf-ocr h2 { margin: 0; color: #f4f7fa; font-size: clamp(1.55rem, 3vw, 2.15rem); letter-spacing: -.035em; }
.hpdf-ocr__intro { margin: 12px 0 24px; color: #95a2b1; line-height: 1.55; }

.hpdf-ocr__languages { display: grid; gap: 9px; }
.hpdf-ocr__languages button {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 58px;
	padding: 0 16px;
	border: 1px solid #334155;
	border-radius: 12px;
	background: #131e2a;
	color: #aeb9c6;
	cursor: pointer;
	font: inherit;
	text-align: left;
	transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}
.hpdf-ocr__languages button:hover { border-color: #586a82; color: #fff; transform: translateY(-1px); }
.hpdf-ocr__languages button.is-active {
	border-color: #ff3644;
	background: linear-gradient(100deg, rgba(255, 31, 45, .17), rgba(255, 31, 45, .04));
	color: #fff;
	box-shadow: inset 4px 0 #ff1f2d;
}
.hpdf-ocr__languages button small {
	display: grid;
	place-items: center;
	min-width: 52px;
	height: 28px;
	border-radius: 999px;
	background: rgba(255, 255, 255, .06);
	color: #9daab8;
	font-size: .66rem;
	font-weight: 900;
}
.hpdf-ocr__languages button.is-active small { background: #ff1f2d; color: #fff; }

.hpdf-ocr__local-note {
	display: flex;
	align-items: flex-start;
	gap: 11px;
	margin: 20px 0;
	padding: 13px 14px;
	border-radius: 11px;
	background: rgba(36, 200, 117, .06);
	color: #8fb3a0;
}
.hpdf-ocr__local-note > span {
	display: grid;
	place-items: center;
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: #24c875;
	color: #07140d;
	font-size: .72rem;
	font-weight: 950;
}
.hpdf-ocr__local-note p { margin: 0; font-size: .75rem; line-height: 1.5; }
.hpdf-ocr__local-note strong { color: #b4d9c3; }

.hpdf-ocr__start {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 11px;
	width: 100%;
	min-height: 58px;
	border: 0;
	border-radius: 13px;
	background: linear-gradient(135deg, #ff2433, #d90b1c);
	color: #fff;
	cursor: pointer;
	font: inherit;
	font-weight: 900;
	box-shadow: 0 15px 34px rgba(255, 31, 45, .24);
}
.hpdf-ocr__start:hover { filter: brightness(1.08); transform: translateY(-1px); }
.hpdf-ocr__start span { font-size: 1.35rem; }

.hpdf-ocr__progress { height: 12px; margin-top: 28px; border-radius: 999px; background: #263242; overflow: hidden; }
.hpdf-ocr__progress span {
	display: block;
	width: 0;
	height: 100%;
	border-radius: inherit;
	background: linear-gradient(90deg, #ff1f2d, #ff5a65);
	box-shadow: 0 0 16px rgba(255, 31, 45, .46);
	transition: width 160ms ease;
}
.hpdf-ocr__progress-meta { display: flex; justify-content: space-between; margin-top: 10px; color: #9ba8b7; font-size: .78rem; }
.hpdf-ocr__progress-meta strong { color: #fff; }
.hpdf-ocr__patience { margin: 24px 0 14px; color: #7f8c9b; font-size: .75rem; line-height: 1.5; }
.hpdf-ocr__cancel { width: 100%; }

.hpdf-ocr__status {
	min-height: 36px;
	margin: 0;
	padding: 9px 20px;
	border-top: 1px solid #293545;
	background: #0b131d;
	color: #91abd0;
	font-size: .75rem;
}
.hpdf-ocr__status.is-error { color: #ff8b94; }

.hpdf-ocr__results { padding: 28px; background: #111a25; }
.hpdf-ocr__results-head { display: flex; align-items: center; justify-content: space-between; gap: 28px; }
.hpdf-ocr__results-head p:last-child { margin: 9px 0 0; color: #94a1af; }
.hpdf-ocr__download {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	flex: 0 0 auto;
	min-width: 290px;
	min-height: 62px;
	padding: 9px 20px;
	border: 0;
	border-radius: 13px;
	background: linear-gradient(135deg, #ff2332, #d90a1b);
	color: #fff;
	cursor: pointer;
	font: inherit;
	box-shadow: 0 15px 34px rgba(255, 31, 45, .22);
}
.hpdf-ocr__download:hover { filter: brightness(1.08); }
.hpdf-ocr__download > span:first-child { font-size: 1.3rem; font-weight: 950; }
.hpdf-ocr__download > span:last-child { display: grid; gap: 2px; text-align: left; }
.hpdf-ocr__download small { color: rgba(255, 255, 255, .75); font-size: .68rem; }

.hpdf-ocr__text-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	margin-top: 26px;
	padding: 13px 15px;
	border: 1px solid #2e3b4c;
	border-bottom: 0;
	border-radius: 12px 12px 0 0;
	background: #0e1721;
}
.hpdf-ocr__text-toolbar > div:first-child { display: grid; gap: 3px; }
.hpdf-ocr__text-toolbar strong { color: #f1f4f7; }
.hpdf-ocr__text-toolbar small { color: #8794a3; }
.hpdf-ocr__text-toolbar > div:last-child { display: flex; gap: 8px; }
.hpdf-ocr__results textarea {
	display: block;
	width: 100%;
	min-height: 350px;
	padding: 18px;
	border: 1px solid #2e3b4c;
	border-radius: 0 0 12px 12px;
	outline: 0;
	background: #f6f7f8;
	color: #151a20;
	font: 15px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace;
	resize: vertical;
}
.hpdf-ocr__results textarea:focus { border-color: #ff5965; box-shadow: 0 0 0 3px rgba(255, 31, 45, .13); }
.hpdf-ocr__text-note { margin: 9px 2px 0; color: #7f8c9b; font-size: .72rem; }
.hpdf-ocr__finish-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 22px; }
.hpdf-ocr__finish-actions a { display: inline-flex; align-items: center; }

@media (max-width: 850px) {
	.hpdf-ocr { width: calc(100vw - 24px); border-radius: 18px; }
	.hpdf-ocr__body { grid-template-columns: 1fr; }
	.hpdf-ocr__preview { border-right: 0; border-bottom: 1px solid #293545; }
	.hpdf-ocr__canvas-wrap { height: 350px; }
	.hpdf-ocr__control { padding: 26px 20px; }
	.hpdf-ocr__results-head { align-items: stretch; flex-direction: column; }
	.hpdf-ocr__download { width: 100%; min-width: 0; }
}

@media (max-width: 560px) {
	.hpdf-ocr__topbar { align-items: flex-start; flex-direction: column; padding: 14px; }
	.hpdf-ocr__new { width: 100%; }
	.hpdf-ocr__preview { padding: 12px; }
	.hpdf-ocr__canvas-wrap { height: 300px; padding: 10px; }
	.hpdf-ocr__control { padding: 24px 16px; }
	.hpdf-ocr__results { padding: 20px 14px; }
	.hpdf-ocr__download {
		width: 100%;
		min-height: 70px;
		padding: 11px 14px;
		white-space: normal;
	}
	.hpdf-ocr__download > span:last-child { min-width: 0; }
	.hpdf-ocr__download strong { display: block; font-size: .9rem; line-height: 1.3; }
	.hpdf-ocr__text-toolbar { align-items: stretch; flex-direction: column; }
	.hpdf-ocr__text-toolbar > div:last-child { display: grid; grid-template-columns: 1fr 1fr; }
	.hpdf-ocr__text-toolbar button { padding: 0 9px; }
	.hpdf-ocr__results textarea { min-height: 300px; font-size: 14px; }
	.hpdf-ocr__finish-actions { display: grid; }
	.hpdf-ocr__finish-actions button,
	.hpdf-ocr__finish-actions a { justify-content: center; width: 100%; min-height: 46px; }
}

@media (prefers-reduced-motion: reduce) {
	.hpdf-ocr *, .hpdf-ocr *::before, .hpdf-ocr *::after { scroll-behavior: auto !important; transition: none !important; }
}
