.avm-maker {
	--avm-accent: #1f6f5c;
	--avm-border: rgba(0, 0, 0, 0.12);
	--avm-muted: #666;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	line-height: 1.4;
	color: inherit;
	max-width: 1100px;
	margin: 0 auto;
}
.avm-maker *, .avm-maker *::before, .avm-maker *::after { box-sizing: border-box; }

.avm-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; }
@media (max-width: 820px) { .avm-layout { grid-template-columns: minmax(0, 1fr); } }

/* Stage */
.avm-stage { position: sticky; top: 16px; }
@media (max-width: 820px) { .avm-stage { position: static; } }
.avm-canvas-wrap { position: relative; display: flex; justify-content: center; background: #111; border-radius: 10px; overflow: hidden; }
.avm-canvas { display: block; max-width: 100%; height: auto; max-height: 72vh; }
.avm-canvas-wrap[data-o="landscape"] .avm-canvas { width: 100%; }

.avm-transport { display: flex; align-items: center; gap: 12px; margin-top: 10px; }
.avm-play { flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--avm-accent); color: #fff; cursor: pointer; position: relative; padding: 0; }
.avm-play::before { content: ""; position: absolute; left: 15px; top: 12px; border-style: solid; border-width: 8px 0 8px 13px; border-color: transparent transparent transparent #fff; }
.avm-play.is-playing::before { left: 13px; top: 12px; width: 4px; height: 16px; border: 0; background: #fff; box-shadow: 9px 0 0 #fff; }
.avm-seek { flex: 1; height: 8px; border-radius: 4px; background: var(--avm-border); cursor: pointer; overflow: hidden; }
.avm-seek-fill { height: 100%; width: 0; background: var(--avm-accent); }
.avm-time { flex: none; font-variant-numeric: tabular-nums; color: var(--avm-muted); font-size: 13px; }

/* Controls */
.avm-controls h3 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--avm-muted); margin: 20px 0 8px; }
.avm-controls h3:first-child { margin-top: 0; }
.avm-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; min-width: 0; }
.avm-field > span { font-size: 13px; }
.avm-field select { width: 100%; padding: 7px 8px; border: 1px solid var(--avm-border); border-radius: 6px; background: #fff; color: #111; font: inherit; }
.avm-field input[type="color"] { width: 100%; height: 36px; padding: 2px; border: 1px solid var(--avm-border); border-radius: 6px; background: #fff; cursor: pointer; }
.avm-field input[type="range"] { width: 100%; accent-color: var(--avm-accent); }
.avm-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.avm-hint { font-size: 12px; color: var(--avm-muted); margin: -4px 0 0; }

.avm-bgs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.avm-bg { position: relative; width: 52px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: 6px; background: #333 center / cover no-repeat; cursor: pointer; overflow: hidden; outline-offset: 2px; }
.avm-bg.is-active { border-color: var(--avm-accent); box-shadow: 0 0 0 2px #fff inset; }
.avm-bg video { width: 100%; height: 100%; object-fit: cover; display: block; pointer-events: none; }
.avm-bg-badge { position: absolute; right: 3px; bottom: 2px; font-size: 10px; color: #fff; text-shadow: 0 0 3px #000; }
.avm-bg-color::after { content: "Aa"; position: absolute; inset: 0; display: grid; place-items: center; color: rgba(255,255,255,.8); font-size: 13px; }

.avm-seg { display: inline-flex; border: 1px solid var(--avm-border); border-radius: 6px; overflow: hidden; }
.avm-seg button { border: 0; background: transparent; color: inherit; padding: 7px 14px; cursor: pointer; font: inherit; }
.avm-seg button + button { border-left: 1px solid var(--avm-border); }
.avm-seg button.is-active { background: var(--avm-accent); color: #fff; }

.avm-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.avm-btn { padding: 9px 14px; border: 1px solid var(--avm-border); border-radius: 6px; background: #fff; color: #111; cursor: pointer; font: inherit; }
.avm-btn:disabled { opacity: 0.5; cursor: default; }
.avm-btn-primary { background: var(--avm-accent); border-color: var(--avm-accent); color: #fff; width: 100%; font-weight: 600; padding: 11px 14px; }
.avm-status { min-height: 1.4em; font-size: 13px; color: var(--avm-muted); margin: 10px 0 0; }
.avm-status.is-error { color: #b42318; }

/* Export overlay */
.avm-export { position: absolute; left: 0; right: 0; bottom: 0; padding: 14px; background: rgba(0, 0, 0, 0.75); color: #fff; display: grid; gap: 10px; font-size: 13px; }
.avm-export-bar { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, 0.2); overflow: hidden; }
.avm-export-fill { height: 100%; width: 0; background: #fff; }
.avm-export .avm-btn { justify-self: start; padding: 5px 12px; }

.avm-empty, .avm-loading { color: var(--avm-muted); }
.avm-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 14px; cursor: pointer; }
.avm-check input { width: 16px; height: 16px; accent-color: var(--avm-accent); margin: 0; }
.avm-bg-upload { background: transparent; border: 2px dashed var(--avm-border); color: inherit; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.avm-bg-upload span { font-size: 22px; line-height: 1; }
.avm-bg-upload small { font-size: 11px; }
.avm-bg-upload:hover { border-color: var(--avm-accent); }
.avm-bgs + .avm-hint { margin: -6px 0 12px; }
.avm-ar-inline { font-family: "AVM Quran", "Noto Naskh Arabic", "Geeza Pro", serif; font-size: 17px; white-space: nowrap; }
.avm-basmala-note:empty { display: none; }
.avm-basmala-note { margin-top: 4px; }
.avm-check input:disabled + .avm-basmala-label { opacity: 0.5; }
