@font-face {
  font-family: Studio;
  src: local("SF Arabic"), local("Geeza Pro"), local("Arial");
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: #f7f6f2;
  color: #242824;
  font-family:
    Studio,
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 13px;
}
button,
input,
select {
  font: inherit;
}
button,
a,
input,
select,
summary {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  border: 1px solid transparent;
  background: transparent;
  border-radius: 8px;
  min-height: 36px;
  padding: 7px 12px;
  color: inherit;
}
button:hover {
  background: #eaece5;
}
button:disabled {
  opacity: 0.5;
  cursor: wait;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid #0a9690;
  outline-offset: 3px;
}
a {
  color: inherit;
}
button.primary {
  background: #a5f6e9;
  color: #25331a;
  font-weight: 700;
  border: 1px solid #c1dd86;
}
button.primary:hover {
  background: #77e9db;
}
button.outlined {
  border-color: #d8dcd1;
  background: #fff;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2 {
  font-size: 16px;
  font-weight: 650;
}
h3 {
  font-size: 14px;
}
.muted {
  color: #7b8278;
  line-height: 1.8;
  font-size: 12px;
}
.topbar {
  height: 78px;
  background: #fbfcf7;
  border-bottom: 1px solid #dfe3d9;
  padding: 0 25px;
  display: flex;
  align-items: center;
  gap: 35px;
}
.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  text-decoration: none;
  font-size: 23px;
  font-weight: 800;
}
.brand-mark {
  width: 37px;
  height: 41px;
  border-radius: 14px 4px 14px 4px;
  background: #283023;
  color: #daf29f;
  text-align: center;
  line-height: 39px;
  font-size: 29px;
}
.brand small {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #757c6e;
  line-height: 1.6;
}
.privacy {
  font-size: 11px;
  color: #727b6a;
  display: flex;
  gap: 7px;
  align-items: center;
}
.privacy i {
  width: 6px;
  height: 6px;
  background: #13afa9;
  border-radius: 50%;
}
.topbar nav {
  margin-inline-start: auto;
  display: flex;
  gap: 8px;
}
.topbar .primary {
  margin-inline-start: 8px;
  min-width: 140px;
}
.topbar .primary span {
  padding-inline-start: 20px;
}
.workspace {
  display: grid;
  grid-template-columns: 265px minmax(300px, 1fr) 265px;
  min-height: calc(100vh - 78px);
  align-items: start;
}
.library,
.properties {
  background: #fbfcf8;
  height: calc(100vh - 78px);
  overflow-y: auto;
  scrollbar-width: thin;
  position: sticky;
  top: 0;
}
.library {
  border-inline-end: 1px solid #dfe3d9;
  padding: 23px 16px 0;
  display: flex;
  flex-direction: column;
}
.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.count {
  font-family: system-ui;
  font-size: 11px;
  background: #e9eddf;
  color: #61704e;
  padding: 4px 8px;
  border-radius: 5px;
}
.intro {
  margin-bottom: 15px;
}
.library input[type="search"] {
  width: 100%;
  height: 37px;
  padding: 8px 10px;
  background: #f1f3ec;
  border: 1px solid #e2e6d9;
  border-radius: 8px;
  font-size: 11px;
}
.categories {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.categories button {
  font-size: 10px;
  min-height: 28px;
  padding: 4px 8px;
  border-radius: 5px;
}
.categories button.active {
  background: #283023;
  color: #fff;
}
.templates {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding-bottom: 20px;
  flex: 1;
}
.template {
  padding: 0;
  min-width: 0;
  background: #f1f1e9;
  border: 1px solid #e6e8dd;
  border-radius: 9px;
  text-align: right;
  overflow: hidden;
  position: relative;
  height: 110px;
}
.template.active {
  border: 2px solid #5f7d31;
}
.template canvas {
  width: 100%;
  height: 74px;
  display: block;
  object-fit: cover;
  pointer-events: none;
}
.template .template-label {
  display: block;
  font-size: 10px;
  padding: 7px 7px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  direction: ltr;
  text-align: left;
}
.template.active:after {
  content: "✓";
  position: absolute;
  top: 5px;
  right: 5px;
  background: #a5f6e9;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  text-align: center;
  line-height: 18px;
  font-size: 11px;
}
.template .variant {
  position: absolute;
  left: 4px;
  top: 4px;
  background: #fefdf9d9;
  font-size: 8px;
  padding: 1px 4px;
  border-radius: 3px;
}
.library-foot {
  padding: 12px 0;
  background: #fbfcf8;
  border-top: 1px solid #e5e7dc;
}
.library-foot button {
  padding: 0;
  font-size: 11px;
  min-height: 24px;
}
.library-foot small {
  display: block;
  color: #8b9184;
  font-size: 9px;
}
.editor {
  padding: 25px 26px;
  min-width: 0;
}
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 8px;
}
.eyebrow {
  color: #8c9384;
  display: block;
  font-size: 10px;
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}
.editor-toolbar h2 {
  font-size: 19px;
  direction: ltr;
  text-align: right;
}
.format-controls {
  display: flex;
  gap: 7px;
  align-items: center;
}
.format-controls select {
  background: #fff;
  border: 1px solid #dfe3d9;
  border-radius: 7px;
  padding: 8px 9px;
  font-size: 11px;
}
.format-controls button {
  border-color: #dfe3d9;
  background: #fff;
  font-family: system-ui;
  font-size: 11px;
}
.stage-wrap {
  background: #e8e8df;
  min-height: 240px;
  height: min(53vh, 570px);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  border: 1px solid #dce0d2;
  border-radius: 12px;
  overflow: hidden;
  padding: 14px;
  background-image:
    linear-gradient(45deg, #e1e4da 25%, transparent 25%),
    linear-gradient(-45deg, #e1e4da 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, #e1e4da 75%),
    linear-gradient(-45deg, transparent 75%, #e1e4da 75%);
  background-size: 20px 20px;
  background-position:
    0 0,
    0 10px,
    10px -10px,
    -10px 0;
}
#stage {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  box-shadow: 0 5px 30px #1e2f1612;
}
.stage-tag {
  position: absolute;
  left: 11px;
  bottom: 9px;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 8px;
  background: #fafbf4cf;
  color: #66715b;
}
.stage-tag span {
  font-family: system-ui;
}
.transport {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  border-bottom: 1px solid #e0e4d9;
  direction: ltr;
}
.transport button {
  padding: 5px 9px;
  min-height: 32px;
  min-width: 32px;
}
.transport .play {
  background: #263022;
  color: #fff;
  border-radius: 50%;
  height: 33px;
  width: 33px;
  font-size: 10px;
}
.time {
  font: 10px system-ui;
  color: #777e70;
  white-space: nowrap;
}
.transport input {
  flex: 1;
  min-width: 30px;
  accent-color: #526c32;
  height: 3px;
}
.transport #toggleDemo {
  font-size: 10px;
  direction: rtl;
  white-space: nowrap;
  color: #75806b;
}
.media-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 23px 0 13px;
  gap: 10px;
}
.media-heading h3 span {
  font: 10px system-ui;
  margin-inline-start: 5px;
  color: #8b9483;
}
.media-heading p {
  font-size: 10px;
  margin-top: 3px;
}
.media-heading button {
  font-size: 11px;
  white-space: nowrap;
}
.media-list {
  display: flex;
  gap: 9px;
  min-height: 94px;
  overflow-x: auto;
  padding-bottom: 7px;
}
.empty-media {
  width: 100%;
  border: 1px dashed #ccd3c0;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #71815c;
  font-size: 25px;
  min-height: 94px;
}
.empty-media span {
  font-size: 12px;
}
.empty-media small {
  display: block;
  color: #969f8b;
  font: 9px system-ui;
  margin-top: 5px;
}
.media-item {
  flex: 0 0 105px;
  position: relative;
  background: #e3e6dd;
  border-radius: 8px;
  overflow: hidden;
}
.media-item img,
.media-item video {
  height: 77px;
  width: 105px;
  object-fit: contain;
  display: block;
}
.media-item .media-name {
  font-size: 9px;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  padding: 4px 6px;
  max-width: 105px;
}
.media-item .remove-media {
  position: absolute;
  top: 3px;
  left: 3px;
  background: #ffffffe0;
  border-radius: 50%;
  min-height: 20px;
  width: 20px;
  padding: 0;
  font-size: 14px;
}
.media-item .move-media {
  position: absolute;
  top: 3px;
  right: 3px;
  background: #ffffffe0;
  min-height: 20px;
  padding: 0 4px;
  font: 10px system-ui;
}
.scene-note {
  font-size: 10px;
  color: #8c9582;
  margin-top: 13px;
  line-height: 1.9;
}
.properties {
  padding: 20px 18px;
  border-inline-start: 1px solid #dfe3d9;
}
.properties .panel-heading {
  margin-bottom: 13px;
}
.properties h2 {
  font-size: 14px;
}
.properties details {
  border-top: 1px solid #e7eadf;
  padding: 14px 0;
}
.properties summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 12px;
  list-style: none;
  display: flex;
  justify-content: space-between;
}
.properties summary:after {
  content: "+";
  font: 15px system-ui;
  color: #8b9482;
}
.properties details[open] summary:after {
  content: "−";
}
.control-body {
  padding-top: 17px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.range-label {
  font-size: 11px;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 9px;
  color: #626d56;
}
.range-label output {
  font: 10px system-ui;
  color: #778669;
  direction: ltr;
  background: #eff2e8;
  padding: 3px 5px;
  border-radius: 4px;
}
.range-label input {
  grid-column: 1/-1;
  width: 100%;
  height: 3px;
  accent-color: #13afa9;
  cursor: pointer;
  margin: 2px 0 3px;
}
.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 11px;
  color: #626d56;
}
.field input:not([type="color"]),
.field select {
  width: 100%;
  min-width: 0;
  background: #f3f5ee;
  border: 1px solid #e1e6d7;
  border-radius: 6px;
  padding: 8px;
  font-size: 11px;
  color: #3d4733;
}
.swatches {
  display: flex;
  gap: 7px;
}
.swatches button {
  border: 1px solid #d3d8c8;
  width: 25px;
  height: 25px;
  min-height: 25px;
  padding: 0;
  border-radius: 50%;
  background: var(--swatch);
}
.color-row {
  display: flex;
  justify-content: space-between;
}
.color-row label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  color: #78846b;
}
input[type="color"] {
  border: 1px solid #d9dfcd;
  background: transparent;
  padding: 2px;
  width: 35px;
  height: 28px;
  border-radius: 5px;
  cursor: pointer;
}
.check {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 7px;
}
.check input {
  accent-color: #13afa9;
}
dialog {
  border: 1px solid #dce2d0;
  border-radius: 15px;
  padding: 0;
  width: 430px;
  max-width: 94vw;
  color: #263022;
  background: #fafcf6;
  box-shadow: 0 25px 100px #15220b33;
}
dialog::backdrop {
  background: #16200f60;
  backdrop-filter: blur(4px);
}
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 0;
  padding: 23px 25px;
  border-bottom: 1px solid #e1e8d8;
}
.dialog-head button {
  font-size: 23px;
  padding: 1px 8px;
}
.dialog-content {
  padding: 20px 25px;
  display: flex;
  flex-direction: column;
  gap: 17px;
}
.notice {
  font-size: 10px;
  line-height: 1.9;
  color: #7c886c;
  background: #eff3e5;
  border-radius: 7px;
  padding: 10px;
}
.export-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.export-actions .primary {
  flex: 1;
}
progress {
  width: 100%;
  accent-color: #0a9690;
  height: 7px;
}
#exportStatus {
  font-size: 11px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}
#toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #263022;
  color: #f5ffe8;
  border: 1px solid #4b5e39;
  border-radius: 9px;
  padding: 12px 20px;
  font-size: 12px;
  box-shadow: 0 10px 40px #0002;
  opacity: 0;
  pointer-events: none;
  z-index: 10;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.15s;
}
#toast.visible {
  opacity: 1;
}
.coverage-content {
  line-height: 2;
  font-size: 12px;
}
body.busy .properties,
body.busy .library,
body.busy .format-controls,
body.busy .transport,
body.busy .media-heading,
body.busy .media-list {
  pointer-events: none;
  opacity: 0.65;
}
.drop-active:after {
  content: "أفلت ملفاتك لإضافتها";
  position: fixed;
  inset: 90px 20px 20px;
  background: #effbdfee;
  border: 2px dashed #94b95c;
  border-radius: 18px;
  z-index: 8;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #4d6b2a;
  pointer-events: none;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 300px minmax(300px, 1fr) 290px;
  }
  .templates {
    grid-template-columns: 1fr 1fr;
  }
  .template {
    height: 126px;
  }
  .template canvas {
    height: 90px;
  }
  .editor {
    padding: 30px 40px;
  }
  .stage-wrap {
    height: min(58vh, 720px);
  }
}
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 205px minmax(260px, 1fr) 230px;
  }
  .library {
    padding: 20px 10px 0;
  }
  .editor {
    padding: 22px 16px;
  }
  .topbar {
    padding: 0 18px;
    gap: 20px;
  }
  .properties {
    padding: 20px 12px;
  }
  .template {
    height: 96px;
  }
  .template canvas {
    height: 62px;
  }
  .template .template-label {
    font-size: 9px;
  }
  .format-controls {
    gap: 2px;
  }
  .editor-toolbar h2 {
    font-size: 16px;
  }
}
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 180px minmax(240px, 1fr);
  }
  .properties {
    grid-column: 1/-1;
    position: static;
    height: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 25px;
  }
  .properties .panel-heading {
    grid-column: 1/-1;
  }
  .library {
    height: calc(100vh - 78px);
  }
  .editor {
    padding: 20px 15px;
  }
  .privacy {
    display: none;
  }
  .topbar {
    gap: 10px;
  }
  .topbar nav {
    gap: 0;
  }
  .topbar button {
    font-size: 11px;
    padding: 6px 8px;
  }
  .topbar .primary {
    min-width: 115px;
  }
  .stage-wrap {
    height: 45vh;
  }
  .media-heading p {
    max-width: 230px;
  }
  .templates {
    gap: 6px;
  }
  .template {
    height: 85px;
  }
  .template canvas {
    height: 53px;
  }
  .template .template-label {
    font-size: 8px;
    padding: 7px 4px;
  }
}
@media (max-width: 580px) {
  .topbar {
    height: 68px;
    padding: 0 12px;
  }
  .brand {
    font-size: 20px;
  }
  .brand small {
    display: none;
  }
  .brand-mark {
    width: 31px;
    height: 34px;
    font-size: 24px;
    line-height: 31px;
  }
  .topbar nav button {
    font-size: 10px;
  }
  .topbar .primary {
    min-width: 95px;
    margin-inline-start: 4px;
  }
  .topbar .primary span {
    padding-inline-start: 4px;
  }
  .workspace {
    display: flex;
    flex-direction: column;
  }
  .editor {
    order: 0;
    width: 100%;
    padding: 20px 12px;
  }
  .stage-wrap {
    height: 36vh;
    min-height: 230px;
  }
  .editor-toolbar {
    margin-bottom: 13px;
  }
  .editor-toolbar h2 {
    font-size: 15px;
  }
  .format-controls select {
    font-size: 10px;
    padding: 7px 4px;
  }
  .format-controls button {
    font-size: 10px;
  }
  .library {
    order: 1;
    width: 100%;
    height: auto;
    max-height: 480px;
    position: static;
    border-top: 1px solid #dfe3d9;
    padding: 17px 13px 0;
  }
  .templates {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .template {
    height: 106px;
  }
  .template canvas {
    height: 73px;
  }
  .template .template-label {
    font-size: 9px;
  }
  .library-foot {
    padding: 9px 0;
  }
  .properties {
    order: 2;
    width: 100%;
    display: block;
    padding: 20px;
  }
  .media-heading {
    margin-top: 18px;
  }
  .media-heading p {
    font-size: 9px;
    max-width: 220px;
  }
  .transport {
    gap: 5px;
  }
  .time {
    font-size: 9px;
  }
  .media-list {
    min-height: 76px;
  }
  .empty-media {
    min-height: 76px;
  }
  .properties details {
    padding: 16px 0;
  }
  .control-body {
    gap: 20px;
  }
  .range-label input {
    height: 7px;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
  }
  #toast {
    transition: none;
  }
  dialog::backdrop {
    backdrop-filter: none;
  }
}
/* Bloop's observed library–canvas–inspector geometry, with original branding. */
body {
  background: #f7f8fb;
  color: #11131a;
  font-family:
    system-ui,
    -apple-system,
    "Arial",
    sans-serif;
}
.topbar {
  height: 48px;
  padding: 0 16px;
  background: #f7f8fb;
  border: 0;
  direction: ltr;
}
.brand {
  direction: rtl;
  font-size: 21px;
}
.brand-mark {
  background: #11131a;
  color: #fff;
  width: 26px;
  height: 29px;
  line-height: 26px;
  border-radius: 8px 3px;
  font-size: 22px;
}
.brand small {
  font-size: 9px;
}
.topbar nav {
  direction: rtl;
}
.privacy {
  direction: rtl;
  color: #5c7089;
}
.topbar button {
  min-height: 32px;
}
.topbar button.primary,
button.primary {
  background: #11131a;
  color: #fff;
  border-color: #11131a;
}
.topbar button.primary:hover,
button.primary:hover {
  background: #2b303b;
}
.workspace {
  direction: ltr;
  grid-template-columns: 220px minmax(300px, 1fr) 320px;
  min-height: calc(100vh - 48px);
  gap: 0;
}
.workspace > * {
  direction: rtl;
}
.library,
.properties {
  height: calc(100vh - 48px);
  background: #f7f8fb;
  border: 0;
  top: 0;
}
.library {
  padding: 16px 10px 0 16px;
}
.library h1 {
  font-size: 13px;
}
.library .intro {
  font-size: 10px;
  margin-bottom: 10px;
}
.library input[type="search"] {
  background: #fff;
  border-color: #e1e4eb;
  height: 34px;
  color: #5c7089;
}
.categories {
  gap: 2px;
  margin: 10px 0;
}
.categories button {
  font-size: 9px;
  border: 1px solid #e1e4eb;
  background: #fff;
  min-height: 26px;
}
.categories button.active {
  background: #edf0f5;
  color: #11131a;
  border-color: #aeb8c7;
}
.templates {
  grid-template-columns: 1fr;
  gap: 12px;
  display: grid;
  align-content: start;
  flex: none;
}
.template {
  height: 132px;
  border: 0;
  background: transparent;
  overflow: visible;
  border-radius: 8px;
}
.template:hover {
  background: transparent;
}
.template canvas {
  height: 99px;
  width: 100%;
  border: 1px solid #e1e4eb;
  border-radius: 8px;
  background: #fff;
}
.template .template-label {
  font-size: 12px;
  padding: 9px 0;
  color: #5c7089;
}
.template.active {
  border: 0;
}
.template.active canvas {
  border: 2px solid #13afa9;
}
.template.active:after {
  background: #13afa9;
  color: #fff;
}
.library-foot {
  background: #f7f8fb;
  border-color: #d9dee7;
  margin-top: 10px;
}
.editor {
  height: calc(100vh - 64px);
  min-height: 560px;
  margin: 8px 7px;
  padding: 35px 40px 30px;
  border-radius: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.editor-toolbar {
  justify-content: center;
  position: relative;
  margin-bottom: 16px;
  min-height: 42px;
}
.editor-toolbar > div:first-child {
  position: absolute;
  right: 0;
  top: -15px;
}
.editor-toolbar h2 {
  font-size: 11px;
  max-width: 160px;
  color: #5c7089;
}
.editor-toolbar .eyebrow {
  font-size: 8px;
  color: #8a98aa;
}
.format-controls select {
  border: 1px dashed #cbd2dd;
  background: #fff;
  color: #5c7089;
  font-size: 12px;
  padding: 8px 13px;
}
.format-controls button {
  position: absolute;
  left: 0;
  top: 0;
  background: #fff;
  color: #5c7089;
}
.stage-wrap {
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  min-height: 0;
  height: auto;
  flex: 1;
  overflow: hidden;
}
.stage-wrap canvas {
  border-radius: 14px;
  box-shadow: none;
  max-height: 100%;
  max-width: 100%;
  object-fit: contain;
}
.stage-tag {
  bottom: 12px;
  left: 12px;
  font-size: 8px;
  background: #fff9;
  color: #5c7089;
}
.transport {
  border: 0;
  margin-top: 28px;
  padding: 0;
  gap: 10px;
}
.transport .play {
  border: 1px solid #c8ced9;
  background: #f7f8fb;
  color: #11131a;
  border-radius: 7px;
  height: 32px;
  width: 32px;
}
.transport > button {
  border: 1px solid #c8ced9;
  border-radius: 7px;
  color: #11131a;
}
.transport #toggleDemo {
  border-color: #13afa9;
  color: #63972a;
}
.transport input {
  accent-color: #11131a;
}
.scene-note {
  font-size: 8px;
  color: #8c98aa;
  margin-top: 12px;
}
.properties {
  padding: 24px 16px 18px 10px;
}
.properties h2 {
  font-size: 13px;
}
.properties details {
  border-color: #cdd3dd;
  padding: 14px 0;
}
.properties summary {
  font-size: 13px;
  font-weight: 500;
}
.control-body {
  gap: 17px;
}
.range-label,
.field {
  font-size: 12px;
  color: #5c7089;
}
.range-label input {
  accent-color: #11131a;
}
.range-label output {
  background: #e9edf3;
  color: #5c7089;
}
.field input:not([type="color"]),
.field select {
  background: #fff;
  border-color: #dce1e9;
  color: #11131a;
  min-height: 34px;
}
.swatches button {
  border-color: #d1d7e0;
}
.media-heading {
  margin: 15px 0 8px;
  align-items: start;
}
.media-heading h3 {
  font-size: 13px;
  font-weight: 500;
}
.media-heading p {
  font-size: 11px;
  color: #5c7089;
  line-height: 1.6;
}
.media-heading button {
  font-size: 10px;
  min-height: 30px;
  padding: 4px 7px;
}
.properties .media-list {
  min-height: 65px;
  max-height: 130px;
  margin-bottom: 18px;
}
.empty-media {
  min-height: 65px;
  font-size: 11px;
  color: #71a538;
  border-color: #ced6df;
  background: #f2f4f8;
}
.empty-media span {
  font-size: 11px;
}
.empty-media small {
  font-size: 8px;
}
.media-item {
  flex-basis: 83px;
}
.media-item img,
.media-item video {
  width: 83px;
  height: 60px;
}
.media-item .media-name {
  max-width: 83px;
}
.count {
  background: #e9edf3;
  color: #5c7089;
}
.muted {
  color: #5c7089;
}
#sourceFilter {
  background: #fff;
  border: 1px solid #dce1e9;
  border-radius: 7px;
  font-size: 11px;
  color: #5c7089;
  min-height: 32px;
  width: 100%;
  margin-top: 8px;
  padding: 5px 8px;
}
dialog {
  background: #fff;
  border-color: #d9dfe8;
}
.notice {
  background: #f2f5fa;
  color: #5c7089;
}
#toast {
  background: #11131a;
  border-color: #242a36;
  color: #fff;
}
.control-body input[type="range"] {
  accent-color: #11131a;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 245px minmax(300px, 1fr) 340px;
  }
  .editor {
    padding: 36px 40px;
  }
  .template {
    height: 145px;
  }
  .template canvas {
    height: 110px;
  }
  .stage-wrap {
    height: auto;
  }
}
@media (max-width: 1120px) {
  .workspace {
    grid-template-columns: 185px minmax(260px, 1fr) 270px;
  }
  .library {
    padding: 16px 8px 0 12px;
  }
  .editor {
    padding: 26px 22px;
  }
  .properties {
    padding: 20px 12px 16px 8px;
  }
  .template {
    height: 115px;
  }
  .template canvas {
    height: 84px;
  }
  .template .template-label {
    font-size: 11px;
  }
  .editor-toolbar h2 {
    max-width: 100px;
  }
  .format-controls select {
    font-size: 11px;
    padding: 8px;
  }
  .editor-toolbar > div:first-child {
    top: -15px;
  }
}
@media (max-width: 850px) {
  .workspace {
    grid-template-columns: 165px minmax(230px, 1fr);
  }
  .editor {
    height: calc(100vh - 64px);
  }
  .properties {
    grid-column: 1/-1;
    height: auto;
    position: static;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0 22px;
    padding: 20px;
  }
  .properties .media-heading,
  .properties .media-list {
    grid-column: 1/-1;
  }
  .library {
    height: calc(100vh - 48px);
  }
  .template {
    height: 106px;
  }
  .template canvas {
    height: 77px;
  }
  .template .template-label {
    font-size: 10px;
  }
  .editor-toolbar > div:first-child {
    position: static;
  }
  .editor-toolbar {
    justify-content: space-between;
  }
  .format-controls button {
    position: static;
  }
  .editor-toolbar .eyebrow {
    display: none;
  }
  .editor-toolbar h2 {
    max-width: 130px;
  }
  .transport {
    gap: 6px;
  }
  .time {
    font-size: 9px;
  }
}
@media (max-width: 580px) {
  .topbar {
    height: 48px;
    padding: 0 10px;
  }
  .topbar .brand {
    font-size: 18px;
  }
  .topbar .primary {
    min-width: 90px;
  }
  .workspace {
    display: flex;
    gap: 0;
  }
  .editor {
    order: 0;
    width: calc(100% - 16px);
    margin: 8px;
    height: 59vh;
    min-height: 370px;
    padding: 16px;
  }
  .library {
    order: 1;
    width: 100%;
    height: auto;
    max-height: 510px;
    padding: 16px;
  }
  .properties {
    order: 2;
    display: block;
    width: 100%;
    height: auto;
    padding: 20px;
  }
  .templates {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
  .template {
    height: 99px;
  }
  .template canvas {
    height: 70px;
  }
  .template .template-label {
    font-size: 9px;
  }
  .library .intro {
    display: none;
  }
  .categories {
    margin: 8px 0;
  }
  .editor-toolbar {
    margin-bottom: 14px;
  }
  .stage-wrap {
    min-height: 0;
    height: auto;
  }
  .transport {
    margin-top: 16px;
  }
  .scene-note {
    font-size: 8px;
    line-height: 1.6;
  }
  .editor-toolbar h2 {
    font-size: 11px;
  }
  .format-controls select {
    font-size: 10px;
  }
  .format-controls button {
    font-size: 9px;
    padding: 5px 7px;
  }
  .properties .media-list {
    max-height: 140px;
  }
  .properties details {
    padding: 14px 0;
  }
}
/* Source-matched editor chrome; personal turquoise identity and original previews. */
.library > .panel-heading,
.library > .intro,
.properties > .panel-heading {
  display: none;
}
.library {
  padding-top: 16px;
}
.library-tabs {
  display: flex;
  direction: ltr;
  gap: 8px;
  margin-bottom: 8px;
  height: 32px;
  flex-shrink: 0;
}
.library-tabs button {
  border: 1px solid #dce1e8;
  border-radius: 8px;
  height: 32px;
  min-height: 32px;
  font-size: 12px;
  white-space: nowrap;
  color: #5c7089;
  padding: 5px 14px;
  flex: 1;
}
.library-tabs button.active {
  border-color: #bdc6d2;
  background: #eef1f6;
  color: #11131a;
}
.library input[type="search"] {
  margin-bottom: 16px;
  flex-shrink: 0;
}
.templates {
  gap: 12px;
}
.template-wrap {
  position: relative;
}
.template {
  width: 100%;
  height: 128px;
}
.template canvas {
  height: 96px;
  background: #fff;
}
.template .template-label {
  font-size: 12px;
  line-height: 20px;
  padding: 8px 0 4px;
}
.template.active:after {
  display: none;
}
.template.active canvas {
  border-color: #13afa9;
}
.favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 1;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  font: 21px system-ui;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  background: #fffc;
  color: #8695a5;
  line-height: 24px;
}
.favorite.selected {
  color: #0c918c;
  background: #e6faf6;
}
.template .variant {
  left: 8px;
  top: 8px;
  font-size: 8px;
  background: #fff9;
}
.properties {
  padding-top: 18px;
}
.properties .media-heading {
  display: flex;
  position: relative;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 12px;
  min-height: 83px;
}
.media-heading > div {
  width: 100%;
  padding-bottom: 12px;
}
.media-heading #addMedia {
  font-size: 0;
  width: 66px;
  height: 66px;
  border: 1px solid #d7dee8;
  background: #f1f3f7;
  margin-top: 0;
}
.media-heading #addMedia:after {
  content: "＋";
  font-size: 24px;
  color: #5c7089;
}
.media-heading h3 {
  font-weight: 500;
  font-size: 14px;
}
.media-heading h3 span {
  color: #11131a;
}
.media-heading p {
  font-size: 13px;
  padding-top: 6px;
  line-height: 1.6;
}
.demo-picker {
  font-size: 11px;
  color: #0c918c;
  border: 1px solid #c9e8e3;
  background: #effbf8;
  align-self: center;
  padding: 8px;
}
.properties .media-list {
  margin-bottom: 20px;
}
.media-list:has(.empty-media) {
  display: none;
}
.properties details {
  min-height: 44px;
  padding: 0;
  border-top: 1px solid #cdd3dd;
}
.properties summary {
  height: 44px;
  display: flex;
  align-items: center;
  font-weight: 500;
  font-size: 14px;
  direction: ltr;
  justify-content: flex-start;
  gap: 10px;
}
.properties summary:before {
  content: "◇";
  font-size: 18px;
  color: #688098;
  width: 18px;
  text-align: center;
}
.properties summary:after {
  content: "⌄";
  font-size: 14px;
  color: #688098;
  margin-left: auto;
}
.properties details[open] summary:after {
  content: "⌃";
}
.properties .control-body {
  padding: 8px 0 20px;
  gap: 18px;
  direction: rtl;
}
.inspector-export,
.inspector-reset {
  width: 100%;
  height: 40px;
  min-height: 40px;
  margin-top: 8px;
  font-size: 13px;
}
.inspector-export {
  margin-top: 20px;
}
.inspector-reset {
  border: 1px solid #dce1e8;
  background: #fff;
  color: #445064;
}
.properties input[type="range"],
.control-body input[type="range"] {
  accent-color: #10121a;
}
.brand-mark {
  background: #0c5d61;
  color: #a8fff0;
}
.privacy i {
  background: #13afa9;
}
.transport #toggleDemo {
  border-color: #10a9a3;
  color: #0b8c87;
}
.swatches button[data-bg="#d9e7d0"] {
  background: #97e6dc;
}
.template.active canvas {
  border-width: 1.5px;
}
.categories {
  direction: rtl;
  max-height: 60vh;
  overflow: auto;
  margin: 0;
  gap: 7px;
}
.categories button {
  font-size: 12px;
  min-height: 36px;
  white-space: normal;
}
.categories button.active {
  background: #0c5d61;
  color: #fff;
  border-color: #0c5d61;
}
.library-foot {
  font-size: 10px;
}
.library-foot small {
  display: none;
}
.stage-tag {
  display: none;
}
.scene-note {
  font-size: 9px;
  min-height: 15px;
  max-height: 30px;
  overflow: hidden;
}
.topbar nav {
  margin-left: auto;
  direction: ltr;
}
.topbar nav button {
  direction: rtl;
}
.topbar .privacy {
  margin-left: 12px;
}
.topbar .primary {
  margin-inline-start: 8px;
}
.topbar {
  gap: 18px;
}
.brand {
  direction: rtl;
}
.editor-toolbar h2 {
  font-size: 11px;
  font-weight: 500;
  color: #7c8b9e;
}
.transport .time {
  font-size: 11px;
  order: 4;
  margin-left: 10px;
}
.transport input {
  order: 3;
}
.transport #toggleDemo {
  order: 2;
  margin-right: 0;
}
.transport #restart {
  order: 0;
}
.transport #play {
  order: 1;
}
.editor {
  padding-bottom: 18px;
}
.transport {
  margin-top: 30px;
}
#sourceFilter {
  font-size: 13px;
  margin: 0;
  min-height: 38px;
}
.template-wrap:has(.template.active) .template-label {
  color: #0c918c;
}
.properties summary {
  font-family: system-ui, "Arial", sans-serif;
}
.library-tabs {
  margin-top: 0;
}
.library-foot {
  margin-top: 12px;
}
.media-item .remove-media:hover {
  background: #f5fff9;
}
.range-label output {
  background: #edf2f7;
}
.swatches button:nth-child(3) {
  background: #9ce3d8;
}
.swatches button:nth-child(4) {
  background: #0c5d61;
}
@media (max-width: 850px) {
  .properties {
    display: block;
    max-width: 100%;
    padding: 20px;
  }
  .properties details {
    width: 100%;
  }
  .properties .media-heading > div {
    width: 100%;
  }
  .properties .media-heading {
    min-height: 70px;
  }
  .library-tabs button {
    font-size: 10px;
    padding: 5px 8px;
  }
  .template {
    height: 113px;
  }
  .template canvas {
    height: 81px;
  }
  .template .template-label {
    font-size: 10px;
  }
  .topbar nav {
    gap: 0;
  }
  .topbar .privacy {
    display: none;
  }
  .editor {
    padding-bottom: 16px;
  }
  .scene-note {
    font-size: 8px;
  }
}
@media (max-width: 580px) {
  .library {
    padding-top: 12px;
  }
  .library-tabs {
    max-width: 220px;
  }
  .library input[type="search"] {
    margin-bottom: 12px;
  }
  .template {
    height: 100px;
  }
  .template canvas {
    height: 70px;
  }
  .template .template-label {
    font-size: 9px;
    padding-top: 5px;
  }
  .favorite {
    width: 23px;
    height: 23px;
    min-height: 23px;
    font-size: 17px;
    top: 4px;
    right: 4px;
    border-radius: 6px;
  }
  .topbar {
    gap: 8px;
  }
  .topbar nav button {
    font-size: 9px;
    padding: 5px;
  }
  .topbar .primary {
    min-width: 85px;
  }
  .topbar .brand {
    font-size: 17px;
  }
  .transport .time {
    font-size: 8px;
    margin-left: 0;
  }
  .transport {
    gap: 5px;
  }
  .scene-note {
    display: none;
  }
  .media-heading p {
    max-width: none;
  }
  .properties summary {
    font-size: 13px;
  }
  .library-foot {
    display: none;
  }
  .categories button {
    font-size: 11px;
  }
  .template .variant {
    font-size: 7px;
    left: 4px;
    top: 4px;
  }
}
.stage-wrap[data-loading]:after {
  content: "جارٍ تجهيز الحركة…";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: #ffffffed;
  color: #526980;
  font-size: 12px;
  box-shadow: 0 4px 20px #0000000a;
}
.stage-wrap[data-loading] canvas {
  opacity: 0.45;
}
@media (min-width: 1600px) {
  .workspace {
    grid-template-columns: 220px minmax(300px, 1fr) 320px;
  }
}
.library-tabs #allTemplates {
  flex: 0 0 56px;
}
.library-tabs #favoriteTemplates {
  flex: 1;
}
.brand > span:last-child {
  display: block;
  color: #11131a;
  font-size: 20px;
  font-weight: 700;
}
.brand small {
  display: none;
}
@media (min-width: 851px) {
  .stage-wrap {
    transform: translateY(10px);
  }
}
.source-locked {
  opacity: 0.5;
}
.source-locked input,
.source-locked select {
  cursor: not-allowed;
}
.stage-wrap[data-render-error]:after {
  content: attr(data-render-error);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(80%, 420px);
  padding: 15px 20px;
  border: 1px solid #dce2e8;
  border-radius: 8px;
  background: #ffffffed;
  color: #526980;
  font-size: 12px;
  text-align: center;
  line-height: 1.9;
}
.stage-wrap[data-render-error] canvas {
  opacity: 0.25;
}

