/* Pin maker — all rules are scoped to .pmt-app so the theme stays untouched. */
.pmt-app {
	--pmt-ink: #17151f;
	--pmt-muted: #5b5966;
	--pmt-line: #e3e2e8;
	--pmt-field: #d5d4dc;
	--pmt-soft: #f1f0f4;
	--pmt-stage: #e9e8ee;
	--pmt-card: #ffffff;
	--pmt-accent: #4f3df0;
	--pmt-accent-soft: #f1efff;
	--pmt-accent-ink: #3b2cd6;
	--pmt-ok: #0e6b4f;
	--pmt-error: #b42318;
	font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
	font-size: 14px;
	line-height: 1.4;
	color: var(--pmt-ink);
	max-width: 1360px;
	margin: 0 auto;
}
.pmt-app *,
.pmt-app *::before,
.pmt-app *::after { box-sizing: border-box; }
.pmt-app [hidden] { display: none !important; }

.pmt-app .pmt-editor { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-start; }
.pmt-app .pmt-col { min-width: 0; }
.pmt-app .pmt-controls { flex: 1 1 290px; order: 1; background: var(--pmt-card); border: 1px solid var(--pmt-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.pmt-app .pmt-stage { flex: 2 1 380px; order: 2; background: var(--pmt-stage); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.pmt-app .pmt-side { flex: 1 1 290px; order: 3; display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 760px) {
	.pmt-app .pmt-editor { gap: 12px; }
	.pmt-app .pmt-stage { order: 1; padding: 12px; gap: 10px; }
	.pmt-app .pmt-controls { order: 2; padding: 12px; }
	.pmt-app .pmt-side { order: 3; }
	.pmt-app .pmt-canvas-wrap canvas { max-height: 58vh; }
	.pmt-app .pmt-tab { font-size: 12px; min-height: 44px; }
}

/* Generic controls (reset theme styles) */
.pmt-app button { font: inherit; cursor: pointer; margin: 0; text-transform: none; letter-spacing: normal; line-height: 1.2; }
.pmt-app button:disabled { opacity: 0.45; cursor: default; }
.pmt-app input[type="text"],
.pmt-app input[type="url"],
.pmt-app textarea,
.pmt-app select {
	font: inherit; font-size: 15px; color: var(--pmt-ink); background: #fff;
	border: 1px solid var(--pmt-field); border-radius: 10px; padding: 10px 12px; width: 100%; min-height: 44px; margin: 0; box-shadow: none;
}
.pmt-app textarea { resize: vertical; line-height: 1.4; }
.pmt-app input[type="color"] { width: 100%; height: 44px; padding: 4px; border: 1px solid var(--pmt-field); border-radius: 10px; background: #fff; }
.pmt-app input[type="range"] { width: 100%; accent-color: var(--pmt-accent); margin: 4px 0; }
.pmt-app input[type="checkbox"] { width: 20px; height: 20px; accent-color: var(--pmt-accent); margin: 0; }
.pmt-app :focus-visible { outline: 3px solid var(--pmt-accent); outline-offset: 2px; }

.pmt-app .pmt-field { display: flex; flex-direction: column; gap: 6px; }
.pmt-app .pmt-field label,
.pmt-app .pmt-label { font-size: 13px; font-weight: 600; }
.pmt-app .pmt-row { display: flex; justify-content: space-between; align-items: center; }
.pmt-app .pmt-row output { color: var(--pmt-muted); font-weight: 500; }
.pmt-app .pmt-help { margin: 0; font-size: 12px; color: var(--pmt-muted); }
.pmt-app .pmt-center { text-align: center; }
.pmt-app .pmt-check { display: flex; align-items: center; justify-content: space-between; font-size: 13px; font-weight: 600; padding: 10px 12px; background: #f7f7f9; border-radius: 10px; }
.pmt-app .pmt-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; }
.pmt-app .pmt-grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pmt-app .pmt-box { background: #f7f7f9; border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; }
.pmt-app .pmt-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.pmt-app .pmt-btnrow { display: flex; gap: 8px; }
.pmt-app .pmt-btnrow > input { flex: 1; min-width: 0; }
.pmt-app .pmt-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 0 14px; border: 1px solid var(--pmt-field); border-radius: 10px;
	background: #fff; color: var(--pmt-ink); font-weight: 600; font-size: 14px;
}
.pmt-app .pmt-btn:hover:not(:disabled) { background: #f7f7f9; }
.pmt-app .pmt-primary { background: var(--pmt-accent); border-color: var(--pmt-accent); color: #fff; }
.pmt-app .pmt-primary:hover:not(:disabled) { background: var(--pmt-accent-ink); }
.pmt-app .pmt-danger { color: var(--pmt-error); }
.pmt-app .pmt-wide { width: 100%; }
.pmt-app .pmt-big { width: 100%; min-height: 52px; font-size: 15px; font-weight: 700; border-radius: 12px; }
.pmt-app .pmt-icon { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--pmt-field); border-radius: 10px; background: #fff; color: var(--pmt-ink); padding: 0; }

/* Tabs */
.pmt-app .pmt-tabs { display: flex; gap: 4px; background: var(--pmt-soft); padding: 4px; border-radius: 10px; }
.pmt-app .pmt-tab { flex: 1; min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--pmt-muted); font-weight: 600; font-size: 13px; padding: 0 4px; }
.pmt-app .pmt-tab[aria-selected="true"] { background: #fff; color: var(--pmt-ink); box-shadow: 0 1px 2px rgba(23, 21, 31, 0.12); }
.pmt-app .pmt-panel { display: flex; flex-direction: column; gap: 14px; }

/* Layout picker */
.pmt-app .pmt-layouts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pmt-app .pmt-layout { display: flex; flex-direction: column; gap: 6px; align-items: stretch; padding: 0; border: 0; background: none; color: var(--pmt-ink); font-size: 12px; font-weight: 600; text-align: center; }
.pmt-app .pmt-layout canvas { width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 8px; border: 1px solid var(--pmt-field); display: block; }
.pmt-app .pmt-layout[aria-pressed="true"] canvas { outline: 3px solid var(--pmt-accent); outline-offset: 1px; }

/* Presets */
.pmt-app .pmt-presets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.pmt-app .pmt-preset { display: flex; align-items: center; gap: 6px; min-height: 48px; padding: 6px 10px; border: 1px solid var(--pmt-field); border-radius: 12px; background: #fff; color: var(--pmt-ink); font-size: 12px; font-weight: 600; text-align: left; }
.pmt-app .pmt-preset span { width: 20px; height: 20px; border-radius: 6px; flex: 0 0 20px; }

/* Photo slots */
.pmt-app .pmt-slots,
.pmt-app .pmt-pool { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pmt-app .pmt-thumb { position: relative; aspect-ratio: 1; border: 1px solid var(--pmt-field); border-radius: 10px; background: #dad8e0 center / cover no-repeat; padding: 0; color: var(--pmt-muted); font-size: 20px; }
.pmt-app .pmt-thumb.pmt-empty { border-style: dashed; background-color: #f7f7f9; }
.pmt-app .pmt-thumb[aria-pressed="true"] { outline: 3px solid var(--pmt-accent); outline-offset: 1px; }

/* Stage */
.pmt-app .pmt-toolbar { align-self: stretch; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.pmt-app .pmt-canvas-wrap { position: relative; width: 100%; display: flex; justify-content: center; }
.pmt-app .pmt-canvas-wrap canvas { display: block; width: auto; max-width: 100%; height: auto; max-height: 560px; border-radius: 10px; box-shadow: 0 18px 40px rgba(23, 21, 31, 0.22); touch-action: manipulation; cursor: grab; background: #fff; }
.pmt-app .pmt-drop { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(79, 61, 240, 0.85); color: #fff; font-size: 18px; font-weight: 700; border-radius: 12px; pointer-events: none; }

/* Side cards */
.pmt-app .pmt-card { background: var(--pmt-card); border: 1px solid var(--pmt-line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.pmt-app .pmt-h { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.3; }
.pmt-app .pmt-status { font-size: 13px; font-weight: 600; min-height: 1em; }
.pmt-app .pmt-status:empty { display: none; }
.pmt-app .pmt-busy { color: var(--pmt-muted); }
.pmt-app .pmt-ok { color: var(--pmt-ok); }
.pmt-app .pmt-error { color: var(--pmt-error); }
.pmt-app .pmt-suggest { text-align: left; padding: 10px 12px; border: 2px solid var(--pmt-accent); border-radius: 10px; background: var(--pmt-accent-soft); color: var(--pmt-ink); font-size: 14px; }
.pmt-app .pmt-seg { display: flex; gap: 4px; background: var(--pmt-soft); padding: 4px; border-radius: 10px; }
.pmt-app .pmt-seg button { flex: 1; min-height: 38px; border: 0; border-radius: 8px; background: transparent; color: var(--pmt-muted); font-weight: 600; font-size: 13px; }
.pmt-app .pmt-seg button[aria-pressed="true"] { background: #fff; color: var(--pmt-ink); box-shadow: 0 1px 2px rgba(23, 21, 31, 0.12); }
.pmt-app .pmt-upload { min-width: 200px; min-height: 48px; font-size: 15px; }
.pmt-app .pmt-movehint { color: var(--pmt-accent-ink); font-weight: 600; }

/* Keep theme (e.g. Astra) button and link styles from changing the editor. */
.pmt-app button,
.pmt-app button:hover,
.pmt-app button:focus,
.pmt-app button:active { box-shadow: none; text-decoration: none; }
.pmt-app .pmt-btn,
.pmt-app .pmt-btn:hover,
.pmt-app .pmt-btn:focus,
.pmt-app .pmt-btn:active { color: var(--pmt-ink); border: 1px solid var(--pmt-field); }
.pmt-app .pmt-btn:hover:not(:disabled) { background: #f7f7f9; }
.pmt-app .pmt-btn:not(:hover) { background: #fff; }
.pmt-app .pmt-btn.pmt-primary,
.pmt-app .pmt-btn.pmt-primary:hover,
.pmt-app .pmt-btn.pmt-primary:focus,
.pmt-app .pmt-btn.pmt-primary:active { color: #fff; background: var(--pmt-accent); border-color: var(--pmt-accent); }
.pmt-app .pmt-btn.pmt-primary:hover:not(:disabled) { background: var(--pmt-accent-ink); border-color: var(--pmt-accent-ink); }
.pmt-app .pmt-btn.pmt-danger,
.pmt-app .pmt-btn.pmt-danger:hover,
.pmt-app .pmt-btn.pmt-danger:focus { color: var(--pmt-error); }
.pmt-app .pmt-tab,
.pmt-app .pmt-tab:hover,
.pmt-app .pmt-tab:focus { background: transparent; color: var(--pmt-muted); border: 0; }
.pmt-app .pmt-tab[aria-selected="true"] { background: #fff; color: var(--pmt-ink); box-shadow: 0 1px 2px rgba(23, 21, 31, 0.12); }
.pmt-app .pmt-seg button,
.pmt-app .pmt-seg button:hover,
.pmt-app .pmt-seg button:focus { background: transparent; color: var(--pmt-muted); border: 0; }
.pmt-app .pmt-seg button[aria-pressed="true"] { background: #fff; color: var(--pmt-ink); box-shadow: 0 1px 2px rgba(23, 21, 31, 0.12); }
.pmt-app .pmt-icon,
.pmt-app .pmt-icon:hover,
.pmt-app .pmt-icon:focus { background: #fff; color: var(--pmt-ink); border: 1px solid var(--pmt-field); }
.pmt-app .pmt-layout,
.pmt-app .pmt-layout:hover,
.pmt-app .pmt-layout:focus { background: none; color: var(--pmt-ink); border: 0; }
.pmt-app .pmt-preset,
.pmt-app .pmt-preset:hover,
.pmt-app .pmt-preset:focus { background: #fff; color: var(--pmt-ink); border: 1px solid var(--pmt-field); }
.pmt-app .pmt-suggest,
.pmt-app .pmt-suggest:hover,
.pmt-app .pmt-suggest:focus { background: var(--pmt-accent-soft); color: var(--pmt-ink); border: 2px solid var(--pmt-accent); }
.pmt-app .pmt-thumb:hover,
.pmt-app .pmt-thumb:focus { color: var(--pmt-muted); }
.pmt-app .pmt-layouts { max-height: 640px; overflow-y: auto; padding: 4px; }
@media (max-width: 760px) { .pmt-app .pmt-layouts { max-height: none; overflow: visible; } }

/* Theme hover/focus styles must not change size or casing. */
.pmt-app button,
.pmt-app button:hover,
.pmt-app button:focus,
.pmt-app button:active { text-transform: none; letter-spacing: normal; font-family: inherit; }
.pmt-app .pmt-btn:hover, .pmt-app .pmt-btn:focus, .pmt-app .pmt-btn:active { padding: 0 14px; border-radius: 10px; min-height: 44px; }
.pmt-app .pmt-btn.pmt-big:hover, .pmt-app .pmt-btn.pmt-big:focus, .pmt-app .pmt-btn.pmt-big:active { border-radius: 12px; min-height: 52px; }
.pmt-app .pmt-tab:hover, .pmt-app .pmt-tab:focus, .pmt-app .pmt-tab:active { padding: 0 4px; border-radius: 8px; }
.pmt-app .pmt-seg button, .pmt-app .pmt-seg button:hover, .pmt-app .pmt-seg button:focus, .pmt-app .pmt-seg button:active { padding: 0 6px; border-radius: 8px; }
.pmt-app .pmt-icon:hover, .pmt-app .pmt-icon:focus, .pmt-app .pmt-icon:active { padding: 0; border-radius: 10px; }
.pmt-app .pmt-thumb, .pmt-app .pmt-thumb:hover, .pmt-app .pmt-thumb:focus, .pmt-app .pmt-thumb:active { padding: 0; border-radius: 10px; }
.pmt-app .pmt-layout:hover, .pmt-app .pmt-layout:focus, .pmt-app .pmt-layout:active { padding: 0; }
.pmt-app .pmt-preset:hover, .pmt-app .pmt-preset:focus, .pmt-app .pmt-preset:active { padding: 6px 10px; border-radius: 12px; }
.pmt-app .pmt-suggest:hover, .pmt-app .pmt-suggest:focus, .pmt-app .pmt-suggest:active { padding: 10px 12px; border-radius: 10px; }
