/* TTB Image Watermark Adder v1.0.0 */
.ttb-tool{
  max-width: 980px;
  margin: 24px auto;
  padding: 20px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 2px 20px rgba(0,0,0,0.05);
  font-family: system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,Arial,sans-serif;
  color:#111827;
}
.ttb-header h2{margin:0 0 6px 0;font-size:1.5rem;font-weight:800}
.ttb-sub{margin:0 0 16px 0;color:#6b7280}
.ttb-card{border:1px solid #e5e7eb;border-radius:14px;padding:16px;background:#fafafa}
.ttb-label{font-weight:700;margin-right:8px}
.ttb-row{display:flex;gap:12px;align-items:center;flex-wrap:wrap;margin:10px 0}
.ttb-checkbox{display:flex;align-items:center;gap:8px;font-weight:600}
.ttb-btn{appearance:none;border:1px solid #3b82f6;background:#3b82f6;color:#fff;padding:10px 14px;border-radius:999px;font-weight:700;cursor:pointer;transition:transform .05s ease,filter .15s ease,box-shadow .15s ease;box-shadow:0 6px 18px rgba(59,130,246,.25)}
.ttb-btn:hover{filter:brightness(1.05)} .ttb-btn:active{transform:translateY(1px)}
.ttb-btn.ghost{background:transparent;color:#374151;border-color:#d1d5db;box-shadow:none}
.ttb-error{margin-top:8px;padding:8px 12px;border:1px solid #fecaca;background:#fef2f2;color:#991b1b;border-radius:10px;font-size:.95rem}
.ttb-input{flex:1;min-width:260px;padding:10px 12px;border:1px solid #e5e7eb;border-radius:10px;background:#fff}

.ttb-ir-stage{max-width:100%;overflow:hidden;margin:12px 0;}
.ir-stage-inner{max-width:100%;overflow:auto;padding:8px;background:#f9fafb;border-radius:12px;border:1px solid #e5e7eb}
.ir-viewport{position:relative;width:max-content;height:max-content}
.iwa-canvas-wrap{position:relative;display:inline-block;line-height:0}
#iwa-main{display:block;max-width:none;height:auto}
#iwa-logo, #iwa-text{
  position:absolute;
  left:16px; top:16px;
  user-select:none;
  touch-action:none;
  cursor:move;
}
#iwa-logo{max-width:none;height:auto;display:block}
.iwa-text{
  padding:4px 6px;
  color:#000;
  background: rgba(255,255,255,0.0); /* no bg so it sits as clean text; tweak if needed */
  border-radius:6px;
  white-space:pre;
}

.iwa-section-title{margin:0;font-size:1.05rem}
.iwa-divider{border:none;border-top:1px solid #e5e7eb;margin:12px 0}

/* Styled file input similar to Image Resizer */
#iwa-file, #iwa-logo-file, #iwa-footer-logo {
  display: block;
  padding: 12px 14px;
  border: 2px dashed #9ca3af;
  border-radius: 10px;
  background-color: #f9fafb;
  color: #374151;
  font-size: 0.95rem;
  cursor: pointer;
}
#iwa-file:hover, #iwa-file:focus,
#iwa-logo-file:hover, #iwa-logo-file:focus,
#iwa-footer-logo:hover, #iwa-footer-logo:focus {
  border-color: #3b82f6; background-color: #f3f4f6; outline: none;
}
#iwa-file::file-selector-button,
#iwa-logo-file::file-selector-button,
#iwa-footer-logo::file-selector-button{
  background:#3b82f6;border:none;color:#fff;font-weight:600;padding:8px 12px;margin-right:12px;border-radius:6px;cursor:pointer
}
#iwa-file::file-selector-button:hover,
#iwa-logo-file::file-selector-button:hover,
#iwa-footer-logo::file-selector-button:hover{background:#2563eb}

.iwa-footer {
  position: relative;
  height: 75px;
  background: #fff;              /* default, toggled by radios */
  border-top: 1px solid #e5e7eb;
  line-height: 0;
}

.iwa-footer-left {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
  font-weight: 600;
  color: #000;                   /* toggled to white on black bg */
  line-height: 1.2;
}

.iwa-footer-right {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  max-height: 60px;              /* fit inside 75px bar */
  height: auto;
  width: auto;
  display: block;
}

.ir-info { font-size: 12px; }
.iwa-text-input { flex-grow: 1 }

.iwa-scale-frame{
  position: relative;
  display: inline-block;
  line-height: 0;      /* no extra gaps */
  overflow: hidden;    /* <— critical: collapse scroll area to the frame */
}