/* ===== Image Tools — shared styles (preetitounicode.com) ===== */
.imgt-wrap { --ia: #2563eb; --ia2: #1d4ed8; --ink: #1f2937; --muted: #5b6b7b; max-width: 880px; margin: 0 auto; padding: 28px 16px 8px; }
.imgt-wrap.imgt-wide { max-width: 1000px; }
.imgt-wrap * { box-sizing: border-box; }

.imgt-hero { text-align: center; margin-bottom: 22px; }
.imgt-hero .imgt-ic { width: 56px; height: 56px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ia), var(--ia2)); color: #fff; font-size: 24px; margin-bottom: 12px; }
.imgt-hero h1 { font-size: 28px; line-height: 1.2; color: var(--ink); margin: 0 0 8px; }
.imgt-hero p { font-size: 15px; color: var(--muted); margin: 0; }

.imgt-card { position: relative; background: #fff; border: 1px solid #e7eef3; border-radius: 16px; box-shadow: 0 8px 30px rgba(31,50,67,.07); padding: 22px; }
#imgt_panel { margin-top: 20px; }
/* processing overlay (e.g. AI background removal) */
.imgt-overlay { position: absolute; inset: 0; background: rgba(255,255,255,.85); backdrop-filter: blur(2px); display: none; align-items: center; justify-content: center; border-radius: 16px; z-index: 30; }
.imgt-overlay.show { display: flex; }
.imgt-overlay .ov { text-align: center; color: #46586a; font-weight: 600; max-width: 320px; padding: 16px; }
.imgt-overlay .ov i { font-size: 30px; color: var(--ia); display: block; margin-bottom: 12px; }
.imgt-overlay .ov small { display: block; margin-top: 6px; font-weight: 400; color: #8a9bab; font-size: 12.5px; }
.imgt-controls button:disabled, .imgt-controls select:disabled, .imgt-row button:disabled { opacity: .5; cursor: not-allowed; }

.imgt-zone { border: 2px dashed #cdd9e3; border-radius: 14px; background: #fafcfe; padding: 38px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.imgt-zone:hover, .imgt-zone.is-drag { border-color: var(--ia); background: #eff5ff; }
.imgt-zone .z-ic { font-size: 38px; color: var(--ia); margin-bottom: 10px; }
.imgt-zone .z-t { font-size: 16px; font-weight: 700; color: var(--ink); }
.imgt-zone .z-s { font-size: 13px; color: var(--muted); margin-top: 4px; }
.imgt-zone .z-btn { display: inline-block; margin-top: 14px; padding: 9px 20px; border-radius: 999px; background: var(--ia); color: #fff; font-size: 14px; font-weight: 600; }

.imgt-card.has-file .imgt-zone { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; }
.imgt-card.has-file .imgt-zone .z-ic { font-size: 18px; margin: 0; }
.imgt-card.has-file .imgt-zone .z-t { font-size: 13.5px; }
.imgt-card.has-file .imgt-zone .z-s { display: none; }
.imgt-card.has-file .imgt-zone .z-btn { margin: 0 0 0 auto; padding: 7px 15px; font-size: 13px; white-space: nowrap; }

/* preview + workspace */
.imgt-work { margin-top: 16px; display: grid; grid-template-columns: 1fr 320px; gap: 22px; align-items: start; }
.imgt-preview { background: #f3f6f9; border: 1px solid #e7eef3; border-radius: 12px; padding: 14px; display: flex; align-items: center; justify-content: center; min-height: 260px; max-height: 64vh; overflow: hidden; }
.imgt-preview img, .imgt-preview canvas { max-width: 100%; max-height: 58vh; display: block; border-radius: 4px; box-shadow: 0 6px 22px rgba(31,50,67,.12); background:#fff; }
.imgt-controls { display: flex; flex-direction: column; gap: 14px; }

.imgt-field { display: flex; flex-direction: column; gap: 5px; }
.imgt-field label { font-size: 12.5px; font-weight: 700; color: var(--muted); }
.imgt-field label b { color: var(--ia); }
.imgt-field input[type="text"], .imgt-field input[type="number"], .imgt-field select { padding: 9px 11px; border: 1.5px solid #dce6ec; border-radius: 9px; font-size: 14px; color: var(--ink); background: #fff; width: 100%; }
.imgt-field .hint { font-size: 11.5px; color: #93a2b1; }
.imgt-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.imgt-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.imgt-check { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; color: var(--ink); cursor: pointer; }

.imgt-field input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 999px; background: #e0e9f0; outline: none; border: none; padding: 0; }
.imgt-field input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--ia); cursor: pointer; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.imgt-field input[type="range"]::-moz-range-thumb { width: 18px; height: 18px; border: none; border-radius: 50%; background: var(--ia); cursor: pointer; }

.imgt-presets { margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.imgt-presets button { padding: 7px 12px; border: 1px solid #dce6ec; background: #fff; border-radius: 999px; font-size: 12.5px; font-weight: 600; color: #46586a; cursor: pointer; }
.imgt-presets button:hover { background: #eff5ff; border-color: var(--ia); color: var(--ia); }
.imgt-presets button.is-on { background: var(--ia); color: #fff; border-color: var(--ia); }

.imgt-go { margin-top: 4px; width: 100%; padding: 13px 20px; border: none; border-radius: 12px; background: var(--ia); color: #fff; font-size: 15.5px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 9px; transition: background .15s, transform .12s, opacity .15s; }
.imgt-go:hover:not(:disabled) { background: var(--ia2); transform: translateY(-1px); }
.imgt-go:disabled { opacity: .5; cursor: not-allowed; }
.imgt-mini { align-items: center; gap: 10px; padding: 8px 14px; border: 1px solid #dce6ec; background: #fff; border-radius: 9px; font-size: 13px; font-weight: 600; color: #46586a; cursor: pointer; }
.imgt-mini:hover { background: #eff5ff; }
.imgt-meta { font-size: 13px; color: var(--muted); }
.imgt-estimate { font-size: 13.5px; color: #46586a; background: #eff5ff; border: 1px solid #d4e3fb; border-radius: 9px; padding: 9px 12px; }
.imgt-estimate b { color: var(--ia); }
.imgt-result { display: none; margin-top: 6px; padding: 12px 15px; border-radius: 10px; font-size: 14px; font-weight: 600; }
.imgt-result.ok { background: #e9f9f1; color: #1c7a4f; border: 1px solid #bfe9d4; }
.imgt-result.err { background: #fdecea; color: #b62a21; border: 1px solid #f0c8c6; }

.imgt-privacy { display: inline-flex; align-items: center; gap: 7px; margin-top: 14px; font-size: 13px; color: #1c7a4f; background: #e9f9f1; border: 1px solid #bfe9d4; border-radius: 999px; padding: 7px 14px; }

/* cropper container */
.imgt-cropbox { max-height: 60vh; }
.imgt-cropbox img { max-width: 100%; display: block; }

/* content */
.imgt-content { max-width: 880px; margin: 26px auto 0; padding: 0 16px; }
.imgt-content h2 { font-size: 21px; color: var(--ink); margin: 26px 0 10px; }
.imgt-content h3 { font-size: 16px; color: var(--ink); margin: 18px 0 6px; }
.imgt-content p { font-size: 15px; line-height: 1.7; color: #44525f; margin: 0 0 12px; }
.imgt-content ul, .imgt-content ol { margin: 0 0 14px; padding-left: 20px; }
.imgt-content li { font-size: 15px; line-height: 1.7; color: #44525f; margin-bottom: 6px; }

/* related + hub */
.imgt-related { max-width: 880px; margin: 22px auto 0; padding: 0 16px; }
.imgt-related-h { display: block; font-size: 12px; font-weight: 700; color: #8a9bab; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 9px; }
.imgt-other { display: flex; flex-wrap: wrap; gap: 8px; }
.imgt-other a { font-size: 13px; color: #46586a; background: #f1f5f8; border: 1px solid #e2e9ef; border-radius: 999px; padding: 6px 13px; text-decoration: none; }
.imgt-other a:hover { background: var(--ia); color: #fff; border-color: var(--ia); }
.imgt-other-all { background: var(--ia) !important; color: #fff !important; border-color: var(--ia) !important; }

.imgt-hub { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 8px; }
.imgt-hub-card { display: flex; gap: 13px; align-items: flex-start; padding: 18px; background: #fff; border: 1px solid #e7eef3; border-radius: 14px; text-decoration: none; transition: transform .15s, box-shadow .15s, border-color .15s; }
.imgt-hub-card:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(31,50,67,.1); border-color: #bcd0f5; }
.imgt-hub-card .h-ic { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 11px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--ia), var(--ia2)); color: #fff; font-size: 18px; }
.imgt-hub-card > span:last-child { display: flex; flex-direction: column; }
.imgt-hub-card .h-t { display: block; font-size: 15.5px; font-weight: 700; color: var(--ink); }
.imgt-hub-card .h-d { display: block; font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.45; }

@media (max-width: 720px) { .imgt-work { grid-template-columns: 1fr; } .imgt-preview { order: -1; } }
@media (max-width: 560px) { .imgt-hero h1 { font-size: 23px; } .imgt-card { padding: 16px; } }
