/* Transparent PNG Trimmer (r1). Loaded only on /transparent-png-trimmer.html */
[hidden] { display: none !important; }

/* The shared toast inherits a light panel color with white text; keep it readable here */
#toast { background: #111827; color: #FFFFFF; border-color: #111827; }

/* Upload zone: full size first, then a slim bar so phones can still add files */
.center-stage .upload-zone { margin-bottom: 16px; }
.upload-zone:focus-visible { outline: 3px solid #2F6BFF; outline-offset: 2px; }
.upload-zone.is-compact { display: flex; align-items: center; gap: 12px; padding: 10px 14px; text-align: left; }
.upload-zone.is-compact .upload-icon { width: 38px; height: 38px; margin: 0; border-radius: 9px; flex: 0 0 auto; }
.upload-zone.is-compact .upload-title { font-size: 15px; margin: 0; }
.upload-zone.is-compact .upload-subtitle { font-size: 12.5px; margin: 0; }
.upload-zone.is-compact .upload-hint { display: none; }

/* Preview */
.tpt-stage-card .stage-card-head { flex-wrap: wrap; }
.tpt-view { width: auto; min-width: 220px; }
.tpt-view button { min-height: 36px; padding: 7px 12px; }
.tpt-preview-wrap { position: relative; display: flex; align-items: center; justify-content: center; min-height: 280px; padding: 12px; background: #F1F5F9; }
.tpt-preview-wrap canvas { display: block; max-width: 100%; border-radius: 6px; }
.tpt-preview-wrap canvas.is-picking { cursor: crosshair; }
.tpt-empty { text-align: center; color: #475569; max-width: 360px; font-size: 14px; line-height: 1.6; }
.tpt-empty .pe-icon { width: 44px; height: 44px; margin: 0 auto 10px; color: #64748B; }
.tpt-empty .pe-icon .ui-icon { width: 44px; height: 44px; }
.tpt-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 10px 18px 0; font-size: 12.5px; color: #475569; }
.tpt-legend span { display: inline-flex; align-items: center; gap: 6px; }
.tpt-legend i { width: 14px; height: 10px; border-radius: 2px; display: inline-block; }
.tpt-legend .lg-removed { background: rgba(220, 38, 38, 0.45); }
.tpt-legend .lg-kept { border: 2px solid #2563EB; }
.tpt-legend .lg-art { border: 1px dotted #1D4ED8; }

.tpt-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px 16px; margin: 0; padding: 12px 18px 4px; }
.tpt-stats div { min-width: 0; }
.tpt-stats dt { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: #64748B; }
.tpt-stats dd { margin: 2px 0 0; font-size: 14px; font-weight: 650; color: #0F172A; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tpt-stats .tpt-wide { grid-column: 1 / -1; }
.tpt-insight { margin: 4px 18px 16px; padding: 10px 12px; border-radius: 8px; background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E3A8A; font-size: 13.5px; line-height: 1.55; }

/* File list */
.tpt-files { list-style: none; margin: 0; padding: 8px; display: grid; gap: 6px; max-height: 360px; overflow-y: auto; }
.tpt-file { display: flex; align-items: center; gap: 6px; border: 1px solid #E2E8F0; border-radius: 8px; background: #FFFFFF; padding: 4px; }
.tpt-file.selected { border-color: #2563EB; box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18); }
.tpt-file-main { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; color: #0F172A; border-radius: 6px; }
.tpt-file-main:focus-visible, .tpt-icon-btn:focus-visible, .tpt-swatch:focus-visible, .tpt-view button:focus-visible, .tool-aside .seg button:focus-visible { outline: 3px solid #2F6BFF; outline-offset: 1px; }
.tpt-thumb { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 6px; border: 1px solid #E2E8F0; background: #FFFFFF; background-image: linear-gradient(45deg, #E2E8F0 25%, transparent 25%), linear-gradient(-45deg, #E2E8F0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #E2E8F0 75%), linear-gradient(-45deg, transparent 75%, #E2E8F0 75%); background-size: 10px 10px; background-position: 0 0, 0 5px, 5px -5px, -5px 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tpt-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.tpt-file-text { min-width: 0; display: flex; flex-direction: column; }
.tpt-file-text b { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tpt-file-meta { font-size: 12px; color: #475569; font-variant-numeric: tabular-nums; }
.tpt-file.is-hint .tpt-file-meta { color: #92400E; }
.tpt-file.is-empty .tpt-file-meta, .tpt-file.is-error .tpt-file-meta { color: #B91C1C; }
.tpt-icon-btn { flex: 0 0 auto; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid #E2E8F0; border-radius: 8px; background: #F8FAFC; color: #1E293B; cursor: pointer; }
.tpt-icon-btn:hover:not(:disabled) { border-color: #2563EB; color: #1D4ED8; }
.tpt-icon-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.tpt-icon-btn .ui-icon { width: 18px; height: 18px; }

/* Next-step card */
.tpt-next { padding: 16px 18px; margin-bottom: 20px; border: 1px solid #BFDBFE; background: #F8FBFF; border-radius: 10px; }
.tpt-next h2 { font-size: 16px; font-weight: 800; color: #0F172A; margin: 0 0 6px; }
.tpt-next p { font-size: 13.5px; color: #334155; margin: 0 0 12px; line-height: 1.55; }
.tpt-next .btn { flex: 0 0 auto; text-decoration: none; }
.tpt-next .tpt-next-alt { margin: 10px 0 0; font-size: 12.5px; }
.tpt-next a:not(.btn) { color: #1D4ED8; font-weight: 700; }

/* Settings panel (dark aside) */
.tool-aside .help-note { color: #CBD5E1; }
.tool-aside .help-note b { color: #FFFFFF; }
.tool-aside .seg button { min-height: 40px; }
.tpt-color-row { display: flex; gap: 8px; align-items: stretch; }
.tpt-color-row input[type="color"] { width: 54px; flex: 0 0 auto; }
.tpt-color-row input[type="text"] { width: 100%; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.tool-aside input[aria-invalid="true"] { border-color: #F87171; }
.tpt-swatches { display: flex; gap: 8px; margin-top: 10px; align-items: center; flex-wrap: wrap; }
.tpt-swatch { width: 34px; height: 34px; border-radius: 8px; border: 2px solid rgba(255, 255, 255, 0.35); cursor: pointer; padding: 0; }
.tpt-tip { font-size: 12.5px; color: #CBD5E1; margin: 10px 0 0; line-height: 1.5; }
.tpt-range-val { color: #FFFFFF; font-variant-numeric: tabular-nums; }
.tool-aside .settings-section { margin-top: 10px; }
/* A collapsed section is hidden from keyboard and screen readers once its close animation ends */
.tool-aside .settings-content { transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s, visibility 0s linear 0s; }
.tool-aside .settings-content.collapsed { visibility: hidden; transition: max-height 0.3s ease, padding 0.3s ease, opacity 0.2s, visibility 0s linear 0.3s; }
.tpt-sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 640px) {
  .tpt-view { width: 100%; }
  .tpt-view button, .tool-aside .seg button { min-height: 44px; }
  .tpt-swatch { width: 44px; height: 44px; }
  .tpt-preview-wrap { min-height: 220px; padding: 6px; }
  .tpt-stats { grid-template-columns: 1fr 1fr; padding: 12px 12px 4px; }
  .tpt-insight { margin: 4px 12px 14px; }
  .tpt-icon-btn { width: 44px; height: 44px; }
  .tpt-files { max-height: none; }
  .upload-zone.is-compact .upload-subtitle { display: none; }
  .tpt-next .btn { width: 100%; }
}
