/* Editor */

/* Dark in both themes: follow only theme-independent tokens */
.y-ie {
    --y-ie-bg: #000;
    --y-ie-panel: #161618;
    --y-ie-control: rgba(255, 255, 255, .1);
    --y-ie-control-hover: rgba(255, 255, 255, .18);
    --y-ie-text: #fff;
    --y-ie-muted: rgba(255, 255, 255, .6);
    --y-ie-accent: var(--yurba-brand-color, #3d7bfd);
    --y-ie-accent-soft: var(--yurba-brand-color-opacity, rgba(61, 123, 253, .2));
    --y-ie-on-accent: var(--yurba-on-brand-color, #fff);
    --y-ie-track: rgba(255, 255, 255, .3);
    --y-ie-danger: var(--yurba-red-color, #ff3b30);
    --y-ie-radius: var(--yurba-radius-l, 14px);
    --y-ie-ease-in: cubic-bezier(.05, .7, .1, 1);

    position: relative;
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 320px;
    overflow: hidden;
    background: var(--y-ie-bg);
    color: var(--y-ie-text);
    font-family: inherit;
    font-size: 14px;
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.y-ie--fullscreen {
    position: fixed;
    inset: 0;
    z-index: var(--y-ie-zindex, 10000);
    height: 100dvh;
}

.y-ie button {
    font-family: inherit;
    color: inherit;
}

.y-ie .material-symbols-rounded {
    font-size: 22px;
    line-height: 1;
}

.y-ie__defs {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

.y-ie__btn:focus-visible,
.y-ie__done:focus-visible,
.y-ie__music-pill:focus-visible,
.y-ie__tool:focus-visible,
.y-ie__chip:focus-visible,
.y-ie__swatch:focus-visible,
.y-ie__filter:focus-visible,
.y-ie__music-card:focus-visible,
.y-ie__emoji-menu button:focus-visible,
.y-ie .y-ie__layer-delete:focus-visible {
    outline: 2px solid var(--y-ie-accent);
    outline-offset: 2px;
}

/* Top bar */

.y-ie__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
}

.y-ie__history {
    display: flex;
    gap: 4px;
}

.y-ie__btn {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    transition: background .15s ease, opacity .15s ease, transform .15s ease;
}

.y-ie__btn:hover:not(:disabled) {
    background: var(--y-ie-control);
}

.y-ie__btn:active:not(:disabled) {
    transform: scale(.94);
}

.y-ie__btn:disabled {
    opacity: .5;
    cursor: default;
}

.y-ie__done {
    flex-shrink: 0;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: var(--yurba-radius-pill, 100px);
    background: var(--y-ie-accent-soft);
    color: var(--y-ie-accent) !important;
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, opacity .15s ease, transform .15s ease;
}

.y-ie__done:hover:not(:disabled) {
    background: var(--y-ie-accent);
    color: var(--y-ie-on-accent) !important;
}

.y-ie__done:active:not(:disabled) {
    transform: scale(.96);
}

.y-ie__done:disabled {
    opacity: .5;
    cursor: progress;
}

/* Stage */

.y-ie__viewport {
    position: relative;
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    min-height: 0;
}

.y-ie__stage {
    position: relative;
    overflow: hidden;
    touch-action: none;
    border-radius: 4px;
}

.y-ie--frame .y-ie__stage {
    border-radius: var(--y-ie-radius);
}

.y-ie__base,
.y-ie__paint {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.y-ie__vignette,
.y-ie__layers,
.y-ie__guides {
    position: absolute;
    inset: 0;
}

.y-ie__vignette,
.y-ie__guides {
    pointer-events: none;
}

.y-ie.is-drawing .y-ie__stage {
    cursor: crosshair;
}

.y-ie.is-drawing .y-ie__layers {
    pointer-events: none;
}

.y-ie--frame .y-ie__stage:not(:has(.y-ie__layer:hover)) {
    cursor: grab;
}

/* Layers */

.y-ie__layer {
    position: absolute;
    transform-origin: center;
    cursor: move;
    touch-action: none;
}

.y-ie__layer-body > canvas {
    display: block;
}

.y-ie__layer.is-selected::before {
    content: "";
    position: absolute;
    inset: -6px;
    border: calc(1.5px / var(--y-ie-stretch, 1)) dashed rgba(255, 255, 255, .85);
    border-radius: calc(10px / var(--y-ie-stretch, 1));
    pointer-events: none;
}

.y-ie__layer.is-editing {
    visibility: hidden;
}

.y-ie .y-ie__layer-delete,
.y-ie .y-ie__layer-handle {
    position: absolute;
    display: none;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: #fff;
    color: #000;
    box-shadow: 0 1px 6px rgba(0, 0, 0, .35);
    transform: scale(calc(1 / var(--y-ie-stretch, 1)));
}

.y-ie__layer-delete {
    top: -19px;
    left: -19px;
    cursor: pointer;
}

.y-ie__layer-handle {
    right: -19px;
    bottom: -19px;
    cursor: nwse-resize;
}

.y-ie__layer-delete .material-symbols-rounded,
.y-ie__layer-handle .material-symbols-rounded {
    font-size: 16px;
}

.y-ie__layer.is-selected .y-ie__layer-delete,
.y-ie__layer.is-selected .y-ie__layer-handle {
    display: flex;
}

.y-ie__guide {
    position: absolute;
    display: none;
    background: rgba(255, 214, 10, .9);
}

.y-ie__guide.is-on {
    display: block;
}

.y-ie__guide--x {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
}

.y-ie__guide--y {
    left: 0;
    right: 0;
    top: 50%;
    height: 1px;
}

/* JS measures its width as the drop radius */
.y-ie__trash {
    position: absolute;
    bottom: 18px;
    left: 50%;
    display: none;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .55);
    border: 1.5px solid rgba(255, 255, 255, .4);
    transform: translateX(-50%);
    transition: transform .15s ease, background .15s ease, border-color .15s ease;
    pointer-events: none;
}

.y-ie.is-dragging-layer .y-ie__trash {
    display: flex;
}

.y-ie__trash.is-over {
    background: var(--y-ie-danger);
    border-color: transparent;
    transform: translateX(-50%) scale(1.15);
}

@media (pointer: coarse) {
    .y-ie__layer.is-selected .y-ie__layer-handle {
        display: none;
    }
}

/* Crop */

.y-ie__crop {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.y-ie.is-cropping .y-ie__stage {
    overflow: visible;
}

.y-ie__crop-shade {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.y-ie__crop-hole {
    position: absolute;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .55);
}

.y-ie__crop-box {
    position: absolute;
    border: 1px solid rgba(255, 255, 255, .9);
    cursor: move;
}

.y-ie__crop-grid {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to right, transparent calc(100% / 3 - .5px), rgba(255, 255, 255, .45) calc(100% / 3 - .5px), rgba(255, 255, 255, .45) calc(100% / 3 + .5px), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), rgba(255, 255, 255, .45) calc(200% / 3 - .5px), rgba(255, 255, 255, .45) calc(200% / 3 + .5px), transparent calc(200% / 3 + .5px)),
        linear-gradient(to bottom, transparent calc(100% / 3 - .5px), rgba(255, 255, 255, .45) calc(100% / 3 - .5px), rgba(255, 255, 255, .45) calc(100% / 3 + .5px), transparent calc(100% / 3 + .5px), transparent calc(200% / 3 - .5px), rgba(255, 255, 255, .45) calc(200% / 3 - .5px), rgba(255, 255, 255, .45) calc(200% / 3 + .5px), transparent calc(200% / 3 + .5px));
    opacity: 0;
    transition: opacity .15s ease;
    pointer-events: none;
}

.y-ie__crop.is-dragging .y-ie__crop-grid {
    opacity: 1;
}

.y-ie__crop-box:focus-visible,
.y-ie__crop-handle:focus-visible,
.y-ie__trim-range:focus-visible,
.y-ie__trim-handle:focus-visible {
    outline: 2px solid var(--y-ie-accent);
    outline-offset: 2px;
}

.y-ie__crop-handle {
    position: absolute;
    width: 22px;
    height: 22px;
}

.y-ie__crop-handle::after {
    content: "";
    position: absolute;
    background: #fff;
    border-radius: var(--yurba-radius-pill, 100px);
}

.y-ie__crop-handle[data-handle="nw"],
.y-ie__crop-handle[data-handle="ne"],
.y-ie__crop-handle[data-handle="sw"],
.y-ie__crop-handle[data-handle="se"] {
    border: 0 solid #fff;
}

.y-ie__crop-handle[data-handle="nw"] { top: -3px; left: -3px; border-width: 3px 0 0 3px; cursor: nwse-resize; }
.y-ie__crop-handle[data-handle="ne"] { top: -3px; right: -3px; border-width: 3px 3px 0 0; cursor: nesw-resize; }
.y-ie__crop-handle[data-handle="sw"] { bottom: -3px; left: -3px; border-width: 0 0 3px 3px; cursor: nesw-resize; }
.y-ie__crop-handle[data-handle="se"] { bottom: -3px; right: -3px; border-width: 0 3px 3px 0; cursor: nwse-resize; }

.y-ie__crop-handle[data-handle="n"],
.y-ie__crop-handle[data-handle="s"] {
    left: 50%;
    width: 36px;
    margin-left: -18px;
    cursor: ns-resize;
}

.y-ie__crop-handle[data-handle="n"] { top: -12px; }
.y-ie__crop-handle[data-handle="s"] { bottom: -12px; }

.y-ie__crop-handle[data-handle="n"]::after,
.y-ie__crop-handle[data-handle="s"]::after {
    left: 6px;
    right: 6px;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
}

.y-ie__crop-handle[data-handle="e"],
.y-ie__crop-handle[data-handle="w"] {
    top: 50%;
    height: 36px;
    margin-top: -18px;
    cursor: ew-resize;
}

.y-ie__crop-handle[data-handle="e"] { right: -12px; }
.y-ie__crop-handle[data-handle="w"] { left: -12px; }

.y-ie__crop-handle[data-handle="e"]::after,
.y-ie__crop-handle[data-handle="w"]::after {
    top: 6px;
    bottom: 6px;
    left: 50%;
    width: 3px;
    margin-left: -1.5px;
}

/* Panel and tools */

.y-ie__panel {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 16px 16px 12px;
    border-radius: var(--yurba-radius-xl, 20px) var(--yurba-radius-xl, 20px) 0 0;
    background: var(--y-ie-panel);
    animation: y-ie-rise .2s var(--y-ie-ease-in);
}

.y-ie__panel[hidden] {
    display: none;
}

.y-ie__tools {
    display: flex;
    gap: 2px;
    padding: 6px 8px;
    padding-bottom: max(6px, env(safe-area-inset-bottom));
    overflow-x: auto;
    scrollbar-width: none;
    background: var(--y-ie-panel);
}

.y-ie__panel[hidden] + .y-ie__tools {
    padding-top: 10px;
    border-radius: var(--yurba-radius-xl, 20px) var(--yurba-radius-xl, 20px) 0 0;
}

/* Spacers, not justify-content: wide rows must scroll to the start */
.y-ie__tools::before,
.y-ie__tools::after {
    content: "";
    margin: auto;
}

.y-ie__tools::-webkit-scrollbar,
.y-ie__chips::-webkit-scrollbar,
.y-ie__filters::-webkit-scrollbar,
.y-ie__colors::-webkit-scrollbar {
    display: none;
}

.y-ie__tool {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    gap: 4px;
    min-width: 58px;
    padding: 4px;
    border: none;
    border-radius: var(--yurba-radius-m, 10px);
    background: transparent;
    color: var(--y-ie-muted) !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: color .15s ease;
}

/* The icon may be custom markup: match it by place, the label is always last */
.y-ie__tool > :not(:last-child) {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 32px;
    border-radius: var(--yurba-radius-pill, 100px);
    transition: background .15s ease, transform .15s ease;
}

.y-ie__tool:hover:not(:disabled) {
    color: var(--y-ie-text) !important;
}

.y-ie__tool:hover:not(:disabled) > :not(:last-child) {
    background: var(--y-ie-control);
}

.y-ie__tool:active:not(:disabled) > :not(:last-child) {
    transform: scale(.94);
}

.y-ie__tool.is-active {
    color: var(--y-ie-text) !important;
    font-weight: 600;
}

.y-ie__tool.is-active > :not(:last-child),
.y-ie__tool.is-active:hover > :not(:last-child) {
    background: var(--y-ie-control-hover);
}

.y-ie__tool[hidden] {
    display: none;
}

.y-ie__tool:disabled {
    opacity: .5;
    cursor: default;
}

@media (max-width: 520px) {
    .y-ie__tool {
        min-width: 50px;
        padding: 4px 2px;
    }

    .y-ie__tool > :not(:last-child) {
        width: 44px;
    }
}

.y-ie__chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
}

.y-ie__chip {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 12px;
    border: none;
    border-radius: var(--yurba-radius-pill, 100px);
    background: var(--y-ie-control);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}

.y-ie__chip:hover {
    background: var(--y-ie-control-hover);
}

.y-ie__chip.is-active {
    background: var(--y-ie-text);
    color: #000 !important;
}

.y-ie__chip .material-symbols-rounded {
    font-size: 20px;
}

.y-ie__chip.is-changed:not(.is-active)::after {
    content: "";
    width: 6px;
    height: 6px;
    margin-left: -2px;
    border-radius: 50%;
    background: var(--y-ie-accent);
}

.y-ie__colors {
    display: flex;
    gap: 10px;
    /* The active swatch's ring reaches ~6px out */
    padding: 6px;
    overflow-x: auto;
    scrollbar-width: none;
}

.y-ie__swatch {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid rgba(255, 255, 255, .85);
    border-radius: 50%;
    background: var(--y-ie-swatch);
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
}

.y-ie__swatch:hover {
    transform: scale(1.08);
}

.y-ie__swatch.is-active {
    transform: scale(1.1);
    box-shadow: 0 0 0 2px var(--y-ie-panel), 0 0 0 4px var(--y-ie-accent);
}

.y-ie__swatch--blur {
    background: conic-gradient(from 45deg, #ff9a9e, #fad0c4, #a1c4fd, #c2e9fb, #ff9a9e);
    filter: blur(.4px);
}

/* Sliders */

.y-ie__slider {
    display: grid;
    grid-template-columns: auto 1fr 36px;
    align-items: center;
    gap: 12px;
}

.y-ie__slider-label {
    color: var(--y-ie-muted);
    font-size: 13px;
    font-weight: 500;
}

.y-ie__slider-value {
    font-size: 13px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.y-ie__slider input,
.y-ie__text-size {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 4px;
    margin: 0;
    border-radius: var(--yurba-radius-pill, 100px);
    background: var(--y-ie-track);
    outline: none;
    cursor: pointer;
}

.y-ie__slider input {
    background:
        linear-gradient(to right,
            transparent min(var(--y-ie-origin, 0%), var(--y-ie-fill, 0%)),
            var(--y-ie-accent) min(var(--y-ie-origin, 0%), var(--y-ie-fill, 0%)),
            var(--y-ie-accent) max(var(--y-ie-origin, 0%), var(--y-ie-fill, 0%)),
            transparent max(var(--y-ie-origin, 0%), var(--y-ie-fill, 0%))),
        var(--y-ie-track);
}

.y-ie__slider input::-webkit-slider-thumb,
.y-ie__text-size::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    transition: transform .15s ease, box-shadow .15s ease;
}

.y-ie__slider input::-moz-range-thumb,
.y-ie__text-size::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border: none;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    transition: transform .15s ease, box-shadow .15s ease;
}

.y-ie__slider input:hover::-webkit-slider-thumb,
.y-ie__text-size:hover::-webkit-slider-thumb {
    transform: scale(1.2);
}

.y-ie__slider input:hover::-moz-range-thumb,
.y-ie__text-size:hover::-moz-range-thumb {
    transform: scale(1.2);
}

.y-ie__slider input:active::-webkit-slider-thumb,
.y-ie__text-size:active::-webkit-slider-thumb {
    transform: scale(1.4);
}

.y-ie__slider input:active::-moz-range-thumb,
.y-ie__text-size:active::-moz-range-thumb {
    transform: scale(1.4);
}

.y-ie__slider input:focus-visible::-webkit-slider-thumb,
.y-ie__text-size:focus-visible::-webkit-slider-thumb {
    box-shadow: 0 0 0 2px var(--y-ie-panel), 0 0 0 4px var(--y-ie-accent);
}

.y-ie__slider input:focus-visible::-moz-range-thumb,
.y-ie__text-size:focus-visible::-moz-range-thumb {
    box-shadow: 0 0 0 2px var(--y-ie-panel), 0 0 0 4px var(--y-ie-accent);
}

/* Filters and stickers */

.y-ie__filters {
    display: flex;
    gap: 10px;
    padding: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}

.y-ie__filter {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: none;
    border-radius: var(--yurba-radius-m, 10px);
    background: none;
    color: var(--y-ie-muted) !important;
    font-size: 12px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    transition: color .15s ease;
}

.y-ie__filter:hover {
    color: var(--y-ie-text) !important;
}

.y-ie__filter canvas {
    width: auto;
    height: 64px;
    max-width: 96px;
    border-radius: var(--yurba-radius-m, 10px);
    outline: 2px solid transparent;
    outline-offset: 2px;
    object-fit: cover;
    transition: outline-color .15s ease;
}

.y-ie__filter.is-active {
    color: var(--y-ie-text) !important;
    font-weight: 600;
}

.y-ie__filter.is-active canvas {
    outline-color: var(--y-ie-accent);
}

.y-ie__emoji-menu {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(40px, 1fr));
    gap: 4px;
}

.y-ie__emoji-menu button {
    height: 40px;
    padding: 0;
    border: none;
    border-radius: var(--yurba-radius-m, 10px);
    background: none;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
    transition: background .15s ease, transform .15s ease;
}

.y-ie__emoji-menu button:hover {
    background: var(--y-ie-control);
}

.y-ie__emoji-menu button:active {
    transform: scale(.9);
}

/* Trim */

/* No padding: JS maps its width to seconds */
.y-ie__trim {
    position: relative;
    height: 56px;
    overflow: hidden;
    border-radius: var(--yurba-radius-m, 10px);
    touch-action: none;
}

.y-ie__trim-strip {
    display: flex;
    height: 100%;
    overflow: hidden;
    border-radius: var(--yurba-radius-m, 10px);
    opacity: .55;
}

.y-ie__trim-strip canvas {
    flex: 1 0 auto;
    height: 100%;
    min-width: 0;
    object-fit: cover;
}

.y-ie__trim-range {
    position: absolute;
    top: 0;
    bottom: 0;
    border: 2px solid #fff;
    border-radius: var(--yurba-radius-m, 10px);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, .45);
    cursor: grab;
}