/* Editor review: inline library tools, grouped inspector and adjacent media. */
:root {
  --surface: #fff;
  --workspace: #f7f8fb;
  --ink: #11131a;
  --muted: #5c7089;
  --line: #dce1e8;
  --accent: #0c5d61;
  --accent-soft: #effbf8;
}
body { font-family: Arial, system-ui, sans-serif; font-size: 14px; color: var(--ink); }
button, input, select, summary { font-family: inherit; }
button { min-height: 36px; }
.topbar { height: 64px; padding: 0 24px; border-bottom: 1px solid var(--line); background: var(--surface); }
.brand { gap: 10px; font-size: 24px; }
.brand-mark { width: 32px; height: 34px; line-height: 32px; font-size: 25px; }
.brand small { display: block; font-size: 11px; color: var(--muted); }
.topbar nav { gap: 8px; }
.topbar nav button { font-size: 13px; padding: 8px 14px; }
.topbar .privacy { font-size: 12px; }
button.primary, .topbar button.primary { background: var(--accent); border-color: var(--accent); }
button.primary:hover, .topbar button.primary:hover { background: #0c918c; }
.workspace { grid-template-columns: 300px minmax(280px, 1fr) 300px; min-height: calc(100vh - 64px); }
.library, .properties { height: calc(100vh - 64px); padding: 22px 18px; top: 0; }
.library { background: var(--surface); border-right: 1px solid var(--line); }
.library > .panel-heading, .properties > .panel-heading { display: flex; margin-bottom: 18px; }
.library h1, .properties h2 { font-size: 17px; font-weight: 700; }
.count { font-size: 12px; padding: 4px 8px; }
.library > .intro { display: none; }
.library-tabs { height: 36px; margin-bottom: 12px; gap: 4px; background: var(--workspace); border-radius: 8px; padding: 3px; }
.library-tabs button { border: 0; height: 30px; min-height: 30px; font-size: 13px; border-radius: 6px; padding: 4px; }
.library-tabs button.active { background: var(--surface); box-shadow: 0 1px 3px #11131a12; color: var(--accent); }
.library input[type="search"] { height: 40px; font-size: 13px; margin-bottom: 8px; background: var(--workspace); }
#openFilters { border: 1px solid var(--line); background: var(--surface); text-align: right; font-size: 12px; margin-bottom: 14px; color: var(--muted); }
#openFilters:after { content: "⌄"; float: left; }
.library-filters { flex-shrink: 0; }
.library-filters > summary { display: none; }
.library-filters .dialog-content { padding: 0 0 16px; gap: 10px; }
#sourceFilter { font-size: 13px; min-height: 38px; }
.categories { max-height: 190px; gap: 6px; }
.categories button { min-height: 32px; font-size: 11px; padding: 5px 8px; }
.templates { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 10px; }
.template { height: auto; min-height: 100px; }
.template canvas { width: 100%; height: auto; aspect-ratio: 16/10; border-radius: 8px; }
.template .template-label { font: 12px/1.5 Arial, sans-serif; padding: 7px 1px 0; color: var(--muted); }
.template.active canvas { border: 2px solid #13afa9; }
.favorite { top: 5px; right: 5px; width: 28px; height: 28px; min-height: 28px; font-size: 18px; background: #fffffff0; }
.template .variant { left: 4px; top: 5px; font-size: 8px; max-width: 65%; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.library-foot { margin-top: 22px; padding-top: 14px; background: var(--surface); }
.library-foot button { font-size: 12px; }
.editor { margin: 0; border-radius: 0; background: var(--workspace); height: calc(100vh - 64px); min-height: 650px; padding: 22px 28px 16px; }
.editor-toolbar { flex-shrink: 0; min-height: 44px; margin-bottom: 20px; justify-content: space-between; gap: 12px; }
.editor-toolbar > div:first-child { position: static; min-width: 0; }
.editor-toolbar h2 { font: 600 16px/1.5 Arial, sans-serif; max-width: 250px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.editor-toolbar .eyebrow { display: block; font-size: 11px; margin-bottom: 3px; }
.format-controls { gap: 8px; flex-shrink: 0; }
.format-controls select, .format-controls button { position: static; font-size: 12px; border: 1px solid var(--line); min-height: 36px; border-radius: 7px; padding: 6px 9px; }
.stage-wrap { min-height: 160px; flex: 1; padding: 12px 0; }
.stage-wrap canvas { border-radius: 10px; }
.transport { margin-top: 16px; gap: 8px; padding: 0 0 18px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.transport > button, .transport .play { height: 36px; min-height: 36px; min-width: 36px; }
.transport .play { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.transport #toggleDemo { font-size: 11px; min-width: 72px; background: var(--surface); }
.transport .time { margin-left: 4px; font-size: 11px; }
.transport input { accent-color: var(--accent); }
.editor .media-heading { margin: 18px 0 12px; min-height: 0; align-items: center; flex-wrap: wrap; flex-shrink: 0; gap: 8px; }
.editor .media-heading > div { width: auto; padding: 0; flex: 1; min-width: 150px; }
.media-heading h3 { font-size: 14px; font-weight: 700; }
.media-heading p { padding-top: 4px; font-size: 12px; max-width: none; }
.media-heading #addMedia { width: auto; height: 36px; font-size: 12px; min-height: 36px; padding: 6px 12px; background: var(--surface); color: var(--ink); }
.media-heading #addMedia:after { display: none; }
.demo-picker { font-size: 11px; min-height: 36px; padding: 6px 10px; }
.editor .media-list { display: flex; flex-shrink: 0; min-height: 78px; max-height: 92px; padding-bottom: 4px; }
.editor .media-list:has(.empty-media) { display: flex; }
.empty-media { min-height: 76px; background: var(--surface); color: var(--muted); border-color: #c8ced9; gap: 10px; }
.empty-media span { font-size: 13px; }
.empty-media small { font-size: 10px; margin-top: 4px; }
.media-item { flex-basis: 90px; background: var(--surface); }
.media-item img,.media-item video { width: 90px; height: 55px; }
.media-item .media-name { max-width: 90px; font-size: 10px; }
.scene-note { font-size: 11px; line-height: 1.6; max-height: none; overflow: visible; margin-top: 10px; flex-shrink: 0; color: var(--muted); }
.properties { background: var(--surface); border-left: 1px solid var(--line); }
.properties .panel-heading #resetSettings { width: auto; margin: 0; height: 30px; min-height: 30px; font-size: 11px; padding: 5px 7px; }
.properties summary { direction: rtl; font-family: inherit; height: 48px; font-weight: 600; font-size: 14px; gap: 0; }
.properties summary:before { display: none; }
.properties summary:after { margin-left: 0; margin-inline-start: auto; color: var(--muted); }
.properties details { border-color: var(--line); }
.properties .control-body { gap: 18px; padding: 6px 0 22px; }
.range-label,.field { font-size: 13px; color: var(--muted); }
.range-label output { font-size: 11px; color: var(--ink); }
.field select,.field input:not([type="color"]) { font-size: 12px; min-height: 36px; background: var(--workspace); }
.properties input[type="range"], .control-body input[type="range"] { accent-color: var(--accent); height: 5px; }
.inspector-export { margin-top: 22px; }
.inspector-reset { margin-top: 8px; }
@media (min-width:1600px) {
 .workspace { grid-template-columns: 330px minmax(300px,1fr) 320px; }
 .editor { padding: 28px 40px 20px; }
}
@media (max-width:1200px) and (min-width:851px) {
 .workspace { grid-template-columns: 250px minmax(260px,1fr) 260px; }
 .library,.properties { padding: 20px 14px; }
 .editor { padding: 20px 18px 16px; }
 .editor-toolbar { flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
 .editor-toolbar h2 { font-size: 14px; }
 .format-controls { margin-inline-start: auto; }
 .media-heading p { display: none; }
}
@media (max-width:850px) {
 .workspace { grid-template-columns: 250px minmax(0,1fr); }
 .library { height: calc(100vh - 64px); padding: 20px 14px; }
 .editor { height: calc(100vh - 64px); min-height: 700px; padding: 20px; }
 .editor-toolbar { flex-wrap: wrap; }
 .editor-toolbar h2 { max-width: 210px; }
 .format-controls { margin-inline-start: auto; }
 .properties { height: auto; display: block; padding: 24px; border-top: 1px solid var(--line); }
 .properties > .panel-heading { display: flex; }
 .properties details { width: 100%; }
 .topbar { padding: 0 16px; }
 .topbar .privacy { display: none; }
 .media-heading p { display: none; }
}
@media (max-width:580px) {
 .topbar { height: 60px; padding: 0 12px; gap: 8px; }
 .brand { font-size: 21px; }
 .brand small { display: none; }
 .brand-mark { width: 26px; height: 29px; line-height: 27px; font-size: 22px; }
 .topbar nav { gap: 2px; }
 .topbar nav button { font-size: 11px; padding: 6px; min-height: 36px; }
 .topbar .primary { min-width: 90px; margin: 0; }
 .topbar .primary span { padding: 0; }
 .workspace { display: flex; }
 .editor { width: 100%; margin: 0; padding: 18px 16px; height: 690px; min-height: 0; order: 0; }
 .editor-toolbar { margin-bottom: 12px; }
 .editor-toolbar h2 { font-size: 15px; max-width: 180px; }
 .editor-toolbar .eyebrow { font-size: 10px; }
 .format-controls select,.format-controls button { font-size: 11px; padding: 5px 7px; }
 .stage-wrap { min-height: 140px; }
 .transport { margin-top: 12px; gap: 5px; }
 .transport .time { font-size: 10px; margin-left: 0; }
 .transport #toggleDemo { min-width: 60px; font-size: 10px; padding: 4px; }
 .editor .media-heading > div { min-width: 90px; }
 .editor .media-heading { margin-top: 14px; }
 .media-heading #addMedia { padding: 5px 8px; }
 .demo-picker { padding: 5px 7px; font-size: 10px; }
 .scene-note { font-size: 10px; }
 .library { width: 100%; height: auto; max-height: 620px; padding: 22px 16px; border-top: 1px solid var(--line); }
 .library-tabs { max-width: none; }
 .templates { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; }
 .template { height: auto; }
 .template canvas { height: auto; }
 .template .template-label { font-size: 12px; }
 .properties { padding: 22px 16px; }
 .properties summary { min-height: 48px; }
}

/* Owner typography and surface rules: filled or outlined, never both. */
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('assets/fonts/IBMPlexSansArabic-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('assets/fonts/IBMPlexSansArabic-Medium.ttf') format('truetype'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('assets/fonts/IBMPlexSansArabic-SemiBold.ttf') format('truetype'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'IBM Plex Sans Arabic'; src: url('assets/fonts/IBMPlexSansArabic-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
body, button, input, select, summary, output,
.editor-toolbar h2, .template .template-label, .properties summary,
.time, .transport .time, .media-heading h3 span, .count {
  font-family: 'IBM Plex Sans Arabic', sans-serif;
}
body { line-height: 1.65; }
.brand { font-weight: 600; font-size: 26px; }
.brand small { font-weight: 400; font-size: 10px; }
.brand-mark { display: none; }
.topbar { border-bottom: 0; }
.library,.properties { border: 0; }
.template canvas { border: 0; border-radius: 20px; }
.template.active canvas { border: 0; }
.template-wrap:has(.template.active) .template-label { color: var(--accent); font-weight: 600; }
.template .template-label { padding: 9px 3px 0; }
.template .variant { border: 0; background: #fffffff0; border-radius: 6px; }
.favorite { border: 0; background: #fffffff0; border-radius: 10px; }
.favorite.selected { border: 0; background: #e6faf6; }
button.primary, .topbar button.primary { border: 0; border-radius: 12px; }
button.outlined, .media-heading #addMedia { background: transparent; border: 1px solid #c8ced9; border-radius: 10px; }
button.outlined:hover,.media-heading #addMedia:hover { background: transparent; border-color: var(--accent); }
.library input[type='search'], #sourceFilter,
.field select, .field input:not([type='color']),
.format-controls select { background: #eef1f5; border: 0; border-radius: 10px; }
.library input[type='search'] { height: 42px; }
#openFilters { border: 0; background: #eef1f5; border-radius: 10px; min-height: 38px; }
.library-tabs { background: #eef1f5; border: 0; padding: 3px; height: 38px; border-radius: 10px; }
.library-tabs button { height: 32px; min-height: 32px; }
.library-tabs button.active { background: #fff; border: 0; box-shadow: none; border-radius: 8px; }
.categories button { background: #eef1f5; border: 0; border-radius: 8px; }
.categories button.active { background: var(--accent); border: 0; }
.format-controls button, .transport > button { background: transparent; border: 1px solid #c8ced9; border-radius: 10px; }
.format-controls button:hover, .transport > button:hover { background: transparent; border-color: var(--accent); }
.transport .play { background: var(--ink); border: 0; color: #fff; border-radius: 10px; }
.transport .play:hover { background: #2b303b; border: 0; }
.transport #toggleDemo { background: transparent; border: 1px solid #10a9a3; }
.demo-picker { border: 0; background: var(--accent-soft); border-radius: 10px; }
.empty-media { background: transparent; border: 1px dashed #c8ced9; border-radius: 18px; }
.media-item { border: 0; border-radius: 16px; }
.media-item .remove-media,.media-item .move-media { border: 0; }
.stage-wrap canvas { border-radius: 20px; }
.inspector-reset { background: transparent; border: 1px solid #c8ced9; border-radius: 12px; }
.inspector-reset:hover { background: transparent; border-color: var(--accent); }
dialog { border: 0; border-radius: 20px; }
.dialog-head button { border: 0; background: transparent; }
.count, .range-label output { border: 0; background: #eef1f5; border-radius: 6px; }
input[type='color'] { border: 0; background: transparent; padding: 0; }
.swatches button { border: 0; }
#toast { border: 0; border-radius: 12px; }
.properties .control-body { gap: 18px; }
.properties .field select { min-height: 40px; }
.editor-toolbar h2 { font-size: 16px; line-height: 1.65; }
@media (max-width:580px) {
 .brand { font-size: 23px; }
 .topbar nav button { font-size: 10px; }
 .template canvas { border-radius: 18px; }
 .template .template-label { font-size: 11px; }
}
.properties > .field { margin-bottom: 20px; }

/* Owner-selected soft gray palette. */
:root{--accent:#199f98;--accent-soft:#eeeeee;--workspace:#f5f5f5;--surface:#ffffff;--muted:#666666;--line:#dedede;--ink:#222222}
body{background:#f5f5f5;color:#222}.topbar,.library,.properties{background:#ffffff}.editor{background:#f5f5f5}button.primary,.topbar button.primary{background:#199f98;color:#082b29;border:0}button.primary:hover,.topbar button.primary:hover{background:#199f98;filter:brightness(.94)}
.library input[type=search],#openFilters,#sourceFilter,.field select,.field input:not([type=color]),.format-controls select,.library-tabs{background:#eeeeee;border:0;color:#383838}.library-tabs button.active{background:#ffffff;color:#222}.categories button{background:#eeeeee;border:0;color:#444}.categories button.active{background:#199f98;color:#082b29;border:0}
.template canvas{border:0;border-radius:28px}.template.active canvas{border:0}.template-wrap:has(.template.active) .template-label{color:#222}.template .template-label{color:#666666}.template .variant,.favorite{background:rgba(255,255,255,.94);border:0;color:#676767}.favorite.selected{background:#eeeeee;color:#222}
.stage-wrap canvas{border-radius:24px}.media-item{border-radius:18px}.empty-media{border-radius:18px;background:transparent;border-color:#c9c9c9;color:#666666}.demo-picker{background:#eeeeee;border:0;color:#444}.demo-picker:hover{background:#eeeeee;filter:brightness(.96)}.count,.range-label output,.notice{background:#eeeeee;color:#555;border:0}.muted,.field,.range-label,.eyebrow,.editor-toolbar .eyebrow,.scene-note,.privacy,.media-heading p,.transport .time,.library-tabs button,.properties summary:after{color:#666666}
button.outlined,.media-heading #addMedia,.format-controls button,.transport > button,.transport #toggleDemo,.inspector-reset{background:transparent;border-color:#c9c9c9;color:#444}.transport .play{background:#252525;color:#fff;border:0}.transport .play:hover{background:#333}.properties input[type=range],.control-body input[type=range],.transport input,progress,.check input{accent-color:#199f98}.privacy i{background:#199f98}dialog{background:#ffffff;border:0}dialog::backdrop{background:rgba(0,0,0,.35)}.drop-active:after{background:rgba(255,255,255,.95);border:0;color:#444}.source-locked{opacity:1;color:#888}button.primary:disabled,.topbar button.primary:disabled{opacity:1;background:#dedede;color:#777}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline-color:#737373}
/* Owner correction: fully rounded fields, tabs and categories. */
.library input[type='search'], #openFilters, #sourceFilter,
.field select, .field input:not([type='color']), .format-controls select,
.library-tabs, .library-tabs button, .library-tabs button.active,
.categories button, .categories button.active,
button.primary, .topbar button.primary,
button.outlined, .media-heading #addMedia, .format-controls button,
.transport > button, .transport .play, .transport #toggleDemo,
.demo-picker, .inspector-reset, .count, .range-label output,
.dialog-content select, .dialog-content input:not([type='checkbox']):not([type='range']):not([type='color']) {
  border-radius: 9999px;
}
.library input[type='search'], #openFilters, #sourceFilter,
.field select, .field input:not([type='color']), .format-controls select {
  padding-inline: 16px;
}
.library-tabs { padding: 3px; }
.library-tabs button { padding-inline: 12px; }
.categories button { padding-inline: 12px; }
/* Floating preview surface with neutral gutters; compact upload controls. */
body, .workspace { background: #fff; }
.workspace { padding: 12px 16px 20px; gap: 16px; }
.library, .properties { height: calc(100vh - 96px); }
.editor {
  height: calc(100vh - 96px);
  min-height: 580px;
  margin: 0;
  padding: 22px 26px 18px;
  background: #f5f5f5;
  border: 0;
  border-radius: 32px;
  box-shadow: 0 8px 28px rgba(0,0,0,.035);
  overflow: hidden;
}
.editor-toolbar { margin-bottom: 12px; min-height: 38px; }
.editor .media-list:has(.empty-media) { display: none; }
.editor:has(.empty-media) .transport #toggleDemo { display: none; }
.editor .media-heading { margin: 14px 0 0; }
.editor .media-heading > div { min-width: 80px; }
.editor .media-heading:has(+ .media-list:not(:has(.empty-media))) { margin-bottom: 12px; }
.transport { padding-bottom: 14px; margin-top: 14px; }
.scene-info { flex-shrink: 0; margin-top: 10px; color: #737373; font-size: 11px; }
.scene-info > summary { cursor: pointer; list-style: none; width: fit-content; }
.scene-info > summary:after { content: ' ⌄'; }
.scene-info[open] > summary:after { content: ' ⌃'; }
.scene-info .scene-note { margin-top: 8px; padding-bottom: 2px; }
@media (max-width:1200px) and (min-width:851px) {
 .workspace { grid-template-columns: 240px minmax(240px,1fr) 250px; gap: 12px; padding-inline: 12px; }
 .editor { padding-inline: 18px; }
}
@media (max-width:850px) {
 .workspace { grid-template-columns: 220px minmax(0,1fr); gap: 12px; padding: 12px; }
 .editor { height: calc(100vh - 96px); min-height: 620px; padding: 20px; }
 .library { height: calc(100vh - 96px); }
 .properties { height: auto; }
}
@media (max-width:580px) {
 .workspace { padding: 12px; gap: 12px; }
 .editor { width: 100%; height: 590px; min-height: 0; margin: 0; padding: 18px 16px; border-radius: 26px; }
 .library, .properties { width: 100%; height: auto; padding: 20px 4px; }
 .library { max-height: 620px; }
 .editor-toolbar { margin-bottom: 8px; }
 .scene-info { font-size: 10px; }
}
.editor { overflow-x: hidden; overflow-y: auto; scrollbar-width: thin; }

/* Consistent RTL choice controls; native selects remain as the state source. */
html { -webkit-text-size-adjust: 100%; }
button, summary, [role='button'] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
.studio-select { position: relative; display: block; width: 100%; min-width: 0; }
.native-select-source { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; opacity: 0; overflow: hidden; pointer-events: none; clip-path: inset(50%); }
.select-trigger { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 14px; background: #eee; border: 0; border-radius: 9999px; min-height: 42px; padding: 9px 16px; color: #383838; text-align: right; font-size: 12px; line-height: 1.6; }
.select-trigger:hover { background: #e7e7e7; }
.select-trigger:disabled { opacity: 1; background: #f2f2f2; color: #999; cursor: not-allowed; }
.select-value { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.ui-chevron { flex: 0 0 7px; width: 7px; height: 7px; border: 0; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); margin-inline-start: 6px; }
.select-trigger[aria-expanded=true] .ui-chevron { transform: rotate(225deg) translate(-2px,-1px); }
.format-controls .studio-select { width: auto; min-width: 122px; }
.format-controls .select-trigger { font-size: 12px; }
.properties summary:after, #openFilters:after, .scene-info > summary:after, .scene-info[open] > summary:after {
 content: ''; display: block; width: 7px; height: 7px; flex-shrink: 0; border: 0; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: rotate(45deg) translateY(-2px); color: #777; font-size: 0; margin-inline-start: auto;
}
.properties details[open] > summary:after, .scene-info[open] > summary:after { content: ''; transform: rotate(225deg) translate(-2px,-1px); }
#openFilters { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
#openFilters:after { float: none; }
#openFilters[aria-expanded=true]:after { transform: rotate(225deg) translate(-2px,-1px); }
.scene-info > summary { display: flex; gap: 8px; align-items: center; }
.choice-dialog { position: fixed; margin: 0; padding: 8px; inset: auto; width: 280px; max-width: calc(100vw - 24px); max-height: 390px; background: #fff; color: #222; border: 0; border-radius: 22px; box-shadow: 0 14px 54px rgba(0,0,0,.16); overflow: auto; overscroll-behavior: contain; }
.choice-dialog::backdrop { background: transparent; backdrop-filter: none; }
.choice-heading { display: none; }
.choice-list { display: flex; flex-direction: column; gap: 3px; }
.choice-option { display: flex; width: 100%; align-items: center; justify-content: space-between; gap: 14px; text-align: right; padding: 10px 14px; min-height: 42px; border: 0; border-radius: 9999px; background: transparent; font-size: 12px; }
.choice-option:hover, .choice-option:focus-visible { background: #f1f1f1; }
.choice-option[aria-selected=true] { background: #eee; font-weight: 600; }
.option-check { width: 13px; flex-shrink: 0; }
.choice-option[aria-selected=true] .option-check { width: 6px; height: 11px; border-right: 1.8px solid #333; border-bottom: 1.8px solid #333; transform: rotate(45deg); margin-inline-end: 4px; }
.mobile-workspace-nav { display: none; }
.project-actions { display: contents; }
.project-actions > summary { display: none; }
.project-actions > div { display: flex; gap: 8px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 body { padding-bottom: calc(86px + env(safe-area-inset-bottom)); }
 .topbar { position: sticky; top: 0; z-index: 5; height: 64px; padding-inline: max(14px,env(safe-area-inset-left)); background: #fff; }
 .topbar .brand { font-size: 23px; }
 .topbar .brand small, .topbar .privacy { display: none; }
 .topbar nav { align-items: center; gap: 8px; }
 .topbar nav button { min-height: 44px; font-size: 12px; padding-inline: 14px; }
 .topbar .primary { min-width: 112px; }
 .project-actions { display: block; position: relative; }
 .project-actions > summary { display: grid; place-items: center; min-height: 44px; min-width: 78px; border-radius: 9999px; background: #eee; list-style: none; cursor: pointer; font-size: 12px; }
 .project-actions > summary::-webkit-details-marker { display: none; }
 .project-actions > div { position: absolute; top: 52px; right: 0; width: 175px; padding: 8px; display: flex; flex-direction: column; background: #fff; border-radius: 20px; box-shadow: 0 10px 35px rgba(0,0,0,.14); z-index: 8; }
 .project-actions:not([open]) > div { display: none; }
 .project-actions > div button { text-align: right; }
 .workspace { display: flex; padding: 10px 12px; gap: 0; min-height: calc(100dvh - 150px); }
 .workspace > .editor, .workspace > .library, .workspace > .properties { width: 100%; margin: 0; }
 body[data-mobile-panel=preview] .library, body[data-mobile-panel=preview] .properties,
 body[data-mobile-panel=templates] .editor, body[data-mobile-panel=templates] .properties,
 body[data-mobile-panel=settings] .editor, body[data-mobile-panel=settings] .library { display: none; }
 .editor { height: calc(100dvh - 164px); min-height: 460px; padding: 16px; border-radius: 28px; }
 .editor-toolbar { flex-wrap: wrap; gap: 8px; min-height: 44px; }
 .editor-toolbar h2 { max-width: 175px; font-size: 14px; }
 .format-controls { gap: 6px; }
 .format-controls .studio-select { min-width: 120px; }
 .format-controls button { min-height: 44px; }
 .library { height: auto; max-height: none; position: static; padding: 14px 4px; border: 0; }
 .properties { height: auto; padding: 14px 4px; border: 0; }
 .library .templates { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px 12px; }
 .library input[type=search], .field input:not([type=color]), .field select { font-size: 16px; min-height: 46px; }
 .select-trigger { min-height: 46px; font-size: 14px; }
 .properties summary { height: 52px; font-size: 15px; }
 .properties .control-body { gap: 22px; padding-bottom: 26px; }
 .properties .range-label { font-size: 14px; }
 .range-label input[type=range] { min-height: 26px; }
 .transport > button, .transport .play { width: 44px; min-width: 44px; height: 44px; min-height: 44px; }
 .transport input { min-height: 26px; }
 .transport .time { font-size: 10px; }
 .media-heading #addMedia, .demo-picker { min-height: 44px; }
 .media-heading #addMedia { font-size: 12px; }
 #openFilters, .categories button, .library-tabs button { min-height: 40px; }
 .library-tabs { height: 46px; }
 .choice-dialog { left: 0; right: 0; bottom: 0; top: auto; width: 100%; max-width: 100%; max-height: min(76dvh,640px); border-radius: 28px 28px 0 0; padding: 10px 14px calc(18px + env(safe-area-inset-bottom)); }
 .choice-dialog::backdrop { background: rgba(0,0,0,.32); }
 .choice-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 6px 6px 14px; position: sticky; top: -10px; background: #fff; }
 .choice-heading h2 { font-size: 16px; font-weight: 600; }
 .choice-close { width: 44px; min-height: 44px; border-radius: 50%; background: #eee; font-size: 24px; padding: 0; }
 .choice-option { min-height: 50px; font-size: 14px; padding-inline: 18px; }
 .mobile-workspace-nav { display: flex; position: fixed; bottom: max(10px,env(safe-area-inset-bottom)); left: max(12px,env(safe-area-inset-left)); right: max(12px,env(safe-area-inset-right)); padding: 5px; gap: 4px; background: #fff; border-radius: 9999px; box-shadow: 0 6px 35px rgba(0,0,0,.14); z-index: 7; }
 .mobile-workspace-nav button { flex: 1; min-height: 48px; font-size: 14px; border-radius: 9999px; color: #666; background: transparent; }
 .mobile-workspace-nav button[aria-pressed=true] { background: #252525; color: #fff; }
}
@media (hover:none) {
 .select-trigger:hover { background: #eee; }
 .choice-option:hover { background: transparent; }
 .choice-option[aria-selected=true]:hover { background: #eee; }
 button { -webkit-tap-highlight-color: transparent; }
}
@media (prefers-reduced-motion:reduce) { * { scroll-behavior: auto !important; } }
.format-controls .select-trigger { background: #eee; border: 0; }
@media (hover:none) {
 button.primary:hover, .topbar button.primary:hover { filter: none; background: #199f98; }
 .transport .play:hover { background: #252525; }
 .mobile-workspace-nav button:hover { background: transparent; }
 .mobile-workspace-nav button[aria-pressed=true]:hover { background: #252525; }
 .project-actions > div button:hover, button.favorite:hover { background: #eee; }
}
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .topbar { height: calc(64px + env(safe-area-inset-top)); padding-top: env(safe-area-inset-top); }
 .editor { height: calc(100dvh - 164px - env(safe-area-inset-top)); }
 html { overscroll-behavior-y: none; }
}
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .topbar { padding-left: max(14px,env(safe-area-inset-left)); padding-right: max(14px,env(safe-area-inset-right)); }
 .workspace { padding-left: max(12px,env(safe-area-inset-left)); padding-right: max(12px,env(safe-area-inset-right)); }
 .choice-dialog { padding-left: max(14px,env(safe-area-inset-left)); padding-right: max(14px,env(safe-area-inset-right)); }
}
/* Simplified header and a persistent live preview for touch layouts. */
.topbar { direction: rtl; height: 72px; padding: 0 24px; gap: 18px; }
.topbar .brand { font-size: 28px; font-weight: 600; letter-spacing: -.5px; }
.topbar .privacy { margin: 0; font-size: 11px; padding: 6px 10px; border-radius: 9999px; background: #f1f1f1; color: #666; }
.topbar nav { margin: 0; margin-inline-start: auto; direction: rtl; align-items: center; gap: 12px; }
.project-actions { display: block; }
.project-actions > div { background: #eee; padding: 4px; border-radius: 9999px; gap: 0; }
.project-actions > div button { min-height: 36px; border-radius: 9999px; padding-inline: 16px; font-size: 12px; }
.project-actions > div button:hover { background: #e3e3e3; }
button.primary, button.primary:hover, .topbar button.primary, .topbar button.primary:hover { color: #fff; background: #0b807b; filter: none; }
.categories button.active { background: #0b807b; color: #fff; }
button.primary:disabled, .topbar button.primary:disabled { background: #dedede; color: #777; }
.topbar .primary { min-height: 44px; padding-inline: 22px; margin: 0; font-weight: 500; }
.live-preview { display: contents; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .topbar { height: calc(64px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) max(14px,env(safe-area-inset-right)) 0 max(14px,env(safe-area-inset-left)); gap: 10px; }
 .topbar .brand { font-size: 25px; }
 .topbar .privacy { display: none; }
 .topbar nav { gap: 8px; }
 .topbar .primary { padding-inline: 16px; min-width: 112px; }
 .project-actions > div { padding: 8px; background: #fff; }
 .project-actions > div button { min-height: 44px; }
 .workspace { gap: 14px; align-items: stretch; }
 body[data-mobile-panel=templates] .editor, body[data-mobile-panel=settings] .editor { display: block; }
 .editor { position: sticky; top: calc(72px + env(safe-area-inset-top)); z-index: 3; height: auto; min-height: 0; flex-shrink: 0; padding: 12px 14px; overflow: hidden; }
 .live-preview { display: flex; flex-direction: column; height: clamp(250px,40dvh,360px); gap: 8px; }
 .editor-toolbar { display: flex; flex-wrap: nowrap; flex-shrink: 0; gap: 8px; margin: 0; min-height: 44px; }
 .editor-toolbar h2 { max-width: 110px; font-size: 12px; }
 .format-controls { margin: 0; gap: 5px; }
 .format-controls .studio-select { min-width: 110px; }
 .format-controls .select-trigger { min-height: 44px; padding: 7px 12px; font-size: 11px; }
 .format-controls #snapshot { min-height: 44px; padding-inline: 8px; font-size: 10px; }
 .stage-wrap { min-height: 80px; padding: 0; flex: 1; }
 .stage-wrap canvas { border-radius: 18px; }
 .transport { flex-shrink: 0; margin: 0; padding: 0; border: 0; gap: 6px; }
 .transport .time { font-size: 10px; }
 .editor .media-heading { margin-top: 12px; padding-top: 12px; border-top: 1px solid #dedede; }
 .editor .media-list { margin-top: 10px; }
 body[data-mobile-panel=templates] .editor > .media-heading,
 body[data-mobile-panel=templates] .editor > .media-list,
 body[data-mobile-panel=templates] .editor > .scene-info,
 body[data-mobile-panel=settings] .editor > .media-heading,
 body[data-mobile-panel=settings] .editor > .media-list,
 body[data-mobile-panel=settings] .editor > .scene-info { display: none; }
 .library,.properties { padding-top: 8px; }
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:500px) and (max-width:1000px) {
 .workspace { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); align-items: start; direction: ltr; gap: 14px; }
 .workspace > .editor { grid-column: 1; grid-row: 1; direction: rtl; }
 .workspace > .library, .workspace > .properties { grid-column: 2; grid-row: 1; direction: rtl; }
 .live-preview { height: 210px; }
 body[data-mobile-panel=preview] .editor { grid-column: 1/-1; }
}
/* Keep editing lists in their own scroll region, never behind the preview. */
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 body { height: 100dvh; overflow: hidden; padding-bottom: 0; }
 .workspace { height: calc(100dvh - 150px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); min-height: 0; overflow: hidden; }
 .editor { position: relative; top: auto; flex: 0 0 auto; }
 .live-preview { height: clamp(200px,35dvh,320px); }
 .workspace > .library,.workspace > .properties { height: auto; min-height: 0; max-height: none; flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
 body[data-mobile-panel=preview] .editor { height: 100%; display: flex; flex-direction: column; overflow-y: auto; }
 body[data-mobile-panel=preview] .live-preview { height: auto; flex: 1 0 240px; }
}
@media (pointer:coarse) and (orientation:landscape) and (max-height:500px) and (max-width:1000px) {
 .workspace { grid-template-rows: minmax(0,1fr); }
 .workspace > .editor { min-height: 0; height: 100%; }
 .live-preview { height: 100%; }
 .workspace > .library,.workspace > .properties { height: 100%; }
 body[data-mobile-panel=preview] .live-preview { flex-basis: 140px; }
}
@media (orientation:portrait) and (max-height:550px) and (max-width:680px) {
 body:not([data-mobile-panel=preview]) .live-preview { height: 140px; }
 body:not([data-mobile-panel=preview]) .editor-toolbar { display: none; }
}
/* Filled Lucide shapes: local masks inherit the exact text color. */
.motion-icon { display: inline-block; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor; -webkit-mask: var(--icon) center/contain no-repeat; mask: var(--icon) center/contain no-repeat; pointer-events: none; vertical-align: middle; }
.has-icon { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.icon-label { min-width: 0; }
#openFilters .icon-label { flex: 1; text-align: right; }
#openFilters { display: flex; }
.favorite .motion-icon { width: 17px; height: 17px; flex-basis: 17px; opacity: .6; }
.favorite.selected .motion-icon { opacity: 1; color: #0b807b; }
#play .motion-icon { width: 15px; height: 15px; flex-basis: 15px; }
#restart, #play { padding: 0; }
.media-item .remove-media .motion-icon, .media-item .move-media .motion-icon { width: 13px; height: 13px; flex-basis: 13px; }
.search-control { position: relative; flex-shrink: 0; }
.search-control > .motion-icon { position: absolute; top: 13px; right: 16px; width: 16px; height: 16px; color: #777; z-index: 1; }
.library .search-control input { padding-right: 42px; }
.dialog-head button.has-icon { width: 36px; height: 36px; padding: 0; }
.ui-chevron, .select-trigger[aria-expanded=true] .ui-chevron { width: 16px; height: 16px; flex: 0 0 16px; border: 0; transform: none; }
.select-trigger[aria-expanded=true] .ui-chevron { transform: rotate(180deg); }
.choice-option .option-check, .choice-option[aria-selected=true] .option-check { width: 16px; height: 16px; flex: 0 0 16px; margin: 0; border: 0; transform: none; opacity: 0; }
.choice-option[aria-selected=true] .option-check { opacity: 1; }
.properties summary:after, #openFilters:after, .scene-info > summary:after,
.properties details[open] > summary:after, .scene-info[open] > summary:after {
 width: 16px; height: 16px; border: 0; transform: none; background: currentColor; -webkit-mask: url('assets/icons/chevron-down.svg') center/contain no-repeat; mask: url('assets/icons/chevron-down.svg') center/contain no-repeat;
}
.properties details[open] > summary:after, .scene-info[open] > summary:after, #openFilters[aria-expanded=true]:after { transform: rotate(180deg); }
.project-actions > summary.has-icon { display: none; }
.mobile-workspace-nav button.has-icon { gap: 7px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .project-actions > summary.has-icon { display: flex; min-width: 88px; padding-inline: 12px; }
 .topbar nav { gap: 6px; }
 .topbar .primary { padding-inline: 13px; gap: 7px; }
 .topbar .primary .motion-icon { width: 16px; height: 16px; flex-basis: 16px; }
 .search-control > .motion-icon { top: 15px; }
 .format-controls #snapshot { gap: 4px; }
 .format-controls #snapshot .motion-icon { width: 14px; height: 14px; flex-basis: 14px; }
 .mobile-workspace-nav button { font-size: 13px; padding-inline: 8px; }
 .demo-picker, .media-heading #addMedia { gap: 5px; }
 .demo-picker .motion-icon, .media-heading #addMedia .motion-icon { width: 16px; height: 16px; flex-basis: 16px; }
}
/* Owner correction: rectangular template previews and outline icon colors. */
.template canvas, .template.active canvas { border-radius: 14px; }
.favorite, .favorite.selected { border-radius: 50%; background: rgba(255,255,255,.94); }
.motion-icon { color: #6a6a6a; }
.motion-icon[data-icon='image-plus'],
.motion-icon[data-icon='images'],
.motion-icon[data-icon='save'],
.motion-icon[data-icon='sliders-horizontal'],
.mobile-workspace-nav button:not([aria-pressed=true]) .motion-icon[data-icon='settings-2'] { color: #0b807b; }
.favorite .motion-icon { opacity: 1; color: #8a8a8a; }
.favorite.selected .motion-icon { color: #0b807b; }
button.primary .motion-icon, .topbar button.primary .motion-icon,
.transport .play .motion-icon,
.mobile-workspace-nav button[aria-pressed=true] .motion-icon { color: #fff; }
.select-trigger .ui-chevron, .choice-option .option-check { color: #6a6a6a; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .template canvas, .template.active canvas { border-radius: 14px; }
}
/* Owner preference: template previews use the same capsule radius as library controls. */
.template canvas, .template.active canvas { border-radius: 9999px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .template canvas, .template.active canvas { border-radius: 9999px; }
}
/* Each multipart icon combines its own neutral and turquoise path layers. */
.motion-icon.duotone-icon { position: relative; background: none; -webkit-mask: none; mask: none; --part-neutral: #6a6a6a; --part-accent: #0b807b; }
.duotone-icon::before,.duotone-icon::after { content: ''; position: absolute; inset: 0; display: block; background: var(--part-neutral); -webkit-mask: var(--icon-neutral) center/contain no-repeat; mask: var(--icon-neutral) center/contain no-repeat; }
.duotone-icon::after { background: var(--part-accent); -webkit-mask-image: var(--icon-accent); mask-image: var(--icon-accent); }
button.primary .duotone-icon,.topbar button.primary .duotone-icon,
.transport .play .duotone-icon,.mobile-workspace-nav button[aria-pressed=true] .duotone-icon { --part-neutral: #fff; --part-accent: #fff; }
#useDemo { width: 40px; height: 40px; min-height: 40px; padding: 0; }
#useDemo .motion-icon { width: 20px; height: 20px; flex-basis: 20px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 #useDemo { width: 44px; height: 44px; min-height: 44px; }
}
.search-control > .duotone-icon { position: absolute; }
/* Match the actual corner radius, rather than half of each element's height. */
:root { --library-corner: 20px; }
.library-tabs, .library input[type='search'], #openFilters,
.template canvas, .template.active canvas { border-radius: var(--library-corner); }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .template canvas, .template.active canvas { border-radius: var(--library-corner); }
}
/* Consistent header actions with separate open/save targets. */
.topbar nav { gap: 12px; }
.project-actions > div { background: transparent; padding: 0; gap: 8px; border-radius: 0; }
.project-actions > div button {
  display: inline-flex; align-items: center; justify-content: center;
  height: 44px; min-height: 44px; min-width: 136px;
  padding: 0 18px; gap: 9px; border: 0; border-radius: 20px;
  background: #eee; font-size: 13px; font-weight: 400; line-height: 1;
}
.project-actions > div button:hover { background: #e5e5e5; }
.topbar #openExport { height: 44px; min-height: 44px; min-width: 148px; padding: 0 20px; gap: 9px; border-radius: 20px; font-size: 13px; line-height: 1; }
.topbar nav .motion-icon { width: 18px; height: 18px; flex-basis: 18px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .topbar nav { gap: 8px; }
 .project-actions > summary.has-icon { height: 44px; padding-inline: 14px; gap: 8px; font-size: 12px; }
 .project-actions > div { background: #fff; padding: 8px; gap: 6px; border-radius: 20px; }
 .project-actions > div button { width: 100%; min-width: 0; height: 44px; padding-inline: 14px; justify-content: flex-start; font-size: 13px; border-radius: 14px; }
 .topbar #openExport { height: 44px; min-width: 126px; padding-inline: 14px; font-size: 12px; gap: 8px; border-radius: 9999px; }
 .topbar nav .motion-icon { width: 18px; height: 18px; flex-basis: 18px; }
}
/* Matching outlined controls for canvas aspect and PNG snapshot. */
.format-controls #snapshot, .format-controls .select-trigger,
.format-controls .select-trigger:hover {
  background: transparent; border: 1px solid #c9c9c9;
  height: 36px; min-height: 36px; border-radius: 9999px;
  padding: 6px 12px; color: #444;
}
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .format-controls #snapshot, .format-controls .select-trigger,
 .format-controls .select-trigger:hover { height: 44px; min-height: 44px; padding-inline: 10px; }
}
/* Sidebars only: preserve the center workspace geometry and controls. */
.library-tabs { gap: 2px; }
.library-tabs button { min-width: 0; flex: 1 1 auto; gap: 5px; padding-inline: 7px; font-size: 11px; }
.library-tabs button .motion-icon { width: 14px; height: 14px; flex-basis: 14px; }
.library-tabs button .icon-label { white-space: nowrap; }
.library-files { display: none; }
.library[data-library-view=files] .library-files { display: block; }
.library[data-library-view=files] > .search-control,
.library[data-library-view=files] > #openFilters,
.library[data-library-view=files] > .library-filters,
.library[data-library-view=files] > .templates,
.library[data-library-view=files] > .library-foot { display: none; }
.sidebar-add { width: 100%; min-height: 42px; margin-bottom: 14px; }
.sidebar-file-empty { color: #777; font-size: 12px; padding: 18px 6px; text-align: center; }
.sidebar-file-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px 8px; }
.sidebar-file { min-width: 0; position: relative; }
.sidebar-file img,.sidebar-file video { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 16px; background: #eee; }
.file-number { position: absolute; right: 5px; top: 5px; border-radius: 9999px; background: rgba(255,255,255,.94); color: #444; min-width: 19px; text-align: center; font-size: 10px; }
.file-name { font-size: 10px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; margin-top: 5px; color: #666; }
.file-actions { display: flex; gap: 4px; margin-top: 5px; }
.file-actions button { flex: 1; padding: 0; min-height: 28px; height: 28px; border-radius: 9999px; background: #eee; border: 0; }
.file-actions .motion-icon { width: 14px; height: 14px; flex-basis: 14px; }
.quick-inspector > .panel-heading { gap: 10px; margin-bottom: 18px; }
.current-template-thumb { width: 44px; height: 44px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.quick-inspector .current-template-name { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.change-template { background: #eee; min-height: 34px; padding: 6px 11px; font-size: 11px; }
.inspector-section { padding: 18px 0; border-top: 1px solid #dedede; display: flex; flex-direction: column; gap: 16px; }
.inspector-section > h3 { font-size: 13px; font-weight: 600; }
.inspector-subtitle { font-size: 12px; color: #666; margin-bottom: -6px; }
.quick-aspects { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; }
.quick-aspects button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-width: 0; min-height: 66px; padding: 8px 0; background: #eee; border-radius: 16px; border: 0; font-size: 10px; direction: ltr; }
.aspect-shape { display: block; width: 20px; max-height: 24px; border: 1px solid currentColor; border-radius: 3px; }
.quick-aspects button[aria-pressed=true] { background: #252525; color: #fff; }
.quick-durations { display: grid; grid-template-columns: repeat(5,minmax(0,1fr)); gap: 5px; margin-top: -5px; }
.quick-durations button { min-height: 32px; padding: 5px 0; background: #eee; border: 0; border-radius: 9999px; font-size: 11px; }
.quick-durations button[aria-pressed=true] { background: #252525; color: #fff; }
.quick-inspector .inspector-section .range-label { gap: 9px; }
.quick-inspector .swatches { flex-wrap: wrap; gap: 9px; }
.quick-inspector .swatches button { width: 28px; height: 28px; min-height: 28px; }
.transparent-swatch { background: repeating-conic-gradient(#ccc 0% 25%,#fff 0% 50%) 50%/10px 10px; }
.quick-inspector .swatches button[aria-pressed=true] { outline: 2px solid #666; outline-offset: 3px; }
.quick-inspector .color-row[hidden],.quick-inspector .color-row label[hidden] { display: none; }
.quick-inspector .advanced-settings-body { padding-bottom: 12px; }
.quick-inspector .advanced-settings-body details { padding-inline: 8px; }
.quick-inspector .advanced-settings-body details:first-child { border-top: 0; }
.quick-inspector .advanced-settings-body summary { font-size: 12px; }
.quick-inspector .inspector-advanced > summary { font-size: 13px; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .library-tabs button { font-size: 12px; padding-inline: 8px; }
 .sidebar-file-grid { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 16px 12px; }
 .file-actions button { min-height: 44px; height: 44px; }
 .sidebar-add { min-height: 46px; }
 .quick-aspects button { min-height: 70px; font-size: 11px; }
 .quick-durations button { min-height: 40px; }
 .quick-inspector .current-template-name { font-size: 15px; }
 .change-template { min-height: 44px; }
}
.quick-inspector .current-template-name { text-align: right; }
.quick-inspector .swatches .transparent-swatch { background: repeating-conic-gradient(#ccc 0% 25%,#fff 0% 50%) 50%/10px 10px; }
.quick-inspector .swatches button[data-bg='#ffffff'] { box-shadow: inset 0 0 0 1px #d6d6d6; }
/* Export actions share the header; aspect selection stays in the inspector. */
.editor-toolbar .format-controls { display: none; }
.topbar #snapshot { height: 44px; min-height: 44px; min-width: 124px; padding: 0 18px; border: 1px solid #c9c9c9; border-radius: 20px; background: transparent; font-size: 13px; gap: 9px; }
.topbar #snapshot:hover { background: transparent; border-color: #777; }
@media (max-width:680px), (pointer:coarse) and (max-width:1000px) {
 .topbar #snapshot { min-width: 44px; width: 44px; padding: 0; border-radius: 9999px; }
 .topbar #snapshot .icon-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
 .topbar #openExport { min-width: 112px; padding-inline: 12px; font-size: 11px; gap: 6px; }
 .topbar .brand { font-size: 23px; }
 .topbar .project-actions > summary.has-icon { min-width: 78px; padding-inline: 10px; }
 .library-tabs button { padding-inline: 5px; font-size: 11px; gap: 4px; }
}
