@font-face {
  font-family: VideoUI;
  src: url("/video-maker/fonts/noto-sans-arabic-400.woff2");
  font-display: swap;
}
@font-face {
  font-family: Nunito;
  src: url("/video-maker/fonts/nunito-latin.woff2");
  font-display: swap;
}
@font-face {
  font-family: VideoBengali;
  src: url("/video-maker/fonts/noto-sans-bengali-400.woff2");
  font-display: swap;
}
/* Semantic tokens mirror MaqamTokens and ReaderSky; reusable by future ports. */
:root {
  color-scheme: light;
  --paper: #f4fafd;
  --card: #fff;
  --surface-muted: #e6f7fe;
  --ink: #34495a;
  --muted: #526b7d;
  --line: #e2ebf1;
  --boundary: #93acbc;
  --sky: #5bc8f5;
  --sky-lip: #34a9dc;
  --on-sky: #0e3a52;
  --link: #08658c;
  --sun: #ffd25e;
  --mint: #63d6ae;
  --success: #196347;
  --success-soft: #e6f9f1;
  --rose: #a9362c;
  --rose-soft: #ffedea;
  --lavender: #b7a4ff;
  --stage: #e9f0f5;
  --radius-card: 24px;
  --radius-control: 12px;
  --space: 4px;
  scroll-padding-top: 24px;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0f1b24;
  --card: #172733;
  --surface-muted: #24394a;
  --ink: #eaf4fa;
  --muted: #b8ccd9;
  --line: #24394a;
  --boundary: #6f899c;
  --link: #a9e3fb;
  --success: #63d6ae;
  --success-soft: #163c32;
  --rose: #ff8e7f;
  --rose-soft: #442d31;
  --stage: #101e29;
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="system"] {
    color-scheme: dark;
    --paper: #0f1b24;
    --card: #172733;
    --surface-muted: #24394a;
    --ink: #eaf4fa;
    --muted: #b8ccd9;
    --line: #24394a;
    --boundary: #6f899c;
    --link: #a9e3fb;
    --success: #63d6ae;
    --success-soft: #163c32;
    --rose: #ff8e7f;
    --rose-soft: #442d31;
    --stage: #101e29;
  }
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font:
    15px/1.6 Nunito,
    VideoUI,
    system-ui,
    sans-serif;
}
html[lang="ar"] body,
html[lang="fa"] body,
html[lang="ur"] body {
  font-family: VideoUI, Nunito, system-ui, sans-serif;
}
html[lang="bn"] body {
  font-family: VideoBengali, Nunito, system-ui, sans-serif;
}
a {
  color: var(--link);
}
button,
input,
select,
.button {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.46;
}
button,
input,
select,
.button {
  min-height: 48px;
  border: 1px solid var(--boundary);
  border-radius: var(--radius-control);
  background: var(--card);
  color: var(--ink);
  padding: 10px 12px;
}
button:hover:not(:disabled),
summary:hover {
  border-color: var(--sky-lip);
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
canvas:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 4px;
}
input,
select {
  min-width: 0;
  max-width: 100%;
}
input[type="search"],
select {
  width: 100%;
}
input[type="search"]::placeholder {
  color: var(--muted);
  opacity: 1;
}
input[type="range"] {
  width: 100%;
  min-height: 28px;
  padding: 0;
  border: 0;
  accent-color: var(--link);
  background: transparent;
}
input[type="checkbox"] {
  width: 20px;
  height: 20px;
  min-height: 20px;
  flex: 0 0 auto;
  accent-color: var(--link);
  padding: 0;
}
input[type="color"] {
  width: 100%;
  height: 48px;
  padding: 5px;
}
label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 16px;
  font-size: 13px;
  font-weight: 700;
  min-width: 0;
}
output {
  font-variant-numeric: tabular-nums;
}
h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}
h1 {
  font-size: clamp(25px, 2.5vw, 36px);
  line-height: 1.3;
  margin: 4px 0 8px;
  letter-spacing: -0.02em;
}
h2 {
  font-size: 21px;
  line-height: 1.4;
  margin: 0;
}
h3 {
  font-size: 17px;
  margin: 0 0 16px;
}
.wrap {
  width: min(1400px, calc(100% - 64px));
  margin-inline: auto;
}
.editor-header {
  background: var(--card);
  border-bottom: 1px solid var(--line);
}
.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 84px;
  gap: 16px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}
