.text-panel-content[hidden], .text-properties[hidden] { display: none !important; }
.text-panel-content { padding: 1px 0 16px; color: #eeeaf7; }
.text-panel-intro { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 3px 0 13px; }
.text-panel-intro > div { min-width: 0; }
.text-panel-intro b { display: block; font-size: 12px; line-height: 1.5; }
.text-panel-intro small { display: block; color: #92909e; font-size: 9px; line-height: 1.5; }
.text-panel-intro button { flex: 0 0 auto; border: 1px solid #7561c3; border-radius: 8px; padding: 7px 9px; background: #2d2350; color: #eee7ff; font-size: 10px; font-weight: 800; cursor: pointer; }
.text-panel-intro button:hover { background: #45336e; }
.text-preset-filters { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 10px; scrollbar-width: none; }
.text-preset-filters::-webkit-scrollbar { display: none; }
.text-preset-filters button { flex: 0 0 auto; border: 1px solid #30313d; border-radius: 999px; padding: 5px 9px; background: #1a1b23; color: #a5a2b2; font-size: 9px; font-weight: 700; cursor: pointer; }
.text-preset-filters button.active, .text-preset-filters button:hover { border-color: #8164ec; background: #312550; color: #f7f2ff; }
.text-preset-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.text-preset-card { min-width: 0; padding: 0; overflow: hidden; border: 1px solid #333242; border-radius: 11px; background: #171721; color: #f4efff; text-align: start; cursor: pointer; transition: border-color .18s, transform .18s, box-shadow .18s; }
.text-preset-card:hover, .text-preset-card:focus-visible { border-color: #a383ff; box-shadow: 0 8px 22px rgba(10, 7, 23, .35); transform: translateY(-2px); outline: 0; }
.text-preset-art { position: relative; height: 75px; display: flex; align-items: center; justify-content: center; overflow: hidden; isolation: isolate; background: radial-gradient(circle at 75% 15%, #4b286f, transparent 55%), #151421; }
.text-preset-art::after { content: ''; position: absolute; inset: 0; z-index: -1; opacity: .65; background: linear-gradient(135deg, transparent 35%, rgba(255,255,255,.06)); }
.text-preset-art i { position: absolute; width: 80px; height: 80px; border: 1px solid rgba(228,207,255,.15); border-radius: 50%; transform: translate(28px, 30px); }
.text-preset-art strong { position: relative; z-index: 1; max-width: 88%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; font: 800 13px/1.5 "Noto Kufi Arabic", Tahoma, sans-serif; text-shadow: 0 3px 12px #000; }
.text-preset-card > span:last-child { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-height: 26px; padding: 5px 7px; }
.text-preset-card > span:last-child b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 9px; }
.text-preset-card > span:last-child em { display: grid; place-items: center; width: 17px; height: 17px; flex: 0 0 auto; border-radius: 5px; background: rgba(132, 96, 237, .2); color: #c7b4ff; font: 800 normal 14px/1 Arial, sans-serif; }
.text-preset-card--cinema .text-preset-art { background: linear-gradient(180deg, #35264d, #101019 68%); }
.text-preset-card--cinema strong { letter-spacing: .07em; }
.text-preset-card--lower .text-preset-art { align-items: flex-end; padding-bottom: 11px; background: linear-gradient(155deg, #284250, #101d2b); }
.text-preset-card--lower strong { padding: 2px 8px; border-inline-start: 3px solid #71d7ee; background: rgba(4,11,21,.72); font-size: 11px; }
.text-preset-card--neon .text-preset-art { background: radial-gradient(circle, #39205a, #10101c 72%); }
.text-preset-card--neon strong { color: #e4bbff; text-shadow: 0 0 8px #ce7aff, 0 0 18px #a852ef; }
.text-preset-card--outline .text-preset-art { background: linear-gradient(140deg, #29495d, #152331); }
.text-preset-card--outline strong { -webkit-text-stroke: .6px #edfaff; color: transparent; font-size: 16px; }
.text-preset-card--quote .text-preset-art { background: linear-gradient(135deg, #62404f, #1c1a28); }
.text-preset-card--quote strong::before { content: '“'; color: #e6b3ce; font-size: 22px; }
.text-preset-card--badge .text-preset-art { background: linear-gradient(125deg, #1f4946, #10231f); }
.text-preset-card--badge strong { padding: 3px 10px; border: 1px solid #92ddcf; border-radius: 999px; background: #13342f; }
.text-preset-card--pop .text-preset-art { background: radial-gradient(circle, #7045ae, #2a1a49 75%); }
.text-preset-card--pop strong { transform: rotate(-6deg); color: #ffe17d; font-size: 18px; text-shadow: 2px 3px 0 #5a278f; }
.text-preset-card--type .text-preset-art { background: linear-gradient(125deg, #263242, #10151f); }
.text-preset-card--type strong::after { content: '|'; color: #9cdaff; margin-inline-start: 2px; }
.text-preset-card--sunset .text-preset-art { background: linear-gradient(155deg, #c56e67, #59326a 62%, #1b1c35); }
.text-preset-card--sunset strong { color: #fff4d8; }
.text-preset-card--minimal .text-preset-art { background: #e9e7de; }
.text-preset-card--minimal strong { color: #1f2330; text-shadow: none; }
.text-preset-card--sticker .text-preset-art { background: linear-gradient(155deg, #352d73, #131538); }
.text-preset-card--sticker strong { padding: 4px 9px; border-radius: 8px; background: #f5da79; color: #302c49; text-shadow: none; transform: rotate(4deg); }
.text-preset-card--reveal .text-preset-art { background: linear-gradient(125deg, #7c426a, #2c244b); }
.text-preset-card--reveal strong { box-shadow: inset 0 -7px #e56cac; }

.text-properties { display: grid; gap: 12px; margin-top: 14px; padding-top: 14px; border-top: 1px solid #2e2b3b; }
.text-properties > :not(:first-child) { border-top: 1px solid #2b2936; padding-top: 10px; }
.clip-properties.is-text-selected > .property-label, .clip-properties.is-text-selected > #selectedClipName { display: none; }
.clip-properties.is-text-selected .text-properties { margin-top: 0; padding-top: 0; border-top: 0; }
.text-property-field, .text-property-slider { display: grid; gap: 6px; min-width: 0; color: #c3becf; font-size: 10px; font-weight: 700; }
.text-content-head { display: flex; align-items: stretch; gap: 0; min-width: 0; min-height: 55px; padding: 6px; border: 1px solid #353040; border-radius: 9px; background: linear-gradient(180deg, #1b1923, #16151e); }
.text-content-head > label { display: flex; flex: 0 0 auto; align-items: center; padding: 0 7px; border-inline-end: 1px solid #383244; white-space: nowrap; }
.text-content-tools { display: grid; flex: 1 1 auto; grid-template-columns: 34px 62px minmax(0, 1fr); align-items: stretch; min-width: 0; }
.text-content-tool { display: grid; grid-template-rows: 12px 28px; align-content: center; align-items: center; gap: 2px; min-width: 0; padding: 0 3px; border-inline-end: 1px solid #383244; color: #bcb6c9; font-size: 9px; line-height: 1; text-align: center; white-space: nowrap; }
.text-color-tool { position: relative; z-index: 21; }
.text-background-tool { position: relative; z-index: 20; }
.text-content-tools .text-color-picker, .text-content-tools .text-background-picker { display: block; width: 26px; height: 26px; margin-inline: auto; padding: 0; }
.text-content-tools #textOpacitySlot { display: flex; align-items: center; min-width: 0; padding-inline-start: 5px; }
.text-content-tools #opacityControl { display: grid; grid-template-columns: minmax(0, 1fr) 29px; grid-template-rows: 12px 28px; align-items: center; gap: 2px; width: 100%; min-width: 0; margin: 0; color: #bcb6c9; font-size: 9px; line-height: 1; white-space: nowrap; }
.text-content-tools #opacityControl output { width: 29px; text-align: end; color: #d2c3ff; font: 700 9px/1 Arial, sans-serif; font-variant-numeric: tabular-nums; direction: ltr; }
.text-content-tools #opacityRange { grid-column: 1 / -1; appearance: none; width: 100%; height: 28px; margin: 0; padding: 0 2px; border: 0; background: transparent; cursor: pointer; }
.text-content-tools #opacityRange::-webkit-slider-runnable-track { height: 4px; border-radius: 999px; background: linear-gradient(var(--text-range-direction, to left), #a887ff 0 var(--range-progress, 100%), #484253 var(--range-progress, 100%) 100%); }
.text-content-tools #opacityRange::-webkit-slider-thumb { appearance: none; width: 13px; height: 13px; margin-top: -4.5px; border: 2px solid #e6d9ff; border-radius: 50%; background: #9971ee; box-shadow: 0 0 0 2px rgba(151, 112, 238, .18); }
.text-content-tools #opacityRange::-moz-range-track { height: 4px; border-radius: 999px; background: #484253; }
.text-content-tools #opacityRange::-moz-range-progress { height: 4px; border-radius: 999px; background: #a887ff; }
.text-content-tools #opacityRange::-moz-range-thumb { width: 11px; height: 11px; border: 2px solid #e6d9ff; border-radius: 50%; background: #9971ee; }
.text-content-tools #opacityRange:focus-visible { outline: 2px solid #b89dff; outline-offset: 1px; border-radius: 6px; }
.text-property-field textarea, .text-property-field select { width: 100%; min-width: 0; border: 1px solid #3a3547; border-radius: 8px; background-color: #17161f; color: #f5f2fa; outline: none; font: 11px/1.6 "Noto Kufi Arabic", Tahoma, sans-serif; }
.text-property-field textarea { resize: vertical; min-height: 65px; padding: 8px 10px; }
.text-property-field textarea:focus, .text-property-field select:focus { border-color: #9478ec; box-shadow: 0 0 0 2px rgba(140,107,241,.16); }
.text-property-field select { appearance: none; padding: 6px 9px; padding-inline-end: 21px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='m2 4 4 4 4-4' fill='none' stroke='%23ab9cca' stroke-width='1.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 7px center; cursor: pointer; }
html[dir="ltr"] .text-property-field select { background-position: right 7px center; }
.text-property-field select option { background: #17161f; color: #f5f2fa; }
#textFontFamily optgroup { background: #211b2d; color: #c4b2ff; font-style: normal; font-weight: 800; }
.text-property-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: stretch; gap: 6px; }
.text-property-row > *, .text-layout-row > * { min-width: 0; padding: 7px 6px; border: 1px solid #353040; border-radius: 9px; background: linear-gradient(180deg, #1b1923, #16151e); }
.text-font-row { grid-template-columns: minmax(0, 1fr) 78px; }
.text-font-size-field input { box-sizing: border-box; width: 100%; min-width: 0; height: 34px; padding: 0 6px; border: 1px solid #3a3547; border-radius: 8px; background: #17161f; color: #f5f2fa; outline: none; text-align: center; font: 800 12px/1 Arial, sans-serif; appearance: textfield; -moz-appearance: textfield; }
.text-font-size-field input::-webkit-inner-spin-button, .text-font-size-field input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.text-font-size-field input:focus { border-color: #9478ec; box-shadow: 0 0 0 2px rgba(140,107,241,.16); }
.clip-properties #opacityControl[hidden] { display: none !important; }
.text-color-picker { border: 1px solid #625673; border-radius: 7px; background: var(--text-color-preview, #fff); box-shadow: inset 0 0 0 2px #17161f; cursor: pointer; }
.text-background-picker { border: 1px solid #625673; border-radius: 7px; background: var(--text-background-preview, #171022); box-shadow: inset 0 0 0 2px #17161f; cursor: pointer; }
.text-background-picker.is-transparent { background-color: #eee; background-image: linear-gradient(45deg, #bbb 25%, transparent 25%), linear-gradient(-45deg, #bbb 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #bbb 75%), linear-gradient(-45deg, transparent 75%, #bbb 75%); background-size: 12px 12px; background-position: 0 0, 0 6px, 6px -6px, -6px 0; }
.text-color-picker:hover, .text-color-picker:focus-visible, .text-background-picker:hover, .text-background-picker:focus-visible { border-color: #b399ff; outline: none; }
.text-palette-popover[hidden], .text-recent-colors[hidden], .text-recent-swatches button[hidden] { display: none; }
.text-palette-popover { position: absolute; top: calc(100% + 6px); z-index: 30; display: grid; gap: 8px; width: 174px; padding: 9px; border: 1px solid #514766; border-radius: 11px; background: #1c1a25; box-shadow: 0 14px 34px rgba(0,0,0,.45); text-align: start; white-space: normal; }
html[dir="rtl"] .text-palette-popover { left: 0; }
html[dir="ltr"] .text-palette-popover { right: 0; }
html[dir="rtl"] .text-color-popover { left: auto; right: 0; }
html[dir="ltr"] .text-color-popover { left: 0; right: auto; }
.text-background-transparent { display: flex; align-items: center; gap: 7px; height: 30px; padding: 0 7px; border: 1px solid #3c354e; border-radius: 7px; background: #24212e; color: #e8e1f4; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-background-transparent i { flex: 0 0 16px; height: 16px; border: 1px solid #aaa2b5; border-radius: 3px; background-color: #eee; background-image: linear-gradient(45deg,#bbb 25%,transparent 25%),linear-gradient(-45deg,#bbb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#bbb 75%),linear-gradient(-45deg,transparent 75%,#bbb 75%); background-size: 8px 8px; background-position: 0 0,0 4px,4px -4px,-4px 0; }
.text-background-transparent[aria-pressed="true"] { border-color: #9876ec; background: #332749; }
.text-palette-swatches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 5px; }
.text-palette-swatches button { height: 26px; border: 1px solid #655d70; border-radius: 6px; background: var(--swatch); cursor: pointer; }
.text-palette-swatches button[aria-pressed="true"] { outline: 2px solid #a986fa; outline-offset: 1px; }
.text-palette-swatches button:hover, .text-palette-swatches button:focus-visible { border-color: #d9ccff; outline: 2px solid #a986fa; outline-offset: 1px; }
.text-recent-colors { display: flex; align-items: center; justify-content: space-between; gap: 7px; padding: 4px 0; border-top: 1px solid #393242; border-bottom: 1px solid #393242; color: #d0c6df; font-size: 9px; font-weight: 700; }
.text-recent-swatches { display: flex; gap: 6px; }
.text-recent-swatches button { width: 25px; height: 25px; border: 1px solid #8a7b9f; border-radius: 6px; background: var(--swatch); cursor: pointer; }
.text-recent-swatches button:hover, .text-recent-swatches button:focus-visible { outline: 2px solid #a986fa; outline-offset: 1px; }
.text-palette-custom { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 7px; border-top: 1px solid #393242; color: #d0c6df; font-size: 10px; font-weight: 700; cursor: pointer; }
.text-palette-custom input { flex: 0 0 34px; width: 34px; height: 25px; padding: 2px; border: 1px solid #625673; border-radius: 6px; background: #17161f; cursor: pointer; }
.text-palette-custom input::-webkit-color-swatch-wrapper { padding: 0; }
.text-palette-custom input::-webkit-color-swatch { border: 0; border-radius: 3px; }
.text-property-slider { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
.text-property-slider output { color: #c5b4ff; font: 800 11px/1 Arial, sans-serif; }
.text-property-slider input { grid-column: 1 / -1; width: 100%; accent-color: #9574f4; }
.text-properties .text-property-slider input[type="range"] { appearance: none; width: 100%; height: 34px; margin: 0; padding: 0 3px; border: 0; background: transparent; cursor: pointer; }
.text-properties .text-property-slider input[type="range"]::-webkit-slider-runnable-track { height: 5px; border-radius: 999px; background: linear-gradient(var(--text-range-direction, to left), #a887ff 0 var(--range-progress, 0%), #484253 var(--range-progress, 0%) 100%); }
.text-properties .text-property-slider input[type="range"]::-webkit-slider-thumb { appearance: none; width: 16px; height: 16px; margin-top: -5.5px; border: 2px solid #e6d9ff; border-radius: 50%; background: #9971ee; box-shadow: 0 0 0 3px rgba(151, 112, 238, .18), 0 2px 6px rgba(0, 0, 0, .45); }
.text-properties .text-property-slider input[type="range"]::-moz-range-track { height: 5px; border-radius: 999px; background: #484253; }
.text-properties .text-property-slider input[type="range"]::-moz-range-progress { height: 5px; border-radius: 999px; background: #a887ff; }
.text-properties .text-property-slider input[type="range"]::-moz-range-thumb { width: 13px; height: 13px; border: 2px solid #e6d9ff; border-radius: 50%; background: #9971ee; box-shadow: 0 0 0 3px rgba(151, 112, 238, .18), 0 2px 6px rgba(0, 0, 0, .45); }
.text-properties .text-property-slider input[type="range"]:focus-visible { outline: 2px solid #b89dff; outline-offset: 1px; border-radius: 7px; }
html[dir="ltr"] .text-properties { --text-range-direction: to right; }
.text-layout-row { display: grid; grid-template-columns: minmax(0, 1fr) 91px; align-items: stretch; gap: 6px; min-width: 0; }
.text-duration-loop-row { align-items: start; }
.text-duration-loop-row .text-property-slider { grid-template-rows: 13px 34px; align-items: center; }
.text-duration-loop-row .text-property-field select { height: 34px; }
.text-motion-timing-group { display: grid; gap: 12px; min-width: 0; padding: 9px 10px; border-right: 1px solid #353040; border-bottom: 1px solid #353040; border-left: 1px solid #353040; border-radius: 9px; background: linear-gradient(180deg, #1b1923, #16151e); }
.text-card-size-field { margin: 0; }
.text-align-field { display: grid; gap: 6px; min-width: 0; color: #c3becf; font-size: 10px; font-weight: 700; }
.text-align-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3px; direction: rtl; }
.text-align-row button { display: grid; place-items: center; height: 30px; min-width: 0; border: 1px solid #353140; border-radius: 7px; padding: 0; background: #181820; color: #a5a1b2; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.text-align-row button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.text-align-row button:hover, .text-align-row button:focus-visible { border-color: #8f79d7; color: #fff; outline: none; }
.text-align-row button.active { border-color: #8064d5; background: #332750; color: #f5efff; }
.text-motion-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.text-motion-head b { font-size: 11px; }
.text-motion-head small { color: #8f899d; font-size: 8px; }

.text-preview-layer { position: absolute; inset: 0; z-index: auto; overflow: hidden; pointer-events: none; }
.text-preview-item { position: absolute; min-width: 0; max-width: 94%; transform: translate(-50%, -50%); pointer-events: auto; touch-action: none; cursor: grab; user-select: none; }
.text-preview-item.is-dragging { cursor: grabbing; }
.text-preview-item.is-selected { outline: 1px dashed rgba(255,255,255,.9); outline-offset: 5px; }
.text-preview-item.is-selected::after { content: ''; position: absolute; inset: -9px; border: 1px solid rgba(158,126,255,.65); border-radius: 7px; pointer-events: none; }
.video-canvas.is-playing .text-preview-item.is-selected { outline: none; }
.video-canvas.is-playing .text-preview-item.is-selected::after,
.video-canvas.is-playing .text-preview-item .text-resize-handle { display: none; }
.text-resize-handle { position: absolute; z-index: 3; display: none; place-items: center; width: 22px; height: 22px; touch-action: none; }
.text-preview-item.is-selected .text-resize-handle { display: grid; }
.text-resize-handle::after { content: ''; width: 9px; height: 9px; border: 2px solid #fff; border-radius: 3px; background: #8e69ef; box-shadow: 0 2px 8px rgba(0,0,0,.7); }
.text-resize-handle[data-corner="nw"] { top: -11px; left: -11px; cursor: nwse-resize; }
.text-resize-handle[data-corner="ne"] { top: -11px; right: -11px; cursor: nesw-resize; }
.text-resize-handle[data-corner="sw"] { bottom: -11px; left: -11px; cursor: nesw-resize; }
.text-resize-handle[data-corner="se"] { bottom: -11px; right: -11px; cursor: nwse-resize; }
.text-preview-body { display: block; width: 100%; padding: .12em .28em; border-radius: .16em; color: #fff; font-weight: 800; line-height: 1.45; overflow-wrap: break-word; white-space: pre-wrap; text-shadow: 0 3px 12px rgba(0,0,0,.75); transform-origin: center; }
.text-preview-content { display: inline; outline: none; }
.text-preview-content[contenteditable="true"] { background: rgba(0,0,0,.35); user-select: text; cursor: text; }
.text-preview-item.is-typing .text-preview-content::after { content: '|'; color: currentColor; margin-inline-start: 1px; font-weight: 400; }
.text-preview-item[data-text-style="neon"] .text-preview-body { text-shadow: 0 0 8px currentColor, 0 0 20px currentColor; }
.text-preview-item[data-text-style="outline"] .text-preview-body { -webkit-text-stroke: 1px currentColor; color: transparent !important; text-shadow: none; }
.text-preview-item[data-text-style="pop"] .text-preview-body { text-shadow: .055em .07em 0 #612f99, 0 3px 10px #000; }
.text-preview-item[data-text-style="lower"] .text-preview-body { border-inline-start: .1em solid #6bd6ee; border-radius: 0; }
.text-preview-item[data-text-style="sticker"] .text-preview-body { transform: rotate(3deg); text-shadow: none; }
.text-preview-item[data-text-style="minimal"] .text-preview-body { text-shadow: none; }
.text-preview-item[data-text-style="reveal"] .text-preview-body { box-shadow: inset 0 -.16em rgba(232,105,170,.7); }
.text-preview-item[data-text-style="outline"] .text-preview-body { -webkit-text-stroke-color: var(--text-stroke); }
.text-clip .text-clip-glyph { display: grid; place-items: center; width: 20px; height: 20px; flex: 0 0 auto; border: 1px solid rgba(238,181,103,.65); border-radius: 5px; background: rgba(238,181,103,.16); color: #ffdcad; font: 800 13px/1 Georgia, serif; }
.text-clip .clip-content { min-width: 0; }

@media (max-width: 980px) { .text-panel-content { padding-bottom: 28px; } }
