/* Feedus admin additions: element status colours (spec 5.5) and the drop zone (spec 5.6). */

/* Element table colours (2026-11-14): muted cobalt for elements on air, a
   brighter cobalt for the one on screen now, violet for scheduled ones, and a
   turquoise progress line. Light mode uses lighter tints and a deeper line. */
:root {
    --feedus-row-active: rgb(60 88 140 / 0.10);
    --feedus-row-live: rgb(84 124 196 / 0.24);
    --feedus-row-scheduled: rgb(139 92 246 / 0.08);
    --feedus-live-line: #0aa5aa;
}
.dark {
    --feedus-row-active: rgb(60 88 140 / 0.20);
    --feedus-row-live: rgb(92 136 214 / 0.38);
    --feedus-row-scheduled: rgb(139 92 246 / 0.12);
    --feedus-live-line: #2de2e6;
}
.fi-ta-row.feedus-row-active > td { background-color: var(--feedus-row-active); }
.fi-ta-row.feedus-row-scheduled > td { background-color: var(--feedus-row-scheduled); }
.fi-ta-row.feedus-row-ended > td { background-color: rgb(107 114 128 / 0.10); opacity: 0.75; }
.fi-ta-row.feedus-row-hidden > td { background-color: rgb(107 114 128 / 0.10); opacity: 0.6; }
.fi-ta-row.feedus-row-disabled > td { background-color: rgb(107 114 128 / 0.10); opacity: 0.6; }
.fi-ta-row.feedus-row-disabled .fi-ta-text-item-label,
.fi-ta-row.feedus-row-disabled .fi-ta-text-item { text-decoration: line-through; }
.feedus-warning-text { color: rgb(234 88 12); font-weight: 500; }
/* The element table is wide; slightly narrower cells keep it without a side scroll on laptops. */
.fi-ta-table:has(tr.feedus-row) :is(.fi-ta-text, .fi-ta-image, .fi-ta-icon, th.fi-ta-header-cell) { padding-left: 0.5rem; padding-right: 0.5rem; }

.feedus-thumb { border-radius: 4px; background: #000; max-width: 86px; object-fit: contain; }

.feedus-dropzone { margin-bottom: 1rem; }
.feedus-dropzone-target {
    display: flex; align-items: center; gap: 0.75rem; width: 100%;
    padding: 1rem 1.25rem; border: 2px dashed rgb(156 163 175 / 0.6); border-radius: 0.75rem;
    color: rgb(107 114 128); text-align: left; cursor: pointer; transition: border-color .15s, background-color .15s;
}
.feedus-dropzone-target:hover,
.feedus-dropzone.is-dragging .feedus-dropzone-target { border-color: var(--primary-500); background: color-mix(in srgb, var(--primary-500) 6%, transparent); color: inherit; }
.feedus-dropzone-hint { display: block; font-size: 0.8rem; }

.feedus-upload-list { margin-top: 0.75rem; display: grid; gap: 0.5rem; }
.feedus-upload-item { padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: rgb(156 163 175 / 0.1); font-size: 0.875rem; }
.feedus-upload-row { display: flex; justify-content: space-between; gap: 1rem; }
.feedus-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feedus-upload-item.is-error { background: rgb(239 68 68 / 0.12); color: rgb(185 28 28); }
.feedus-upload-item.is-done { background: rgb(34 197 94 / 0.12); }
.feedus-progress { margin-top: 0.35rem; height: 4px; border-radius: 2px; background: rgb(156 163 175 / 0.3); overflow: hidden; }
.feedus-progress-bar { height: 100%; background: var(--primary-500); transition: width .2s; }

/* Playlist list: the id right after the name, on its own line on phones. */
.feedus-playlist-id { margin-left: 0.5rem; font-size: 0.8em; color: rgb(156 163 175); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 767px) {
    .feedus-playlist-id { display: block; margin-left: 0; }
}

/* ---- Live preview on the playlist page (spec 4.2) ----
   The page is full width; its grid has three cells: details, preview, element list.
   Phones: details, list, preview. From 1024 px the preview sits beside the
   details and the list takes the full width below. From 1800 px the preview is
   a sticky column on the right of both, so it stays in view along the list. */
.feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(2) { order: 1; }
@media (min-width: 1024px) {
    .feedus-playlist-layout > .fi-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 24rem); align-items: start; }
    .feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(2) { order: 0; }
    .feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(3) { grid-column: 1 / -1; }
}
@media (min-width: 1800px) {
    .feedus-playlist-layout > .fi-grid { grid-template-columns: minmax(0, 1fr) 19rem; align-items: stretch; }
    .feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(1) { grid-column: 1; grid-row: 1; }
    .feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(2) { grid-column: 2; grid-row: 1 / span 2; }
    .feedus-playlist-layout > .fi-grid > .fi-grid-col:nth-child(3) { grid-column: 1; grid-row: 2; }
    .feedus-live { position: sticky; top: 5.5rem; }
}
.feedus-live-card { padding: 0.75rem; border: 1px solid rgb(156 163 175 / 0.25); border-radius: 0.75rem; background: rgb(156 163 175 / 0.05); }
.feedus-live-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.5rem; font-size: 0.875rem; font-weight: 600; }
.feedus-live-screen { width: min(100%, calc(32vh * var(--feedus-live-ratio))); margin-inline: auto; background: #000; border-radius: 0.4rem; overflow: hidden; box-shadow: 0 0 0 1px rgb(156 163 175 / 0.25); }
@media (min-width: 1800px) { .feedus-live-screen { width: min(100%, calc(55vh * var(--feedus-live-ratio))); } }
.feedus-live-now { margin-top: 0.5rem; font-size: 0.875rem; }
.feedus-live-help { margin-top: 0.3rem; font-size: 0.78rem; opacity: 0.6; }
.feedus-live-title { display: inline-flex; align-items: center; gap: 0.45rem; }
.feedus-live-dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--primary-500); animation: feedus-live-pulse 1.6s ease-in-out infinite; }
@keyframes feedus-live-pulse { 50% { opacity: 0.3; } }
.feedus-live-left { font-variant-numeric: tabular-nums; opacity: 0.7; font-weight: 400; }
.feedus-live-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.feedus-live-now span { opacity: 0.7; }
.fi-ta-row.is-live > td { background-color: var(--feedus-row-live); }
.feedus-live-bar { position: fixed; z-index: 15; height: 3px; border-radius: 2px; overflow: hidden; pointer-events: none; background: color-mix(in srgb, var(--feedus-live-line) 22%, transparent); }
.feedus-live-bar > span { display: block; height: 100%; background: var(--feedus-live-line); transform-origin: left center; box-shadow: 0 0 8px var(--feedus-live-line); }
@media (prefers-reduced-motion: reduce) { .feedus-live-dot { animation: none; } }

