.tpjc-tool {
    --tpjc-primary: #2457d6;
    --tpjc-border: #d9deea;
    --tpjc-muted: #5f6878;
    box-sizing: border-box;
    width: 100%;
    max-width: 920px;
    margin: 24px auto;
    padding: clamp(16px, 3vw, 28px);
    color: #172033;
    background: #fff;
    border: 1px solid var(--tpjc-border);
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(20, 35, 70, .07);
    font-family: inherit;
}
.tpjc-tool * { box-sizing: border-box; }
.tpjc-heading { margin-bottom: 22px; }
.tpjc-heading h2 { margin: 0 0 8px; color: inherit; font-size: clamp(22px, 3vw, 28px); line-height: 1.2; }
.tpjc-heading p, .tpjc-privacy-note, .tpjc-quality-note { margin: 0; color: var(--tpjc-muted); font-size: 14px; line-height: 1.55; }
.tpjc-upload-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.tpjc-upload-card, .tpjc-single-upload-card { min-width: 0; padding: 16px; border: 1px dashed #aeb9ce; border-radius: 12px; background: #f9fbff; }
.tpjc-single-upload-card { margin-bottom: 22px; }
.tpjc-upload-label { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; cursor: pointer; }
.tpjc-upload-number { display: inline-grid; place-items: center; width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%; color: #fff; background: var(--tpjc-primary); font-weight: 700; }
.tpjc-upload-title { flex: 1 1 120px; font-weight: 700; }
.tpjc-upload-button { display: inline-block; padding: 9px 12px; border-radius: 8px; color: var(--tpjc-primary); background: #eaf0ff; font-size: 13px; font-weight: 700; }
.tpjc-file-input { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; clip-path: inset(50%); }
.tpjc-file-input:focus + .tpjc-file-meta { outline: 2px solid var(--tpjc-primary); outline-offset: 3px; }
.tpjc-file-meta { margin-top: 12px; color: var(--tpjc-muted); font-size: 13px; overflow-wrap: anywhere; }
.tpjc-source-preview { display: block; max-width: 100%; max-height: 180px; margin: 12px auto 0; object-fit: contain; border-radius: 8px; background: #fff; }
.tpjc-settings { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.tpjc-reducer-settings { margin-top: 4px; }
.tpjc-field { min-width: 0; }
.tpjc-field label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 7px; font-size: 13px; font-weight: 700; }
.tpjc-field select, .tpjc-field input[type="range"] { width: 100%; }
.tpjc-field select { min-height: 42px; padding: 8px 11px; border: 1px solid var(--tpjc-border); border-radius: 8px; color: #172033; background: #fff; font: inherit; }
.tpjc-field input[type="range"] { accent-color: var(--tpjc-primary); cursor: pointer; }
.tpjc-target-field input[type="range"] { margin: 6px 0 2px; }
.tpjc-field label output { color: var(--tpjc-primary); font-weight: 800; white-space: nowrap; }
.tpjc-field-help { margin: 7px 0 0; color: var(--tpjc-muted); font-size: 12px; line-height: 1.4; }
.tpjc-range-labels { display: flex; justify-content: space-between; gap: 8px; color: var(--tpjc-muted); font-size: 11px; }
.tpjc-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tpjc-primary-button, .tpjc-secondary-button, .tpjc-download-button { display: inline-flex; min-height: 46px; align-items: center; justify-content: center; padding: 11px 18px; border: 0; border-radius: 9px; cursor: pointer; text-align: center; text-decoration: none !important; font: inherit; font-size: 14px; font-weight: 700; transition: opacity .15s ease, transform .15s ease; }
.tpjc-primary-button, .tpjc-download-button { color: #fff !important; background: var(--tpjc-primary); }
.tpjc-secondary-button { color: #26344d; background: #eef1f6; }
.tpjc-primary-button:hover, .tpjc-secondary-button:hover, .tpjc-download-button:hover { opacity: .9; transform: translateY(-1px); }
.tpjc-primary-button:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.tpjc-status { min-height: 22px; margin-top: 12px; color: var(--tpjc-muted); font-size: 13px; line-height: 1.5; }
.tpjc-status.tpjc-error { color: #b42318; }
.tpjc-status.tpjc-success { color: #167044; }
.tpjc-result { margin-top: 18px; padding: 18px; border: 1px solid var(--tpjc-border); border-radius: 12px; background: #fbfcff; }
.tpjc-result-heading h3 { margin: 0 0 5px; font-size: 18px; }
.tpjc-result-heading p { margin: 0 0 14px; color: var(--tpjc-muted); font-size: 13px; }
.tpjc-result-preview { display: block; max-width: 100%; max-height: 600px; margin: 0 auto 16px; object-fit: contain; background: #fff; border: 1px solid #edf0f5; }
.tpjc-download-button { width: 100%; }
.tpjc-privacy-note { margin-top: 18px; }
.tpjc-quality-note { margin-top: 6px; font-size: 12px; }
@media (max-width: 640px) {
    .tpjc-upload-grid, .tpjc-settings { grid-template-columns: 1fr; }
    .tpjc-actions { flex-direction: column; }
    .tpjc-primary-button, .tpjc-secondary-button { width: 100%; }
}