.y-ie__trim-handle {
    position: absolute;
    top: -2px;
    bottom: -2px;
    width: 14px;
    background: #fff;
    cursor: ew-resize;
}

.y-ie__trim-handle[data-side="start"] {
    left: -2px;
    border-radius: var(--yurba-radius-m, 10px) 0 0 var(--yurba-radius-m, 10px);
}

.y-ie__trim-handle[data-side="end"] {
    right: -2px;
    border-radius: 0 var(--yurba-radius-m, 10px) var(--yurba-radius-m, 10px) 0;
}

.y-ie__trim-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2px;
    height: 16px;
    margin: -8px 0 0 -1px;
    border-radius: var(--yurba-radius-pill, 100px);
    background: #000;
}

.y-ie__trim-playhead {
    position: absolute;
    top: 4px;
    bottom: 4px;
    width: 2px;
    margin-left: -1px;
    border-radius: var(--yurba-radius-pill, 100px);
    background: var(--y-ie-accent);
    pointer-events: none;
}

.y-ie__trim-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--y-ie-muted);
    font-size: 13px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

/* Text editing */

.y-ie__text-edit {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 72px 16px 16px;
    background: rgba(0, 0, 0, .6);
    backdrop-filter: blur(6px);
    animation: y-ie-fade .2s var(--y-ie-ease-in);
}

