:root { }

.wm-card { padding: 28px; }
.wm-title-bar { background: linear-gradient(135deg, var(--site-dark) 0%, var(--site-dark-2) 100%); border-radius: 10px 10px 0 0; padding: 18px 24px; margin: -28px -28px 24px; }
.wm-title-bar h1 { color: #fff; margin: 0; font-size: 1.4em; text-align: center; }

/* ===== Mode tabs ===== */
.wm-mode-tabs { display: flex; gap: 10px; margin-bottom: 22px; }
.wm-mode-tab { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; border: 2px solid #e5e7eb; background: #fafbfc; color: #6b7280; font-weight: 700; font-size: .95em; padding: 12px 16px; border-radius: 10px; cursor: pointer; transition: all .15s ease; }
.wm-mode-tab i { font-size: 1.05em; }
.wm-mode-tab:hover { border-color: var(--site-light); color: var(--site-dark); }
.wm-mode-tab.is-active { border-color: var(--site-light); background: #f0fdfa; color: var(--site-dark); }
.wm-mode-panel.hide { display: none; }

/* ===== Dropzone ===== */
.wm-dropzone { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 36px 20px; text-align: center; color: #6b7280; cursor: pointer; transition: all .15s ease; }
.wm-dropzone.dragover { border-color: var(--site-light); background: #f0fdfa; }
.wm-dropzone i { font-size: 2.3em; margin-bottom: 10px; display: block; color: var(--site-light); }
.wm-dropzone p { margin: 0 0 4px; font-weight: 600; color: #374151; }
.wm-dropzone .wm-hint { font-size: .82em; color: #9ca3af; }
.wm-dropzone input[type="file"] { display: none; }

.wm-hint { font-size: .82em; color: #9ca3af; margin: 8px 0 0; }

.wm-error { color: var(--site-danger); background: var(--site-danger-bg); border: 1px solid var(--site-danger-border); border-radius: 8px; padding: 12px 16px; font-size: .9em; margin: 16px 0 0; }
.wm-error.hide { display: none; }

/* ===== Small logo dropzone (nested inside controls) ===== */
.wm-logo-dropzone { border: 2px dashed #cbd5e1; border-radius: 8px; padding: 16px; text-align: center; color: #6b7280; cursor: pointer; transition: all .15s ease; display: flex; align-items: center; gap: 10px; justify-content: center; font-size: .88em; }
.wm-logo-dropzone.dragover { border-color: var(--site-light); background: #f0fdfa; }
.wm-logo-dropzone i { font-size: 1.3em; color: var(--site-light); }
.wm-logo-dropzone input[type="file"] { display: none; }
.wm-logo-preview { display: flex; align-items: center; gap: 10px; }
.wm-logo-preview img { max-width: 46px; max-height: 46px; border-radius: 6px; border: 1px solid #e5e7eb; background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 12px 12px; }
.wm-logo-preview .wm-logo-name { font-size: .85em; color: #374151; font-weight: 600; flex: 1; text-align: left; word-break: break-all; }
.wm-logo-preview button { background: none; border: none; color: var(--site-danger); cursor: pointer; font-size: 1em; padding: 4px; }

/* ===== Workspace ===== */
.wm-workspace { margin-top: 22px; }
.wm-change-file { background: none; border: none; color: var(--site-dark); font-weight: 600; font-size: .88em; cursor: pointer; padding: 0 0 16px; display: inline-flex; align-items: center; gap: 6px; }
.wm-change-file:hover { color: var(--site-dark); }

/* ===== Preview + controls, side by side ===== */
.wm-workspace-row { display: grid; grid-template-columns: minmax(240px, 380px) 1fr; gap: 24px; align-items: start; }
.wm-preview-pane { min-width: 0; }

.wm-preview-box { background: repeating-conic-gradient(#f1f3f6 0% 25%, #fff 0% 50%) 50% / 20px 20px; border: 1px solid #e5e7eb; border-radius: 10px; min-height: 220px; max-height: 420px; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 8px; margin-bottom: 12px; }
.wm-preview-box canvas { max-width: 100%; max-height: 400px; object-fit: contain; display: block; }
.wm-preview-meta { font-size: .82em; color: #6b7280; text-align: center; min-height: 1.3em; }

/* PDF has no live canvas preview - just a file summary card */
.wm-pdf-file-card { display: flex; align-items: center; gap: 14px; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 18px; background: #fafbfc; }
.wm-pdf-file-card i { font-size: 1.9em; color: var(--site-danger); }
.wm-pdf-file-name { font-weight: 700; color: #23272f; font-size: .95em; word-break: break-all; }
.wm-pdf-file-meta { font-size: .82em; color: #6b7280; margin-top: 2px; }

/* ===== Controls ===== */
.wm-controls { border: 1px solid #eee; border-radius: 10px; padding: 18px 20px; background: #fafbfc; }
.wm-field { margin-bottom: 16px; }
.wm-field:last-child { margin-bottom: 0; }
.wm-field label { display: block; font-size: .85em; font-weight: 600; color: #374151; margin-bottom: 6px; }
.wm-field input[type="text"], .wm-field select { width: 100%; border: 1px solid #ddd; border-radius: 7px; padding: 9px 10px; font-size: .92em; box-sizing: border-box; background: #fff; color: #23272f; }
.wm-field input[type="range"] { width: 100%; accent-color: var(--site-light); }
.wm-field input[type="color"] { width: 52px; height: 34px; padding: 2px; border: 1px solid #ddd; border-radius: 7px; cursor: pointer; background: #fff; }
.wm-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.wm-field-inline { display: flex; align-items: center; gap: 12px; }

/* ===== Watermark type toggle (Text / Logo) ===== */
.wm-type-toggle { display: flex; gap: 10px; margin-bottom: 16px; }
.wm-type-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 7px; border: 1.5px solid #ddd; background: #fff; color: #6b7280; font-weight: 600; font-size: .88em; padding: 9px 10px; border-radius: 8px; cursor: pointer; transition: all .15s ease; }
.wm-type-btn i { font-size: 1em; }
.wm-type-btn.is-active { border-color: var(--site-light); background: #f0fdfa; color: var(--site-dark); }
.wm-type-panel.hide { display: none; }

/* ===== Position grid ===== */
.wm-position-label { display: flex; align-items: center; justify-content: space-between; }
.wm-tile-toggle { display: flex; align-items: center; gap: 6px; font-size: .82em; font-weight: 600; color: #6b7280; cursor: pointer; }
.wm-tile-toggle input { accent-color: var(--site-light); }
.wm-position-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; max-width: 220px; margin: 0 auto; }
.wm-position-grid.wm-disabled { opacity: .4; pointer-events: none; }
.wm-pos-btn { aspect-ratio: 1; border: 1.5px solid #ddd; background: #fff; border-radius: 8px; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #9ca3af; transition: all .15s ease; }
.wm-pos-btn i { font-size: .85em; }
.wm-pos-btn:hover { border-color: var(--site-light); color: var(--site-dark); }
.wm-pos-btn.is-active { border-color: var(--site-light); background: var(--site-light); color: #fff; }

.wm-btn { border: none; border-radius: 8px; padding: 13px 26px; font-weight: 700; cursor: pointer; font-size: .98em; display: flex; align-items: center; gap: 8px; background: var(--site-light); color: #fff; width: 100%; justify-content: center; transition: filter .15s ease; }
.wm-btn:disabled { opacity: .45; cursor: not-allowed; }
.wm-btn:not(:disabled):hover { filter: brightness(1.08); }

.wm-status { text-align: center; color: #6b7280; font-size: .88em; margin-top: 12px; min-height: 1.3em; }
.wm-status.wm-status-error { color: var(--site-danger); }
.wm-status:empty { display: none; }

@media (max-width: 800px) {
    .wm-workspace-row { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .wm-field-row { grid-template-columns: 1fr; }
    .wm-mode-tabs { flex-direction: column; }
}
