@font-face { font-family: SnapPixText; src: url('fonts/Inter-Regular.ttf') format('truetype'); font-weight: 400; font-style: normal; font-display: block; }
.text-tools-home { margin-top: 16px; border-top: 1px solid var(--studio-border); padding-top: 12px; }
.text-tools-home summary { cursor: pointer; min-height: 44px; padding: 8px 0; }
#text-tools { display: grid; gap: 10px; min-width: 0; }
#text-tools label { display: grid; gap: 5px; font-size: 12px; }
#text-tools input, #text-tools select, #text-tools textarea { width: 100%; min-width: 0; min-height: 40px; }
#text-tools textarea { resize: vertical; padding: 8px; font: inherit; color: var(--studio-text); background: var(--studio-raised); border: 1px solid var(--studio-border); border-radius: 6px; }
.text-tool-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#text-tools .text-background { display: flex; align-items: center; gap: 8px; }
#text-tools .text-background input { width: 20px; min-height: 24px; }
#text-tools small { color: var(--studio-muted); font-size: 11px; line-height: 1.5; }
.placed-text { position: absolute; z-index: 5; touch-action: none; cursor: grab; user-select: none; outline: 1px solid transparent; }
.placed-text.selected { outline: 1px solid var(--studio-accent); }
.placed-text:focus-visible { outline: 2px solid var(--studio-accent); }
.placed-text canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
/* Text clips use the same compact geometry as telemetry tracks. */
html[data-theme] .text-time-track { position: absolute; display: flex; align-items: center; gap: 5px; box-sizing: border-box; inset-block: 0; padding: 0 17px; border: 1px solid color-mix(in srgb, var(--studio-accent) 65%, transparent); border-radius: 6px; background: color-mix(in srgb, var(--studio-accent) 22%, var(--studio-panel)); color: var(--studio-text); font-family: inherit; text-align: left; touch-action: none; user-select: none; cursor: grab; }
.text-time-icon { flex: 0 0 auto; font: 600 13px/1 Georgia, serif; color: var(--studio-accent); }
.text-time-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; line-height: 1.2; font-weight: 500; }
.text-time-track:focus-visible { outline: 2px solid var(--studio-accent); outline-offset: 2px; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    #text-tools input, #text-tools select, #text-tools textarea { font-size: 16px; min-height: 44px; }
    .text-selection-active .widget-time-tracks, .text-selection-active .widget-track-tools { visibility: hidden; }
    html[data-theme] body > header #phone-import {
        order: -2;
        flex-shrink: 0;
        min-height: 44px;
        padding: 8px 11px;
        font-size: 12px;
        background: #d88992;
        border-color: #c67581;
        color: #552c32;
    }
    html[data-theme] body > header #phone-import:hover { background: #e198a1; }
    html[data-theme] body > header #phone-import:active { background: #ca7683; }
    html[data-theme] body > header #export { order: -1; }
    html[data-theme] body > header .actions { gap: 12px; }
    html[data-theme] body > header .brand strong span { display: none; }
}
#phone-import { display: none; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) { #phone-import { display: inline-flex; align-items: center; justify-content: center; } }

@media (max-width:360px) { header .brand img { display: none; } }

.phone-download-result { display: none; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    header .desktop-export-result { display: none !important; }
    html[data-theme] .phone-download-result { display: grid; place-items: center; width: 44px; min-width: 44px; min-height: 44px; padding: 0; }
}


.workspace-add { margin-top: 10px; }
.workspace-add > span { display: block; margin-bottom: 5px; color: var(--studio-muted); font-size: 11px; }
.workspace-add-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--studio-border); border-radius: 8px; background: var(--studio-raised); }
html[data-theme] .workspace-add-actions button { display: flex; align-items: center; justify-content: center; gap: 5px; min-height: 38px; min-width: 0; padding: 4px; border: 0; border-radius: 0; background: transparent; font-size: 11px; }
html[data-theme] .workspace-add-actions button + button { border-left: 1px solid var(--studio-border); }
html[data-theme] .workspace-add-actions button:hover { background: var(--studio-hover); }
.workspace-add-actions svg, .library .import-button svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.inspector.widget-inspector-empty > :not(.desktop-text-inspector),
.inspector:has(> .desktop-text-inspector:not([hidden])) > :not(.desktop-text-inspector) {
    display: none !important;
}
.desktop-text-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.desktop-text-heading h2 { margin: 0; font-size: 18px; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) { .workspace-add { display: none !important; } }

