@font-face {
  font-family: "Noto Nastaliq Urdu";
  src: url("./assets/NotoNastaliqUrdu.woff2") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "AlQalam Taj Nastaleeq";
  src: url("./assets/AlQalamTajNastaleeq.woff2") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Jameel Noori Nastaleeq";
  src: url("./assets/JameelNooriNastaleeq.woff2") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

@font-face {
  font-family: "Harf Arabic";
  src: url("./assets/HarfArabic.woff2") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  color-scheme: dark;
  --bg: #11110f;
  --panel: #181815;
  --line: rgba(255,255,255,.09);
  --muted: #9e9c92;
  --gold: #c8a96a;
  --font-urdu: "Noto Nastaliq Urdu";
  --font-arabic: "Harf Arabic";
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: #f3f0e8; font-family: Inter, ui-sans-serif, system-ui, sans-serif; min-height: 100vh; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.topbar { height: 76px; padding: 0 4vw; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; background: rgba(17,17,15,.92); backdrop-filter: blur(18px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid rgba(200,169,106,.4); color: var(--gold); font: 22px/1 var(--font-urdu); transform: rotate(45deg); }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand b, .brand small { display: block; }
.brand b { font-family: Georgia, serif; letter-spacing: .03em; font-size: 18px; }
.brand small { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .17em; margin-top: 2px; }
.api-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: 11px; }
.api-pill span, .live-dot { width: 7px; height: 7px; background: #a58a50; border-radius: 50%; box-shadow: 0 0 10px #a58a50; }
.api-pill.ready span { background: #70a77a; box-shadow: 0 0 10px #70a77a; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.history-trigger { color: #c6c2b7; border: 1px solid var(--line); background: transparent; border-radius: 999px; padding: 8px 12px; cursor: pointer; font-size: 11px; }
.motion-link { text-decoration: none; color: #e0c27f; border-color: rgba(200,169,106,.48); }
.history-trigger b { display: inline-grid; place-items: center; min-width: 18px; height: 18px; margin-left: 5px; padding: 0 5px; color: #17140e; background: #c8a96a; border-radius: 999px; font-size: 9px; }
.workspace { display: grid; grid-template-columns: minmax(360px, 480px) minmax(460px, 1fr); height: calc(100vh - 76px); min-height: 620px; overflow: hidden; }
.controls { height: 100%; padding: 40px clamp(24px, 4vw, 58px) 60px; border-right: 1px solid var(--line); overflow-y: auto; overscroll-behavior: contain; }
.intro { margin-bottom: 34px; }
.eyebrow { color: var(--gold) !important; letter-spacing: .18em; font-size: 10px !important; font-weight: 700; }
.intro h1 { font: 400 clamp(34px, 4vw, 52px)/1.05 Georgia, serif; margin: 10px 0 12px; letter-spacing: -.04em; }
.intro h1 em { color: var(--gold); font-weight: 400; }
.intro p { color: var(--muted); max-width: 390px; line-height: 1.6; margin: 0; font-size: 13px; }
.field { border: 0; padding: 0; margin: 0 0 22px; min-width: 0; }
.field label, .field legend { display: block; text-transform: uppercase; color: #c8c5bb; letter-spacing: .12em; font-weight: 700; font-size: 10px; margin-bottom: 9px; }
.label-row { display: flex; justify-content: space-between; align-items: center; }
.label-row span { color: #77756d; font-size: 10px; }
textarea, input, select { width: 100%; color: #f5f1e8; background: #20201c; border: 1px solid var(--line); border-radius: 5px; outline: none; transition: .2s; }
textarea:focus, input:focus, select:focus { border-color: rgba(200,169,106,.7); box-shadow: 0 0 0 3px rgba(200,169,106,.08); }
#quote { resize: vertical; min-height: 130px; padding: 16px 18px; font: 20px/2.1 var(--font-urdu); }
input { padding: 12px 14px; font: 14px/1.8 var(--font-urdu); }
select { padding: 12px; cursor: pointer; }
.style-grid { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr; gap: 4px; }
.style { display: flex; gap: 5px; align-items: center; text-align: left; padding: 5px 6px; background: #1c1c19; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; transition: .15s; }
.style:hover, .style.active { border-color: rgba(200,169,106,.6); background: #23221d; }
.style span { font-size: 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #bbb8ae; }
.style small { display: none; }
.style.active span { color: #e8e4d8; }
.swatch { width: 14px; height: 14px; flex: none; border-radius: 2px; background-color: #333; }
.minimal { background: radial-gradient(circle at 60% 30%, #d0b983, #3d3424 58%, #161511); }
.water { background: radial-gradient(circle at 30% 70%, #d7a8a3 0 14%, transparent 35%), radial-gradient(circle at 70% 20%, #749497, transparent 40%), #d7cdb8; }
.ink { background: radial-gradient(ellipse at 30% 50%, #252724, transparent 48%), linear-gradient(135deg,#ded8c9,#89877d); }
.real { background: linear-gradient(145deg,#9c7043,#3d5147 45%,#101c1a); }
.geo { background: repeating-conic-gradient(from 45deg,#b89a5c 0 12.5%,#203e3b 0 25%); }
.manuscript { background: linear-gradient(135deg,#d0b886,#8f6d41); box-shadow: inset 0 0 0 5px #ead6a855; }
.cinema { background: radial-gradient(circle at 70% 20%,#835b34,#172521 35%,#060807 75%); }
.muharram { background: radial-gradient(circle at 25% 25%,#7a1717,#181212 42%,#050505); }
.anime { background: radial-gradient(circle at 72% 22%,#ffd58a 0 12%,transparent 32%), linear-gradient(145deg,#da88a8,#527ea0 48%,#182b43); }
.aesthetic { background: radial-gradient(ellipse at 54% 72%,#d4b89c 0 7%,#63717d 18%,transparent 35%), linear-gradient(180deg,#334656,#1b2835 58%,#0a1017); }
.notebook { background: repeating-linear-gradient(0deg,#f5f0e6,#f5f0e6 5px,#d8d4e8 5px,#d8d4e8 6px), #f5f0e6; }
.polaroid { background: linear-gradient(180deg,#ccc 0%,#ccc 68%,#fff 68%,#fff 100%); }
.letterpress { background: linear-gradient(145deg,#f5f0e0,#d4c8a8); }
.typewriter { background: linear-gradient(145deg,#fafaf8,#e8e4d8); }
.newsprint { background: linear-gradient(145deg,#e0dcd0,#c8c4b8); }
.vintage { background: linear-gradient(145deg,#c8b48a,#a0895e); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.compact select { font-size: 12px; }
.export-field { margin-top: -10px; }
.font-library { border: 1px solid var(--line); background: #1c1c19; padding: 13px 14px; border-radius: 5px; }
.font-library > label { margin-bottom: 8px; }
.upload-button { margin: 0; color: var(--gold); border: 1px solid rgba(200,169,106,.35); padding: 9px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; }
.asset-picker { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 8px; }
.backup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.backup-actions .secondary-action, .backup-actions .file-action { width: 100%; }
.asset-picker select { min-width: 0; padding: 9px 10px; font-size: 10px; }
.asset-label { margin: 0 !important; color: #aaa79d !important; font-size: 9px !important; text-transform: none !important; letter-spacing: .02em !important; }
.asset-status { display: block; margin: 7px 0 0; color: #77746d; font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auto-panel-status { margin: -3px 0 4px; color: #9d9277; white-space: normal; line-height: 1.5; }
.effect-controls { display: grid; gap: 13px; margin-top: 3px; padding-top: 13px; border-top: 1px solid var(--line); }
.editor-panel { margin: 0 0 10px; border: 1px solid var(--line); border-radius: 5px; background: #191916; }
.editor-panel.inline-settings { margin: -14px 0 22px; border-top-left-radius: 0; border-top-right-radius: 0; background: #1b1b18; }
.editor-panel.inline-settings summary { padding-top: 9px; padding-bottom: 9px; }
.editor-panel summary { padding: 10px 12px 10px 14px; cursor: pointer; color: #bebbb1; text-transform: uppercase; letter-spacing: .11em; font-size: 10px; font-weight: 700; }
.editor-panel summary::marker { color: #77746d; }
.editor-panel summary > span { display: inline-block; width: calc(100% - 62px); vertical-align: middle; }
.section-reset { float: right; margin: -3px 0; padding: 5px 8px; border: 1px solid #3b3933; border-radius: 3px; background: #22211d; color: #8f8b81; cursor: pointer; font: 700 8px/1.2 Arial, sans-serif; letter-spacing: .08em; text-transform: uppercase; }
.section-reset:hover { color: #d7bd87; border-color: rgba(200,169,106,.45); }
.editor-panel[open] summary { border-bottom: 1px solid var(--line); color: #d7bd87; }
.editor-body { display: grid; gap: 13px; padding: 14px; }
.editor-body input:not([type="range"]):not([type="color"]), .editor-body textarea { padding: 10px 11px; font-size: 11px; }
.card-text-editor { display: grid; gap: 8px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #191916; }
.carousel-card-picker { display: grid; grid-template-columns: 34px minmax(0,1fr) 34px; align-items: center; gap: 7px; padding: 8px; border: 1px solid rgba(200,169,106,.22); border-radius: 5px; background: #151613; }
.carousel-card-picker > button, .carousel-card-buttons button { height: 32px; padding: 0 10px; border: 1px solid #3b3933; border-radius: 4px; background: #22231f; color: #aaa69d; cursor: pointer; font-size: 9px; white-space: nowrap; }
.carousel-card-picker > button { padding: 0; font-size: 14px; }
.carousel-card-picker button:hover:not(:disabled) { border-color: #8c7748; color: #ecd18d; }
.carousel-card-picker button:disabled { opacity: .28; cursor: not-allowed; }
.carousel-card-buttons { display: flex; gap: 6px; min-width: 0; overflow-x: auto; padding: 1px; scrollbar-width: thin; }
.carousel-card-buttons button { flex: 0 0 auto; min-width: 62px; }
.carousel-card-buttons button.active { border-color: #c8a96a; background: linear-gradient(135deg,#3b3323,#25231c); color: #f1d493; box-shadow: inset 0 0 0 1px rgba(200,169,106,.14); }
.card-editor-head, .card-editor-actions { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.card-editor-head span { color: #c7a965; font-size: 9px; font-weight: 800; letter-spacing: .04em; }
.card-editor-head button, .card-editor-actions button { padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; background: #24241f; color: #aaa69d; cursor: pointer; font-size: 8px; }
.card-editor-actions button { flex: 1; }
.card-editor-actions #splitCardHere { border-color: rgba(200,169,106,.5); color: #d1b16d; }
.card-text-editor textarea { min-height: 112px; resize: vertical; font: 15px/2 var(--font-urdu) !important; }
.card-text-editor textarea:disabled { opacity: .45; cursor: not-allowed; }
.card-editor-head button:hover, .card-editor-actions button:hover { border-color: #8c7748; color: #e1c783; }
.card-editor-head button:disabled, .card-editor-actions button:disabled { opacity: .35; cursor: not-allowed; }
.range-field { display: grid !important; gap: 6px; margin: 0 !important; }
.range-field span { display: flex; justify-content: space-between; color: #aaa79d; font-size: 9px; text-transform: none; letter-spacing: .02em; }
.range-field b { color: #77746d; font-weight: 500; }
input[type="range"] { appearance: none; height: 3px; padding: 0; border: 0; border-radius: 2px; background: #3b3933; accent-color: var(--gold); }
input[type="range"]::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; border-radius: 50%; background: #c6a662; cursor: pointer; }
.mini-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.mini-grid label { margin: 0; color: #88857d; font-size: 8px; }
.mini-grid select { display: block; margin-top: 6px; padding: 8px; }
.color-field, .switch-row, .file-line { display: flex !important; justify-content: space-between; align-items: center; margin: 0 !important; }
.color-field input { width: 40px; height: 32px; padding: 2px; border: 1px solid var(--line); border-radius: 4px; background: transparent; cursor: pointer; }
.switch-row span { color: #aaa79d; font-size: 10px; text-transform: none; letter-spacing: 0; }
.switch-row input { width: 34px; height: 18px; accent-color: #b99a5c; }
.helper { margin: 0; color: #77746d; font-size: 9px; line-height: 1.6; }
.file-action, .secondary-action { display: inline-flex !important; justify-content: center; align-items: center; margin: 0 !important; padding: 9px 11px; border: 1px solid rgba(200,169,106,.35); border-radius: 3px; background: transparent; color: #cdb174 !important; cursor: pointer; font-size: 9px !important; letter-spacing: .08em; text-transform: uppercase; }
.file-line span { max-width: 145px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #77746d; font-size: 9px; }
.secondary-action { width: 100%; }
.generate { width: 100%; border: 0; border-radius: 4px; background: #b99a5c; color: #15130e; padding: 15px 18px; display: flex; justify-content: space-between; font-weight: 800; cursor: pointer; transition: .2s; }
.generate:hover { background: #d0b270; transform: translateY(-1px); }
.generate:disabled { opacity: .55; cursor: wait; transform: none; }
.video-action { width: 100%; margin-top: 9px; border: 1px solid rgba(112,167,122,.58); border-radius: 4px; background: linear-gradient(135deg,#263c30,#17251e); color: #e5eee6; padding: 13px 18px; display: flex; justify-content: space-between; font-weight: 700; cursor: pointer; transition: .2s; }
.video-action:hover { border-color: #8eb498; background: linear-gradient(135deg,#31503e,#1b2f25); transform: translateY(-1px); }
.video-action:disabled { opacity: .55; cursor: wait; transform: none; }
.video-action[hidden] { display: none; }
.form-note { min-height: 16px; color: #77756d; font-size: 10px; line-height: 1.5; margin: 9px 0 0; }
.stage { position: sticky; top: 76px; height: 100%; padding: 24px clamp(24px, 5vw, 72px) 30px; background: radial-gradient(circle at 50% 25%, #24231e, #141412 60%); display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.stage-toolbar, .stage-footer { display: flex; align-items: center; justify-content: space-between; color: #77756d; font-size: 9px; letter-spacing: .14em; }
.stage-toolbar > div { display: flex; align-items: center; gap: 8px; }
.stage-toolbar button { border: 1px solid var(--line); background: transparent; border-radius: 3px; padding: 6px 9px; cursor: pointer; }
.stage-toolbar button:disabled { opacity: .3; cursor: default; }
.toolbar-actions { display: flex; gap: 5px; }
.canvas-tools { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 10px; color: #77756d; font-size: 9px; letter-spacing: .05em; }
.canvas-tools button { padding: 5px 8px; border: 1px solid var(--line); border-radius: 999px; background: #1a1a17; color: #99968d; cursor: pointer; font-size: 9px; }
.canvas-tools button.active { color: #17140e; background: #c8a96a; border-color: #c8a96a; }
.canvas-tools small { color: #5f5d56; font-size: 8px; }
.stage.video-active .canvas-tools,
.stage.video-active #layoutHint { display: none; }
.poster-wrap { flex: 1; min-height: 520px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; padding: 22px 0; }
.poster { --poster-ratio: 4 / 5; position: relative; flex: 0 0 auto; overflow: hidden; isolation: isolate; container-type: inline-size; aspect-ratio: var(--poster-ratio); width: min(100%, 475px, calc((100vh - 240px) * .8)); box-shadow: 0 28px 80px rgba(0,0,0,.48); background: #2e2a22; }
.poster-render { position: absolute; inset: 0; z-index: 8; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .18s ease; cursor: grab; touch-action: none; user-select: none; }
.poster-render.ready { opacity: 1; }
.poster-render.dragging { cursor: grabbing; }
.poster.live-drag .poster-render { opacity: 0; transition: none; }
.poster.live-drag .quote-safe { will-change: transform; }
.ratio-1-1 { --poster-ratio: 1 / 1; width: min(100%, 475px, calc(100vh - 240px)); }
.ratio-4-5 { --poster-ratio: 4 / 5; width: min(100%, 475px, calc((100vh - 240px) * .8)); }
.ratio-9-16 { --poster-ratio: 9 / 16; width: min(100%, 360px, calc((100vh - 240px) * .5625)); }
.poster-bg, .poster-noise, .poster-shade { position: absolute; inset: 0; }
.poster-bg { z-index: -3; background-size: cover; background-position: center; transition: background .35s; transform: scale(1.02); }
.style-minimalist .poster-bg { background-image: radial-gradient(circle at 76% 18%, rgba(215,187,126,.5), transparent 23%), radial-gradient(circle at 20% 78%, rgba(110,87,49,.65), transparent 36%), linear-gradient(145deg,#514631,#1d1b16 58%,#0e0e0c); }
.style-watercolor .poster-bg { background-image: radial-gradient(ellipse at 20% 25%, rgba(135,166,164,.8), transparent 31%), radial-gradient(ellipse at 78% 70%, rgba(202,136,126,.7), transparent 29%), radial-gradient(circle at 60% 15%, rgba(213,181,111,.6), transparent 20%), linear-gradient(145deg,#d9d0bf,#aca899); }
.style-inkwash .poster-bg { background-image: radial-gradient(ellipse at 78% 18%, rgba(29,32,29,.9), transparent 38%), radial-gradient(ellipse at 12% 80%, rgba(44,49,46,.8), transparent 34%), linear-gradient(150deg,#d7d1c3,#6e716b); filter: grayscale(.8); }
.style-realistic .poster-bg { background-image: radial-gradient(circle at 50% 18%, rgba(216,169,93,.5), transparent 12%), linear-gradient(160deg,transparent 38%,rgba(35,72,61,.8)), linear-gradient(145deg,#8e6b42,#273e39 48%,#091210); }
.style-geometric .poster-bg { background-image: linear-gradient(#12302ecf,#091513e8), repeating-conic-gradient(from 45deg at 50% 50%,#c1a060 0 5%,#1f5350 0 10%); background-size: cover, 120px 120px; }
.style-manuscript .poster-bg { background-image: radial-gradient(circle at 30% 20%,#e2ca95,transparent 38%), repeating-linear-gradient(8deg,#b8935e 0 1px,#cfb57d 1px 5px); }
.style-darkcinematic .poster-bg { background-image: radial-gradient(circle at 72% 18%,#9f6c36aa,transparent 18%),linear-gradient(145deg,#233a34,#080b0a 55%,#020303); }
.style-muharram .poster-bg { background-image: radial-gradient(circle at 24% 18%,#8b1c1ca8,transparent 23%),linear-gradient(160deg,#241414,#080707 55%,#020202); }
.style-anime .poster-bg { background-image: radial-gradient(circle at 72% 17%,#ffd88eaa,transparent 18%), radial-gradient(ellipse at 18% 78%,#4d8b82aa,transparent 32%), linear-gradient(155deg,#d889a7,#557f9e 46%,#17283d); }
.style-aesthetic .poster-bg { background-image: radial-gradient(ellipse at 52% 70%,rgba(218,190,159,.62),rgba(92,108,121,.3) 14%,transparent 29%), linear-gradient(180deg,#3d5262,#263746 48%,#111a24 76%,#080d13); }
.style-notebook .poster-bg { background-color: #f8f3ea; background-image: repeating-linear-gradient(0deg,transparent,transparent 22px,#b8c4d8 22px,#b8c4d8 22.5px), linear-gradient(90deg,transparent 0%,rgba(0,0,0,.04) 97%,rgba(0,0,0,.12) 100%); background-size: 100% 100%, 100% 100%; }
.style-notebook .poster-shade { background: linear-gradient(180deg,rgba(0,0,0,.12),transparent 15%,transparent 85%,rgba(0,0,0,.06)); }
.style-notebook .poster-noise { opacity: 0.08; }
.style-notebook .tone-ivory .quote-safe { color: #2a2a38; }
.style-notebook .tone-ink .quote-safe { color: #1a1a28; }
.style-notebook .quote-safe { transform: rotate(-0.3deg); }

.style-polaroid .poster-bg { background: #f0ede4; }
.style-polaroid .poster-shade { background: linear-gradient(180deg,rgba(0,0,0,.08),transparent 12%,transparent 66%,#fff 66%,#fff 100%); }
.style-polaroid .poster-noise { opacity: 0.04; }
.style-polaroid .quote-safe { bottom: 28%; padding-bottom: 3%; padding-left: 5%; padding-right: 5%; }
.style-polaroid .tone-ivory .quote-safe { color: #333; }
.style-polaroid .tone-ink .quote-safe { color: #111; }

.style-letterpress .poster-bg { background-color: #f2ecdc; background-image: radial-gradient(ellipse at 30% 25%,rgba(210,185,140,.5),transparent 45%), radial-gradient(ellipse at 65% 75%,rgba(195,170,130,.4),transparent 40%), url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='paper'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23paper)' opacity='0.08'/%3E%3C/svg%3E"); background-size: 100% 100%, 100% 100%, 180px 180px; }
.style-letterpress .poster-shade { background: linear-gradient(180deg,rgba(0,0,0,.05),transparent 25%,transparent 75%,rgba(0,0,0,.05)); }
.style-letterpress .poster-noise { opacity: 0.05; }
.style-letterpress .tone-ivory .quote-safe { color: #4a3528; text-shadow: 0 -1px 0 rgba(255,255,255,.3), 0 1px 0 rgba(0,0,0,.15); }
.style-letterpress .tone-ink .quote-safe { color: #2a1f14; text-shadow: 0 -1px 0 rgba(255,255,255,.2), 0 1px 0 rgba(0,0,0,.2); }

.style-typewriter .poster-bg { background-color: #fafaf6; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='grain'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23grain)' opacity='0.04'/%3E%3C/svg%3E"); background-size: 200px 200px; }
.style-typewriter .poster-shade { background: linear-gradient(180deg,rgba(0,0,0,.03),transparent 8%,transparent 92%,rgba(0,0,0,.02)); }
.style-typewriter .poster-noise { opacity: 0.04; }
.style-typewriter .tone-ivory .quote-safe { color: #1a1a1a; letter-spacing: 0.02em; }
.style-typewriter .tone-ink .quote-safe { color: #0a0a0a; letter-spacing: 0.02em; }

.style-newsprint .poster-bg { background-color: #e6e2d8; background-image: repeating-linear-gradient(0deg,transparent,transparent 1px,rgba(170,165,155,.12) 1px,rgba(170,165,155,.12) 2px), repeating-linear-gradient(90deg,transparent,transparent 1px,rgba(170,165,155,.06) 1px,rgba(170,165,155,.06) 2px); background-size: 100% 100%, 100% 100%; }
.style-newsprint .poster-shade { background: linear-gradient(180deg,rgba(0,0,0,.1),transparent 12%,transparent 88%,rgba(0,0,0,.08)); }
.style-newsprint .poster-noise { opacity: 0.15; }
.style-newsprint .tone-ivory .quote-safe { color: #2a2824; }
.style-newsprint .tone-ink .quote-safe { color: #1a1814; }

.style-vintage .poster-bg { background-color: #c4a878; background-image: url("./assets/vintage-parchment.jpg"); background-size: cover; background-position: center; }
.style-vintage .poster-shade { background: radial-gradient(ellipse at 50% 50%,transparent 30%,rgba(40,20,10,.45) 100%); }
.style-vintage .poster-noise { opacity: 0.06; }
.style-vintage .tone-ivory .quote-safe { color: #efe4d0; text-shadow: 0 1px 2px rgba(0,0,0,.3); }
.style-vintage .tone-ink .quote-safe { color: #1a0e04; }
.poster-noise { z-index: -2; opacity: .2; mix-blend-mode: soft-light; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E"); }
.poster-shade { z-index: -1; opacity: var(--overlay-opacity,.62); background: radial-gradient(ellipse at center, transparent 15%, rgba(0,0,0,.72) 100%), linear-gradient(to bottom,rgba(0,0,0,.25),rgba(0,0,0,.12) 55%,rgba(0,0,0,.6)); }
.tone-ink .poster-shade { background: rgba(242,235,218,.48); backdrop-filter: saturate(.7) brightness(1.15); }
.quote-safe { position: absolute; z-index: 0; isolation: isolate; inset: calc((100% - var(--panel-height,1) * 100%) / 2) calc((100% - var(--panel-width,85%)) / 2); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: var(--panel-padding,4%); border-radius: var(--panel-radius,8px); }
.quote-safe::before { content: ""; position: absolute; inset: 0; z-index: -1; transform: translate(calc(var(--panel-x,0) * 1cqw), calc(var(--panel-y,0) * 1cqh)); border-radius: inherit; border: var(--panel-border-width,0) solid var(--panel-border-color,transparent); box-shadow: 0 var(--panel-shadow-y,8px) var(--panel-shadow-blur,24px) var(--panel-shadow-color,transparent); mask-image: linear-gradient(to bottom,transparent 0,#000 var(--panel-feather,0),#000 calc(100% - var(--panel-feather,0)),transparent 100%),linear-gradient(to right,transparent 0,#000 var(--panel-feather,0),#000 calc(100% - var(--panel-feather,0)),transparent 100%); mask-composite: intersect; -webkit-mask-image: linear-gradient(to bottom,transparent 0,#000 var(--panel-feather,0),#000 calc(100% - var(--panel-feather,0)),transparent 100%),linear-gradient(to right,transparent 0,#000 var(--panel-feather,0),#000 calc(100% - var(--panel-feather,0)),transparent 100%); -webkit-mask-composite: source-in; }
.panel-none .quote-safe::before { display: none; }
.panel-glass .quote-safe::before { background: rgba(20,20,17,var(--panel-alpha,.35)); backdrop-filter: blur(var(--panel-blur,10px)); -webkit-backdrop-filter: blur(var(--panel-blur,10px)); clip-path: inset(0 round var(--panel-radius,8px)); }
.panel-dark .quote-safe::before { background: rgba(5,5,4,var(--panel-alpha,.62)); }
.panel-cream .quote-safe::before { background: rgba(238,226,202,var(--panel-alpha,.78)); }
.panel-custom .quote-safe::before { background: var(--panel-fill,rgba(18,18,15,.35)); }
.panel-softfade .quote-safe::before { inset: -8%; border: 0; background: radial-gradient(ellipse at center,var(--panel-fill,rgba(7,9,11,.46)) 0 46%,transparent 100%); backdrop-filter: blur(var(--panel-blur,10px)); }
.panel-bottomfade .quote-safe::before { inset: -7% -5%; border: 0; border-radius: 0; background: linear-gradient(to bottom,transparent 0,var(--panel-fill,rgba(7,9,11,.42)) 34%,var(--panel-fill,rgba(7,9,11,.58)) 100%); backdrop-filter: blur(var(--panel-blur,10px)); }
.panel-outline .quote-safe::before { background: var(--panel-fill,rgba(7,9,11,.12)); outline: 1px solid var(--panel-border-color,rgba(224,205,164,.55)); outline-offset: -1px; }
.panel-paper .quote-safe::before { background: repeating-linear-gradient(7deg,rgba(91,67,35,.035) 0 1px,transparent 1px 5px),var(--panel-fill,rgba(238,226,202,.82)); box-shadow: inset 0 0 35px rgba(91,67,35,.12),0 var(--panel-shadow-y,8px) var(--panel-shadow-blur,24px) var(--panel-shadow-color,transparent); }
.panel-cinematic .quote-safe::before { inset: -6%; border: 0; background: radial-gradient(ellipse at center,var(--panel-fill,rgba(4,6,8,.58)) 0 50%,rgba(4,6,8,.28) 72%,transparent 100%); backdrop-filter: blur(var(--panel-blur,10px)); }
.panel-cream blockquote { mix-blend-mode: var(--text-blend, normal); color: var(--text-color,#211d16); }
.panel-cream cite { mix-blend-mode: var(--text-blend, normal); color: var(--source-color,#624c29); text-shadow: none; }
.panel-paper blockquote { mix-blend-mode: var(--text-blend, normal); color: var(--text-color,#211d16); }
.panel-paper cite { mix-blend-mode: var(--text-blend, normal); color: var(--source-color,#624c29); text-shadow: none; }
.ornament { color: var(--accent,#d7ba7e); font-size: 10px; margin-bottom: 5%; }
blockquote { mix-blend-mode: var(--text-blend, normal); width: 100%; margin: 0; color: var(--text-color,#f5eee0); font: 500 clamp(16px, calc(var(--quote-size, 8.2) * 1cqw), 48px)/var(--quote-line,2.05) var(--font-urdu); -webkit-text-stroke: var(--outline-size,0) var(--outline-color,#17130d); text-shadow: 0 var(--shadow-y,2px) var(--shadow-blur,20px) var(--shadow-color,rgba(0,0,0,.8)), 0 0 var(--glow-blur,0) var(--glow-color,transparent); text-wrap: balance; transform: translate(calc(var(--quote-x,0) * 1cqw), calc(var(--quote-y,0) * .35cqh)); }
.effect-gold blockquote { mix-blend-mode: var(--text-blend, normal); color: transparent; background: linear-gradient(180deg,#fff0bd,#c69b4e); background-clip: text; -webkit-background-clip: text; }
.tone-ink blockquote { mix-blend-mode: var(--text-blend, normal); color: var(--text-color,#1c1b17); }
.poster.text-medium { --quote-base: 6.7; }
.poster.text-long { --quote-base: 5.25; }
.divider { display: flex; align-items: center; gap: 8px; margin: 5% 0 3%; width: 38%; color: var(--accent,#d1ae6a); }
.divider span { height: 1px; background: currentColor; opacity: .6; flex: 1; }
.divider i { font-style: normal; font-size: 7px; }
cite { mix-blend-mode: var(--text-blend, normal); color: var(--source-color,#d9c79f); font: 500 clamp(8px, calc(3.1cqw * var(--source-scale,1)), 30px)/1.8 var(--font-urdu); font-style: normal; text-shadow: 0 2px 8px #000; transform: translate(calc(var(--source-x,0) * 1cqw), calc(var(--source-y,0) * .1cqh)); }
.tone-ink cite { mix-blend-mode: var(--text-blend, normal); color: var(--source-color,#4c3c23); text-shadow: none; }
.speaker-label { max-width: 90%; margin-bottom: 2%; transform: translate(calc(var(--speaker-x,0) * 1cqw), calc(var(--speaker-y,0) * .1cqh)); color: var(--speaker-color,#d9c79f); font: 500 clamp(10px, calc(4.2cqw * var(--speaker-scale,1)), 58px)/1.65 var(--font-urdu); text-align: center; text-shadow: 0 2px 8px #000; white-space: nowrap; }
.cover-card blockquote { mix-blend-mode: var(--text-blend, normal); font-size: clamp(22px, calc(var(--quote-size, 9.2) * 1cqw), 52px); }
.cover-card .ornament { font-size: 14px; }
.brand-watermark { position: absolute; bottom: 3.4%; left: 5%; display: flex; align-items: center; gap: 6px; color: rgba(255,255,255,.48); font-size: 6px; letter-spacing: .18em; }
.brand-watermark img { width: 22px; height: 22px; object-fit: contain; }
.tone-ink .brand-watermark { color: rgba(0,0,0,.48); }
.swipe-hint { position: absolute; right: 5%; bottom: 3.5%; color: rgba(255,255,255,.5); font-size: 6px; letter-spacing: .15em; }
.tone-ink .swipe-hint { color: rgba(0,0,0,.45); }
.card-nav { display: flex; align-items: center; gap: 16px; }
.card-nav[hidden] { display: none; }
.card-nav button { width: 31px; height: 31px; border-radius: 50%; border: 1px solid var(--line); background: #1d1d19; color: #cdb37f; cursor: pointer; }
.card-nav button:disabled { opacity: .3; cursor: default; }
.card-nav > div { min-width: 90px; text-align: center; }
.card-nav span { display: block; color: #9c998f; font-size: 9px; letter-spacing: .08em; }
.card-nav i { display: flex; justify-content: center; gap: 5px; margin-top: 5px; }
.card-nav i b { width: 5px; height: 5px; border-radius: 50%; background: #4b4942; }
.card-nav i b.active { background: #c8a96a; }
.stage-footer p { max-width: 54%; line-height: 1.5; letter-spacing: 0; margin: 0; }
.download-actions { display: flex; gap: 8px; }
.download { background: transparent; border: 1px solid rgba(200,169,106,.5); color: #d7bb82; padding: 10px 14px; border-radius: 3px; cursor: pointer; }
.download.primary { color: #17140e; background: #c3a461; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%,30px); opacity: 0; pointer-events: none; z-index: 30; background: #f0e8d7; color: #1b1812; padding: 11px 16px; border-radius: 4px; font-size: 12px; transition: .25s; box-shadow: 0 8px 30px #0008; }
.toast.show { opacity: 1; transform: translate(-50%,0); }
.history-overlay { position: fixed; inset: 0; z-index: 59; background: rgba(0,0,0,.62); backdrop-filter: blur(3px); }
.history-overlay[hidden] { display: none; }
.history-drawer { position: fixed; z-index: 60; top: 0; right: 0; width: min(420px, 92vw); height: 100vh; display: flex; flex-direction: column; background: #171714; border-left: 1px solid var(--line); box-shadow: -24px 0 80px #0008; transform: translateX(105%); transition: transform .28s ease; }
.history-drawer.open { transform: translateX(0); }
.history-drawer > header { padding: 26px 24px 20px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.history-drawer header p { margin: 0 0 6px; color: var(--gold); font-size: 9px; letter-spacing: .16em; }
.history-drawer h2 { margin: 0; font: 28px/1 Georgia, serif; }
.history-drawer header button { border: 0; background: transparent; color: #aaa69c; font-size: 28px; line-height: 1; cursor: pointer; }
.history-list { flex: 1; overflow: auto; padding: 12px; }
.history-empty { height: 100%; min-height: 240px; display: grid; place-items: center; text-align: center; color: #77746c; font-size: 12px; line-height: 1.7; }
.history-item { display: grid; grid-template-columns: 58px 1fr auto; gap: 12px; align-items: center; margin-bottom: 8px; padding: 11px; border: 1px solid var(--line); background: #1e1e1a; border-radius: 5px; }
.history-thumb { width: 58px; height: 72px; border-radius: 3px; display: grid; place-items: center; color: #dfc78e; font: 20px var(--font-urdu); background: radial-gradient(circle at 65% 20%,#887148,#24221b 55%,#111); }
.history-video-thumb{position:relative;overflow:hidden;padding:0;border:1px solid rgba(200,169,106,.35);cursor:pointer;background:#090a09}.history-video-thumb video{display:block;width:100%;height:100%;object-fit:cover}.history-video-thumb span{position:absolute;inset:0;display:grid;place-items:center;color:#fff;background:rgba(0,0,0,.22);font:15px/1 Inter,sans-serif;text-shadow:0 2px 8px #000}.video-history-item{border-color:rgba(127,162,135,.35)}
.history-copy { min-width: 0; }
.history-copy p { direction: rtl; margin: 0 0 7px; color: #e8e1d3; font: 12px/1.8 var(--font-urdu); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.history-copy span { color: #77746c; font-size: 9px; text-transform: capitalize; }
.history-actions { display: flex; flex-direction: column; gap: 5px; }
.history-actions button { border: 1px solid var(--line); background: transparent; color: #aaa69c; border-radius: 3px; padding: 6px 8px; cursor: pointer; font-size: 9px; }
.history-actions button.open-design { color: #d4b675; border-color: rgba(200,169,106,.4); }
.history-drawer > footer { padding: 15px 18px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; color: #6f6c64; font-size: 9px; }
.history-drawer footer button { border: 0; background: transparent; color: #a97770; cursor: pointer; font-size: 10px; }
.history-drawer footer a { color: #c6a767; text-decoration: none; }
.library-drawer { width: min(520px, 94vw); }
.collection-mode { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; margin: 18px 0 20px; padding: 5px; border: 1px solid var(--line); border-radius: 8px; background: #151512; }
.collection-mode button { min-width: 0; padding: 12px 10px 10px; border: 1px solid transparent; border-radius: 5px; background: transparent; color: #817e75; cursor: pointer; transition: background .18s, border-color .18s, color .18s, transform .18s; }
.collection-mode button:hover { color: #d9d0bf; transform: translateY(-1px); }
.collection-mode button.active { border-color: rgba(200,169,106,.48); background: linear-gradient(135deg,rgba(200,169,106,.16),rgba(200,169,106,.05)); color: #e4d6b7; box-shadow: inset 0 0 0 1px rgba(255,255,255,.025); }
.collection-mode span { display: block; direction: rtl; font: 16px/1.65 var(--font-urdu); }
.collection-mode small { display: block; margin-top: -2px; color: #77736a; font-size: 8px; }
.library-section-tabs { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 6px; padding: 10px 12px 0; background: #171714; }
.library-section-tabs[hidden] { display: none; }
.library-section-tabs button { min-width: 0; padding: 9px 7px 7px; border: 1px solid #34322c; border-radius: 5px; background: #1d1d19; color: #8c887f; cursor: pointer; }
.library-section-tabs button:hover { border-color: #5d523c; color: #d6c6a5; }
.library-section-tabs button.active { border-color: #a88c53; background: linear-gradient(145deg,#302a1d,#211f18); color: #e4d1a8; box-shadow: inset 0 0 0 1px #d6b56c18; }
.library-section-tabs span { display: block; direction: rtl; font: 12px/1.6 var(--font-urdu); }
.library-section-tabs small { display: block; color: #77736a; font-size: 7px; }
.library-tools { display: grid; grid-template-columns: minmax(0,1fr) 150px; gap: 8px; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); }
.library-tools input, .library-tools select { padding: 10px 11px; font-size: 11px; }
.library-tools span { grid-column: 1 / -1; color: #77746c; font-size: 9px; }
.library-list { flex: 1; min-height: 0; overflow: auto; padding: 10px 12px; }
.library-item { position: relative; margin-bottom: 9px; padding: 13px 13px 12px; border: 1px solid var(--line); border-radius: 5px; background: #1e1e1a; }
.library-item-head { display: flex; align-items: center; gap: 8px; padding-right: 34px; }
.library-number { color: #d1b16d; font-size: 9px; letter-spacing: .06em; }
.library-topic { min-width: 0; color: #aaa69d; font-size: 10px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.library-favorite { position: absolute; top: 9px; right: 9px; width: 27px; height: 27px; padding: 0; border: 0; background: transparent; color: #5f5c55; cursor: pointer; font-size: 16px; }
.library-favorite.active { color: #d1b16d; }
.library-quote { direction: rtl; margin: 8px 0 9px; color: #ece5d8; font: 13px/2 var(--font-urdu); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.library-item-actions { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.library-item-actions span { color: #68665f; font-size: 8px; }
.library-item-actions div { display: flex; gap: 6px; }
.library-item-actions button, .library-item-actions a { padding: 6px 9px; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: #928f86; cursor: pointer; font-size: 8px; text-decoration: none; }
.library-item-actions button { color: #1a1710; border-color: #c3a461; background: #c3a461; font-weight: 800; }
.library-more { flex: none; margin: 0 12px 10px; padding: 9px; border: 1px solid var(--line); border-radius: 4px; background: #201f1b; color: #c5a766; cursor: pointer; font-size: 9px; }
.library-empty { min-height: 240px; display: grid; place-items: center; padding: 30px; color: #77746c; text-align: center; font-size: 11px; line-height: 1.7; }
.sahifa-item .library-item-head { padding-right: 0; }
.sahifa-category { margin-inline-start: auto; padding: 3px 6px; border: 1px solid #39372f; border-radius: 10px; color: #77736a; font-size: 7px; white-space: nowrap; }
.sahifa-item .library-quote { -webkit-line-clamp: 2; font-size: 15px; color: #eee5d5; }
.sahifa-detail { flex: 1; min-height: 0; overflow: auto; padding: 12px; }
.sahifa-detail[hidden] { display: none; }
.sahifa-detail-head { position: sticky; top: -12px; z-index: 2; margin: -12px -12px 10px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); background: rgba(23,23,20,.96); backdrop-filter: blur(10px); }
.sahifa-back { padding: 0; border: 0; background: transparent; color: #bca064; cursor: pointer; font-size: 10px; }
.sahifa-detail h3 { direction: rtl; margin: 9px 0 2px; color: #eee4d1; font: 20px/1.8 var(--font-urdu); }
.sahifa-detail-head p { margin: 0; color: #77736a; font-size: 9px; }
.sahifa-text-mode { display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; gap: 10px; margin-top: 11px; color: #918c81; font-size: 9px; }
.sahifa-text-mode select { min-width: 0; padding: 8px 10px; direction: rtl; font: 11px/1.6 var(--font-urdu); }
.sahifa-batch-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin-top: 11px; }
.sahifa-batch-bar select { min-width: 0; padding: 8px; font-size: 9px; }
.sahifa-batch-bar button, .sahifa-use-selected { border: 1px solid #c3a461; border-radius: 4px; background: #c3a461; color: #17140e; cursor: pointer; font-size: 9px; font-weight: 800; }
.sahifa-paragraph { position: relative; display: block; width: 100%; min-width: 0; overflow: hidden; margin-bottom: 8px; padding: 12px 12px 10px 42px; border: 1px solid var(--line); border-radius: 5px; background: #1e1e1a; cursor: pointer; }
.sahifa-paragraph.selected { border-color: rgba(200,169,106,.55); background: #252219; }
.sahifa-paragraph input[type="checkbox"] { appearance: auto; position: absolute; top: 16px; left: 14px; width: 16px; height: 16px; margin: 0; padding: 0; border: 0; border-radius: 3px; background: transparent; box-shadow: none; accent-color: #c3a461; }
.sahifa-paragraph input[type="checkbox"]:focus { border: 0; box-shadow: 0 0 0 3px rgba(200,169,106,.14); }
.sahifa-paragraph .arabic { direction: rtl; max-width: 100%; margin: 0 0 7px; color: #b9ad94; font: 12px/1.9 var(--font-arabic); white-space: normal; overflow-wrap: anywhere; }
.sahifa-paragraph .urdu { direction: rtl; max-width: 100%; margin: 0; color: #ede5d8; font: 12px/2 var(--font-urdu); white-space: normal; overflow-wrap: anywhere; }
.quran-item .library-quote { display: flex; align-items: baseline; gap: 8px; font-size: 18px; }
.quran-item .library-quote small { direction: ltr; color: #77736a; font: 9px/1.4 sans-serif; }
.quran-ayah { padding-right: 44px; }
.quran-ayah .ayah-number { position: absolute; top: 13px; right: 12px; display: grid; place-items: center; width: 24px; height: 24px; border: 1px solid #79683f; border-radius: 50%; color: #c7a963; font: 9px/1 sans-serif; }
.quran-ayah .arabic { color: #e6dac0; font-size: 16px; line-height: 2.15; }
.quran-ayah > small { display: block; direction: rtl; margin-top: 8px; color: #6f6b62; font-size: 8px; }
.sahifa-detail h3 small { direction: ltr; color: #817c72; font: 9px/1.3 sans-serif; }
.sahifa-use-selected { position: sticky; bottom: 0; width: 100%; padding: 11px; box-shadow: 0 -14px 30px #171714; }
.sahifa-loading { min-height: 260px; display: grid; place-items: center; color: #88847b; text-align: center; line-height: 1.8; }

@media (max-width: 900px) {
  html, body { overflow-x: hidden; }
  .workspace { grid-template-columns: minmax(0, 1fr); height: auto; min-height: 0; overflow: visible; }
  .controls { height: auto; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); width: 100%; min-width: 0; max-width: 100%; }
  .stage { position: relative; top: auto; height: auto; min-height: 700px; overflow: visible; width: 100%; min-width: 0; max-width: 100%; }
  .intro, .field, .editor-panel, .poster-wrap { width: 100%; min-width: 0; max-width: 100%; }
  .poster, .ratio-1-1, .ratio-4-5 { width: min(100%, 475px); }
  .ratio-9-16 { width: min(100%, 360px); }
  input, textarea, select { max-width: 100%; }
  .two-col { grid-template-columns: 1fr; }
}
.preset-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.preset-actions .danger { grid-column: 1 / -1; color: #bf8179; border-color: rgba(191,129,121,.35); }
.preset-actions button:disabled { opacity: .38; cursor: not-allowed; }
.preset-status { display: block; margin-top: 9px; color: #77746c; font-size: 9px; line-height: 1.5; }
@media (max-width: 520px) {
  .topbar { padding: 0 14px; height: 56px; }
  .api-pill b { display: none; }
  .controls, .stage { padding-left: 14px; padding-right: 14px; }
  .style-grid { grid-template-columns: 1fr 1fr; }
  .poster-wrap { min-height: 380px; padding: 12px 0; }
  .history-trigger { padding: 7px 9px; font-size: 9px; }
  .history-trigger b { display: none; }
  .library-tools { grid-template-columns: 1fr; }
  .library-tools span { grid-column: auto; }
  .collection-mode { grid-template-columns: 1fr; }
  .intro h1 { font-size: clamp(26px, 8vw, 42px); }
  .stage-footer { flex-direction: column; gap: 10px; align-items: stretch; }
  .stage-footer p { max-width: 100%; text-align: center; }
  .download-actions { justify-content: center; }
}
.card-style-overrides{margin-top:14px;padding:13px;border:1px solid #ffffff16;border-radius:14px;background:#ffffff05}
.card-style-overrides .card-editor-head{margin-bottom:10px}
.card-style-fields{display:grid;gap:10px;transition:opacity .18s ease}
.card-style-fields.disabled{opacity:.42;pointer-events:none}
.card-color-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.card-color-grid .color-field{min-width:0}
@media(max-width:520px){.card-color-grid{grid-template-columns:1fr}}
.background-version-controls{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:7px;margin-top:10px}
.background-version-controls button{padding:8px 9px;border:1px solid var(--line);border-radius:3px;background:#24241f;color:#cdb174;cursor:pointer;font-size:8px;text-transform:uppercase;letter-spacing:.04em}
.background-version-controls button:disabled{opacity:.32;cursor:not-allowed}
.background-version-controls span{text-align:center;color:#aaa69d;font-size:9px;white-space:nowrap}
.video-modal{position:fixed;inset:0;z-index:80;display:grid;place-items:center;padding:2.5vh 2vw;opacity:0;transition:opacity .2s ease}.video-modal[hidden]{display:none}.video-modal.open{opacity:1}.video-modal-backdrop{position:absolute;inset:0;border:0;background:rgba(3,4,4,.78);backdrop-filter:blur(8px);cursor:default}.video-modal-dialog{position:relative;width:min(1500px,96vw);height:95vh;overflow:hidden;border:1px solid rgba(200,169,106,.28);border-radius:12px;background:#0e0f0e;box-shadow:0 35px 120px #000d;transform:translateY(14px) scale(.985);transition:transform .22s ease}.video-modal.open .video-modal-dialog{transform:none}.video-modal-dialog>header{height:62px;display:flex;align-items:center;justify-content:space-between;padding:10px 16px 10px 20px;border-bottom:1px solid var(--line);background:#141512}.video-modal-dialog header p{margin:0 0 2px;color:var(--gold);font-size:7px;letter-spacing:.18em}.video-modal-dialog h2{display:inline;margin:0;font:19px Georgia,serif}.video-modal-dialog header span{margin-left:10px;color:#77746c;font-size:8px}.video-modal-dialog header button{width:34px;height:34px;border:1px solid var(--line);border-radius:50%;background:#1c1d19;color:#c5bda9;cursor:pointer;font-size:22px;line-height:1}.video-modal iframe{display:block;width:100%;height:calc(100% - 62px);border:0;background:#0d0e0d}body.video-modal-open{overflow:hidden}@media(max-width:700px){.video-modal{padding:0}.video-modal-dialog{width:100vw;height:100vh;border:0;border-radius:0}.video-modal-dialog header span{display:none}}
.video-ready-dot{margin-left:auto;color:#87a98d;font-size:7px;letter-spacing:.12em}.video-editor-shell>p{margin:0 0 11px;color:#858078;font-size:9px;line-height:1.65}.video-editor-shell>iframe{display:none;width:100%;height:940px;border:1px solid var(--line);border-radius:7px;background:#0d0e0d}.video-editor-shell.ready>iframe{display:block}.video-editor-shell.ready>p,.video-editor-shell.ready>#prepareVideoEditor{display:none}.video-editor-panel[open]{overflow:visible}.video-editor-panel.stock-library-open{position:relative;z-index:95}.video-editor-panel.stock-library-open .video-editor-shell{position:fixed;inset:0;z-index:95;padding:3vh 3vw;background:rgba(3,4,4,.82);backdrop-filter:blur(8px)}.video-editor-panel.stock-library-open .video-editor-shell>iframe{display:block;width:min(1180px,94vw);height:94vh;margin:auto;border-color:rgba(200,169,106,.32);border-radius:12px;box-shadow:0 35px 120px #000d}body.stock-library-open{overflow:hidden}@media(max-width:700px){.video-editor-shell>iframe{height:820px}.video-editor-panel.stock-library-open .video-editor-shell{padding:0}.video-editor-panel.stock-library-open .video-editor-shell>iframe{width:100vw;height:100vh;border:0;border-radius:0}}
.motion-inline-controls{display:grid;gap:11px}.motion-inline-controls .section-title{margin:0}.motion-inline-controls #videoHookText{width:100%;padding:11px;border:1px solid var(--line);border-radius:4px;background:#1c1d1a;color:#eee5d2;font:17px/1.8 var(--font-urdu);text-align:right}.preview-tabs{display:flex;gap:4px;margin-left:auto}.preview-tabs button{padding:5px 11px;border:1px solid var(--line);border-radius:999px;background:#191a17;color:#858178;cursor:pointer;font-size:8px}.preview-tabs button.active{border-color:#c8a96a88;background:#c8a96a;color:#17140e}.motion-inline-preview{flex:1;min-height:520px;width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:20px 0}.motion-inline-preview[hidden]{display:none}.motion-inline-preview .phone-frame{height:min(68vh,650px)}.motion-inline-preview .stage-head,.motion-inline-preview .timeline,.motion-inline-preview .preview-meta{width:min(365px,100%)}.video-export{border-color:#7fa287;color:#b9d4bd}.video-export:disabled{opacity:.4;cursor:wait}.video-export-note{display:block;margin-top:7px;color:#6f716a;font-size:8px;text-align:right}.stage-footer:has(.video-export-note){align-items:flex-end}@media(max-width:520px){.preview-tabs{order:3;width:100%;justify-content:center}.motion-inline-preview .phone-frame{height:62vh}.video-export-note{width:100%;text-align:center}}

.stock-library-window>.stock-results{scrollbar-gutter:stable;scrollbar-width:thin;scrollbar-color:#c8a96a66 #171815}
.stock-load-more{flex:none;align-self:center;margin:0 18px 12px;padding:10px 24px;border:1px solid #c8a96a77;border-radius:999px;background:#211f19;color:#ddc17e;cursor:pointer;font-size:9px;letter-spacing:.08em;text-transform:uppercase}
.stock-load-more:disabled{opacity:.5;cursor:wait}

/* Mobile: ensure color picker is tappable */
@media (max-width: 768px) {
  .color-field input { width: 44px; height: 36px; }
}
/* Touch target accessibility */
@media (max-width: 900px) {
  button, .history-trigger, .upload-button, .file-action, .secondary-action {
    min-height: 44px;
    min-width: 44px;
  }
  .layer-actions button { min-width: 44px; min-height: 44px; padding: 8px; font-size: 16px; }
  input[type="range"] { min-height: 28px; }
  .editor-sidebar-tabs button { min-height: 44px; }
  .sticker-btn { min-height: 60px; }
  select { min-height: 40px; }
}
/* Mobile preview jump button */
.mobile-preview-jump {
  display: none;
  position: sticky; bottom: 16px; z-index: 30;
  margin: 16px auto; padding: 14px 28px;
  border: 1px solid #c8a96a; border-radius: 999px;
  background: #c8a96a; color: #17140e;
  font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.4);
  letter-spacing: .04em;
}
@media (max-width: 900px) {
  .mobile-preview-jump { display: block; }
}
