/*
 * Layered page editor (spec 11.7): a full-screen window over the admin.
 * Always dark, so the page in the middle is judged against neutral grey.
 */
.fce {
    --fce-bg: #101413;
    --fce-panel: #171d1b;
    --fce-line: #2a3330;
    --fce-text: #e7ece9;
    --fce-muted: #93a19b;
    --fce-accent: #a3e635;
    --fce-accent-2: #2de2e6;
    position: fixed;
    inset: 0;
    z-index: 40;
    display: flex;
    flex-direction: column;
    background: var(--fce-bg);
    color: var(--fce-text);
    font-size: 14px;
}

.fce-bar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding: 0.6rem 1rem;
    background: var(--fce-panel);
    border-bottom: 1px solid var(--fce-line);
    flex-wrap: wrap;
}

.fce-title { display: flex; flex-direction: column; line-height: 1.2; min-width: 10rem; }
.fce-title strong { font-size: 1rem; }
.fce-title span { color: var(--fce-muted); font-size: 0.8rem; }

.fce-add { display: flex; align-items: center; gap: 0.4rem; }
.fce-add-label { color: var(--fce-muted); font-size: 0.8rem; margin-right: 0.2rem; }

.fce-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background: linear-gradient(#1f2926, #1f2926) padding-box, linear-gradient(120deg, var(--fce-accent), var(--fce-accent-2)) border-box;
    color: var(--fce-text);
    font-weight: 600;
    cursor: pointer;
}
.fce-tool:hover { background: linear-gradient(#34452f, #34452f) padding-box, linear-gradient(120deg, var(--fce-accent), var(--fce-accent-2)) border-box; }
.fce-tool-icon { width: 1.1rem; height: 1.1rem; color: var(--fce-accent); }

.fce-bar-end { display: flex; align-items: center; gap: 0.75rem; margin-left: auto; flex-wrap: wrap; }
.fce-inline { display: inline-flex; align-items: center; gap: 0.4rem; color: var(--fce-muted); font-size: 0.85rem; }

.fce-input,
.fce .fce-input {
    background: #0c100f;
    color: var(--fce-text);
    border: 1px solid var(--fce-line);
    border-radius: 0.375rem;
    padding: 0.35rem 0.5rem;
    font-size: 0.875rem;
    width: 100%;
    min-width: 0;
}
.fce-input:focus { outline: none; border-color: var(--fce-accent); }
.fce-name { width: 14rem; }
.fce-num { width: 5.5rem; }
.fce-textarea { resize: vertical; font-family: inherit; }
.fce select.fce-input { padding-right: 1.5rem; }

.fce-body { flex: 1; display: flex; min-height: 0; }

.fce-side {
    width: 17rem;
    flex: none;
    overflow-y: auto;
    background: var(--fce-panel);
    padding: 0.75rem;
}
.fce-layers { border-right: 1px solid var(--fce-line); }
.fce-props { border-left: 1px solid var(--fce-line); width: 19rem; }
.fce-side-title { font-weight: 700; margin-bottom: 0.5rem; font-size: 0.9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fce-help { color: var(--fce-muted); font-size: 0.78rem; line-height: 1.35; display: block; }
.fce-keys { margin-top: 1rem; }

.fce-layer-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border-radius: 0.375rem;
    border: 1px solid transparent;
    background: transparent;
    color: var(--fce-text);
    text-align: left;
    cursor: pointer;
}
.fce-layer-row:hover { background: #222b28; }
.fce-layer-row.is-selected { border-color: var(--fce-accent); background: #222b28; }
.fce-page-row { margin-top: 0.5rem; border-top: 1px dashed var(--fce-line); border-radius: 0; }
.fce-layer-icon { width: 1.4rem; text-align: center; color: var(--fce-accent); font-weight: 700; }
.fce-layer-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.fce-canvas {
    flex: 1;
    min-width: 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: #262b29 repeating-conic-gradient(#2c322f 0% 25%, #262b29 0% 50%) 0 0 / 24px 24px;
}

.fce-stage {
    position: relative;
    flex: none;
    box-shadow: 0 6px 30px rgba(0, 0, 0, 0.55);
    touch-action: none;
    user-select: none;
    cursor: default;
}
.fce-page { position: absolute; inset: 0; overflow: hidden; }
.fce-page .fcp video { pointer-events: none; }
.fce-overlay { position: absolute; inset: 0; pointer-events: none; }

.fce-select {
    position: absolute;
    box-sizing: border-box;
    border: 1.5px solid var(--fce-accent);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.5);
}
.fce-handle {
    position: absolute;
    width: 10px;
    height: 10px;
    margin: -5px 0 0 -5px;
    background: #fff;
    border: 1.5px solid #2b3a10;
    border-radius: 2px;
    pointer-events: auto;
}
.fce-handle-nw { left: 0; top: 0; cursor: nwse-resize; }
.fce-handle-n { left: 50%; top: 0; cursor: ns-resize; }
.fce-handle-ne { left: 100%; top: 0; cursor: nesw-resize; }
.fce-handle-e { left: 100%; top: 50%; cursor: ew-resize; }
.fce-handle-se { left: 100%; top: 100%; cursor: nwse-resize; }
.fce-handle-s { left: 50%; top: 100%; cursor: ns-resize; }
.fce-handle-sw { left: 0; top: 100%; cursor: nesw-resize; }
.fce-handle-w { left: 0; top: 50%; cursor: ew-resize; }

.fce-guide { position: absolute; background: #ff4fd8; }
.fce-guide-x { top: 0; bottom: 0; width: 1px; }
.fce-guide-y { left: 0; right: 0; height: 1px; }

.fce-group { padding-bottom: 0.9rem; margin-bottom: 0.9rem; border-bottom: 1px solid var(--fce-line); display: flex; flex-direction: column; gap: 0.6rem; }
.fce-field { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.8rem; color: var(--fce-muted); min-width: 0; }
.fce-field em { font-style: normal; color: var(--fce-text); }
.fce-row { display: flex; gap: 0.6rem; align-items: flex-end; }
.fce-row > .fce-field { flex: 1; }
.fce-wrap { flex-wrap: wrap; flex-direction: row; }
.fce-grid4 { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; }
.fce-check { display: inline-flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; cursor: pointer; }
.fce-color { width: 3rem; height: 2rem; padding: 0; border: 1px solid var(--fce-line); border-radius: 0.375rem; background: none; cursor: pointer; }
.fce input[type="range"] { accent-color: var(--fce-accent); width: 100%; }
.fce input[type="checkbox"] { accent-color: var(--fce-accent); }

.fce-segment { display: flex; border: 1px solid var(--fce-line); border-radius: 0.375rem; overflow: hidden; }
.fce-segment button { flex: 1; padding: 0.3rem 0.25rem; background: transparent; color: var(--fce-text); font-size: 0.8rem; cursor: pointer; border-left: 1px solid var(--fce-line); }
.fce-segment button:first-child { border-left: 0; }
.fce-segment button.is-on { background: var(--fce-accent); color: #10150c; font-weight: 700; }

.fce-small {
    padding: 0.3rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid var(--fce-line);
    background: #222b28;
    color: var(--fce-text);
    font-size: 0.8rem;
    cursor: pointer;
}
.fce-small:hover { border-color: var(--fce-accent); }
.fce-small.is-danger:hover { border-color: #fb7185; color: #fb7185; }

.fce-file-preview { width: 100%; max-height: 8rem; object-fit: contain; background: #0c100f; border-radius: 0.375rem; }

.fce-picker {
    position: absolute;
    inset: 0;
    z-index: 5;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.fce-picker-box {
    width: min(64rem, 100%);
    max-height: 100%;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: var(--fce-panel);
    border: 1px solid var(--fce-line);
    border-radius: 0.5rem;
    padding: 1rem;
}
.fce-picker-head { display: flex; gap: 0.75rem; align-items: center; }
.fce-picker-head strong { white-space: nowrap; }
.fce-picker-head .fce-input { max-width: 18rem; margin-left: auto; }
.fce-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: 0.6rem; overflow-y: auto; }
.fce-pick {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.4rem;
    border-radius: 0.375rem;
    border: 1px solid var(--fce-line);
    background: #1c2421;
    color: var(--fce-text);
    text-align: left;
    cursor: pointer;
}
.fce-pick:hover { border-color: var(--fce-accent); background: #26302c; }
.fce-pick-img { position: relative; display: block; aspect-ratio: 16 / 10; background: #0c100f; border-radius: 0.25rem; overflow: hidden; }
.fce-pick-img img { width: 100%; height: 100%; object-fit: cover; }
.fce-pick-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); color: #fff; text-shadow: 0 1px 4px #000; font-size: 1.4rem; }
.fce-pick-name { font-size: 0.8rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fce-pick-meta { font-size: 0.72rem; color: var(--fce-muted); }
.fce-link { color: var(--fce-accent); font-size: 0.85rem; }

/* Part 2: undo, layer eye and lock, drop marker, animations, uploads. */
.fce-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 0.375rem;
    border: 1px solid var(--fce-line);
    background: #1f2926;
    cursor: pointer;
}
.fce-icon-btn:hover:not(:disabled) { border-color: var(--fce-accent); }
.fce-icon-btn:disabled,
.fce-tool:disabled { opacity: 0.4; cursor: default; }
.fce-row-btn {
    display: inline-flex;
    padding: 0.15rem;
    border-radius: 0.25rem;
    background: transparent;
    color: var(--fce-muted);
    opacity: 0.8;
    cursor: pointer;
}
.fce-layer-row:hover .fce-row-btn,
.fce-row-btn.is-on { opacity: 1; }
.fce-row-btn.is-on { color: var(--fce-accent); }
.fce-row-btn:hover { color: var(--fce-text); }
.fce-row-icon { width: 1.15rem; height: 1.15rem; }
.fce-layer-row.is-hidden .fce-layer-name { opacity: 0.45; text-decoration: line-through; }
.fce-layer-row.is-drop { box-shadow: inset 0 2px 0 var(--fce-accent-2); }
.fce-layer-row[draggable="true"] { cursor: grab; }
.fce-select.is-locked { border-style: dashed; border-color: #f59e0b; }
.fce-upload { position: relative; }
.fce-upload-row { display: flex; justify-content: space-between; gap: 1rem; font-size: 0.8rem; padding: 0.35rem 0.5rem; border-radius: 0.375rem; background: #222b28; }
.fce-upload-row.is-failed { color: #fb7185; }
.fce-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Part 3: menu of the other layer types, messages, embedded videos. */
.fce-menu { position: relative; }
.fce-menu-list {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 6;
    min-width: 14rem;
    display: flex;
    flex-direction: column;
    padding: 0.3rem;
    background: var(--fce-panel);
    border: 1px solid var(--fce-line);
    border-radius: 0.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}
.fce-menu-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.6rem;
    border-radius: 0.375rem;
    background: transparent;
    color: var(--fce-text);
    text-align: left;
    cursor: pointer;
}
.fce-menu-item:hover { background: #222b28; }
.fce-help.fce-error { color: #fb7185; }
.fce-warning {
    margin: 0;
    padding: 0.5rem 0.6rem;
    border-radius: 0.375rem;
    border: 1px solid rgba(245, 158, 11, 0.5);
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
    font-size: 0.78rem;
    line-height: 1.35;
}
.fce-page iframe { pointer-events: none; }

/*
 * Phones and small tablets (also a phone on its side): the side panels
 * leave too little room for the page, so the editor says so first.
 */
.fce-narrow {
    display: none;
}

@media (max-width: 1023px), (max-height: 599px) {
    .fce-narrow {
        position: absolute;
        inset: 0;
        z-index: 100;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 16px;
        background: rgba(10, 13, 12, 0.94);
        overflow-y: auto;
    }
}

.fce-narrow-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    max-width: 360px;
    padding: 24px 20px;
    border: 1px solid var(--fce-line);
    border-radius: 10px;
    background: var(--fce-panel);
    text-align: center;
}

.fce-narrow-card strong {
    font-size: 17px;
}

.fce-narrow-card p {
    margin: 0;
    color: var(--fce-muted);
    line-height: 1.5;
}

.fce-narrow-icon {
    width: 40px;
    height: 40px;
    color: var(--fce-accent);
}

.fce-narrow-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-top: 6px;
}

/* Template locks (spec 11.7): settings a template user may not change. */
.fce-fieldset {
    min-width: 0;
    margin: 0;
    padding: 0;
    border: 0;
}

.fce-fieldset:disabled {
    opacity: 0.45;
}

.fce-template-lock {
    display: inline-flex;
    color: #f59e0b;
}

.fce-layer-row.is-fixed {
    cursor: default;
}

.fce-layer-row.is-fixed .fce-layer-name {
    opacity: 0.55;
}

/* "Tallenna pohjaksi" dialog. */
.fce-dialog {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: min(30rem, 100%);
    padding: 1.25rem;
    border: 1px solid var(--fce-line);
    border-radius: 0.5rem;
    background: var(--fce-panel);
}

.fce-dialog strong {
    font-size: 16px;
}

/* Live miniature of a page template (feedusTemplateThumb). */
.feedus-template-thumb {
    position: relative;
    width: 100%;
    overflow: hidden;
    border-radius: 6px;
    background: #000;
}

.feedus-thumb-page {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.feedus-template-thumb-cell {
    width: 9rem;
}

/* Template gallery in "Lisää valmiista pohjista". */
.feedus-template-section {
    margin-top: 1rem;
}

.feedus-template-section:first-child {
    margin-top: 0;
}

.feedus-template-section h3 {
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.feedus-template-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
    gap: 0.75rem;
}

.feedus-template-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 0.5rem;
    border: 1px solid rgb(156 163 175 / 0.3);
    border-radius: 0.5rem;
    text-decoration: none;
    color: inherit;
}

.feedus-template-card:hover {
    border-color: var(--primary-500, #84cc16);
}

.feedus-template-card-name {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
}

.feedus-template-card-meta {
    font-size: 0.75rem;
    opacity: 0.65;
}

.feedus-template-note {
    margin-top: 0.5rem;
    font-size: 0.8rem;
    opacity: 0.7;
}

/* AI helper of a text layer (spec 11.7 "Tekoäly") */
.fce-ai { border: 1px solid rgba(167, 139, 250, 0.45); border-radius: 0.5rem; padding: 0.6rem; display: flex; flex-direction: column; gap: 0.5rem; background: rgba(139, 92, 246, 0.07); }
.fce-ai-head { display: flex; align-items: center; gap: 0.4rem; font-weight: 700; font-size: 0.85rem; color: #c4b5fd; }
.fce-ai-icon { width: 1rem; height: 1rem; }
.fce-ai-body { display: flex; flex-direction: column; gap: 0.5rem; }
.fce-ai-label { font-size: 0.8rem; color: var(--fce-muted); }
.fce-ai-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.fce-ai-btn {
    padding: 0.4rem 0.6rem;
    border-radius: 0.375rem;
    border: 0;
    background: #7c3aed;
    color: #fff;
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.fce-ai-btn:hover { background: #8b5cf6; }
.fce-ai-btn:disabled { opacity: 0.45; cursor: default; }
.fce-ai-busy { margin: 0; font-size: 0.8rem; color: #c4b5fd; animation: fce-ai-pulse 1.2s ease-in-out infinite; }
@keyframes fce-ai-pulse { 50% { opacity: 0.45; } }
.fce-ai-result { border: 1px solid var(--fce-line); border-radius: 0.375rem; padding: 0.5rem; display: flex; flex-direction: column; gap: 0.4rem; align-items: flex-start; }
.fce-ai-text { margin: 0; white-space: pre-line; font-size: 0.85rem; line-height: 1.4; }
.fce-link { color: var(--fce-accent); text-decoration: underline; }

/* "Luo kuva tekoälyllä" dialog over the file picker (spec 11.7 "Tekoäly") */
.fce-ai-image { z-index: 6; }
.fce-ai-dialog { width: min(40rem, 100%); max-height: 100%; overflow-y: auto; }
.fce-ai-current { display: flex; gap: 0.75rem; align-items: center; cursor: pointer; }
.fce-ai-current img { width: 5.5rem; height: 4rem; object-fit: cover; border-radius: 0.375rem; border: 1px solid var(--fce-line); }
.fce-ai-current > span { display: flex; flex-direction: column; gap: 0.2rem; }
.fce-ai-refs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fce-ai-ref { position: relative; width: 4rem; height: 4rem; padding: 0; border: 1px solid var(--fce-line); border-radius: 0.375rem; overflow: hidden; background: #111; cursor: pointer; }
.fce-ai-ref img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fce-ai-ref span { position: absolute; top: 0.1rem; right: 0.2rem; color: #fff; font-weight: 700; text-shadow: 0 0 3px #000; }
.fce-ai-bank { display: flex; flex-direction: column; gap: 0.5rem; }
.fce-ai-bank-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(4.5rem, 1fr)); gap: 0.4rem; max-height: 14rem; overflow-y: auto; }
.fce-ai-bank-item { aspect-ratio: 1; padding: 0; border: 2px solid transparent; border-radius: 0.375rem; overflow: hidden; background: #111; cursor: pointer; }
.fce-ai-bank-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fce-ai-bank-item.is-on { border-color: #a78bfa; }
.fce-ai-bank-item:disabled { opacity: 0.35; cursor: default; }
.fce-small.is-on { border-color: #a78bfa; color: #c4b5fd; }
.fce-small.is-disabled { opacity: 0.4; pointer-events: none; }
.fce-ai-preview { position: relative; padding: 0; border: 0; border-radius: 0.375rem; overflow: hidden; background: repeating-conic-gradient(#222 0 25%, #2c2c2c 0 50%) 0 0 / 16px 16px; display: flex; justify-content: center; cursor: zoom-in; }
.fce-ai-zoom-hint { position: absolute; right: 0.5rem; bottom: 0.5rem; padding: 0.25rem 0.5rem; border-radius: 0.375rem; background: rgba(0, 0, 0, 0.7); color: #fff; font-size: 0.78rem; font-weight: 700; }
.fce-ai-preview:hover .fce-ai-zoom-hint { background: #7c3aed; }
.fce-ai-zoom { position: fixed; inset: 0; z-index: 50; background: rgba(0, 0, 0, 0.94); display: flex; align-items: center; justify-content: center; padding: 1.5rem; cursor: zoom-out; }
.fce-ai-zoom img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 0 40px rgba(0, 0, 0, 0.6); }
.fce-ai-zoom-close { position: absolute; top: 0.75rem; right: 1rem; color: #ddd; font-size: 0.85rem; }
.fce-ai-preview img { max-width: 100%; max-height: 20rem; display: block; }
.fce-ai-btn.is-quiet { background: transparent; border: 1px solid #7c3aed; color: #c4b5fd; }
.fce-dialog-actions { display: flex; justify-content: space-between; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ---------- Timeline (spec 11.7 "Aikajana") ---------- */
.fce-center { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fce-center .fce-canvas { min-height: 0; }
.fce-timeline { flex: none; background: var(--fce-panel); border-top: 1px solid var(--fce-line); }
.fce-tl-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 0;
    color: var(--fce-text);
    font-size: 0.85rem;
    text-align: left;
    cursor: pointer;
}
.fce-tl-head .fce-help { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fce-tl-chevron { width: 1rem; height: 1rem; flex: none; transition: transform 0.15s; transform: rotate(180deg); }
.fce-timeline.is-open .fce-tl-chevron { transform: none; }
.fce-tl-body { max-height: 32vh; overflow-y: auto; padding: 0 0.75rem 0.6rem; }
.fce-tl-empty { padding: 0.25rem 0 0.5rem; }
.fce-tl-grid { position: relative; }
.fce-tl-row { display: flex; align-items: center; height: 1.7rem; }
.fce-tl-row.is-selected .fce-tl-label { color: var(--fce-accent); }
.fce-tl-row.is-hidden { opacity: 0.45; }
.fce-tl-label {
    width: 9.5rem;
    flex: none;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0 0.5rem 0 0;
    background: transparent;
    border: 0;
    color: var(--fce-text);
    font-size: 0.8rem;
    text-align: left;
    cursor: pointer;
    overflow: hidden;
}
.fce-tl-track { position: relative; flex: 1; min-width: 0; height: 100%; }
.fce-tl-row:not(.fce-tl-axis-row) .fce-tl-track { border-top: 1px solid rgba(255, 255, 255, 0.04); }
.fce-tl-axis-row { height: 1.3rem; position: sticky; top: 0; z-index: 2; background: var(--fce-panel); }
.fce-tl-tick {
    position: absolute;
    top: 0.15rem;
    transform: translateX(-50%);
    font-size: 0.7rem;
    color: var(--fce-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}
.fce-tl-tick:first-child { transform: none; }
.fce-tl-bar {
    position: absolute;
    top: 0.3rem;
    bottom: 0.3rem;
    display: flex;
    justify-content: space-between;
    border-radius: 4px;
    background: rgba(163, 230, 53, 0.35);
    border: 1px solid rgba(163, 230, 53, 0.75);
    cursor: grab;
    touch-action: none;
    overflow: hidden;
}
.fce-tl-row.is-selected .fce-tl-bar { background: rgba(163, 230, 53, 0.55); border-color: var(--fce-accent); }
/* Stays to the end of the page: the bar fades out at the end of the axis. */
.fce-tl-bar.is-open-end { border-right-color: transparent; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.fce-tl-bar.is-locked { cursor: not-allowed; filter: grayscale(1); opacity: 0.7; }
.fce-tl-in, .fce-tl-out { height: 100%; flex: none; pointer-events: none; }
.fce-tl-in { background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.35)); }
.fce-tl-out { background: linear-gradient(90deg, rgba(255, 255, 255, 0.35), rgba(255, 255, 255, 0)); }
.fce-tl-handle { position: absolute; top: 0; bottom: 0; width: 7px; cursor: ew-resize; }
.fce-tl-handle.is-start { left: 0; }
.fce-tl-handle.is-end { right: 0; }
.fce-tl-bar.is-locked .fce-tl-handle { cursor: not-allowed; }
.fce-tl-marks { position: absolute; inset: 0; display: flex; pointer-events: none; }
/* After the page's time the playlist moves on: hatched. */
.fce-tl-after {
    position: absolute;
    top: 0;
    bottom: 0;
    right: 0;
    z-index: 0;
    border-left: 2px dashed var(--fce-accent-2);
    background: rgba(0, 0, 0, 0.28);
}
.fce-tl-bar { z-index: 1; }
.fce-tl-playhead { position: absolute; z-index: 3; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: #f43f5e; }

/* ---------- Text effects (spec 11.7 "Tekstitehosteet") ---------- */
.fce-effects { display: flex; flex-direction: column; gap: 0.45rem; margin-top: 0.4rem; padding-top: 0.6rem; border-top: 1px dashed var(--fce-line); }
.fce-effect { border: 1px solid var(--fce-line); border-radius: 0.375rem; padding: 0.35rem 0.5rem; }
.fce-effect.is-on { border-color: rgba(163, 230, 53, 0.55); }
.fce-effect-head { font-weight: 600; }
.fce-effect-body { display: flex; flex-wrap: wrap; gap: 0.45rem 0.75rem; padding: 0.4rem 0 0.15rem; }
.fce-effect-body > .fce-field { flex: 1 1 100%; }
.fce-effect-body > .fce-effect-color { flex: 0 0 auto; }
.fce-dirs button { font-size: 0.95rem; padding: 0.15rem 0; }

/* Departures layer: search results of stops and stations (spec 11.7 "Lähdöt"). */
.fce-dep-results {
    display: flex;
    flex-direction: column;
    max-height: 16rem;
    overflow-y: auto;
    border: 1px solid var(--fce-line, rgba(255, 255, 255, 0.15));
    border-radius: 6px;
}
.fce-dep-result {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    padding: 0.4rem 0.6rem;
    text-align: left;
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
}
.fce-dep-result + .fce-dep-result { border-top: 1px solid var(--fce-line, rgba(255, 255, 255, 0.1)); }
.fce-dep-result:hover, .fce-dep-result:focus-visible { background: rgba(255, 255, 255, 0.08); }
.fce-dep-result small { opacity: 0.7; }