@font-face { font-family: SnapPixText; src: url('fonts/Inter-SemiBold.ttf') format('truetype'); font-weight: 600; font-style: normal; font-display: block; }
@font-face { font-family: SnapPixText; src: url('fonts/Inter-Bold.ttf') format('truetype'); font-weight: 700; font-style: normal; font-display: block; }
.text-tabs, .text-style-tabs { display: none; }
#text-tools [data-text-pane], #text-tools [data-style-pane] { display: grid; gap: 12px; min-width: 0; }
#text-tools [data-text-pane] { padding-top: 12px; }
.text-presets, .text-swatches { display: flex; gap: 10px; overflow-x: auto; padding: 4px 2px 10px; scrollbar-width: none; }
html[data-theme] .text-presets button { flex: 0 0 58px; height: 58px; min-height: 58px; border: 2px solid transparent; border-radius: 10px; padding: 4px; background: var(--studio-raised); }
html[data-theme] .text-presets button[aria-pressed=true], html[data-theme] .text-fonts button[aria-pressed=true] { border-color: var(--studio-accent); }
html[data-theme] .text-swatches button { flex: 0 0 44px; width: 44px; height: 44px; min-height: 44px; padding: 5px; border: 2px solid transparent; border-radius: 50%; background: var(--swatch); background-clip: content-box; }
html[data-theme] .text-swatches button[aria-pressed=true] { border-color: var(--studio-accent); }
.text-fonts, .text-templates { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; }
html[data-theme] .text-fonts button, html[data-theme] .text-templates button { min-height: 64px; padding: 8px; border: 1px solid transparent; border-radius: 8px; background: var(--studio-raised); font-family: SnapPixText; white-space: normal; }
.text-entry { position: relative; }
html[data-theme] #text-tools .text-confirm { position: absolute; right: 4px; top: 25px; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 10px; border: 0; background: transparent; color: var(--studio-accent); }
.text-confirm svg, .placed-text button svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
#text-tools .text-entry textarea { padding-right: 52px; }
.text-timing { border-top: 1px solid var(--studio-border); padding-top: 8px; }
.text-timing summary { min-height: 36px; cursor: pointer; font-size: 12px; }
#text-tools input[type=checkbox] { width: 22px; min-height: 22px; accent-color: var(--studio-accent); }
#text-tools input[type=range] { accent-color: var(--studio-accent); }
html[data-theme] .placed-text button {
    position: absolute;
    display: none;
    place-items: center;
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: var(--studio-text);
    transform: translate(-50%, -50%);
    touch-action: none;
}
html[data-theme] .placed-text.selected button { display: grid; }
.placed-text button svg {
    width: 18px;
    height: 18px;
    padding: 3px;
    border: 1px solid var(--studio-border);
    border-radius: 5px;
    background: var(--studio-panel);
}
/* Keep the hit area invisible in every interaction state. */
html[data-theme] .placed-text button:is(:hover, :active, :focus-visible) {
    background: transparent;
    box-shadow: none;
    outline: none;
}
.placed-text .text-delete-handle svg {
    width: 16px;
    height: 16px;
    padding: 2px;
    border: 0;
    background: color-mix(in srgb, var(--studio-panel) 58%, transparent);
    stroke-width: 1.6;
}
.placed-text button:hover svg { color: var(--studio-accent); }
.placed-text button:focus-visible svg,
.placed-text .text-scale-handle:focus-visible::after { outline: 1px solid var(--studio-accent); outline-offset: 2px; }
.placed-text .text-scale-handle { cursor: nwse-resize; }
.placed-text .text-rotate-handle { cursor: grab; }
.placed-text .text-rotate-handle:active { cursor: grabbing; }
.placed-text .text-rotate-handle svg {
    width: 20px;
    height: 20px;
    padding: 3px;
    border-color: #4c78af;
    border-radius: 50%;
    background: #fff;
    color: #294365;
}
.placed-text .text-scale-handle::after {
    content: '';
    width: 10px;
    height: 10px;
    box-sizing: border-box;
    border: 1px solid #f6f9ff;
    background: #4598fa;
    pointer-events: none;
}
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    #text-tools { gap: 10px; }
    #text-tools .text-tabs, #text-tools .text-style-tabs { display: flex; gap: 18px; overflow-x: auto; scrollbar-width: none; flex: none; min-width: 0; }
    html[data-theme] #text-tools .text-tabs button, html[data-theme] #text-tools .text-style-tabs button { flex: none; min-height: 44px; padding: 8px 0; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--studio-muted); font-size: 15px; transition: color .15s,border-color .15s; }
    html[data-theme] #text-tools .text-tabs button[aria-selected=true], html[data-theme] #text-tools .text-style-tabs button[aria-pressed=true] { color: var(--studio-text); border-bottom-color: var(--studio-accent); }
    #text-tools [data-text-pane]:not(.active), #text-tools [data-style-pane]:not(.active) { display: none; }
    #text-tools [data-text-pane] { padding-top: 0; }
    #text-tools .text-entry textarea { min-height: 52px; height: 52px; border: 0; border-radius: 10px; background: var(--studio-raised); resize: vertical; }
    #text-tools .text-entry { font-size: 0; gap: 0; position: sticky; top: 0; z-index: 2; background: var(--studio-panel); }
    html[data-theme] #text-tools .text-confirm { top: 4px; }
    #text-tools > #add-text { display: none; }
    #text-tools > small { display: none; }
    body.text-sheet-open .phone-sheet-backdrop { pointer-events: none; background: transparent; }
    html[data-theme] body.text-sheet-open .editor > .preview-shell { flex: 0 0 auto; height: max(70px,calc(44dvh - 60px)); }
    html[data-theme] #phone-dock .phone-sheet.text-sheet { height: var(--sheet-height,56dvh); max-height: 72dvh; }
    html[data-theme] #phone-dock .phone-sheet.text-sheet .phone-sheet-heading { height: 44px; padding-top: 0; }
    #phone-dock .phone-sheet.text-sheet .phone-sheet-content { height: calc(100% - 44px); padding-bottom: max(16px,env(safe-area-inset-bottom)); }
    html[data-theme] body.text-keyboard-open #phone-dock .phone-sheet.text-sheet { height: 140px; bottom: max(0px,calc(100dvh - var(--text-viewport-height))); }
    body.text-keyboard-open #text-tools > :not(.text-entry) { display: none !important; }
    html[data-theme] body.text-keyboard-open .editor > .preview-shell { height: max(50px,calc(var(--text-viewport-height) - 210px)); }
}

