.jin-wps-tool,
.jin-wps-tool * { box-sizing: border-box; }
.jin-wps-tool [hidden] { display: none !important; }

.jin-wps-tool {
	--wps-purple: #6d4bf2;
	--wps-purple-dark: #4d32bc;
	--wps-ink: #20243a;
	--wps-muted: #697089;
	--wps-line: #e1e4f0;
	--wps-soft: #f7f7fc;
	--wps-green: #18794e;
	width: min(100%, 75rem);
	margin: .65rem auto;
	color: var(--wps-ink);
	font-size: .9rem;
	background: #fff;
	border: 1px solid var(--wps-line);
	border-radius: 1rem;
	box-shadow: 0 1rem 2.5rem rgb(43 35 92 / 9%);
	overflow: hidden;
}

.jin-wps-tool .screen-reader-text { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.jin-wps-header { display: grid; grid-template-columns: minmax(5rem, 8rem) 1fr; min-height: 4.6rem; border-bottom: 1px solid var(--wps-line); }
.jin-wps-header h1 { display: flex; align-items: center; justify-content: center; margin: 0; padding: .65rem 1rem; font-size: clamp(1.1rem, 2vw, 1.45rem); line-height: 1.3; text-align: center; }
.jin-wps-logo { display: grid; place-items: center; padding: .55rem; background: linear-gradient(145deg, #f5f1ff, #eef1ff); border-right: 1px solid var(--wps-line); }
.jin-wps-logo-image { display: block; max-width: 100%; max-height: 3.1rem; width: auto; height: auto; object-fit: contain; }
.jin-wps-logo-mark { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; color: #fff; font-size: 1.35rem; background: linear-gradient(135deg, #7957ff, #4c7cff); border-radius: .75rem; box-shadow: 0 .35rem .8rem rgb(91 71 213 / 24%); }
.jin-wps-account { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: .35rem .65rem; padding: .5rem 1rem; font-size: .78rem; border-bottom: 1px solid var(--wps-line); }
.jin-wps-plan, .jin-wps-limit { padding: .18rem .55rem; border-radius: 999px; }
.jin-wps-plan--free { color: #3e465d; background: #eceef4; }
.jin-wps-plan--pro { color: #714b00; background: #ffedb5; }
.jin-wps-plan--beta { color: #fff; background: #6d4bf2; }
.jin-wps-limit { color: #4d32bc; background: #f0edff; font-weight: 700; }
.jin-wps-privacy { display: flex; gap: .5rem; align-items: flex-start; padding: .58rem 1rem; color: #543f00; font-size: .77rem; line-height: 1.5; background: #fff9df; border-bottom: 1px solid #efdda2; }
.jin-wps-privacy p, .jin-wps-intro p { margin: 0; }
.jin-wps-intro { padding: .65rem 1rem; background: var(--wps-soft); border-bottom: 1px solid var(--wps-line); }
.jin-wps-intro h2 { margin: 0 0 .25rem; font-size: 1rem; }
.jin-wps-intro p { color: var(--wps-muted); font-size: .82rem; line-height: 1.5; }

.jin-wps-steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin: 0; padding: 1rem clamp(.75rem, 5vw, 5rem); list-style: none; border-bottom: 1px solid var(--wps-line); }
.jin-wps-steps li { position: relative; display: flex; align-items: center; justify-content: center; gap: .45rem; color: #8a90a5; font-size: .82rem; font-weight: 700; }
.jin-wps-steps li:not(:last-child)::after { content: ''; position: absolute; left: calc(50% + 3.6rem); right: calc(-50% + 3.6rem); height: 2px; background: #e3e5ee; }
.jin-wps-steps span { position: relative; z-index: 1; display: grid; place-items: center; width: 2rem; height: 2rem; background: #fff; border: 2px solid #cbd0df; border-radius: 50%; }
.jin-wps-steps [aria-current="step"] { color: var(--wps-purple-dark); }
.jin-wps-steps [aria-current="step"] span { color: #fff; background: var(--wps-purple); border-color: var(--wps-purple); box-shadow: 0 0 0 4px #eeeaff; }
.jin-wps-steps .is-complete { color: var(--wps-green); }
.jin-wps-steps .is-complete span { color: #fff; background: var(--wps-green); border-color: var(--wps-green); }
.jin-wps-steps .is-complete span::after { content: '✓'; position: absolute; font-size: .75rem; }
.jin-wps-steps .is-complete span { font-size: 0; }

.jin-wps-workspace { padding: clamp(.85rem, 3vw, 1.6rem); background: #fafaff; }
.jin-wps-panel, .jin-wps-result { width: min(100%, 58rem); margin: 0 auto 1rem; padding: clamp(1rem, 3vw, 1.55rem); background: #fff; border: 1px solid var(--wps-line); border-radius: .9rem; box-shadow: 0 .35rem 1rem rgb(38 34 75 / 5%); }
.jin-wps-panel h2, .jin-wps-result h2 { margin: 0 0 1rem; font-size: clamp(1.08rem, 2vw, 1.3rem); }
.jin-wps-eyebrow { margin: 0 0 .25rem; color: var(--wps-purple-dark); font-size: .7rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.jin-wps-panel label, .jin-wps-panel legend { font-weight: 700; }
.jin-wps-url-row { display: grid; grid-template-columns: 1fr auto; gap: .6rem; margin-top: .35rem; }
.jin-wps-url-row input { min-width: 0; min-height: 2.8rem; padding: .65rem .8rem; color: inherit; font: inherit; border: 2px solid #9ba2b7; border-radius: .55rem; }
.jin-wps-help { margin: .45rem 0 0; color: var(--wps-muted); font-size: .78rem; line-height: 1.5; }
.jin-wps-check { margin-top: 1rem; padding: .8rem; background: #f6f8ff; border: 1px solid #dfe4fa; border-radius: .7rem; }
.jin-wps-check p { margin: 0 0 .4rem; font-size: .78rem; }
.jin-wps-check [data-turnstile] { min-height: 4rem; }
.jin-wps-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: .5rem 0 1rem; }
.jin-wps-cards label { cursor: pointer; }
.jin-wps-cards input { position: absolute; opacity: 0; }
.jin-wps-cards span { display: grid; gap: .18rem; min-height: 6.4rem; place-items: center; padding: .8rem; color: var(--wps-muted); background: #fff; border: 2px solid var(--wps-line); border-radius: .75rem; transition: .15s ease; }
.jin-wps-cards b { font-size: 1.6rem; color: #8890a8; }
.jin-wps-cards small { font-weight: 500; }
.jin-wps-cards input:checked + span { color: var(--wps-purple-dark); background: #f7f5ff; border-color: var(--wps-purple); box-shadow: 0 0 0 3px #eeeaff; }
.jin-wps-settings-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .8rem; }
.jin-wps-settings-grid fieldset { display: grid; gap: .45rem; margin: 0; padding: 1rem; border: 1px solid var(--wps-line); border-radius: .75rem; }
.jin-wps-settings-grid label { min-height: 2.2rem; padding: .35rem; font-weight: 600; }
.jin-wps-settings-grid em { padding: .12rem .35rem; color: #fff; font-size: .65rem; font-style: normal; background: var(--wps-purple); border-radius: 999px; }
.jin-wps-summary { display: grid; gap: .45rem; margin: 0; }
.jin-wps-summary div, .jin-wps-result-box dl div { display: grid; grid-template-columns: 8rem 1fr; gap: .5rem; padding: .55rem .7rem; background: var(--wps-soft); border-radius: .4rem; }
.jin-wps-summary dt, .jin-wps-result-box dt { color: var(--wps-muted); font-weight: 700; }
.jin-wps-summary dd, .jin-wps-result-box dd { margin: 0; overflow-wrap: anywhere; }
.jin-wps-notes { margin: .8rem 0; padding: .75rem; font-size: .8rem; line-height: 1.5; background: #f6f8ff; border-left: 4px solid #8394df; }
.jin-wps-notes p { margin: 0; }
.jin-wps-notes p + p { margin-top: .35rem; }
.jin-wps-start-error { margin: 1rem 0 0; padding: .8rem; color: #842323; background: #fff5f5; border: 1px solid #d58b8b; border-radius: .55rem; line-height: 1.6; overflow-wrap: anywhere; }
.jin-wps-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .55rem; margin-top: 1rem; }
.jin-wps-button { min-height: 2.75rem; padding: .55rem 1rem; color: var(--wps-ink); font: inherit; font-weight: 800; background: #fff; border: 1px solid #aeb4c7; border-radius: .55rem; cursor: pointer; }
.jin-wps-button--primary { color: #fff; background: linear-gradient(135deg, #7957ff, #5541dc); border-color: #5a42df; box-shadow: 0 .3rem .75rem rgb(86 64 218 / 20%); }
.jin-wps-button--danger { color: #a32020; border-color: #d9a2a2; }
.jin-wps-button:disabled { cursor: not-allowed; opacity: .48; box-shadow: none; }
.jin-wps-tool :focus-visible { outline: 3px solid #f2b94b; outline-offset: 3px; }
.jin-wps-loader { width: 2.5rem; height: 2.5rem; margin: .5rem auto; border: 4px solid #e6e2fb; border-top-color: var(--wps-purple); border-radius: 50%; animation: jin-wps-spin .8s linear infinite; }
.jin-wps-panel progress { display: block; width: 100%; height: .7rem; accent-color: var(--wps-purple); }
.jin-wps-result { margin-top: 1rem; border-top: 4px solid #c8bdf8; }
.jin-wps-result-box { display: grid; justify-items: center; gap: .5rem; padding: 1.1rem; text-align: center; background: linear-gradient(145deg, #faf9ff, #f5f8ff); border: 2px dashed #c5c9db; border-radius: .75rem; }
.jin-wps-result-box.is-ready { background: #f0fbf6; border-style: solid; border-color: #8bd0ad; }
.jin-wps-result-box.is-error { background: #fff5f5; border-style: solid; border-color: #e1a2a2; }
.jin-wps-result-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; color: var(--wps-purple); font-size: 1.2rem; background: #ece8ff; border-radius: 50%; }
.jin-wps-result-box dl { display: grid; gap: .35rem; width: min(100%, 35rem); margin: .5rem 0 0; text-align: left; }
.jin-wps-unavailable { width: min(100%, 58rem); margin: 0 auto 1rem; padding: .8rem 1rem; color: #6f3412; background: #fff1e8; border: 1px solid #e8b793; border-radius: .7rem; }
.jin-wps-unavailable p { margin: .2rem 0 0; }

@keyframes jin-wps-spin { to { transform: rotate(360deg); } }

.jin-wps-preview { width: 100%; min-width: 0; text-align: left; color: var(--wps-ink); }
.jin-wps-preview h3 { margin: .2rem 0 .7rem; font-size: 1rem; }
.jin-wps-preview-heading { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: space-between; align-items: center; }
.jin-wps-preview-heading > span { font-size: .75rem; color: var(--wps-muted); }
.jin-wps-preview-toolbar { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; margin: .5rem 0; }
.jin-wps-preview-toolbar output { min-width: 3.5rem; text-align: center; font-variant-numeric: tabular-nums; }
.jin-wps-preview-toolbar .jin-wps-button { padding: .4rem .65rem; min-width: 2.75rem; }
.jin-wps-preview-toolbar [aria-pressed="true"] { color: #fff; background: var(--wps-purple-dark); border-color: var(--wps-purple-dark); }
.jin-wps-preview [data-pv-status] { font-size: .8rem; margin: .6rem 0; min-height: 1.5em; }
.jin-wps-preview-viewport { height: min(65vh, 38rem); min-height: 18rem; width: 100%; overflow: auto; position: relative; padding: 12px; background: #e9ecf3; border: 1px solid #b9c0d2; border-radius: .65rem; overscroll-behavior: contain; touch-action: none; scrollbar-gutter: stable; }
.jin-wps-preview-viewport[data-mode="pan"] { cursor: grab; }
.jin-wps-preview-viewport[data-mode="select"] { cursor: crosshair; }
.jin-wps-preview-stage { position: relative; margin: 0 auto; background: white; box-shadow: 0 3px 20px #25375426; user-select: none; }
.jin-wps-preview-stage img { position: absolute; display: block; left: 0; max-width: none !important; max-height: none; pointer-events: none; border-radius: 0; }
.jin-wps-preview-stage > [data-pv-overview] { width: 100%; height: 100%; top: 0; }
.jin-wps-preview-selection { position: absolute; z-index: 2; border: 2px solid #5639dd; background: #7957ff18; box-shadow: 0 0 0 1px white; cursor: move; min-width: 2px; min-height: 2px; }
.jin-wps-preview-handle { position: absolute; display: block; width: 28px; height: 28px; padding: 0; margin: -14px 0 0 -14px; background: transparent; border: none; cursor: inherit; }
.jin-wps-preview-handle::after { content: ''; display: block; width: 10px; height: 10px; margin: 9px; border: 2px solid #fff; background: #5639dd; box-shadow: 0 0 0 1px #5639dd; border-radius: 3px; }
.jin-wps-preview-handle[data-pv-handle="nw"] { left: 0; top: 0; cursor: nwse-resize; }
.jin-wps-preview-handle[data-pv-handle="n"] { left: 50%; top: 0; cursor: ns-resize; }
.jin-wps-preview-handle[data-pv-handle="ne"] { left: 100%; top: 0; cursor: nesw-resize; }
.jin-wps-preview-handle[data-pv-handle="e"] { left: 100%; top: 50%; cursor: ew-resize; }
.jin-wps-preview-handle[data-pv-handle="se"] { left: 100%; top: 100%; cursor: nwse-resize; }
.jin-wps-preview-handle[data-pv-handle="s"] { left: 50%; top: 100%; cursor: ns-resize; }
.jin-wps-preview-handle[data-pv-handle="sw"] { left: 0; top: 100%; cursor: nesw-resize; }
.jin-wps-preview-handle[data-pv-handle="w"] { left: 0; top: 50%; cursor: ew-resize; }
.jin-wps-preview-coordinates { margin-top: .7rem; font-size: .8rem; }
.jin-wps-preview-coordinates summary { cursor: pointer; padding: .5rem; }
.jin-wps-preview-coordinates > div { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .5rem; padding: .5rem 0; }
.jin-wps-preview-coordinates label { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem; }
.jin-wps-preview-coordinates input { min-width: 0; width: 100%; min-height: 44px; font: inherit; padding: .4rem; border: 1px solid #9ba2b7; border-radius: .4rem; }
.jin-wps-crop-result { margin-top: 1rem; padding: 1rem; background: #eef0f8; border-radius: .65rem; text-align: center; }
.jin-wps-crop-result img { display: block; max-width: 100%; max-height: 65vh; height: auto; width: auto; margin: .7rem auto; box-shadow: 0 4px 20px #25375426; }
.jin-wps-crop-result p { font-size: .8rem; }
@media (max-width: 42rem) {
	.jin-wps-result-box { padding: .6rem; }
	.jin-wps-preview-toolbar .jin-wps-button { width: auto; flex: 0 1 auto; font-size: .75rem; }
	.jin-wps-preview-coordinates > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.jin-wps-preview-viewport { min-height: 18rem; padding: 6px; }
}

@media (max-width: 42rem) {
	.jin-wps-tool { border-radius: .5rem; }
	.jin-wps-header { grid-template-columns: 4.5rem 1fr; min-height: 4rem; }
	.jin-wps-header h1 { font-size: 1.05rem; padding: .5rem; }
	.jin-wps-steps { padding: .8rem .4rem; }
	.jin-wps-steps li { flex-direction: column; gap: .2rem; font-size: .67rem; text-align: center; }
	.jin-wps-steps li:not(:last-child)::after { top: 1rem; left: calc(50% + 1.2rem); right: calc(-50% + 1.2rem); }
	.jin-wps-steps span { width: 1.8rem; height: 1.8rem; }
	.jin-wps-url-row, .jin-wps-settings-grid { grid-template-columns: 1fr; }
	.jin-wps-cards { gap: .35rem; }
	.jin-wps-cards span { min-height: 5.6rem; padding: .45rem; font-size: .75rem; }
	.jin-wps-summary div, .jin-wps-result-box dl div { grid-template-columns: 1fr; gap: .1rem; }
	.jin-wps-button { width: 100%; }
	.jin-wps-actions { flex-direction: column-reverse; }
}

@media (prefers-reduced-motion: reduce) {
	.jin-wps-tool *, .jin-wps-tool *::before, .jin-wps-tool *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