/* Download link of an element's file on its edit form. */
.feedus-file-link { color: var(--primary-600, #16a34a); font-weight: 600; text-decoration: underline; }
.dark .feedus-file-link { color: var(--primary-400, #a3e635); }

/* "Vaihda tiedosto" on the element edit form. */
.feedus-replace { display: flex; flex-direction: column; gap: 0.5rem; }
.feedus-replace-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.feedus-replace .feedus-file-link { background: none; border: 0; padding: 0; cursor: pointer; }
.feedus-upload-item.is-error { cursor: pointer; }

/* Recurring schedule (spec 11.1): weekdays as one joined row of toggles. */
.feedus-schedule { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem; }
.feedus-schedule-block { display: flex; flex-direction: column; gap: 0.35rem; }
.feedus-schedule-label { font-size: 0.8rem; font-weight: 600; opacity: 0.75; }
.feedus-weekdays {
    display: inline-flex;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 0.6rem;
    overflow: hidden;
    background: var(--gray-50, #f9fafb);
}
.dark .feedus-weekdays { border-color: rgb(255 255 255 / 0.14); background: rgb(255 255 255 / 0.04); }
.feedus-weekday {
    min-width: 2.75rem;
    padding: 0.5rem 0.4rem;
    border: 0;
    border-left: 1px solid var(--gray-300, #d1d5db);
    background: transparent;
    color: inherit;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 120ms, color 120ms;
}
.dark .feedus-weekday { border-left-color: rgb(255 255 255 / 0.14); }
.feedus-weekday:first-child { border-left: 0; }
.feedus-weekday:hover { background: rgb(127 127 127 / 0.12); }
.feedus-weekday:focus-visible { outline: 2px solid var(--primary-500, #84cc16); outline-offset: -2px; }
.feedus-weekday.is-on { background: var(--primary-600, #16a34a); color: #fff; }
.dark .feedus-weekday.is-on { background: var(--primary-500, #84cc16); color: #111; }
.feedus-schedule-quick { display: flex; gap: 0.9rem; font-size: 0.8rem; }
.feedus-schedule-quick button { background: none; border: 0; padding: 0; color: var(--primary-600, #16a34a); cursor: pointer; text-decoration: underline; }
.dark .feedus-schedule-quick button { color: var(--primary-400, #a3e635); }
.feedus-schedule-times { display: flex; align-items: flex-end; gap: 0.6rem; }
.feedus-schedule-dash { padding-bottom: 0.55rem; opacity: 0.6; }
.feedus-schedule-time {
    padding: 0.45rem 0.6rem;
    border: 1px solid var(--gray-300, #d1d5db);
    border-radius: 0.5rem;
    background: transparent;
    color: inherit;
    font: inherit;
}
.dark .feedus-schedule-time { border-color: rgb(255 255 255 / 0.14); color-scheme: dark; }
.feedus-schedule-help { flex-basis: 100%; margin: 0; font-size: 0.8rem; opacity: 0.7; }
.fi-ta-row.feedus-row-off_schedule > td { background-color: var(--feedus-row-scheduled); }
.feedus-weekday.is-on + .feedus-weekday.is-on { border-left-color: rgb(0 0 0 / 0.2); }

/* File bank (spec 11.6): compact cards, six in a row on a 1920 px screen. */
.fi-resource-tiedostot .fi-ta-record { padding: 0.25rem; }
.fi-resource-tiedostot .fi-ta-record-content { padding: 0.4rem 0.4rem 0.2rem; }
.fi-resource-tiedostot .fi-ta-record .fi-ta-text,
.fi-resource-tiedostot .fi-ta-record .fi-ta-text-item { padding: 0 !important; }
.fi-resource-tiedostot .fi-ta-record .fi-ta-col { padding: 0; }
.fi-resource-tiedostot .feedus-bank-card { gap: 0.15rem; }
.fi-resource-tiedostot .feedus-bank-card .fi-ta-text-item-label,
.fi-resource-tiedostot .feedus-bank-card .fi-ta-text-item { font-size: 0.8rem; line-height: 1.25; }
.fi-resource-tiedostot .feedus-bank-card .fi-size-sm { font-size: 0.72rem; }
.fi-resource-tiedostot .feedus-bank-card .fi-badge { font-size: 0.68rem; padding-top: 0; padding-bottom: 0; }
.fi-resource-tiedostot .fi-ta-record .fi-ta-actions { gap: 0.25rem; }
.feedus-bank-thumbbox { position: relative; display: block; cursor: zoom-in; margin-bottom: 0.25rem; border-radius: 0.4rem; overflow: hidden; }
.feedus-bank-thumbbox:focus-visible { outline: 2px solid var(--primary-500, #84cc16); outline-offset: 2px; }
.feedus-bank-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: contain; background: #111; }
.feedus-bank-zoom {
    position: absolute; right: 0.35rem; bottom: 0.35rem;
    display: grid; place-items: center; width: 1.6rem; height: 1.6rem;
    border-radius: 0.35rem; background: rgb(0 0 0 / 0.85); color: #a3e635;
    transition: transform 120ms;
}
.feedus-bank-thumbbox:hover .feedus-bank-zoom { transform: scale(1.12); }
.feedus-bank-target { margin: 0 0 0.5rem; font-size: 0.85rem; opacity: 0.8; }
.feedus-bank-target.is-missing { padding: 1rem 1.25rem; border: 1px dashed rgb(127 127 127 / 0.4); border-radius: 0.75rem; opacity: 1; }

/* Type buttons beside the search, joined like the weekday row. */
.feedus-bank-types { display: inline-flex; border: 1px solid var(--gray-300, #d1d5db); border-radius: 0.6rem; overflow: hidden; }
.dark .feedus-bank-types { border-color: rgb(255 255 255 / 0.14); }
.feedus-bank-type { padding: 0.4rem 0.9rem; border: 0; border-left: 1px solid var(--gray-300, #d1d5db); background: transparent; color: inherit; font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; }
.dark .feedus-bank-type { border-left-color: rgb(255 255 255 / 0.14); }
.feedus-bank-type:first-child { border-left: 0; }
.feedus-bank-type:hover { background: rgb(127 127 127 / 0.12); }
.feedus-bank-type.is-on { background: var(--primary-600, #16a34a); color: #fff; }
.dark .feedus-bank-type.is-on { background: var(--primary-500, #84cc16); color: #111; }
.feedus-bank-customer { max-width: 16rem; margin-right: 0.5rem; padding: 0.4rem 2rem 0.4rem 0.75rem; border: 1px solid var(--gray-300, #d1d5db); border-radius: 0.6rem; background-color: transparent; color: inherit; font: inherit; font-size: 0.85rem; font-weight: 600; }
.dark .feedus-bank-customer { border-color: rgb(255 255 255 / 0.14); }
.dark .feedus-bank-customer option { background: #1a201e; }

/* Large view over the content area; the sidebar stays visible. */
.feedus-lightbox { position: fixed; top: 0; right: 0; bottom: 0; z-index: 45; display: flex; flex-direction: column; background: rgb(0 0 0 / 0.92); padding: 3.5rem 1.5rem 1rem; }
.feedus-lightbox-media { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.feedus-lightbox-media img, .feedus-lightbox-media video { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 10px 40px rgb(0 0 0 / 0.5); }
.feedus-lightbox-caption { display: flex; gap: 1rem; justify-content: center; align-items: baseline; padding-top: 0.75rem; color: #e5e7eb; font-size: 0.9rem; }
.feedus-lightbox-caption span { opacity: 0.7; }
.feedus-lightbox-close { position: absolute; top: 0.75rem; right: 0.75rem; display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border: 0; border-radius: 0.5rem; background: rgb(255 255 255 / 0.1); color: #fff; cursor: pointer; }
.feedus-lightbox-close:hover { background: rgb(255 255 255 / 0.2); }

.feedus-bank-option { display: flex; align-items: center; gap: 0.6rem; }
.feedus-bank-option > span { display: flex; flex-direction: column; line-height: 1.25; }
.feedus-bank-option small { opacity: 0.65; }
.feedus-bank-option-img { flex: none; width: 56px; height: 32px; object-fit: contain; background: #111; border-radius: 4px; display: inline-block; }
.feedus-bank-usage { margin: 0; padding-left: 1.1rem; list-style: disc; display: flex; flex-direction: column; gap: 0.35rem; }
.fi-resource-tiedostot .feedus-bank-card > *, .fi-resource-tiedostot .feedus-bank-card .fi-ta-col { width: 100%; }

/* ---- Adding elements to a playlist (spec 5.6) ---- */
/* Four slim, equal buttons: a thin gradient edge (the theme's button gradient,
   lime in dark mode and orange in light, drawn under an opaque fill), small radius, compact text. All look
   the same until the mouse is over one, which then gets a clearly brighter fill. */
:root {
    /* Light mode: pale orange, brighter under the mouse, so they stand out on white. */
    --feedus-add-fill: #fff1e2;
    --feedus-add-fill-hover: #ffd29e;
    --feedus-add-icon: #c25e00;
    --feedus-pick-fill: #ffffff;
    --feedus-pick-fill-lit: #eef3f0;
}
.dark {
    --feedus-add-fill: #19211e;
    --feedus-add-fill-hover: #3a4b33;
    --feedus-add-icon: var(--tv-accent-text);
    --feedus-pick-fill: #19211e;
    --feedus-pick-fill-lit: #27322d;
}
.fi-body .fi-btn.feedus-add-btn:not(.fi-link) {
    gap: 0.4rem;
    min-height: 2rem;
    padding: 0.35rem 0.7rem;
    border: 1px solid transparent;
    border-radius: 0.375rem;
    background: linear-gradient(var(--feedus-add-fill), var(--feedus-add-fill)) padding-box, var(--tv-btn) border-box !important;
    color: inherit !important;
    box-shadow: none !important;
    font-size: 0.84rem;
    font-weight: 600;
    letter-spacing: 0.005em;
    filter: none !important;
    transition: background 0.15s;
}
.fi-body .fi-btn.feedus-add-btn .fi-icon { width: 1rem; height: 1rem; color: var(--feedus-add-icon) !important; }
.fi-body .fi-btn.feedus-add-btn:not(.fi-link):hover {
    background: linear-gradient(var(--feedus-add-fill-hover), var(--feedus-add-fill-hover)) padding-box, var(--tv-btn) border-box !important;
}

/* "Lisää tiedostopankista": small thumbnails, a chosen one gets a lime frame
   and its order number. */
.feedus-bank-picker-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; margin-bottom: 0.75rem; }
.feedus-bank-picker-search { flex: 1 1 12rem; min-width: 0; padding: 0.35rem 0.6rem; border-radius: 0.375rem; border: 0; background: var(--feedus-pick-fill); color: inherit; font-size: 0.85rem; box-shadow: 0 0 0 1px var(--tv-line-strong); }
.feedus-bank-picker-search:focus { outline: none; box-shadow: 0 0 0 1px var(--tv-active-edge); }
.feedus-bank-picker-types { display: inline-flex; border-radius: 0.375rem; overflow: hidden; box-shadow: 0 0 0 1px var(--tv-line-strong); }
.feedus-bank-picker-types button { padding: 0.3rem 0.65rem; font-size: 0.8rem; font-weight: 600; opacity: 0.7; }
.feedus-bank-picker-types button + button { border-left: 1px solid var(--tv-line-strong); }
.feedus-bank-picker-types button.is-on { opacity: 1; background: var(--feedus-pick-fill-lit); color: var(--tv-accent-text); }
.feedus-bank-picker-count { font-size: 0.8rem; font-weight: 600; color: var(--tv-accent-text); }
.feedus-bank-picker-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr)); gap: 0.6rem; max-height: 55vh; overflow-y: auto; padding: 3px; }
.feedus-bank-pick { display: flex; flex-direction: column; gap: 0.15rem; padding: 0.3rem; border-radius: 0.5rem; text-align: left; background: var(--feedus-pick-fill); box-shadow: 0 0 0 1px var(--tv-line-strong); transition: box-shadow 0.12s, background 0.12s; }
.feedus-bank-pick:hover { background: var(--feedus-pick-fill-lit); }
.feedus-bank-pick.is-chosen { background: var(--feedus-pick-fill-lit); box-shadow: 0 0 0 2px var(--tv-active-edge); }
.feedus-bank-pick-img { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 0.3rem; overflow: hidden; background: #0d1110; }
.feedus-bank-pick-img img { width: 100%; height: 100%; object-fit: contain; }
.feedus-bank-pick-video { position: absolute; left: 0.25rem; bottom: 0.25rem; width: 1.1rem; height: 1.1rem; color: #fff; filter: drop-shadow(0 1px 2px rgb(0 0 0 / 0.6)); }
.feedus-bank-pick-mark { position: absolute; top: 0.25rem; right: 0.25rem; min-width: 1.3rem; height: 1.3rem; padding: 0 0.3rem; border-radius: 999px; display: grid; place-items: center; background: var(--tv-btn); color: #fff; font-size: 0.72rem; font-weight: 700; }
.dark .feedus-bank-pick-mark { color: #0c100f; }
.feedus-bank-pick-name { font-size: 0.75rem; font-weight: 600; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.feedus-bank-pick-meta { font-size: 0.68rem; opacity: 0.6; line-height: 1.2; }
.feedus-bank-picker-empty, .feedus-bank-picker-none { font-size: 0.85rem; opacity: 0.7; }

/* Upload dialog: like Filament's modals, above everything. */
.feedus-upload-dialog-backdrop { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-start; justify-content: center; padding: 8vh 1rem 1rem; background: rgb(3 7 6 / 0.6); overflow-y: auto; }
.feedus-upload-dialog { width: 100%; max-width: 40rem; padding: 1.25rem 1.5rem; border-radius: calc(var(--tv-radius, 1rem) + 0.25rem); background: var(--tv-glass-strong); box-shadow: 0 0 0 1px var(--tv-line-strong), var(--tv-shadow-strong); -webkit-backdrop-filter: blur(22px); backdrop-filter: blur(22px); }
.feedus-upload-dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.feedus-upload-dialog-head h2 { font-size: 1.1rem; font-weight: 700; }
.feedus-upload-dialog-x { display: grid; place-items: center; width: 2rem; height: 2rem; border: 0; border-radius: 0.375rem; background: transparent; color: inherit; cursor: pointer; opacity: 0.7; }
.feedus-upload-dialog-x:hover { opacity: 1; background: rgb(127 127 127 / 0.12); }
.feedus-upload-dialog .feedus-dropzone { margin-bottom: 0; }
.feedus-upload-dialog .feedus-dropzone-target { min-height: 9rem; justify-content: center; text-align: center; flex-direction: column; }
.feedus-upload-dialog-foot { display: flex; justify-content: flex-end; margin-top: 1rem; }

/* Files dragged over the page. */
.feedus-page-drop { position: fixed; inset: 0; z-index: 49; display: grid; place-items: center; padding: 1.5rem; background: rgb(3 7 6 / 0.55); pointer-events: none; }
.feedus-page-drop-box { display: flex; flex-direction: column; align-items: center; gap: 0.75rem; width: min(36rem, 100%); padding: 3rem 1.5rem; border: 2px dashed var(--tv-active-edge); border-radius: calc(var(--tv-radius, 1rem) + 0.25rem); background: var(--tv-glass-strong); text-align: center; font-size: 1.05rem; color: var(--tv-accent-text); }
.feedus-page-drop-box strong { color: inherit; }

/* Uploads still going while the dialog is closed. */
.feedus-upload-pending { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; padding: 0.35rem 0.75rem; border: 0; border-radius: 0.375rem; background: var(--tv-glass); box-shadow: 0 0 0 1px var(--tv-active-edge); color: inherit; font: inherit; font-size: 0.84rem; font-weight: 600; cursor: pointer; }
.feedus-upload-spinner { width: 0.9rem; height: 0.9rem; border: 2px solid var(--tv-line-strong); border-top-color: var(--tv-active-edge); border-radius: 50%; animation: feedus-spin 0.8s linear infinite; }
@keyframes feedus-spin { to { transform: rotate(360deg); } }

/* Template gallery. */
.feedus-templates { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: 0.875rem; }
.feedus-template { display: flex; flex-direction: column; overflow: hidden; padding: 0; border: 0; border-radius: 0.6rem; background: var(--tv-glass); box-shadow: 0 0 0 1px var(--tv-line-strong); color: inherit; font: inherit; text-align: left; cursor: pointer; transition: box-shadow 0.15s, transform 0.15s; }
.feedus-template:hover, .feedus-template:focus-visible { box-shadow: 0 0 0 2px var(--tv-active-edge); transform: translateY(-1px); outline: none; }
.feedus-template-image { display: grid; place-items: center; aspect-ratio: 16 / 9; background: var(--tv-number, #2a3); background-size: cover; background-position: center; color: #fff; }
.feedus-template-image .fi-icon, .feedus-template-image svg { filter: drop-shadow(0 2px 6px rgb(0 0 0 / 0.45)); }
.feedus-template-body { display: flex; flex-direction: column; gap: 0.25rem; padding: 0.7rem 0.8rem 0.85rem; font-size: 0.82rem; line-height: 1.35; }
.feedus-template-body strong { font-size: 0.95rem; }
.feedus-template-body span { opacity: 0.75; }

/* Empty playlist: the four ways as cards. */
.feedus-empty { padding: 2rem 1.25rem; text-align: center; }
.feedus-empty h3 { font-size: 1.05rem; font-weight: 700; }
.feedus-empty p { max-width: 36rem; margin: 0.35rem auto 1.25rem; font-size: 0.875rem; opacity: 0.75; }
.feedus-empty-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 0.75rem; max-width: 56rem; margin: 0 auto; }
.feedus-empty-option { display: flex; flex-direction: column; align-items: center; gap: 0.4rem; padding: 1.1rem 0.9rem; border: 0; border-radius: 0.6rem; background: var(--tv-glass); box-shadow: 0 0 0 1px var(--tv-line-strong); color: inherit; font: inherit; font-size: 0.8rem; line-height: 1.35; text-decoration: none; cursor: pointer; transition: box-shadow 0.15s; }
.feedus-empty-option:hover { box-shadow: 0 0 0 2px var(--tv-active-edge); }
.feedus-empty-option .fi-icon, .feedus-empty-option svg { color: var(--tv-accent-text); }
.feedus-empty-option strong { font-size: 0.9rem; }
.feedus-empty-option span { opacity: 0.75; }
/* The grey drop zone looked inactive: in the dialog it uses the normal text colour and an accent edge. */
.feedus-upload-dialog .feedus-dropzone-target { color: inherit; border-color: color-mix(in srgb, var(--tv-active-edge) 55%, transparent); }
.feedus-upload-dialog .feedus-dropzone-target > .fi-icon, .feedus-upload-dialog .feedus-dropzone-target > svg { width: 2rem; height: 2rem; color: var(--tv-accent-text); }
.feedus-upload-dialog .feedus-dropzone-hint { opacity: 0.75; }
/* Icon sizes (Filament's build has no h-8 / h-10 utilities). */
.feedus-template-image svg { width: 2.75rem; height: 2.75rem; }
.feedus-empty-option svg { width: 1.75rem; height: 1.75rem; }
.feedus-page-drop-box svg { width: 2.25rem; height: 2.25rem; }
/* Four in a row, or two by two: never three and one. */
.feedus-empty-options { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .feedus-empty-options { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 36rem; } }
@media (max-width: 480px) { .feedus-empty-options { grid-template-columns: 1fr; } }

/* AI price dialog and key guide (spec 11.2 "Tekoälyavaimet"), filament/ai/*.blade.php */
.feedus-ai-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.feedus-ai-muted { font-size: 0.85rem; opacity: 0.7; margin-top: 0.5rem; }
.feedus-ai-subheading { font-weight: 600; margin: 1rem 0 0.35rem; }
.feedus-ai-prices { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.feedus-ai-prices th, .feedus-ai-prices td { padding: 0.4rem 0.5rem; border-bottom: 1px solid rgb(156 163 175 / 0.25); text-align: left; vertical-align: top; }
.feedus-ai-prices th { font-weight: 500; width: 45%; }
.feedus-ai-prices td div { display: flex; justify-content: space-between; gap: 1rem; }
.feedus-ai-guide details { margin-top: 0.4rem; padding: 0.5rem 0.75rem; border-radius: 0.5rem; background: rgb(156 163 175 / 0.08); }
.feedus-ai-guide summary { cursor: pointer; font-weight: 500; }
.feedus-ai-guide ol { margin: 0.5rem 0 0.4rem 1.25rem; list-style: decimal; font-size: 0.9rem; }
.feedus-ai-guide a { font-size: 0.85rem; color: var(--primary-500); word-break: break-all; }

/* Play statistics (spec 11.4), filament/pages/stats.blade.php; prints as a report. */
.feedus-stats { display: grid; gap: 1.25rem; }
.feedus-stats-filter-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: 0.9rem; }
.feedus-stats-field { display: grid; gap: 0.3rem; font-size: 0.85rem; font-weight: 600; }
.feedus-stats-ranges { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.9rem; }
.feedus-stats-check { display: inline-flex; gap: 0.45rem; align-items: center; margin-left: 0.5rem; font-size: 0.85rem; }
.feedus-stats-subject { font-size: 1rem; }
.feedus-stats-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr)); gap: 0.9rem; }
.feedus-stats-card { display: grid; gap: 0.25rem; padding: 0.9rem 1rem; border-radius: 0.75rem; background: var(--tv-glass); box-shadow: 0 0 0 1px var(--tv-line-strong); }
.feedus-stats-card span { font-size: 0.8rem; opacity: 0.75; }
.feedus-stats-card b { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.feedus-stats-chart { display: block; width: 100%; height: 14rem; }
.feedus-stats-chart.is-small { height: 9rem; }
.feedus-stats-bar { fill: var(--primary-500); }
.feedus-stats-bar:hover { fill: var(--primary-400); }
.feedus-stats-axis { stroke: currentColor; stroke-opacity: 0.25; stroke-width: 1; vector-effect: non-scaling-stroke; }
.feedus-stats-labels { display: grid; margin-top: 0.3rem; font-size: 0.7rem; opacity: 0.7; white-space: nowrap; }
.feedus-stats-labels span { overflow: visible; text-align: center; }
.feedus-stats-note { font-size: 0.8rem; opacity: 0.7; margin-top: 0.4rem; }
.feedus-stats-empty { opacity: 0.75; }
.feedus-stats-table-wrap { overflow-x: auto; }
.feedus-stats-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.feedus-stats-table th, .feedus-stats-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid rgb(156 163 175 / 0.25); text-align: left; }
.feedus-stats-table th { font-weight: 600; font-size: 0.8rem; opacity: 0.8; }
.feedus-stats-table .is-num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.feedus-stats-table a { color: var(--tv-accent-text, var(--primary-500)); }
@media print {
    .fi-sidebar, .fi-topbar, .fi-header-actions, .fi-page-header-main-ctn .fi-header-actions-ctn, .feedus-stats-filters { display: none !important; }
    .fi-main-ctn, .fi-main, .fi-page { margin: 0 !important; padding: 0 !important; max-width: none !important; }
    body, .fi-body { background: #fff !important; color: #000 !important; }
    .feedus-stats-card, .fi-section { box-shadow: 0 0 0 1px #ccc !important; background: #fff !important; break-inside: avoid; }
    .feedus-stats-bar { fill: #444 !important; }
    .feedus-stats-table a { color: #000 !important; text-decoration: none; }
}

/* Training videos (spec 11.10, HelpVideosPage) */
.feedus-help-note { font-size: 0.875rem; opacity: 0.75; margin-bottom: 1rem; }
.feedus-help-section + .feedus-help-section { margin-top: 2.5rem; }
.feedus-help-heading { font-size: 0.8rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; opacity: 0.8; margin-bottom: 0.9rem; }
.feedus-help-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); }
.feedus-help-card { display: flex; flex-direction: column; overflow: hidden; border-radius: var(--tv-radius, 1rem); background: var(--tv-glass); box-shadow: 0 0 0 1px var(--tv-line-strong), var(--tv-shadow); }
.feedus-help-thumb { position: relative; display: block; aspect-ratio: 16 / 9; width: 100%; background: #0b100e; cursor: pointer; }
.feedus-help-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 0.3s ease, opacity 0.3s ease; opacity: 0.92; }
.feedus-help-thumb:hover img, .feedus-help-thumb:focus-visible img { transform: scale(1.03); opacity: 1; }
.feedus-help-play { position: absolute; left: 50%; top: 50%; width: 3.5rem; height: 3.5rem; margin: -1.75rem 0 0 -1.75rem; display: grid; place-items: center; border-radius: 999px; background: rgb(0 0 0 / 0.55); color: #fff; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.85); transition: transform 0.2s ease, background 0.2s ease; }
.feedus-help-play svg { width: 1.6rem; height: 1.6rem; margin-left: 0.2rem; }
.feedus-help-thumb:hover .feedus-help-play, .feedus-help-thumb:focus-visible .feedus-help-play { transform: scale(1.1); background: var(--primary-600, #65a30d); }
.feedus-help-duration { position: absolute; right: 0.6rem; bottom: 0.6rem; padding: 0.1rem 0.45rem; border-radius: 0.35rem; background: rgb(0 0 0 / 0.7); color: #fff; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.feedus-help-body { display: grid; gap: 0.35rem; padding: 0.9rem 1.1rem 1.1rem; }
.feedus-help-number { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--tv-accent-text, #477a00); }
.dark .feedus-help-number { color: var(--primary-400, #a3e635); }
.feedus-help-body h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.feedus-help-body h3 button { text-align: left; }
.feedus-help-body h3 button:hover { text-decoration: underline; }
.feedus-help-body p { font-size: 0.875rem; line-height: 1.5; opacity: 0.8; }
.feedus-help-modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1.5rem; background: rgb(0 0 0 / 0.82); backdrop-filter: blur(4px); }
.feedus-help-window { position: relative; width: min(100%, 1400px, calc((100vh - 13rem) * 16 / 9)); color: #fff; }
.feedus-help-window video { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border-radius: 0.75rem; box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.8); }
.feedus-help-caption { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start; justify-content: space-between; margin-top: 1rem; }
.feedus-help-caption > div:first-child { flex: 1 1 24rem; display: grid; gap: 0.3rem; }
.feedus-help-caption .feedus-help-number { color: var(--primary-400, #a3e635); }
.feedus-help-caption h2 { font-size: 1.3rem; font-weight: 700; }
.feedus-help-caption p { font-size: 0.9rem; line-height: 1.5; opacity: 0.8; max-width: 60rem; }
.feedus-help-nav { display: flex; gap: 0.5rem; }
.feedus-help-close { position: absolute; top: -0.9rem; right: -0.9rem; width: 2.4rem; height: 2.4rem; display: grid; place-items: center; border-radius: 999px; background: #fff; color: #111; box-shadow: 0 4px 16px rgb(0 0 0 / 0.4); }
.feedus-help-close svg { width: 1.2rem; height: 1.2rem; }
@media (max-width: 640px) {
    .feedus-help-modal { padding: 0.75rem; }
    .feedus-help-close { top: -0.6rem; right: -0.3rem; }
}

/* Page library list (spec 11.11): a little smaller text, room for every action. */
.feedus-pages-table .fi-ta-text-item-label,
.feedus-pages-table .fi-ta-text-item { font-size: 0.875rem; }
.feedus-pages-table .fi-ta-text-description { font-size: 0.8rem; }
.feedus-pages-table th.fi-ta-header-cell { font-size: 0.75rem; }

/* Simple front page (spec 11.16). */
.feedus-simple { display: flex; flex-direction: column; gap: 1rem; }
.feedus-simple-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: .5rem; }
.feedus-simple-figure { display: flex; flex-direction: column; gap: .1rem; padding: .5rem .75rem; border-radius: 8px; background: var(--tv-glass, rgba(127,127,127,.08)); border: 1px solid var(--tv-line, rgba(127,127,127,.2)); }
.feedus-simple-figure-label { font-size: .8rem; opacity: .75; }
.feedus-simple-figure-value { font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.feedus-simple-figure.is-success .feedus-simple-figure-value { color: var(--success-500); }
.feedus-simple-figure.is-danger .feedus-simple-figure-value { color: var(--danger-500); }
.feedus-simple-unit { display: block; min-width: 14rem; }
.feedus-simple-empty { opacity: .7; }
.feedus-simple-screens { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: .75rem; }
/* Each card spans two rows of the grid through subgrid, so every heading block in a row is as tall as the tallest and the dividers line up. */
.feedus-simple-screen { padding: .75rem .9rem; border-radius: 8px; border: 1px solid var(--tv-line, rgba(127,127,127,.2)); background: rgba(0,0,0,.1); display: grid; grid-template-rows: subgrid; grid-row: span 2; row-gap: .6rem; }
.feedus-simple-screen-top { display: flex; flex-direction: column; gap: .3rem; padding-bottom: .6rem; border-bottom: 1px solid var(--tv-line, rgba(127,127,127,.3)); }
.feedus-simple-screen-body { display: flex; flex-direction: column; gap: .3rem; }
.feedus-simple-playlists-title { font-size: .8rem; font-weight: 600; opacity: .8; }
:root.dark .feedus-simple-screen { background: rgba(255,255,255,.06); }
.feedus-simple-screen-head { display: flex; align-items: center; gap: .5rem; }
.feedus-simple-screen-name { color: var(--tv-accent-text, var(--primary-500)); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* Beats the theme's turquoise link rule (.fi-body .fi-section a:not(..):not(..)), so screens stand apart from the playlist links. */
.fi-body .fi-section .feedus-simple-screen a.feedus-simple-screen-name:not(.fi-btn) { color: var(--tv-accent-text, var(--primary-500)); }
a.feedus-simple-screen-name:hover { text-decoration: underline; }
.feedus-simple-dot { width: .6rem; height: .6rem; border-radius: 50%; flex: none; background: var(--gray-400); }
.feedus-simple-dot.is-online { background: var(--success-500); }
.feedus-simple-dot.is-offline { background: var(--danger-500); }
.feedus-simple-dot.is-power_saving { background: var(--info-500); }
.feedus-simple-meta { font-size: .85rem; opacity: .75; overflow-wrap: anywhere; }
.feedus-simple-playlists { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .15rem; }
.feedus-simple-playlists a { color: var(--tv-link, var(--primary-500)); }
.feedus-simple-playlists a:hover { text-decoration: underline; }