.text-time-tracks { position: relative; display: grid; gap: 3px; margin-top: 3px; padding-block: 2px; }
.text-time-lane { position: relative; height: 24px; }
html[data-theme] .text-time-track:not([aria-pressed=true]) { border-color: transparent; background: color-mix(in srgb,var(--studio-accent) 14%,var(--studio-panel)); }
.text-time-track:not([aria-pressed=true]) .text-time-handle { visibility: hidden; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) { .text-time-tracks { max-height: 82px; overflow-y: auto; scrollbar-width: none; } }

#text-tools textarea { font-family: inherit; }
#text-tools .text-custom-color {
    --color-picker-size: 44px;
    position: relative;
    align-self: center;
    flex: 0 0 var(--color-picker-size);
    width: var(--color-picker-size);
    height: var(--color-picker-size);
    padding: 0;
    border-radius: 50%;
    background: conic-gradient(#ff6060,#ffe34d,#5dd5c8,#7babff,#c67bff,#ff6060);
    font-size: 0;
}
#text-tools .text-custom-color input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}
#text-tools .text-custom-color:focus-within { outline: 2px solid var(--studio-accent); outline-offset: 2px; }
.phone-back svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    #text-tools > #remove-text { order: 12; color: #ef959c; background: transparent; border: 0; min-height: 44px; }
    #text-tools > .text-timing { order: 11; }
    #text-tools .text-custom-color { font-size: 0; }
}