.brand img {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 16px;
}
.header-tools {
  display: flex;
  align-items: center;
  gap: 16px;
}
.header-tools > label {
  font-size: 11px;
  margin: 0;
  gap: 1px;
}
.header-tools select {
  min-height: 36px;
  padding: 5px 10px;
  width: 112px;
  font-size: 13px;
}
.language-menu {
  position: relative;
  z-index: 20;
}
.language-menu summary {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  cursor: pointer;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  font-size: 14px;
  font-weight: 700;
}
.language-menu summary::-webkit-details-marker {
  display: none;
}
.language-menu nav {
  position: absolute;
  inset-inline-end: 0;
  top: calc(100% + 12px);
  width: 220px;
  max-height: 65vh;
  overflow: auto;
  background: var(--card);
  border: 1px solid var(--boundary);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 10px 0 #0e3a5209;
}
.language-menu nav a {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  min-height: 44px;
  text-decoration: none;
  border-radius: 8px;
  color: var(--ink);
}
.language-menu nav a:hover,
.language-menu nav a[aria-current] {
  background: var(--surface-muted);
}
.editor-main {
  padding-block: 28px 48px;
}
.workspace-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}
.eyebrow {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--link);
  margin: 0;
}
.intro-copy {
  color: var(--muted);
  margin: 0;
  font-size: 14px;
}
.privacy-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 310px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}
.privacy-pill > span {
  font-size: 20px;
  color: var(--link);
}
.workspace-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}
.wizard-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}
.wizard-nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  border-color: transparent;
  background: transparent;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 700;
}
.step-number {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--line);
  font-size: 12px;
}
.wizard-nav [aria-current="step"] {
  background: var(--surface-muted);
  color: var(--link);
}
.wizard-nav [aria-current="step"] .step-number {
  background: var(--sky);
  color: var(--on-sky);
}
.history-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.history-actions button {
  min-height: 40px;
  font-size: 12px;
  border-color: var(--line);
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.history-actions button span {
  font-size: 20px;
}
.studio {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.85fr);
  gap: 24px;
  align-items: start;
}
.control-deck,
.step-panel,
.card,
#settings,
.preview-pane {
  min-width: 0;
}
.project-brief {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  padding: 0 4px 16px;
}
.project-brief p {
  font-size: 13px;
  color: var(--muted);
  text-align: end;
  margin: 0;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 24px;
  margin-bottom: 16px;
}
.section-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.section-heading .eyebrow {
  margin-bottom: 2px;
}
.section-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 48px;
  border-radius: 14px;
  background: var(--surface-muted);
  color: var(--link);
  font-size: 14px;
  font-weight: 800;
  flex: 0 0 auto;
}
.section-icon.mint {
  background: #e6f9f1;
  color: #196347;
}
.section-icon.sun {
  background: #fff5d6;
  color: #71520b;
}
.pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.fine {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
}
.section-divider {
  height: 1px;
  background: var(--line);
  margin: 24px 0;
}
.selection-summary {
  display: block;
  background: var(--surface-muted);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  color: var(--link);
}
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 16px;
}
.segmented button {
  min-height: 40px;
  padding: 7px 12px;
  font-size: 12px;
  border-color: var(--line);
  background: var(--paper);
}
.segmented [aria-pressed="true"] {
  background: var(--surface-muted);
  border-color: var(--link);
  color: var(--link);
  font-weight: 800;
}
.secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: var(--surface-muted);
  color: var(--link);
  border-color: transparent;
  font-size: 13px;
  font-weight: 800;
}
.secondary-action > span {
  font-size: 20px;
}
.plain-fieldset {
  border: 0;
  margin: 0 0 20px;
  padding: 0;
  min-width: 0;
}
.plain-fieldset legend {
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 12px;
  padding: 0;
}
.visual-presets {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}
.visual-presets button {
  padding: 8px;
  border-color: var(--line);
  font-size: 12px;
  min-width: 0;
}
.visual-presets [aria-pressed="true"] {
  border: 2px solid var(--link);
  padding: 7px;
  background: var(--surface-muted);
}
.preset-art {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  height: 68px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #1b3a4b;
}
.preset-art i {
  display: block;
  width: 44%;
  height: 3px;
  border-radius: 3px;
  background: #f7fbff;
}
.preset-art i:nth-child(2) {
  width: 60%;
  height: 4px;
}
.preset-luminous {
  background: #d4e9d8;
}
.preset-luminous i {
  background: #294b3c;
}
.preset-quiet {
  background: #394964;
}
.preset-quiet i {
  background: #f1e8cf;
}
.library-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.library-heading label {
  margin: 0;
}
.library-heading label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.library-heading select {
  width: auto;
  min-width: 95px;
  min-height: 44px;
}
.library-heading output {
  font-size: 12px;
  color: var(--muted);
  text-align: end;
}
.check {
  flex-direction: row;
  align-items: center;
  gap: 9px;
  font-size: 13px;
  font-weight: 400;
  min-height: 32px;
}
.check span {
  flex: 1;
}
#backgrounds {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: max-content;
  max-height: 360px;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 3px;
  gap: 10px;
  margin-bottom: 16px;
}
#backgrounds[data-gallery-size="large"],
[data-gallery-size="large"] #backgrounds {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 560px;
}
#backgrounds[data-gallery-size="large"] .scene,
[data-gallery-size="large"] #backgrounds .scene {
  aspect-ratio: 1;
}
.scene-tile {
  position: relative;
  min-width: 0;
}
.scene {
  display: block;
  position: relative;
  width: 100%;
  aspect-ratio: 1.2;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 3px;
  overflow: hidden;
  background: #243d4b;
  min-height: 64px;
}
.scene img,
.scene-motion {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 7px;
}
.scene-motion {
  position: absolute;
  inset: 3px;
  width: calc(100% - 6px);
  height: calc(100% - 6px);
  pointer-events: none;
}
.scene[aria-pressed="true"] {
  border-color: var(--sky-lip);
  outline: 2px solid var(--card);
  outline-offset: -5px;
}
.scene > span {
  position: absolute;
  bottom: 7px;
  inset-inline-end: 7px;
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #0e3a52d9;
  color: #fff;
  font-size: 10px;
}
.scene-favorite {
  position: absolute;
  inset-block-start: 6px;
  inset-inline-start: 6px;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 0;
  width: 44px;
  height: 44px;
  min-height: 44px;
  border: 0;
  border-radius: 50%;
  background: #0e3a52dd;
  color: white;
  font-size: 19px;
}
.scene-favorite[aria-pressed="true"] {
  background: var(--sun);
  color: var(--on-sky);
}
.upload-disclosure {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}
.upload-disclosure summary {
  cursor: pointer;
  color: var(--link);
  font-size: 13px;
  font-weight: 800;
  padding-block: 6px;
}
.upload-disclosure[open] summary {
  margin-bottom: 14px;
}
.advanced-controls {
  border-block-start: 1px solid var(--line);
  margin-block: 8px 16px;
}
.advanced-controls > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  padding-block: 12px;
  cursor: pointer;
  list-style: none;
  color: var(--link);
  font-size: 13px;
  font-weight: 800;
}
.advanced-controls > summary::-webkit-details-marker {
  display: none;
}
.advanced-controls > summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--surface-muted);
  font-size: 18px;
}
.advanced-controls[open] > summary::after {
  content: "−";
}
.disclosure-content {
  padding-block: 4px 8px;
}
.disclosure-content > :last-child {
  margin-bottom: 0;
}
#upload {
  width: 100%;
  font-size: 12px;
}
.empty-state {
  padding: 16px;
  background: var(--paper);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
}
.size-controls {
  display: grid;
  gap: 4px;
  padding: 16px 0 4px;
}
.size-control {
  gap: 8px;
  padding-block: 4px;
}
.label-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.label-line output {
  direction: ltr;
  color: var(--link);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.coordinate-controls {
  padding-top: 8px;
}
.coordinate-controls label {
  font-size: 12px;
}
.step-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 4px;
}
.primary,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: var(--sky);
  color: var(--on-sky);
  border: 0;
  border-bottom: 4px solid var(--sky-lip);
  font-weight: 800;
  text-decoration: none;
  min-height: 50px;
  padding: 11px 20px;
  border-radius: 14px;
}
.primary:active:not(:disabled),
.button:active {
  border-bottom-width: 1px;
  transform: translateY(3px);
}
.export-review > p {
  color: var(--muted);
  font-size: 14px;
}
.export-facts {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 12px;
  margin-block: 24px;
}
.export-facts > div {
  padding: 16px;
  border-radius: 14px;
  background: var(--paper);
}
.export-facts span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}
.export-facts output {
  display: block;
  font-size: 15px;
  font-weight: 800;
}
.preview-pane {
  position: sticky;
  top: 20px;
  display: grid;
  justify-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  max-height: calc(100vh - 40px);
  overflow: auto;
}
.preview-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
}
.preview-heading h2 {
  font-size: 14px;
}
.preview-toolbar {
  width: 100%;
}
.preview-toolbar label {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12px;
  margin: 0;
}
.preview-toolbar select {
  width: auto;
  min-width: 100px;
  min-height: 44px;
}
.studio:has(.preview-expanded),
.studio:has(.preview-pane[data-preview-scale="large"]) {
  grid-template-columns: minmax(0, 1fr);
}
.preview-pane.preview-expanded,
.preview-pane[data-preview-scale="large"] {
  grid-column: 1 / -1;
  position: static;
  max-height: none;
  overflow: visible;
}
.preview-pane.preview-expanded .canvas-wrap,
.preview-pane.preview-expanded canvas,
.preview-pane[data-preview-scale="large"] .canvas-wrap,
.preview-pane[data-preview-scale="large"] canvas {
  max-height: 80vh;
  max-height: 80svh;
}
.state-pill {
  font-size: 10px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--link);
  text-align: center;
}
.state-pill[data-state="ready"],
.state-pill[data-state="complete"],
.state-pill[data-state="download"] {
  background: var(--success-soft);
  color: var(--success);
}
.state-pill[data-state="error"] {
  background: var(--rose-soft);
  color: var(--rose);
}
.canvas-wrap {
  position: relative;
  display: grid;
  place-items: center;
  width: fit-content;
  max-width: 100%;
  max-height: 53vh;
  margin: 0 auto;
  background: var(--stage);
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}
canvas {
  display: block;
  grid-area: 1/1;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 53vh;
  object-fit: contain;
  border-radius: 10px;
  touch-action: none;
}
#safe-area-overlay {
  position: absolute;
  inset: 15% 9% 13%;
  border: 1px dashed #ffffffc9;
  border-radius: 5px;
  pointer-events: none;
}
#safe-area-overlay span {
  display: none;
}
.preview-hint {
  max-width: 360px;
  text-align: center;
  margin: 0;
  font-size: 11px;
}
.timeline-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  gap: 16px;
  font-size: 12px;
  font-weight: 800;
}
.timeline-heading output {
  font-size: 10px;
  color: var(--muted);
  font-weight: 400;
  text-align: end;
}
.ayah-timeline {
  display: flex;
  width: 100%;
  gap: 5px;
  overflow-x: auto;
  overscroll-behavior: contain;
  padding: 2px 0 5px;
}
.timeline-ayah {
  min-width: 42px;
  min-height: 38px;
  border-color: var(--line);
  border-radius: 9px;
  padding: 5px 9px;
  background: var(--paper);
  font-size: 12px;
  white-space: nowrap;
}
.timeline-ayah[aria-current],
.timeline-ayah[aria-pressed="true"] {
  background: var(--surface-muted);
  color: var(--link);
  border-color: var(--sky-lip);
}
#export-state-help {
  margin: 0;
  text-align: center;
  font-size: 11px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  width: 100%;
}
.preview-actions > button {
  flex: 1;
  min-width: 100px;
  font-size: 12px;
  padding-inline: 10px;
}
.preview-actions #preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}
.export-progress {
  display: grid;
  gap: 6px;
  width: 100%;
  text-align: center;
}
.export-progress output {
  font-size: 12px;
}
.export-progress p {
  margin: 0;
}
.export-progress #export-progress-label {
  color: var(--link);
  font-weight: 800;
}
progress {
  width: 100%;
  height: 8px;
  accent-color: var(--sky);
  border: 0;
  border-radius: 99px;
  overflow: hidden;
}
progress::-webkit-progress-bar {
  background: var(--line);
}
progress::-webkit-progress-value {
  background: var(--sky);
}
#status {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}
#download {
  width: 100%;
}
#reciter-alternatives button {
  font-size: 12px;
  max-width: 100%;
}
#app-cta {
  width: 100%;
  border-top: 1px solid var(--line);
  padding-top: 16px;
  text-align: center;
  font-size: 13px;
}
#app-cta .button {
  margin: 4px;
  font-size: 12px;
}
.draft-status {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--success-soft);
  color: var(--success);
  font-size: 12px;
  margin: 0 0 20px;
}
.size-warning {
  padding: 14px 16px;
  border: 1px solid var(--boundary);
  border-inline-start: 4px solid var(--sun);
  border-radius: 12px;
  background: var(--surface-muted);
  color: var(--ink);
  margin: 0 0 16px;
  font-size: 13px;
  line-height: 1.7;
}
.export-dialog {
  width: min(480px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  max-height: calc(100svh - 48px);
  border: 1px solid var(--boundary);
  border-radius: var(--radius-card);
  padding: 24px;
  color: var(--ink);
  background: var(--card);
  overflow: auto;
}
.export-dialog::backdrop {
  background: #071b2aa6;
}
.export-dialog p {
  margin-block: 16px 24px;
  color: var(--muted);
}
.dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}
.dialog-actions button {
  flex: 1 1 180px;
}
.ayah-search-results {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  margin: -6px 0 16px;
  max-height: 240px;
  overflow: auto;
}
.ayah-search-results button {
  width: 100%;
  text-align: start;
  border: 0;
  min-height: 44px;
  font-size: 14px;
}
.ayah-search-results button:hover {
  background: var(--surface-muted);
}
.preview-jump {
  display: none;
}
.mobile-studio-tabs {
  display: none;
}
footer {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding: 24px;
}
footer a {
  text-decoration: none;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
[hidden] {
  display: none !important;
}
@media (min-width: 1500px) {
  .studio {
    grid-template-columns: minmax(0, 1fr) 480px;
    gap: 32px;
  }
  .control-deck {
    max-width: 860px;
  }
}
@media (max-width: 1050px) {
  .wrap {
    width: calc(100% - 40px);
  }
  .privacy-pill {
    display: none;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.8fr);
    gap: 18px;
  }
  .card {
    padding: 20px;
  }
  .workspace-toolbar {
    align-items: flex-start;
    gap: 12px;
  }
  .history-actions {
    justify-content: flex-end;
  }
  .wizard-nav {
    gap: 0;
  }
  .wizard-nav button {
    padding: 8px 10px;
  }
  .preview-pane {
    padding: 16px;
  }
  #backgrounds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .project-brief {
    display: block;
  }
  .project-brief p {
    text-align: start;
    margin-top: 4px;
  }
}
@media (max-width: 760px) {
  body {
    padding-bottom: 72px;
  }
  .wrap {
    width: calc(100% - 28px);
  }
  .header-row {
    min-height: 76px;
    gap: 12px;
  }
  .brand {
    font-size: 16px;
    gap: 8px;
  }
  .brand img {
    width: 40px;
    height: 40px;
    border-radius: 13px;
  }
  .header-tools {
    gap: 8px;
  }
  .header-tools select {
    width: 90px;
    font-size: 11px;
    min-height: 32px;
  }
  .header-tools > label {
    font-size: 10px;
  }
  .language-menu summary {
    font-size: 12px;
    gap: 5px;
    min-height: 40px;
    padding: 6px 8px;
  }
  .editor-main {
    padding-top: 20px;
  }
  .workspace-heading {
    margin-bottom: 20px;
  }
  .eyebrow {
    font-size: 10px;
  }
  h1 {
    font-size: 25px;
  }
  .intro-copy {
    font-size: 13px;
  }
  .workspace-toolbar {
    display: block;
    margin-bottom: 18px;
  }
  .wizard-nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    border-bottom: 1px solid var(--line);
    padding-bottom: 12px;
    margin-bottom: 12px;
  }
  .wizard-nav button {
    justify-content: center;
    padding: 6px;
    font-size: 12px;
    gap: 7px;
    min-width: 0;
    min-height: 44px;
  }
  .step-number {
    width: 23px;
    height: 23px;
    font-size: 11px;
  }
  .history-actions {
    gap: 6px;
  }
  .history-actions button {
    font-size: 11px;
    min-height: 36px;
    padding: 4px 8px;
  }
  .studio {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
  .project-brief {
    display: block;
  }
  .project-brief p {
    text-align: start;
  }
  .card {
    padding: 20px;
    border-radius: 20px;
  }
  .section-heading {
    margin-bottom: 20px;
  }
  h2 {
    font-size: 19px;
  }
  #backgrounds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 480px;
    max-height: min(64svh, 480px);
    gap: 12px;
    scroll-padding-block: 8px;
  }
  .scene {
    aspect-ratio: 3 / 4;
    border-radius: 14px;
  }
  #backgrounds[data-gallery-size="large"],
  [data-gallery-size="large"] #backgrounds {
    grid-template-columns: minmax(0, 1fr);
    max-height: 640px;
    max-height: min(76svh, 640px);
  }
  #backgrounds[data-gallery-size="large"] .scene,
  [data-gallery-size="large"] #backgrounds .scene {
    aspect-ratio: 3 / 4;
  }
  .library-heading {
    align-items: flex-end;
    gap: 8px;
  }
  .library-heading label {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    max-width: 65%;
  }
  .library-heading select {
    width: 100%;
  }
  .visual-presets {
    gap: 8px;
  }
  .preset-art {
    height: 38px;
    margin-bottom: 5px;
  }
  .segmented button {
    min-height: 44px;
  }
  input[type="range"] {
    min-height: 44px;
  }
  .check {
    min-height: 44px;
  }
  .advanced-controls > summary {
    font-size: 14px;
  }
  .preview-pane {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 18px;
    border-radius: 20px;
  }
  .canvas-wrap,
  canvas {
    max-height: 62vh;
  }
  .preview-pane .preview-hint {
    font-size: 12px;
  }
  .preview-heading h2 {
    font-size: 15px;
  }
  .state-pill {
    font-size: 11px;
  }
  .preview-jump {
    position: fixed;
    inset-block-end: 16px;
    inset-inline-end: 16px;
    z-index: 15;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 9px 18px;
    border-radius: 999px;
    background: var(--sky);
    border: 1px solid var(--sky-lip);
    border-bottom: 4px solid var(--sky-lip);
    color: var(--on-sky);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 4px 0 #0e3a5214;
  }
  .preview-jump span {
    font-size: 20px;
  }
  .step-actions {
    position: static;
  }
  .pair {
    gap: 12px;
  }
  .label-line {
    gap: 8px;
  }
  .label-line output {
    font-size: 11px;
  }
}
@media (max-width: 700px) {
  html[data-editor-step="design"] .mobile-studio-tabs {
    position: sticky;
    top: 0;
    z-index: 16;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    padding-block: 8px;
    margin-bottom: 12px;
    background: var(--paper);
  }
  .mobile-studio-tabs button {
    min-height: 48px;
    border-color: var(--line);
    font-size: 14px;
    font-weight: 800;
  }
  .mobile-studio-tabs button[aria-pressed="true"] {
    border-color: var(--link);
    background: var(--surface-muted);
    color: var(--link);
  }
  html[data-editor-step="passage"] .preview-pane,
  html[data-editor-step="design"][data-mobile-view="edit"] .preview-pane,
  html[data-editor-step="design"][data-mobile-view="preview"] .control-deck,
  html[data-editor-step="passage"] .preview-jump,
  html[data-editor-step="design"] .preview-jump {
    display: none;
  }
}
@media (max-width: 480px) {
  .header-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px 12px;
    padding-block: 10px;
  }
  .header-tools {
    display: contents;
  }
  .header-tools > label {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 12px;
  }
  .header-tools select {
    width: 130px;
    min-height: 44px;
    font-size: 13px;
  }
  .language-menu {
    grid-column: 2;
    grid-row: 1;
  }
  .language-menu summary {
    min-height: 44px;
  }
  .history-actions {
    justify-content: flex-start;
  }
  .history-actions button {
    min-height: 44px;
  }
  .workspace-heading .eyebrow {
    display: none;
  }
  .workspace-heading {
    margin-bottom: 16px;
  }
  .editor-main {
    padding-top: 16px;
  }
  .wizard-nav button {
    overflow-wrap: anywhere;
  }
}
@media (max-width: 380px) {
  .brand span {
    font-size: 14px;
  }
  .brand img {
    width: 34px;
    height: 34px;
  }
  .language-menu summary > span:first-child {
    display: none;
  }
  .wizard-nav button {
    font-size: 11px;
    gap: 5px;
  }
  .card {
    padding: 16px;
  }
  #backgrounds {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pair {
    gap: 10px;
  }
  .project-brief {
    display: block;
  }
  .project-brief p {
    text-align: start;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
    animation: none !important;
  }
  .scene-motion {
    display: none;
  }
}