.y-ie__text-edit[hidden] {
    display: none;
}

.y-ie__text-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    padding-top: max(10px, env(safe-area-inset-top));
}

.y-ie__text-bar .y-ie__done {
    margin-left: auto;
}

/* Mirrors the canvas text layer; JS sets the sizes */
.y-ie__text-input {
    width: min(92%, 640px);
    max-height: 60%;
    padding: calc(var(--y-ie-text-size, 14px) * .1) calc(var(--y-ie-text-size, 14px) * .38);
    border: none;
    border-radius: calc(var(--y-ie-text-size, 14px) * .28);
    outline: none;
    resize: none;
    overflow-y: auto;
    scrollbar-width: none;
    line-height: 1.25;
    caret-color: var(--y-ie-accent);
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

.y-ie__text-input::placeholder {
    color: rgba(255, 255, 255, .45);
}

.y-ie__text-size {
    position: absolute;
    left: 6px;
    top: 50%;
    width: 180px;
    transform: translate(-70px, -50%) rotate(-90deg);
}

.y-ie__text-colors {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: max(16px, env(safe-area-inset-bottom));
    justify-content: center;
}

.y-ie__text-colors .y-ie__swatch.is-active {
    box-shadow: 0 0 0 2px rgba(0, 0, 0, .6), 0 0 0 4px var(--y-ie-accent);
}

@media (max-width: 520px) {
    .y-ie__text-colors {
        justify-content: flex-start;
    }
}

/* Music */

.y-ie__music-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 46%;
    height: 32px;
    padding: 0 12px 0 10px;
    border: none;
    border-radius: var(--yurba-radius-pill, 100px);
    background: var(--y-ie-control);
    color: #fff;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}

.y-ie__music-pill:hover {
    background: var(--y-ie-control-hover);
}

.y-ie__music-pill[hidden] {
    display: none;
}

.y-ie__music-pill .material-symbols-rounded {
    font-size: 18px;
}

.y-ie__music-pill > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.y-ie__music {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scrollbar-width: none;
    padding: 4px;
}

.y-ie__music::-webkit-scrollbar {
    display: none;
}

.y-ie__music-card {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 76px;
    padding: 0;
    border: none;
    border-radius: var(--yurba-radius-l, 14px);
    background: none;
    color: #fff;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.y-ie__music-card:disabled {
    cursor: default;
}

.y-ie__music-cover {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 76px;
    height: 76px;
    border-radius: var(--yurba-radius-l, 14px);
    background: rgba(255, 255, 255, .1) center / cover no-repeat;
    font-size: 28px;
    transition: box-shadow .15s ease, transform .15s ease;
}

.y-ie__music-card:hover:not(:disabled) .y-ie__music-cover {
    transform: scale(1.04);
}

.y-ie__music-card.is-active .y-ie__music-cover {
    box-shadow: 0 0 0 2px var(--y-ie-panel), 0 0 0 4px var(--y-ie-accent);
}

.y-ie__music-card.is-loading .y-ie__music-cover {
    animation: y-ie-pulse 1s ease-in-out infinite alternate;
}

.y-ie__music-title,
.y-ie__music-sub {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 12px;
    line-height: 1.4;
}

.y-ie__music-title {
    font-weight: 600;
}

.y-ie__music-sub {
    color: var(--y-ie-muted);
}

/* Motion */

@keyframes y-ie-pulse {
    from { opacity: .4; }
    to { opacity: 1; }
}

@keyframes y-ie-rise {
    from { opacity: 0; transform: translateY(8px); }
}

@keyframes y-ie-fade {
    from { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .y-ie__panel,
    .y-ie__text-edit {
        animation: none;
    }
}