html[data-theme] #text-tools input[type=range] { appearance: none; -webkit-appearance: none; width: 100%; min-height: 32px; height: 32px; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent; cursor: pointer; }
#text-tools input[type=range]::-webkit-slider-runnable-track { height: 3px; border-radius: 3px; background: var(--studio-border); }
#text-tools input[type=range]::-webkit-slider-thumb { appearance: none; -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border: 0; border-radius: 50%; background: var(--studio-accent); box-shadow: 0 0 0 2px var(--studio-panel); }
#text-tools input[type=range]::-moz-range-track { height: 3px; border-radius: 3px; background: var(--studio-border); }
#text-tools input[type=range]::-moz-range-thumb { width: 20px; height: 20px; border: 0; border-radius: 50%; background: var(--studio-accent); }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    html[data-theme] #phone-dock .phone-sheet.text-sheet { height: var(--sheet-height,60dvh); }
    html[data-theme] body.text-sheet-open .editor > .preview-shell { height: max(70px,calc(40dvh - 60px)); }
    html[data-theme] #text-tools input[type=range] { min-height: 44px; height: 44px; }
    html[data-theme] body.text-keyboard-open #phone-dock .phone-sheet.text-sheet { height: 140px; }
    html[data-theme] body.text-keyboard-open .editor > .preview-shell { height: max(50px,calc(var(--text-viewport-height) - 210px)); }
}

html[data-theme] #text-tools .text-eyedropper { display: grid; place-items: center; background: var(--studio-raised); border: 0; padding: 10px; }
.text-eyedropper svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
@media (max-height:500px) and (max-width:1024px) and (pointer:coarse) {
    .text-time-tracks { max-height: 28px; }
    .widget-track-tools { display: none !important; }
}

@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    #text-tools [data-text-pane], #text-tools [data-style-pane] { gap: 6px; }
    #text-tools .text-presets { padding-bottom: 0; }
    #text-tools .text-swatches { padding-block: 0; }
    #text-tools label:has(> #text-size), #text-tools label:has(> #text-opacity) { display: grid; grid-template-columns: 60px minmax(0,1fr); align-items: center; min-height: 44px; font-size: 13px; }
}

.text-time-tracks { overscroll-behavior-y: contain; }

@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    html[data-theme] #phone-dock .phone-sheet.text-sheet[data-expanded=true] { height: var(--sheet-height,72dvh); }
    html[data-theme] body.text-sheet-open:not(.text-keyboard-open):has(.text-sheet[data-expanded=true]) .editor > .preview-shell { height: max(60px,calc(28dvh - 60px)); }
    html[data-theme] body.text-keyboard-open #phone-dock .phone-sheet.text-sheet[data-expanded=true] { height: 140px; }
}


#text-tools textarea { font-family: "Segoe UI", system-ui, sans-serif; }

.text-new-inline { display: none; }
@media (max-width:768px), (max-width:1024px) and (max-height:500px) and (pointer:coarse) {
    html[data-theme] #text-tools .text-new-inline:not([hidden]) {
        position: absolute;
        top: 4px;
        right: 48px;
        display: grid;
        place-items: center;
        width: 36px;
        height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: var(--studio-muted);
        font-size: 20px;
    }
    #text-tools .text-entry:has(.text-new-inline:not([hidden])) textarea { padding-right: 88px; }
}

/* Desktop uses the same controls in a compact inspector. */
@media (min-width: 769px) {
    .text-tools-home { display: none; }
}

.desktop-text-heading { margin-bottom: 12px; }
html[data-theme] .desktop-text-heading button {
    min-height: 32px;
    padding: 4px 14px;
    border-color: transparent;
    background: var(--studio-accent);
    color: var(--studio-accent-text);
}

.desktop-text-inspector #text-tools {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px 12px;
    align-items: start;
}
.desktop-text-inspector #text-tools > * { grid-column: 1 / -1; }
.desktop-text-inspector #text-tools > #add-text { display: none; }
.desktop-text-inspector #text-tools > .text-timing { grid-column: 1; grid-row: 4; }
.desktop-text-inspector #text-tools > #remove-text { grid-column: 2; grid-row: 4; }
.desktop-text-inspector #text-tools > .text-entry { grid-row: 1; }
.desktop-text-inspector #text-tools > .text-tabs { grid-row: 2; }
.desktop-text-inspector #text-tools > [data-text-pane] { grid-row: 3; }
.desktop-text-inspector #text-tools > small { grid-row: 5; }

html[data-theme] .desktop-text-inspector #text-tools :is(button, select, input[type=number]) {
    min-height: 32px;
    padding: 4px 9px;
    font-size: 12px;
}
html[data-theme] .desktop-text-inspector #text-tools #remove-text {
    border-color: transparent;
    background: transparent;
    color: var(--studio-muted);
}
html[data-theme] .desktop-text-inspector #text-tools #remove-text:hover { color: #ef959c; }

.desktop-text-inspector #text-tools .text-entry textarea { display: block; width: 100%; min-width: 0; padding: 8px 10px; resize: vertical; }
html[data-theme] .desktop-text-inspector #text-tools .text-confirm,
.desktop-text-inspector #text-tools .text-fonts,
.desktop-text-inspector #text-tools [data-text-pane]:not(.active),
.desktop-text-inspector #text-tools [data-style-pane]:not(.active) { display: none; }

.desktop-text-inspector #text-tools :is(.text-tabs, .text-style-tabs) {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    overflow: visible;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--studio-border);
}
html[data-theme] .desktop-text-inspector #text-tools :is(.text-tabs, .text-style-tabs) button {
    flex: none;
    min-height: 28px;
    border: 1px solid transparent;
    border-radius: 5px;
    background: transparent;
    color: var(--studio-muted);
}
html[data-theme] .desktop-text-inspector #text-tools :is(.text-tabs, .text-style-tabs) button:is([aria-selected=true], [aria-pressed=true]) {
    background: var(--studio-raised);
    border-color: var(--studio-border);
    color: var(--studio-accent);
}

.desktop-text-inspector #text-tools [data-text-pane] { padding-top: 0; }
.desktop-text-inspector #text-tools [data-text-pane="Fonts"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.desktop-text-inspector #text-tools :is(.text-presets, .text-swatches) { flex-wrap: wrap; align-items: center; gap: 6px; padding: 2px 0; overflow: visible; }
html[data-theme] .desktop-text-inspector #text-tools .text-presets button { flex-basis: 40px; height: 38px; min-height: 38px; padding: 2px; border-radius: 6px; }
html[data-theme] .desktop-text-inspector #text-tools .text-swatches button { flex-basis: 29px; width: 29px; height: 29px; min-height: 29px; padding: 3px; }
.desktop-text-inspector #text-tools .text-custom-color { --color-picker-size: 29px; }
.desktop-text-inspector #text-tools .text-eyedropper svg { width: 17px; height: 17px; }
.desktop-text-inspector #text-tools label:has(> input[type=range]) {
    grid-template-columns: 82px minmax(0, 1fr);
    align-items: center;
}
.desktop-text-inspector #text-tools .text-timing { border: 0; padding-top: 0; }
.desktop-text-inspector #text-tools .text-timing summary { min-height: 32px; padding-block: 6px; color: var(--studio-muted); }
.desktop-text-inspector #text-tools .text-timing .text-tool-row + .text-tool-row { margin-top: 6px; }


.desktop-text-actions { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: thin; }
.text-selection-active .timeline-edit-tools > :is(#split-clip, #cut-clip, #create-story) { display: none; }
.desktop-text-actions button { flex: none; white-space: nowrap; }
.desktop-text-inspector #text-tools .text-tabs,
.desktop-text-inspector #text-tools .text-style-tabs { gap: 4px; }
html[data-theme] .desktop-text-inspector #text-tools :is(.text-tabs, .text-style-tabs) button { padding-inline: 6px; }

.text-snap-guide {
    position: absolute;
    z-index: 7;
    pointer-events: none;
    background: var(--studio-accent);
    opacity: .7;
}
.text-snap-guide.vertical { top: 0; bottom: 0; left: var(--text-guide-position); width: 1px; }
.text-snap-guide.horizontal { left: 0; right: 0; top: var(--text-guide-position); height: 1px; }
html[data-theme] .phone-sheet.text-sheet .phone-text-cancel {
    width: auto;
    padding-inline: 8px;
    font-size: 12px;
    margin-left: auto;
}

#text-tools [data-text-pane="Animations"] { grid-template-columns: minmax(0, 1fr); }
#text-tools .text-animation-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    align-items: center;
    padding: 6px 0 10px;
    border-bottom: 1px solid var(--studio-border);
}
#text-tools .text-animation-modes {
    display: flex;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--studio-border);
    border-radius: 9px;
    background: var(--studio-panel);
}
html[data-theme] #text-tools .text-animation-modes button {
    flex: 1;
    padding: 4px 8px;
    border: 1px solid transparent;
    border-radius: 6px;
    background: transparent;
    color: var(--studio-muted);
    font-size: 12px;
}
html[data-theme] #text-tools .text-animation-modes button[aria-pressed=true] {
    border-color: var(--studio-border);
    background: var(--studio-raised);
    color: var(--studio-text);
}
#text-tools .text-animation-duration { grid-column: 1 / -1; grid-row: 2; }
html[data-theme] #text-tools .text-animation-replay {
    grid-column: 2;
    grid-row: 1;
    width: 40px;
    padding: 6px;
    border-radius: 8px;
    color: var(--studio-accent);
}
.text-animation-replay svg { display: block; width: 17px; height: 17px; margin: auto; fill: none; stroke: currentColor; stroke-width: 1.7; }
#text-tools .text-animation-cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    padding-top: 4px;
}
html[data-theme] #text-tools .text-animation-cards button {
    display: grid;
    place-items: center;
    gap: 6px;
    min-height: 72px;
    padding: 8px 4px;
    border: 1px solid var(--studio-border);
    border-radius: 9px;
    background: var(--studio-raised);
    font-size: 11px;
}
html[data-theme] #text-tools .text-animation-cards button:hover:enabled { background: var(--studio-hover); }
html[data-theme] #text-tools .text-animation-cards button[aria-pressed=true] {
    border-color: var(--studio-accent);
    background: color-mix(in srgb, var(--studio-accent) 11%, var(--studio-raised));
    color: var(--studio-accent);
}
.animation-card-sample {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-height: 26px;
    font: 700 22px/1 SnapPixText, sans-serif;
}
[data-animation-value=fade] .animation-card-sample {
    background: linear-gradient(90deg, currentColor, transparent);
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
[data-animation-phase=in][data-animation-value=fade] .animation-card-sample {
    background-image: linear-gradient(90deg, transparent, currentColor);
}
[data-animation-value^=slide-] .animation-card-sample::after,
[data-animation-value=pulse] .animation-card-sample::after {
    color: var(--studio-accent);
    font: 500 15px/1 system-ui, sans-serif;
}
[data-animation-value=slide-up] .animation-card-sample::after { content: "\2191"; }
[data-animation-value=slide-down] .animation-card-sample::after { content: "\2193"; }
[data-animation-value=pulse] .animation-card-sample::after { content: "\223F"; }

.text-context-action svg { display: none; }
html[data-theme] .phone-context .text-context-action { display: inline-flex; align-items: center; gap: 5px; }
.phone-context .text-context-action svg { display: block; width: 16px; height: 16px; flex: none; pointer-events: none; }

html[data-theme] #text-tools label.text-animation-duration {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) 4em;
    align-items: center;
    gap: 8px;
}
.text-animation-duration output { padding: 2px 4px; border-radius: 4px; background: var(--studio-raised); text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }

@font-face { font-family: Rubik; src: url('fonts/Rubik-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Rubik; src: url('fonts/Rubik-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Rubik; src: url('fonts/Rubik-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: PlayfairDisplay; src: url('fonts/PlayfairDisplay-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: PlayfairDisplay; src: url('fonts/PlayfairDisplay-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: PlayfairDisplay; src: url('fonts/PlayfairDisplay-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: BebasNeue; src: url('fonts/BebasNeue-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
#text-tools [data-text-pane="Fonts"] > .text-font-family-field { grid-column: 1 / -1; }
html[data-theme] #text-tools .text-fonts button { min-height: 36px; padding: 4px 6px; }
#text-tools .text-fonts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (pointer: coarse) {
    html[data-theme] #text-tools .text-fonts button { min-height: 44px; }
}

.text-presets canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
@font-face { font-family: Montserrat; src: url('fonts/Montserrat-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Montserrat; src: url('fonts/Montserrat-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Montserrat; src: url('fonts/Montserrat-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: JetBrainsMono; src: url('fonts/JetBrainsMono-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: JetBrainsMono; src: url('fonts/JetBrainsMono-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: JetBrainsMono; src: url('fonts/JetBrainsMono-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Pacifico; src: url('fonts/Pacifico-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: DMSans; src: url('fonts/DMSans-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: DMSans; src: url('fonts/DMSans-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: DMSans; src: url('fonts/DMSans-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Merriweather; src: url('fonts/Merriweather-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Merriweather; src: url('fonts/Merriweather-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Merriweather; src: url('fonts/Merriweather-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Nunito; src: url('fonts/Nunito-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Nunito; src: url('fonts/Nunito-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Nunito; src: url('fonts/Nunito-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: OpenSans; src: url('fonts/OpenSans-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: OpenSans; src: url('fonts/OpenSans-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: OpenSans; src: url('fonts/OpenSans-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Oswald; src: url('fonts/Oswald-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Oswald; src: url('fonts/Oswald-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Oswald; src: url('fonts/Oswald-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Poppins; src: url('fonts/Poppins-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Raleway; src: url('fonts/Raleway-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Raleway; src: url('fonts/Raleway-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Raleway; src: url('fonts/Raleway-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Roboto; src: url('fonts/Roboto-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: Roboto; src: url('fonts/Roboto-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: Roboto; src: url('fonts/Roboto-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: SourceSans3; src: url('fonts/SourceSans3-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: SourceSans3; src: url('fonts/SourceSans3-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: SourceSans3; src: url('fonts/SourceSans3-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: WorkSans; src: url('fonts/WorkSans-400.ttf') format('truetype'); font-weight: 400; font-display: block; }
@font-face { font-family: WorkSans; src: url('fonts/WorkSans-600.ttf') format('truetype'); font-weight: 600; font-display: block; }
@font-face { font-family: WorkSans; src: url('fonts/WorkSans-700.ttf') format('truetype'); font-weight: 700; font-display: block; }
@font-face { font-family: Audiowide; src: url('fonts/Audiowide-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: BlackOpsOne; src: url('fonts/BlackOpsOne-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: Bungee; src: url('fonts/Bungee-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: Monoton; src: url('fonts/Monoton-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: RubikDirt; src: url('fonts/RubikDirt-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }
@font-face { font-family: RubikGlitch; src: url('fonts/RubikGlitch-400.ttf') format('truetype'); font-weight: 400 700; font-display: block; }

.text-effect-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
html[data-theme] #text-tools .text-effect-grid button {
    display: grid;
    place-items: center;
    min-width: 0;
    padding: 4px 2px;
    border: 1px solid var(--studio-border);
    border-radius: 7px;
    background: var(--studio-raised);
    font-size: 11px;
}
html[data-theme] #text-tools .text-effect-grid button[aria-pressed=true] { border-color: var(--studio-accent); }
.text-effect-grid canvas { display: block; width: 100%; height: 38px; object-fit: contain; }

html[data-theme] .telemetry-sticker-dialog {
    width: min(400px, calc(100vw - 24px));
    height: var(--sticker-preview-height, 60dvh);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
}
.telemetry-sticker-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.telemetry-sticker-heading button { padding: 4px 10px; }
.telemetry-stickers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
html[data-theme] .telemetry-stickers button {
    display: grid;
    justify-items: center;
    gap: 2px;
    min-width: 0;
    padding: 4px 2px 8px;
    border: 1px solid var(--studio-border);
    border-radius: 9px;
    background: var(--studio-raised);
    font-size: 11px;
}
html[data-theme] .telemetry-stickers button:is(:hover, :focus-visible) {
    border-color: var(--studio-accent);
    background: var(--studio-hover);
}
.telemetry-stickers canvas { display: block; width: min(100%, 88px); height: auto; }

@media (prefers-reduced-motion: no-preference) {
    .finish-sticker-card:is(:hover, :focus-visible) canvas {
        transform-origin: 22% 58%;
        animation: finish-sticker-breeze 1.5s ease-in-out infinite;
    }
}
@keyframes finish-sticker-breeze {
    0%, 100% { transform: skewY(0) rotate(0); }
    45% { transform: skewY(-4deg) rotate(2deg); }
    75% { transform: skewY(2deg) rotate(-1deg); }
}
