/* Nur Layout — Optik über Filament-Variablen / fi-* */
.tk-workspace {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding-bottom: 5rem; /* Platz für Dirty-Save-Bar */
}

/* ── Schlichte Scrollbars (Workspace + kleine Menüs) ── */
.tk-workspace,
.tk-float-list-scroll,
.tk-float-canvas,
.tk-channel-picker-list,
.tk-channel-picker-panel,
.fi-emoji-picker-panel,
.fi-emoji-picker-grid,
.tk-dd-menu,
.tk-cat-order-list,
.tk-canvas-form {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.tk-workspace::-webkit-scrollbar,
.tk-float-list-scroll::-webkit-scrollbar,
.tk-float-canvas::-webkit-scrollbar,
.tk-channel-picker-list::-webkit-scrollbar,
.tk-channel-picker-panel::-webkit-scrollbar,
.fi-emoji-picker-panel::-webkit-scrollbar,
.fi-emoji-picker-grid::-webkit-scrollbar,
.tk-dd-menu::-webkit-scrollbar,
.tk-cat-order-list::-webkit-scrollbar,
.tk-canvas-form::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

/* Noch schmaler in Dropdowns / Picker-Panels */
.tk-channel-picker-list::-webkit-scrollbar,
.tk-channel-picker-panel::-webkit-scrollbar,
.fi-emoji-picker-panel::-webkit-scrollbar,
.fi-emoji-picker-grid::-webkit-scrollbar,
.tk-dd-menu::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

.tk-workspace::-webkit-scrollbar-track,
.tk-float-list-scroll::-webkit-scrollbar-track,
.tk-float-canvas::-webkit-scrollbar-track,
.tk-channel-picker-list::-webkit-scrollbar-track,
.tk-channel-picker-panel::-webkit-scrollbar-track,
.fi-emoji-picker-panel::-webkit-scrollbar-track,
.fi-emoji-picker-grid::-webkit-scrollbar-track,
.tk-dd-menu::-webkit-scrollbar-track,
.tk-cat-order-list::-webkit-scrollbar-track,
.tk-canvas-form::-webkit-scrollbar-track {
    background: transparent;
}

.tk-workspace::-webkit-scrollbar-thumb,
.tk-float-list-scroll::-webkit-scrollbar-thumb,
.tk-float-canvas::-webkit-scrollbar-thumb,
.tk-channel-picker-list::-webkit-scrollbar-thumb,
.tk-channel-picker-panel::-webkit-scrollbar-thumb,
.fi-emoji-picker-panel::-webkit-scrollbar-thumb,
.fi-emoji-picker-grid::-webkit-scrollbar-thumb,
.tk-dd-menu::-webkit-scrollbar-thumb,
.tk-cat-order-list::-webkit-scrollbar-thumb,
.tk-canvas-form::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.14);
    border-radius: 999px;
    border: 1px solid transparent;
    background-clip: padding-box;
}

.tk-workspace::-webkit-scrollbar-thumb:hover,
.tk-float-list-scroll::-webkit-scrollbar-thumb:hover,
.tk-float-canvas::-webkit-scrollbar-thumb:hover,
.tk-channel-picker-list::-webkit-scrollbar-thumb:hover,
.tk-channel-picker-panel::-webkit-scrollbar-thumb:hover,
.fi-emoji-picker-panel::-webkit-scrollbar-thumb:hover,
.fi-emoji-picker-grid::-webkit-scrollbar-thumb:hover,
.tk-dd-menu::-webkit-scrollbar-thumb:hover,
.tk-cat-order-list::-webkit-scrollbar-thumb:hover,
.tk-canvas-form::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.28);
    background-clip: padding-box;
}

.tk-workspace::-webkit-scrollbar-corner,
.tk-float-list-scroll::-webkit-scrollbar-corner,
.tk-float-canvas::-webkit-scrollbar-corner,
.tk-channel-picker-list::-webkit-scrollbar-corner,
.tk-channel-picker-panel::-webkit-scrollbar-corner,
.fi-emoji-picker-panel::-webkit-scrollbar-corner,
.fi-emoji-picker-grid::-webkit-scrollbar-corner,
.tk-dd-menu::-webkit-scrollbar-corner,
.tk-cat-order-list::-webkit-scrollbar-corner,
.tk-canvas-form::-webkit-scrollbar-corner {
    background: transparent;
}

/* Nur die Filament-Überschrift, nicht den Seitencontainer (Inhalt liegt darin). */
.fi-page:has(.tk-workspace) .fi-header {
    display: none !important;
}

/* ── Floating Workspace ── */
.tk-float {
    display: flex;
    align-items: stretch;
    gap: 0.85rem;
    /* Bis zum unteren Viewport-Rand (Filament-Topbar + Workspace-Padding) */
    min-height: calc(100dvh - 8.5rem);
}

/* Keine Filament-Karten im Canvas — flach wie Ticket-Felder */
.tk-canvas-form .fi-section,
.tk-canvas-form .fi-sc-section,
.tk-canvas-form .fi-section-content-ctn {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
}

.tk-float-left,
.tk-float-right {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 0;
}

.tk-float-left {
    width: 17.5rem;
    flex-shrink: 0;
}

.tk-float-right {
    flex: 1;
    min-width: 0;
    min-height: calc(100dvh - 8.5rem);
}

.tk-float-card {
    border-radius: 1rem;
    border: 1px solid color-mix(in srgb, white 8%, transparent);
    background: #171717;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

/* Obere Reihe: Switcher + Toolbar immer gleiche Höhe */
.tk-float-top {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 3.35rem;
    height: 3.35rem;
    padding: 0.35rem 0.45rem;
    box-sizing: border-box;
}

.tk-float-toolbar {
    padding-inline: 0.75rem;
}

.tk-float-switcher-row {
    display: flex;
    width: 100%;
    gap: 0.3rem;
}

.tk-float-switch {
    display: inline-flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    border: 0;
    border-radius: 0.7rem;
    padding: 0.55rem 0.5rem;
    font: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--gray-400, #a3a3a3);
    background: transparent;
    cursor: pointer;
}

.tk-float-switch:hover {
    color: var(--gray-100, #f5f5f5);
    background: color-mix(in srgb, white 6%, transparent);
}

.tk-float-switch.is-active {
    color: #fff;
    background: #262626;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, white 14%, transparent);
}

.tk-float-switch-count {
    min-width: 1.25rem;
    border-radius: 999px;
    padding: 0.05rem 0.35rem;
    font-size: 0.68rem;
    font-weight: 700;
    background: color-mix(in srgb, white 12%, transparent);
}

.tk-float-switch.is-active .tk-float-switch-count {
    background: color-mix(in srgb, white 18%, transparent);
}

.tk-float-list,
.tk-float-canvas {
    display: flex;
    min-height: 0;
    flex: 1 1 auto;
    flex-direction: column;
    overflow: hidden;
}

.tk-float-canvas {
    min-height: calc(100dvh - 12.5rem);
}

.tk-float-list-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.65rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tk-float-list-footer {
    display: flex;
    flex-shrink: 0;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.65rem 0.7rem;
    border-top: 0;
}

/* Echter Full-Width-Button — links bis rechts */
.tk-float-add-btn {
    display: inline-flex !important;
    width: 100% !important;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    min-height: 2.5rem;
    padding: 0.55rem 0.85rem;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 0.65rem;
    background: #222 !important;
    color: #f5f5f5 !important;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    transition: background-color 0.12s ease, border-color 0.12s ease;
}

.tk-float-add-btn > span {
    font-size: 1.05rem;
    font-weight: 650;
    line-height: 1;
}

.tk-float-add-btn:hover {
    background: #2c2c2c !important;
    border-color: rgba(255, 255, 255, 0.22) !important;
    color: #fff !important;
}

.tk-float-add-btn:active {
    background: #1a1a1a !important;
}

.tk-float-canvas {
    overflow-y: auto;
    padding: 1.15rem 1.25rem 1.4rem;
}

.tk-dirty-bar {
    position: fixed;
    inset-inline: 0;
    bottom: 1.25rem;
    /* Über Filament-Sidebar/Overlay; Teleport an body */
    z-index: 10050;
    display: flex;
    justify-content: center;
    padding-inline: 1rem;
    pointer-events: none;
    opacity: 0;
    transform: translateY(120%);
    transition: transform 0.22s ease, opacity 0.22s ease;
}

.tk-dirty-bar.is-visible {
    pointer-events: auto;
    opacity: 1;
    transform: translateY(0);
}

.tk-dirty-bar-inner {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    width: max-content;
    max-width: min(42rem, calc(100vw - 2rem));
    padding: 0.65rem 0.9rem;
    border-radius: 1rem; /* wie tk-float-card */
    border: 1px solid color-mix(in srgb, white 14%, transparent);
    background: rgba(23, 23, 23, 0.94);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(12px);
}

.tk-dirty-bar-hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.2;
    color: var(--gray-300, #d4d4d4);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-dirty-bar-actions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.tk-modules {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
    max-width: 44rem;
    padding-bottom: 5rem;
}

.tk-modules-intro {
    padding: 1.1rem 1.25rem;
}

.tk-modules-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 650;
    color: var(--gray-50, #fafafa);
}

.tk-modules-copy {
    margin: 0.4rem 0 0;
    font-size: 0.85rem;
    line-height: 1.45;
    color: var(--gray-400, #a3a3a3);
}

.tk-modules-form {
    padding: 1rem 1.15rem 1.25rem;
}

@media (max-width: 900px) {
    .tk-float {
        flex-direction: column;
        min-height: 0;
    }

    .tk-float-left,
    .tk-float-right {
        width: 100%;
    }

    .tk-float-list {
        max-height: 16rem;
    }

    .tk-float-top {
        height: auto;
        min-height: 3.35rem;
    }
}

.tk-module-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Modul-Meta (An/Aus über der Rail) — gleiche Feld-Dichte wie Canvas */
.tk-module-meta {
    margin-bottom: 0.75rem;
}

.tk-module-meta .fi-section-content,
.tk-module-meta .fi-section-content-ctn {
    padding: 0 !important;
}

.tk-workspace .fi-section + .fi-section {
    margin-top: 0;
}

.tk-body {
    display: flex;
    min-height: 34rem;
    margin: -1.25rem; /* fi-section content padding ausgleichen */
}

.tk-body--flush {
    min-height: 36rem;
}

.tk-rail {
    display: flex;
    width: 17rem;
    flex-shrink: 0;
    flex-direction: column;
    border-inline-end: 1px solid color-mix(in srgb, var(--gray-950, #0a0a0a) 8%, transparent);
}

.tk-rail-tabs {
    flex-shrink: 0;
    padding: 0.65rem 0.65rem 0.35rem;
    border-bottom: 1px solid color-mix(in srgb, var(--gray-950, #0a0a0a) 8%, transparent);
}

.fi-dark .tk-rail-tabs,
:is(.dark) .tk-rail-tabs {
    border-bottom-color: color-mix(in srgb, white 10%, transparent);
}

.tk-rail-tabs .fi-tabs {
    flex-wrap: wrap;
    gap: 0.25rem;
}

.tk-rail-tabs .fi-tabs-item {
    flex: 1 1 auto;
    justify-content: center;
}

.fi-dark .tk-rail,
:is(.dark) .tk-rail {
    border-inline-end-color: color-mix(in srgb, white 10%, transparent);
}

.tk-rail-scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tk-rail-footer {
    flex-shrink: 0;
    padding: 0.75rem;
    border-top: 1px solid color-mix(in srgb, var(--gray-950, #0a0a0a) 8%, transparent);
}

.fi-dark .tk-rail-footer,
:is(.dark) .tk-rail-footer {
    border-top-color: color-mix(in srgb, white 10%, transparent);
}

.tk-canvas {
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    padding: 1.25rem;
}

.rail-item {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.65rem;
    border: 0;
    border-radius: 0.5rem;
    padding: 0.5rem 0.6rem;
    font: inherit;
    text-align: left;
    color: var(--gray-500, #737373);
    background: transparent;
    cursor: pointer;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.rail-item:hover {
    background: color-mix(in srgb, var(--gray-950, #0a0a0a) 4%, transparent);
    color: var(--gray-700, #334155);
}

.fi-dark .rail-item:hover,
:is(.dark) .rail-item:hover {
    background: color-mix(in srgb, white 5%, transparent);
    color: var(--gray-200, #e2e8f0);
}

.rail-item.is-active {
    color: var(--primary-600, #525252);
    background: color-mix(in srgb, var(--primary-600, #525252) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-600, #525252) 22%, transparent);
}

.fi-dark .rail-item.is-active,
:is(.dark) .rail-item.is-active {
    color: var(--primary-400, #a3a3a3);
    background: color-mix(in srgb, var(--primary-400, #a3a3a3) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-400, #a3a3a3) 28%, transparent);
}

.rail-item-icon {
    display: flex;
    width: 2rem;
    height: 2rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--gray-950, #0a0a0a) 4%, transparent);
    font-size: 0.95rem;
}

.fi-dark .rail-item-icon,
:is(.dark) .rail-item-icon {
    background: color-mix(in srgb, white 6%, transparent);
}

.rail-item-icon img {
    width: 1.15rem;
    height: 1.15rem;
}

.rail-item-body {
    min-width: 0;
    flex: 1;
}

.rail-item-title {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
}

.fi-dark .rail-item-title,
:is(.dark) .rail-item-title {
    color: var(--gray-50, #fafafa);
}

.rail-item-meta {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-500, #737373);
}

.tk-tree-children {
    margin: 0.1rem 0.2rem 0.45rem 0.55rem;
    padding: 0.3rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--gray-950, #0a0a0a) 3%, transparent);
}

.fi-dark .tk-tree-children,
:is(.dark) .tk-tree-children {
    background: color-mix(in srgb, white 3%, transparent);
}

.tk-sub-row {
    display: flex;
    width: 100%;
    align-items: center;
    gap: 0.5rem;
    border: 0;
    border-radius: 0.4rem;
    padding: 0.4rem 0.5rem;
    font: inherit;
    font-size: 0.8125rem;
    color: var(--gray-500, #737373);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.tk-sub-row:hover {
    background: color-mix(in srgb, var(--gray-950, #0a0a0a) 4%, transparent);
    color: var(--gray-700, #334155);
}

.fi-dark .tk-sub-row:hover,
:is(.dark) .tk-sub-row:hover {
    background: color-mix(in srgb, white 5%, transparent);
    color: var(--gray-200, #e2e8f0);
}

.tk-sub-row.is-active {
    font-weight: 500;
    color: var(--primary-600, #525252);
    background: color-mix(in srgb, var(--primary-600, #525252) 10%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-600, #525252) 22%, transparent);
}

.fi-dark .tk-sub-row.is-active,
:is(.dark) .tk-sub-row.is-active {
    color: var(--primary-400, #a3a3a3);
    background: color-mix(in srgb, var(--primary-400, #a3a3a3) 14%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--primary-400, #a3a3a3) 28%, transparent);
}

.tk-sub-icon {
    display: flex;
    width: 1.4rem;
    height: 1.4rem;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-radius: 0.3rem;
    font-size: 0.7rem;
}

.tk-sub-icon img {
    width: 0.9rem;
    height: 0.9rem;
}

.tk-tree-label {
    margin: 0.35rem 0 0.1rem;
    padding: 0 0.4rem;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--gray-400, #a3a3a3);
}

.tk-sub-add {
    display: flex;
    width: 100%;
    border: 0;
    border-radius: 0.4rem;
    padding: 0.4rem 0.5rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary-600, #525252);
    background: transparent;
    cursor: pointer;
    text-align: left;
}

.fi-dark .tk-sub-add,
:is(.dark) .tk-sub-add {
    color: var(--primary-400, #a3a3a3);
}

.tk-sub-add:hover {
    background: color-mix(in srgb, var(--primary-600, #525252) 8%, transparent);
}

.tk-empty-hint {
    padding: 2rem 0.75rem;
    text-align: center;
    font-size: 0.8125rem;
    color: var(--gray-500, #737373);
}

.tk-canvas-shell {
    width: 100%;
    max-width: none;
}

/* Weniger „Filament-Formular“: engere, ruhigere Felder */
.tk-canvas-form .fi-fo-field-wrp,
.tk-canvas-form .fi-sc-component {
    gap: 0.35rem;
}

/*
 * Pixelgleiche Control-Höhe:
 * Filament Select-Button = calc(var(--spacing) * 9) → darauf alles ausrichten.
 * Die Hülle (Wrapper) bekommt keine max-height: sonst wird overflow zu auto
 * und Select-/Farb-/Channel-Menüs erben die Feldhöhe oder werden abgeschnitten.
 */
.tk-canvas-form {
    --tk-control-h: calc(var(--spacing) * 9);
}

.tk-canvas-form .fi-fo-field,
.tk-canvas-form .fi-fo-field-content-col,
.tk-canvas-form .fi-sc,
.tk-canvas-form .fi-sc-component,
.tk-canvas-form .fi-grid-col,
.tk-canvas-form .fi-fo-select,
.tk-canvas-form .fi-fo-select-wrp,
.tk-canvas-form .fi-input-wrp,
.tk-canvas-form .fi-select-input,
.tk-canvas-form .fi-select-input-ctn,
.tk-canvas-form .tk-channel-picker,
.tk-canvas-form .fi-emoji-picker,
.tk-canvas-form .tk-dd,
.tk-canvas-form .tk-title-combo {
    overflow: visible;
}

/* Nur die sichtbare Zeile, nie das Menü */
.tk-canvas-form .tk-title-combo-shell,
.tk-canvas-form .fi-emoji-picker-shell,
.tk-canvas-form .tk-channel-picker-shell,
.tk-canvas-form .tk-dd-trigger--field {
    box-sizing: border-box !important;
    height: var(--tk-control-h) !important;
    min-height: var(--tk-control-h) !important;
    max-height: var(--tk-control-h) !important;
}

.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input) {
    box-sizing: border-box !important;
    height: auto !important;
    min-height: var(--tk-control-h) !important;
    max-height: none !important;
    overflow: visible !important;
}

.tk-canvas-form .fi-input-wrp:has(.fi-badge),
.tk-canvas-form .fi-fo-tags-input.fi-input-wrp,
.tk-canvas-form .fi-input-wrp.fi-fo-color-picker {
    height: auto !important;
    min-height: var(--tk-control-h) !important;
    max-height: none !important;
    overflow: visible !important;
}

/* Einheitliche Controls: gleiche Rundung und Fläche. Nur die Hülle, nicht das Menü. */
.tk-canvas-form .fi-input-wrp,
.tk-canvas-form .tk-channel-picker-shell,
.tk-canvas-form .fi-emoji-picker-shell,
.tk-canvas-form .tk-title-combo-shell,
.tk-canvas-form .tk-dd-trigger--field,
.tk-canvas-form textarea.fi-input,
.tk-canvas-form .tk-cat-order-select {
    border: 0 !important;
    border-radius: 0.65rem !important;
}

/* Ein Ring, keine zweite Filament-Border um Channel/Emoji/Titel */
.tk-canvas-form .tk-channel-picker,
.tk-canvas-form .fi-emoji-picker,
.tk-canvas-form .tk-title-combo,
.tk-canvas-form .tk-dd {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tk-canvas-form .fi-input-wrp,
.tk-canvas-form .tk-channel-picker-shell,
.tk-canvas-form .fi-emoji-picker-shell,
.tk-canvas-form .tk-title-combo-shell,
.tk-canvas-form .tk-dd-trigger--field {
    background-color: #1c1c1c !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
    --tw-ring-shadow: 0 0 #0000 !important;
    --tw-ring-offset-shadow: 0 0 #0000 !important;
    --tw-inset-ring-shadow: 0 0 #0000 !important;
}

.tk-canvas-form .tk-cat-order-select {
    background-color: #1c1c1c !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1) !important;
}

.tk-canvas-form .fi-input-wrp:focus-within {
    background-color: #262626 !important;
    border-color: transparent !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24) !important;
}

.tk-canvas-form .tk-cat-order-select:focus {
    background-color: #262626 !important;
    border-color: transparent !important;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24) !important;
}

.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input):not(.fi-fo-color-picker) {
    display: flex;
    align-items: stretch;
}

.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input):not(.fi-fo-color-picker) .fi-input-wrp-content-ctn,
.tk-canvas-form .fi-input-wrp:not(:has(textarea)) > .fi-select-input,
.tk-canvas-form .fi-input-wrp:not(:has(textarea)) > select {
    display: flex;
    align-items: stretch;
    min-height: 100%;
}

/* Nur die sichtbare Eingabezeile — nie Suche, Farbpanel oder Channel-Panel */
.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input):not(.fi-fo-color-picker) > .fi-input-wrp-content-ctn > .fi-input,
.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input):not(.fi-fo-color-picker) > input.fi-input,
.tk-canvas-form .fi-input-wrp:not(:has(textarea)):not(.fi-fo-tags-input) > select.fi-select-input {
    box-sizing: border-box !important;
    height: var(--tk-control-h) !important;
    min-height: var(--tk-control-h) !important;
    max-height: var(--tk-control-h) !important;
    padding-block: 0 !important;
    line-height: 1.25 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

/* ColorPicker: [Hex …] [Kreis] [Reset] in einer Zeile */
.tk-canvas-form .fi-input-wrp.fi-fo-color-picker {
    display: flex !important;
    align-items: center !important;
    overflow: visible !important;
}

.tk-canvas-form .fi-fo-color-picker > .fi-input-wrp-content-ctn {
    display: flex !important;
    flex: 1 1 auto !important;
    align-items: center !important;
    min-width: 0 !important;
    min-height: var(--tk-control-h) !important;
}

.tk-canvas-form .fi-fo-color-picker .fi-input-wrp-content {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    min-width: 0 !important;
    width: 100% !important;
    height: var(--tk-control-h) !important;
    min-height: var(--tk-control-h) !important;
    overflow: visible !important;
}

.tk-canvas-form .fi-fo-color-picker .fi-input-wrp-content > input.fi-input {
    box-sizing: border-box !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: none !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    padding-block: 0 !important;
    line-height: 1.25 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.tk-canvas-form .fi-fo-color-picker .fi-fo-color-picker-preview {
    flex: 0 0 auto !important;
    width: 1.25rem !important;
    height: 1.25rem !important;
    margin-block: 0 !important;
    margin-inline-start: 0.35rem !important;
    margin-inline-end: 0.35rem !important;
}

.tk-canvas-form .fi-fo-color-picker > .fi-input-wrp-suffix {
    flex: 0 0 auto !important;
    align-self: center !important;
    padding-block: 0 !important;
}

.tk-canvas-form div.fi-select-input {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 1 1 auto;
    align-self: stretch;
    height: auto !important;
    min-height: 100% !important;
    max-height: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.tk-canvas-form select.fi-select-input {
    box-shadow: none !important;
    background-color: transparent !important;
}

.tk-canvas-form .fi-select-input-ctn {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    width: 100%;
    min-height: 100%;
}

.tk-canvas-form .fi-select-input-btn {
    box-sizing: border-box !important;
    display: flex !important;
    flex: 1 1 auto;
    align-items: center !important;
    width: 100% !important;
    height: var(--tk-control-h) !important;
    min-height: var(--tk-control-h) !important;
    max-height: var(--tk-control-h) !important;
    padding-block: 0 !important;
    background-color: transparent !important;
    box-shadow: none !important;
    line-height: 1.25 !important;
}

.tk-canvas-form .fi-input-wrp:has(.fi-badge) .fi-select-input-btn {
    height: auto !important;
    max-height: none !important;
    padding-block: 0.35rem !important;
}

/* Tags (Backup-Ignore): Eingabezeile bleibt eine Zeile, Chips umbrechen darunter */
.tk-canvas-form .fi-fo-tags-input.fi-input-wrp {
    height: auto !important;
    min-height: var(--tk-control-h) !important;
    max-height: none !important;
    align-items: stretch;
}

.tk-canvas-form .fi-fo-tags-input .fi-input-wrp-content-ctn {
    display: block;
    height: auto;
    min-height: 0;
}

.tk-canvas-form .fi-fo-tags-input .fi-input {
    box-sizing: border-box !important;
    height: var(--tk-control-h) !important;
    min-height: var(--tk-control-h) !important;
    max-height: var(--tk-control-h) !important;
    padding: 0 0.75rem !important;
    line-height: 1.25 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.tk-canvas-form .fi-fo-tags-input-tags-ctn {
    border-top-color: rgba(255, 255, 255, 0.08);
}

.tk-canvas-form .tk-path-input {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8125rem;
}

/* Menüs dürfen die Feldhöhe nicht erben */
.tk-canvas-form .fi-dropdown-panel,
.tk-canvas-form .fi-fo-color-picker-panel,
.tk-channel-picker-panel,
.fi-emoji-picker-panel,
.tk-dd-menu {
    height: auto !important;
    min-height: 0 !important;
    max-height: min(22rem, 70vh);
}

.tk-canvas-form .fi-dropdown-panel .fi-input,
.tk-canvas-form .fi-select-input-search-ctn .fi-input,
.tk-canvas-form .fi-fo-color-picker-panel .fi-input,
.tk-canvas-form .fi-fo-color-picker-panel input,
.tk-channel-picker-search-input {
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 2.25rem !important;
    max-height: none !important;
    padding: 0.5rem 0.75rem !important;
    line-height: 1.4 !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.tk-canvas-form .fi-fixed-positioning-context .fi-dropdown-panel,
.fi-fixed-positioning-context .fi-dropdown-panel {
    z-index: 10040;
}

/* Top-Layer: Canvas-Overflow schneidet position:fixed sonst ab */
.tk-popover-lift:popover-open {
    margin: 0;
    right: auto;
    bottom: auto;
    height: auto !important;
    max-height: min(22rem, 70vh);
    padding: 0;
    color: inherit;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 0.75rem;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
    overflow: auto;
}

.tk-canvas-form .fi-input-wrp:not(:has(textarea)) .fi-input-wrp-prefix,
.tk-canvas-form .fi-input-wrp:not(:has(textarea)) .fi-input-wrp-suffix {
    padding-block: 0 !important;
    height: auto;
    align-self: stretch;
    display: flex;
    align-items: center;
}

.tk-canvas-form .fi-fo-field-wrp-label,
.tk-canvas-form .fi-fo-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--gray-400, #a3a3a3);
}

.tk-canvas-form .fi-fo-field-wrp-helper-text,
.tk-canvas-form .fi-fo-helper-text {
    font-size: 0.7rem;
    color: var(--gray-500, #737373);
}

.tk-canvas-form .fi-section-header {
    padding-block: 0.35rem;
}

/* Unterabschnitte (Automationen) — ruhig wie Panel, keine Karten-Optik */
.tk-canvas-form .tk-subsection {
    margin-top: 0.35rem;
    padding-top: 0.65rem;
    border-top: 1px solid color-mix(in srgb, white 8%, transparent);
}

.tk-canvas-form .tk-subsection:first-child {
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
}

.tk-canvas-form .tk-subsection .fi-section-header {
    padding-block: 0.15rem 0.45rem;
}

.tk-canvas-form .tk-subsection .fi-section-header-heading {
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--gray-400, #a3a3a3);
}

.tk-canvas-form .tk-subsection .fi-section-content,
.tk-canvas-form .tk-subsection .fi-section-content-ctn {
    padding: 0 !important;
}

/* Repeater (Formular-Felder) an Panel-Dichte anpassen */
.tk-canvas-form .fi-fo-repeater-item {
    border-radius: 0.65rem;
    border-color: color-mix(in srgb, white 10%, transparent);
    background: color-mix(in srgb, white 2.5%, transparent);
}

.tk-canvas-form .fi-fo-repeater-item-header {
    padding-block: 0.4rem;
}

.tk-canvas-form .fi-ta-input,
.tk-canvas-form textarea {
    min-height: 0;
}

.tk-canvas-head {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tk-canvas-head-text {
    min-width: 0;
    flex: 1;
}

.tk-canvas-head .tk-canvas-title {
    font-size: 0.95rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-canvas-head .tk-canvas-sub {
    margin-top: 0.1rem;
    font-size: 0.7rem;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tk-canvas-head--empty .tk-canvas-title {
    color: var(--gray-400, #a3a3a3);
}

.tk-float-toolbar .fi-btn {
    --btn-padding: 0.35rem 0.65rem;
}

/* Löschen in der Canvas-Toolbar: klarer roter Rahmen wie beim Aktiv-Toggle */
.tk-canvas-actions .fi-btn.fi-color-danger,
.tk-float-toolbar .fi-btn.fi-color-danger {
    min-height: 2rem !important;
    border-radius: 0.65rem !important;
    border: 1px solid color-mix(in srgb, #ef4444 55%, transparent) !important;
    background: color-mix(in srgb, #ef4444 18%, #171717) !important;
    color: #fecaca !important;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #ef4444 22%, transparent) !important;
}

.tk-canvas-actions .fi-btn.fi-color-danger:hover,
.tk-float-toolbar .fi-btn.fi-color-danger:hover {
    background: color-mix(in srgb, #ef4444 28%, #171717) !important;
    border-color: color-mix(in srgb, #ef4444 70%, transparent) !important;
    color: #fff !important;
}

/* Kompakte Pill-Tabs wie im alten Panel — kein zweites Side-Rail */
.tk-pill-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    margin-bottom: 1rem;
    padding: 0.2rem;
    border-radius: 0.6rem;
    background: color-mix(in srgb, white 3.5%, transparent);
}

.tk-pill-tab {
    border: 0;
    border-radius: 0.45rem;
    padding: 0.35rem 0.6rem;
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--gray-400, #a3a3a3);
    background: transparent;
    cursor: pointer;
    white-space: nowrap;
    transition: background-color 0.12s ease, color 0.12s ease;
}

.tk-pill-tab:hover {
    color: var(--gray-100, #f5f5f5);
    background: color-mix(in srgb, white 6%, transparent);
}

.tk-pill-tab.is-active {
    color: #fff;
    background: #262626;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, white 14%, transparent);
}

.tk-canvas-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--gray-950, #0a0a0a);
    line-height: 1.3;
}

.fi-dark .tk-canvas-title,
:is(.dark) .tk-canvas-title {
    color: var(--gray-50, #fafafa);
}

.tk-canvas-sub {
    margin: 0.2rem 0 0;
    font-size: 0.8125rem;
    color: var(--gray-500, #737373);
}

.tk-placeholder {
    display: flex;
    min-height: 18rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    color: var(--gray-500, #737373);
    font-size: 0.875rem;
}

.tk-save-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

.tk-save-hint {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--gray-500, #737373);
}

.tk-truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .tk-body {
        flex-direction: column;
        min-height: 0;
        margin: -1rem;
    }

    .tk-rail {
        width: 100%;
        max-height: 16rem;
        border-inline-end: 0;
        border-bottom: 1px solid color-mix(in srgb, white 10%, transparent);
    }
}

.tk-canvas-actions,
.tk-save-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Canvas-Editor: kein Doppel-Card, dichteres Formular */
.tk-canvas-form {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.tk-canvas-form .fi-section-content-ctn,
.tk-canvas-form .fi-sc-component:first-child {
    margin-top: 0;
}

/* Toolbar-Toggle: Aus = gedämpft, An = klar grün */
.tk-enabled {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    box-sizing: border-box;
    min-height: 2rem;
    margin: 0;
    padding: 0.3rem 0.7rem 0.3rem 0.55rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    color: var(--gray-500, #737373);
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    cursor: pointer;
    user-select: none;
    transition:
        background-color 0.12s ease,
        border-color 0.12s ease,
        color 0.12s ease,
        box-shadow 0.12s ease;
}

.tk-enabled:hover {
    border-color: rgba(255, 255, 255, 0.16);
    color: var(--gray-400, #a3a3a3);
}

.tk-enabled:has(.tk-enabled-input:checked) {
    color: #dcfce7;
    background: color-mix(in srgb, #22c55e 18%, #171717);
    border-color: color-mix(in srgb, #22c55e 45%, transparent);
    box-shadow: inset 0 0 0 1px color-mix(in srgb, #22c55e 20%, transparent);
}

.tk-enabled:has(.tk-enabled-input:checked):hover {
    background: color-mix(in srgb, #22c55e 24%, #171717);
    color: #f0fdf4;
}

.tk-enabled-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.tk-enabled-icon {
    display: inline-flex;
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: inherit;
}

.tk-enabled-icon svg {
    width: 1rem;
    height: 1rem;
    display: none;
}

.tk-enabled .tk-enabled-icon-off {
    display: block;
}

.tk-enabled .tk-enabled-label-off {
    display: inline;
}

.tk-enabled .tk-enabled-icon-on,
.tk-enabled .tk-enabled-label-on {
    display: none;
}

.tk-enabled:has(.tk-enabled-input:checked) .tk-enabled-icon {
    color: #4ade80;
}

.tk-enabled:has(.tk-enabled-input:checked) .tk-enabled-icon-on {
    display: block;
}

.tk-enabled:has(.tk-enabled-input:checked) .tk-enabled-label-on {
    display: inline;
}

.tk-enabled:has(.tk-enabled-input:checked) .tk-enabled-icon-off,
.tk-enabled:has(.tk-enabled-input:checked) .tk-enabled-label-off {
    display: none;
}

.tk-enabled-label-on,
.tk-enabled-label-off {
    letter-spacing: 0.01em;
    min-width: 3.4rem;
}

/* Channel Picker (wie Emoji-Selector) */
.tk-channel-picker {
    position: relative;
    width: 100%;
}

.tk-channel-picker-shell {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: var(--tk-control-h, calc(var(--spacing) * 9));
    min-height: var(--tk-control-h, calc(var(--spacing) * 9));
    padding-right: 0.25rem;
    border: 0;
    border-radius: 0.65rem;
    background: #1c1c1c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.tk-channel-picker-shell:focus-within,
.tk-channel-picker-shell.is-open {
    background: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.tk-channel-picker-trigger {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 0.5rem 0 0.75rem;
    border: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: transparent;
    color: var(--gray-100, #f5f5f5);
    font: inherit;
    font-size: 0.875rem;
    text-align: left;
    cursor: pointer;
}

.tk-channel-picker-value {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.25;
}

.tk-channel-picker-placeholder {
    flex: 1;
    font-size: 0.875rem;
    color: var(--gray-500, #737373);
    line-height: 1.25;
}

.tk-channel-picker-clear,
.tk-channel-picker-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-500, #737373);
    cursor: pointer;
    flex-shrink: 0;
}

.tk-channel-picker-clear:hover,
.tk-channel-picker-caret:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-200, #e5e5e5);
}

.tk-channel-picker-clear svg,
.tk-channel-picker-caret .tk-dd-chevron {
    width: 0.85rem;
    height: 0.85rem;
}

.tk-channel-picker-shell.is-open .tk-channel-picker-caret .tk-dd-chevron {
    transform: rotate(180deg);
}

.tk-channel-picker-panel {
    position: absolute;
    z-index: 40;
    inset-inline: 0;
    top: calc(100% + 0.35rem);
    max-height: min(18rem, 60vh);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 0.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #141414;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.55);
}

/* Offene Menüs hängen am Viewport, damit der Canvas-Scroll sie nicht abschneidet */
.tk-panel-fixed {
    position: fixed !important;
    right: auto !important;
    bottom: auto !important;
    z-index: 10040 !important;
    margin: 0 !important;
}

.tk-channel-picker-search {
    padding: 0.55rem 0.55rem 0.35rem;
    flex-shrink: 0;
}

.tk-channel-picker-search-input {
    width: 100%;
    box-sizing: border-box;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.04);
    color: #e5e5e5;
    padding: 0.45rem 0.65rem;
    font: inherit;
    font-size: 0.8125rem;
    outline: none;
}

.tk-channel-picker-search-input:focus {
    border-color: rgba(255, 255, 255, 0.22);
    background: rgba(255, 255, 255, 0.06);
}

.tk-channel-picker-list {
    overflow-y: auto;
    padding: 0.2rem 0.35rem 0.45rem;
    min-height: 0;
}

.tk-channel-picker-option {
    display: flex;
    align-items: center;
    width: 100%;
    margin: 0;
    padding: 0.4rem 0.55rem;
    border: 0;
    border-radius: 0.45rem;
    background: transparent;
    color: var(--gray-200, #e5e5e5);
    font: inherit;
    font-size: 0.8125rem;
    text-align: left;
    cursor: pointer;
}

.tk-channel-picker-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.tk-channel-picker-option.is-active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.tk-channel-picker-empty {
    margin: 0;
    padding: 0.55rem 0.65rem;
    font-size: 0.75rem;
    color: var(--gray-500, #737373);
}

/* Emoji Picker */
.fi-emoji-picker { position: relative; width: 100%; }
.fi-emoji-picker-shell {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: var(--tk-control-h, calc(var(--spacing) * 9));
    min-height: var(--tk-control-h, calc(var(--spacing) * 9));
    padding-right: 0.25rem;
    border: 0;
    border-radius: 0.65rem;
    background: #1c1c1c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}
.fi-emoji-picker-shell:focus-within,
.fi-emoji-picker:has(.fi-emoji-picker-trigger[aria-expanded="true"]) .fi-emoji-picker-shell {
    background: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}
.fi-emoji-picker-trigger {
    display: flex;
    flex: 1;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
    height: 100%;
    min-height: 0;
    margin: 0;
    padding: 0 0.5rem 0 0.75rem;
    border: 0;
    border-radius: 0.5rem 0 0 0.5rem;
    background: transparent;
    color: var(--gray-100, #f5f5f5);
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.fi-emoji-picker-trigger:hover { background: transparent; }
.fi-emoji-picker-preview { display: flex; align-items: center; gap: .5rem; flex: 1; min-width: 0; }
.fi-emoji-picker-img { width: 1.35rem; height: 1.35rem; object-fit: contain; }
.fi-emoji-picker-unicode { font-size: 1.25rem; line-height: 1; }
.fi-emoji-picker-name { font-size: .8125rem; color: var(--gray-400, #a3a3a3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fi-emoji-picker-placeholder { flex: 1; font-size: .875rem; color: var(--gray-500, #737373); }
.fi-emoji-picker-reset {
    flex-shrink: 0;
}
.fi-emoji-picker-caret {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-500, #737373);
    cursor: pointer;
}
.fi-emoji-picker-caret:hover {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-200, #e5e5e5);
}
.fi-emoji-picker-caret .tk-dd-chevron {
    width: 0.85rem;
    height: 0.85rem;
}
.fi-emoji-picker:has(.fi-emoji-picker-trigger[aria-expanded="true"]) .fi-emoji-picker-caret .tk-dd-chevron {
    transform: rotate(180deg);
}
.fi-emoji-picker-panel {
    position: absolute; z-index: 40; inset-inline: 0; top: calc(100% + .35rem);
    max-height: min(22rem, 70vh); overflow: auto;
    border-radius: .75rem;
    border: 1px solid color-mix(in srgb, white 12%, transparent);
    background: #141414;
    box-shadow: 0 12px 40px rgba(0,0,0,.55);
}
.fi-emoji-picker-search { padding: .65rem .65rem .25rem; }
.fi-emoji-picker-search .fi-input,
.fi-emoji-picker-search input {
    width: 100%; border-radius: .5rem; border: 1px solid color-mix(in srgb, white 10%, transparent);
    background: color-mix(in srgb, white 4%, transparent); color: #e5e5e5;
    padding: .45rem .65rem; font: inherit; font-size: .8125rem;
}
.fi-emoji-picker-section { padding: .35rem 0 .5rem; }
.fi-emoji-picker-label {
    margin: 0; padding: .25rem .75rem;
    font-size: .65rem; font-weight: 600; letter-spacing: .05em;
    text-transform: uppercase; color: var(--gray-500, #737373);
}
.fi-emoji-picker-quick { display: flex; flex-wrap: wrap; gap: .25rem; padding: 0 .65rem .35rem; }
.fi-emoji-picker-quick-btn {
    width: 2.15rem; height: 2.15rem; border-radius: .45rem; border: 1px solid color-mix(in srgb, white 8%, transparent);
    background: transparent; font-size: 1.15rem; cursor: pointer;
}
.fi-emoji-picker-quick-btn:hover { background: color-mix(in srgb, white 6%, transparent); }
.fi-emoji-picker-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(2.35rem, 1fr));
    gap: .2rem; padding: 0 .65rem .35rem; max-height: 8.5rem; overflow-y: auto;
}
.fi-emoji-picker-grid-btn {
    display: flex; align-items: center; justify-content: center;
    padding: .3rem; border-radius: .45rem; border: 1px solid transparent;
    background: transparent; cursor: pointer;
}
.fi-emoji-picker-grid-btn:hover,
.fi-emoji-picker-grid-btn.is-active {
    border-color: color-mix(in srgb, var(--primary-500, #737373) 45%, transparent);
    background: color-mix(in srgb, var(--primary-500, #737373) 12%, transparent);
}
.fi-emoji-picker-empty { margin: 0; padding: .35rem .75rem .5rem; font-size: .75rem; color: var(--gray-500, #737373); }
.fi-emoji-picker-footer { display: flex; justify-content: flex-end; padding: .35rem .65rem .65rem; }
.fi-emoji-picker-clear {
    border: 0; background: transparent; color: var(--gray-400, #a3a3a3);
    font: inherit; font-size: .75rem; cursor: pointer;
}
.fi-emoji-picker-clear:hover { color: #f87171; }

/* Titel + Größen-Dropdown in einem Field */
.tk-title-combo {
    position: relative;
    z-index: 2;
}

.tk-title-combo-shell {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    width: 100%;
    height: var(--tk-control-h, calc(var(--spacing) * 9));
    min-height: var(--tk-control-h, calc(var(--spacing) * 9));
    padding-right: 0.3rem;
    border: 0;
    border-radius: 0.65rem;
    background: #1c1c1c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    transition: background-color 0.12s ease, box-shadow 0.12s ease;
}

.tk-title-combo-shell:focus-within,
.tk-title-combo-shell.is-open {
    background: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.tk-title-combo-input {
    flex: 1;
    min-width: 0;
    height: 100%;
    margin: 0;
    padding: 0 0.65rem 0 0.75rem;
    border: 0;
    background: transparent;
    color: var(--gray-100, #f5f5f5);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    outline: none;
}

.tk-title-combo-input::placeholder {
    color: var(--gray-500, #737373);
}

.tk-title-combo-aside {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}

.tk-title-style-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0;
    padding: 0.2rem 0.4rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-400, #a3a3a3);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.02em;
    cursor: pointer;
}

.tk-title-style-btn:hover,
.tk-title-style-btn[aria-expanded="true"] {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-100, #f5f5f5);
}

.tk-title-style-mark {
    min-width: 1.1rem;
    text-align: center;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    font-weight: 500;
    color: inherit;
}

/* Shared dark dropdown */
.tk-dd {
    position: relative;
    display: inline-flex;
}

.tk-dd--block {
    display: block;
    width: 100%;
}

.tk-dd-trigger--field {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    box-sizing: border-box;
    width: 100%;
    height: var(--tk-control-h, calc(var(--spacing) * 9));
    min-height: var(--tk-control-h, calc(var(--spacing) * 9));
    margin: 0;
    padding: 0 0.75rem;
    border: 0;
    border-radius: 0.65rem;
    background: #1c1c1c;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: var(--gray-300, #d4d4d4);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
}

.tk-dd-trigger--field:hover,
.tk-dd-trigger--field[aria-expanded="true"] {
    background: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
    color: #fff;
}

.tk-dd-chevron {
    width: 0.85rem;
    height: 0.85rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.12s ease, opacity 0.12s ease;
}

.tk-title-style-btn[aria-expanded="true"] .tk-dd-chevron,
.tk-dd-trigger--field[aria-expanded="true"] .tk-dd-chevron {
    transform: rotate(180deg);
    opacity: 1;
}

.tk-dd-menu {
    position: absolute;
    top: calc(100% + 0.25rem);
    right: 0;
    z-index: 40;
    width: max-content;
    min-width: 0;
    max-width: 10rem;
    padding: 0.2rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.45);
}

/* Kategorie-Hinzufügen: volle Feldbreite */
.tk-dd-menu--block {
    left: 0;
    right: 0;
    width: auto;
    max-width: none;
}

.tk-dd-option {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    width: 100%;
    margin: 0;
    padding: 0.3rem 0.45rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-300, #d4d4d4);
    font: inherit;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    white-space: nowrap;
}

.tk-dd-option-mark {
    min-width: 1.35rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--gray-500, #737373);
}

.tk-dd-option:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}

.tk-dd-option:hover .tk-dd-option-mark {
    color: var(--gray-300, #d4d4d4);
}

.tk-dd-option.is-active {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.tk-dd-option.is-active .tk-dd-option-mark {
    color: var(--gray-200, #e5e5e5);
}

.tk-field-reset {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-500, #737373);
    cursor: pointer;
}

.tk-field-reset svg {
    width: 0.95rem;
    height: 0.95rem;
}

.tk-field-reset:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.06);
    color: var(--gray-200, #e5e5e5);
}

.tk-field-reset:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Filament suffix reset actions — gleiche dünne Linie */
.fi-input-wrp-suffix .fi-icon-btn svg,
.fi-fo-field-wrp .fi-icon-btn svg {
    width: 1rem;
    height: 1rem;
}

[x-cloak] {
    display: none !important;
}

/* Category order picker (Panel-Kategorien) */
.tk-cat-order {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}
.tk-cat-order-heading {
    margin-bottom: 0.4rem;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--gray-400, #a3a3a3);
    text-transform: uppercase;
}
.tk-cat-order-select {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: var(--tk-control-h, calc(var(--spacing) * 9));
    min-height: var(--tk-control-h, calc(var(--spacing) * 9));
    padding: 0 2rem 0 0.75rem;
    border-radius: 0.65rem;
    border: 0;
    background-color: #1c1c1c;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%23a3a3a3'%3E%3Cpath fill-rule='evenodd' d='M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z' clip-rule='evenodd'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.65rem center;
    background-size: 0.95rem;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
    color: var(--gray-100, #f5f5f5);
    font: inherit;
    font-size: 0.875rem;
    line-height: 1.25;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
}
.tk-cat-order-select:hover,
.tk-cat-order-select:focus {
    outline: none;
    border-color: transparent;
    background-color: #262626;
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}
.tk-cat-order-select option {
    background: #171717;
    color: #f5f5f5;
}
.tk-cat-order-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    list-style: none;
}
.tk-cat-order-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.55rem;
    border-radius: 0.65rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #222;
}
.tk-cat-order-item.is-ghost {
    opacity: 0.45;
}
.tk-cat-order-handle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-500, #737373);
    cursor: grab;
}
.tk-cat-order-handle:active { cursor: grabbing; }
.tk-cat-order-handle svg { width: 1rem; height: 1rem; }
.tk-cat-emoji,
.tk-cat-order-emoji img,
.tk-cat-order-emoji .tk-cat-emoji {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
.tk-cat-emoji-text,
.tk-cat-order-emoji .tk-cat-emoji-text {
    font-size: 1.1rem;
    line-height: 1;
}
.tk-cat-order-emoji {
    display: inline-flex;
    width: 1.35rem;
    justify-content: center;
    flex-shrink: 0;
}
.tk-cat-order-name {
    flex: 1;
    min-width: 0;
    font-size: 0.875rem;
    color: var(--gray-100, #f5f5f5);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.tk-cat-order-move {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    flex-shrink: 0;
}
.tk-cat-order-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.6rem;
    height: 1.6rem;
    padding: 0;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: var(--gray-400, #a3a3a3);
    font-size: 0.9rem;
    line-height: 1;
    cursor: pointer;
}
.tk-cat-order-icon-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.tk-cat-order-icon-btn.is-danger:hover { color: #f87171; }
.tk-cat-order-search {
    width: 100%;
    margin-bottom: 0.45rem;
    padding: 0.45rem 0.65rem;
    border-radius: 0.5rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: #222;
    color: var(--gray-100, #f5f5f5);
    font: inherit;
    font-size: 0.875rem;
}
.tk-cat-order-search:focus {
    outline: none;
    border-color: rgba(255, 255, 255, 0.22);
    background: #262626;
}
.tk-cat-order-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}
.tk-cat-order-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.55rem;
    border-radius: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: #1a1a1a;
    color: var(--gray-200, #e5e5e5);
    font: inherit;
    font-size: 0.8125rem;
    cursor: pointer;
}
.tk-cat-order-chip:hover {
    background: #262626;
    border-color: rgba(255, 255, 255, 0.18);
}
.tk-cat-order-chip-add {
    color: var(--gray-500, #737373);
    font-weight: 600;
}
.tk-cat-order-empty {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    color: var(--gray-500, #737373);
}

/* ── Canvas: Form + Discord-Vorschau ── */
.tk-canvas-split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(22rem, 30rem);
    gap: 1rem 1.25rem;
    align-items: start;
    width: 100%;
}

.tk-canvas-editor {
    min-width: 0;
}

.tk-canvas-preview-col {
    position: sticky;
    top: 0.35rem;
    min-width: 0;
}

@media (max-width: 1100px) {
    .tk-canvas-split {
        grid-template-columns: 1fr;
    }

    .tk-canvas-preview-col {
        position: static;
        order: -1;
    }
}

/* Discord CV2 preview (nur Card, kein extra Chat-Hintergrund) */
.dc-preview {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    color: #dbdee1;
    font-size: 0.875rem;
    line-height: 1.375;
}

.dc-media {
    border-radius: 0.5rem;
    overflow: hidden;
    max-width: 100%;
}

.dc-media-img {
    display: block;
    width: 100%;
    max-height: 10rem;
    object-fit: cover;
    background: #1e1f22;
}

.dc-media-img--banner {
    max-height: none;
    height: auto;
    object-fit: contain;
    background: transparent;
}

.dc-media-banner {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 5.5rem;
    padding: 1rem 1.25rem;
    background:
        radial-gradient(ellipse 80% 70% at 50% 40%, color-mix(in srgb, var(--dc-banner) 55%, transparent), transparent 70%),
        linear-gradient(135deg, color-mix(in srgb, var(--dc-banner) 35%, #1e1f22), #1e1f22 70%);
}

.dc-media-banner-text {
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    text-align: center;
    word-break: break-word;
}

.dc-card {
    margin-top: 0.2rem;
    border-radius: 0.5rem;
    background: #2b2d31;
    border-inline-start: 4px solid var(--dc-accent, #5865f2);
    overflow: hidden;
}

.dc-card-inner {
    padding: 0.7rem 0.8rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.dc-text {
    color: #dbdee1;
    word-break: break-word;
}

.dc-text--muted {
    color: #949ba4;
    font-size: 0.8125rem;
}

.dc-subtext {
    font-size: 0.75rem;
    color: #949ba4;
    margin: 0.05rem 0;
}

.dc-quote {
    margin: 0.15rem 0;
    padding: 0.05rem 0 0.05rem 0.65rem;
    border-inline-start: 3px solid #4e5058;
    color: #dbdee1;
}

.dc-spoiler {
    display: inline;
    background: #1e1f22;
    color: transparent;
    border-radius: 0.25rem;
    padding: 0 0.15rem;
    cursor: pointer;
    transition: color 0.12s ease, background 0.12s ease;
}

.dc-spoiler:hover,
.dc-spoiler:focus {
    color: #dbdee1;
    background: rgba(0, 0, 0, 0.35);
}

.dc-list {
    margin: 0.2rem 0;
    padding-inline-start: 1.35rem;
}

.dc-list li {
    margin: 0.1rem 0;
}

.dc-pre {
    margin: 0.25rem 0;
    padding: 0.55rem 0.65rem;
    border-radius: 0.4rem;
    background: #1e1f22;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.8rem;
    line-height: 1.4;
    white-space: pre-wrap;
    word-break: break-word;
}

.dc-link {
    color: #00a8fc;
    text-decoration: none;
}

.dc-link:hover {
    text-decoration: underline;
}

.dc-card u {
    text-decoration: underline;
}

.dc-card s {
    text-decoration: line-through;
}

.dc-h1 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #f2f3f5;
    line-height: 1.25;
    margin: 0.1rem 0;
}

.dc-h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #f2f3f5;
    line-height: 1.3;
    margin: 0.1rem 0;
}

.dc-h3 {
    font-size: 1rem;
    font-weight: 700;
    color: #f2f3f5;
    line-height: 1.35;
    margin: 0.05rem 0;
}

.dc-line {
    margin: 0.05rem 0;
}

.dc-br {
    height: 0.45rem;
}

.dc-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 0.85em;
    padding: 0.1rem 0.3rem;
    border-radius: 0.25rem;
    background: #1e1f22;
    color: #dbdee1;
}

.dc-emoji {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: -0.25rem;
    display: inline-block;
    object-fit: contain;
}

.dc-emoji-uni {
    font-size: 1rem;
    line-height: 1;
}

.dc-sep {
    height: 0;
    margin: 0.2rem 0 0.35rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dc-mention {
    display: inline;
    padding: 0 0.15rem;
    border-radius: 0.2rem;
    background: rgba(88, 101, 242, 0.3);
    color: #c9cdfb;
    font-weight: 500;
    white-space: nowrap;
}

.dc-mention--user {
    background: rgba(88, 101, 242, 0.3);
}

.dc-select-wrap {
    position: relative;
    z-index: 1;
}

.dc-select-wrap:has(.is-open) {
    z-index: 5;
}

.dc-select {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
    min-height: 2.35rem;
    padding: 0.4rem 0.65rem;
    border-radius: 0.5rem;
    background: #1e1f22;
    border: 1px solid rgba(0, 0, 0, 0.35);
    color: #949ba4;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dc-select:hover,
.dc-select.is-open {
    border-color: rgba(255, 255, 255, 0.12);
    background: #232428;
}

.dc-select-placeholder {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
}

.dc-select-chevron {
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    opacity: 0.7;
    transition: transform 0.12s ease;
}

.dc-select.is-open .dc-select-chevron {
    transform: rotate(180deg);
}

.dc-select-menu {
    position: absolute;
    inset-inline: 0;
    top: calc(100% + 0.3rem);
    z-index: 20;
    max-height: 14rem;
    overflow-y: auto;
    padding: 0.3rem;
    border-radius: 0.5rem;
    background: #111214;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.55);
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

.dc-select-opt {
    display: flex;
    align-items: flex-start;
    gap: 0.45rem;
    width: 100%;
    padding: 0.4rem 0.5rem;
    border: 0;
    border-radius: 0.35rem;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}

.dc-select-opt:hover {
    background: rgba(88, 101, 242, 0.35);
}

.dc-select-opt-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
    gap: 0.05rem;
}

.dc-select-opt-label {
    font-size: 0.8125rem;
    font-weight: 500;
    color: #dbdee1;
}

.dc-select-opt-desc {
    font-size: 0.7rem;
    color: #949ba4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dc-select-empty {
    margin: 0;
    padding: 0.5rem 0.45rem;
    font-size: 0.75rem;
    color: #949ba4;
}

.dc-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.15rem;
}

.dc-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 2rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.4rem;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: default;
    user-select: none;
}

.dc-btn--primary {
    background: #5865f2;
    color: #fff;
}

.dc-btn--secondary {
    background: #4e5058;
    color: #fff;
}

.dc-btn--danger {
    background: #da373c;
    color: #fff;
}

.dc-preview-empty {
    margin: 0.35rem 0 0;
    font-size: 0.75rem;
    color: #949ba4;
}

.tk-transcript-actions {
    display: flex;
    margin-top: 0.35rem;
}

.tk-transcript {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 1.15rem;
}

.tk-transcript-msg {
    padding: 0.7rem 0.8rem;
    border-radius: 0.5rem;
    background: color-mix(in srgb, var(--gray-500, #737373) 10%, transparent);
}

.tk-transcript-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.65rem;
    align-items: baseline;
    font-size: 0.75rem;
    color: var(--gray-400, #a3a3a3);
}

.tk-transcript-author {
    font-weight: 650;
    color: var(--gray-100, #f5f5f5);
}

.tk-transcript-body {
    margin: 0.3rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--gray-200, #e5e5e5);
}

.tk-transcript-files {
    margin: 0.4rem 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.tk-transcript-files a {
    font-size: 0.75rem;
    color: var(--gray-300, #d4d4d4);
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Server Status / Moderation ── */
.srv-overview { display: flex; flex-direction: column; gap: 1.25rem; }
.srv-overview-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.srv-overview-title { margin: 0; font-size: 1.25rem; font-weight: 650; letter-spacing: -0.02em; }
.srv-overview-sub { margin: 0.25rem 0 0; font-size: 0.875rem; color: var(--gray-400, #a3a3a3); }
.srv-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 0.75rem; padding: 2rem; border: 1px dashed rgba(255,255,255,0.12); border-radius: 0.75rem; color: var(--gray-400, #a3a3a3); }
.srv-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(16rem, 1fr)); gap: 0.85rem; }
.srv-card { display: flex; flex-direction: column; gap: 0.55rem; padding: 1rem 1.05rem; border-radius: 0.85rem; background: rgba(255,255,255,0.03); border: 1px solid rgba(255,255,255,0.08); text-decoration: none; color: inherit; transition: border-color .15s, background .15s, transform .15s; }
.srv-card:hover { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.16); transform: translateY(-1px); }
.srv-card-top { display: flex; align-items: center; gap: 0.5rem; }
.srv-card-name { margin: 0; font-size: 1.05rem; font-weight: 650; }
.srv-card-meta { margin: 0; font-size: 0.75rem; color: var(--gray-400, #a3a3a3); }
.srv-card-muted { font-size: 0.7rem; color: var(--gray-500, #737373); }
.srv-card-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 0.5rem; margin: 0; }
.srv-card-metrics dt { font-size: 0.65rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--gray-500, #737373); }
.srv-card-metrics dd { margin: 0.1rem 0 0; font-size: 0.85rem; font-weight: 600; }
.srv-card-error { margin: 0; font-size: 0.75rem; color: #f07178; }

.srv-pill { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.55rem; border-radius: 999px; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; border: 1px solid transparent; }
.srv-pill--lg { padding: 0.35rem 0.75rem; font-size: 0.78rem; }
.srv-pill--online { color: #5dde8a; background: rgba(93,222,138,0.12); border-color: rgba(93,222,138,0.35); }
.srv-pill--offline { color: #8b929a; background: rgba(139,146,154,0.12); border-color: rgba(139,146,154,0.3); }
.srv-pill--starting { color: #f0b429; background: rgba(240,180,41,0.12); border-color: rgba(240,180,41,0.35); }
.srv-pill--stopping { color: #fb923c; background: rgba(251,146,60,0.12); border-color: rgba(251,146,60,0.35); }
.srv-pill--countdown { color: #60a5fa; background: rgba(96,165,250,0.12); border-color: rgba(96,165,250,0.35); }
.srv-pill--backup { color: #38bdf8; background: rgba(56,189,248,0.12); border-color: rgba(56,189,248,0.35); }
.srv-pill--error { color: #f07178; background: rgba(240,113,120,0.12); border-color: rgba(240,113,120,0.35); }

.srv-detail { display: flex; flex-direction: column; gap: 1rem; width: 100%; }

.fi-page:has(.ops) .fi-header,
.fi-page:has(.ops) .fi-sc-has-max-width,
.fi-page:has(.ops) .fi-main > *,
.fi-page:has(.ops) .fi-page-content {
  max-width: none !important;
  width: 100% !important;
}
.fi-page:has(.ops) .fi-page-header-main-ctn,
.fi-page:has(.ops) .fi-header-heading {
  max-width: none !important;
}

.ops {
  --ops-line: rgba(255,255,255,0.1);
  --ops-soft: #121212;
  --ops-ink: #ececec;
  --ops-dim: #8a8a8a;
  --ops-accent: #d4894a;
  --ops-danger: #e07a7a;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  width: 100%;
  max-width: none;
  color: var(--ops-ink);
}
.ops-muted { color: var(--ops-dim); font-size: 0.78rem; }
.ops-empty { margin: 0.75rem 0 0; color: var(--ops-dim); font-size: 0.85rem; }
.ops-pill { display: inline-flex; align-items: center; padding: 0.2rem 0.5rem; border-radius: 0.35rem; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; border: 1px solid transparent; }
.ops-pill--online { color: #6dcf8a; background: rgba(109,207,138,0.1); border-color: rgba(109,207,138,0.28); }
.ops-pill--offline, .ops-pill--warn { color: #c4a35a; background: rgba(196,163,90,0.1); border-color: rgba(196,163,90,0.28); }
.ops-pill--starting, .ops-pill--countdown { color: var(--ops-accent); background: rgba(212,137,74,0.1); border-color: rgba(212,137,74,0.28); }
.ops-pill--stopping, .ops-pill--backup { color: #7eb6d9; background: rgba(126,182,217,0.1); border-color: rgba(126,182,217,0.28); }
.ops-pill--error { color: #e07a7a; background: rgba(224,122,122,0.1); border-color: rgba(224,122,122,0.28); }

.ops-panel { border: 1px solid var(--ops-line); background: var(--ops-soft); border-radius: 0.5rem; padding: 0.85rem 1rem; }
.ops-panel h3, .ops-panel h4 { margin: 0; }
.ops-panel h4 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ops-dim); font-weight: 650; margin-bottom: 0.15rem; }

.ops-top { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(16rem, 0.7fr); gap: 0.75rem; width: 100%; }
.ops-panel--status { display: flex; flex-direction: column; gap: 0.85rem; }
.ops-status-row { display: flex; align-items: center; gap: 0.55rem; }
.ops-metrics { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.75rem 1rem; margin: 0; }
.ops-metrics dt { font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ops-dim); }
.ops-metrics dd { margin: 0.2rem 0 0; font-size: 1.15rem; font-weight: 650; font-variant-numeric: tabular-nums; }
.ops-metrics-sm { font-size: 0.95rem !important; }

.ops-panel--players { min-height: 7.5rem; display: flex; flex-direction: column; }
.ops-players-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin-bottom: 0.55rem; }
.ops-players-head h3 { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ops-dim); font-weight: 650; }
.ops-players-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.ops-players-table th { text-align: left; font-size: 0.62rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ops-dim); font-weight: 600; padding: 0 0.35rem 0.4rem; border-bottom: 1px solid var(--ops-line); }
.ops-players-table th:last-child, .ops-players-table td:last-child { text-align: right; }
.ops-players-table td { padding: 0.55rem 0.35rem; border-bottom: 1px solid rgba(255,255,255,0.05); font-variant-numeric: tabular-nums; }
.ops-players-table tr:last-child td { border-bottom: 0; }
.ops-players-table tbody tr:hover td { background: rgba(255,255,255,0.03); }

.ops-alert { padding: 0.55rem 0.8rem; border-radius: 0.4rem; font-size: 0.84rem; border: 1px solid var(--ops-line); }
.ops-alert--info { border-color: rgba(126,182,217,0.35); background: rgba(126,182,217,0.08); }
.ops-alert--run { border-color: rgba(212,137,74,0.4); background: rgba(212,137,74,0.1); }
.ops-alert--err { border-color: rgba(224,122,122,0.4); background: rgba(224,122,122,0.1); color: #f0b0b0; }

.ops-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0.75rem; align-items: start; width: 100%; }
.ops-week { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; }
.ops-week-head h3 { font-size: 0.95rem; font-weight: 650; }
.ops-week-head p { margin: 0.2rem 0 0; font-size: 0.75rem; color: var(--ops-dim); }

.ops-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0.35rem; }
.ops-day { border: 1px solid var(--ops-line); background: #0d0d0d; border-radius: 0.5rem; min-height: 12rem; display: flex; flex-direction: column; overflow: hidden; }
.ops-day.is-today { border-color: rgba(212,137,74,0.65); }
.ops-day header { display: flex; justify-content: space-between; align-items: baseline; padding: 0.4rem 0.45rem; border-bottom: 1px solid var(--ops-line); background: rgba(255,255,255,0.02); }
.ops-day header strong { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; }
.ops-day header span { font-size: 0.68rem; color: var(--ops-dim); }
.ops-day ul { list-style: none; margin: 0; padding: 0.3rem; display: flex; flex-direction: column; gap: 0.25rem; flex: 1; }
.ops-day-empty { color: rgba(139,145,154,0.45); font-size: 0.75rem; text-align: center; padding: 1.5rem 0; }

.ops-ev { width: 100%; display: grid; grid-template-columns: 2.35rem 1fr auto; gap: 0.25rem; align-items: center; text-align: left; padding: 0.32rem 0.35rem; border-radius: 0.35rem; border: 1px solid transparent; background: rgba(212,137,74,0.14); color: #efd0b0; font-size: 0.7rem; cursor: pointer; line-height: 1.2; }
.ops-ev time { font-weight: 700; font-variant-numeric: tabular-nums; }
.ops-ev span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-ev em { font-style: normal; font-size: 0.6rem; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.75; }
.ops-ev--reset { background: rgba(224,122,122,0.14); border-color: rgba(224,122,122,0.25); color: #f0c0c0; }
.ops-ev.is-manual { background: rgba(126,182,217,0.14); border-color: rgba(126,182,217,0.25); color: #c8dff0; }
.ops-ev.is-skipped { opacity: 0.4; text-decoration: line-through; }
.ops-ev.is-on { outline: 1px solid rgba(255,255,255,0.5); outline-offset: 0; }
.ops-ev:hover { filter: brightness(1.08); }

.ops-sheet { border: 1px solid var(--ops-line); background: #0d0d0d; border-radius: 0.5rem; padding: 0.75rem; display: flex; flex-direction: column; gap: 0.65rem; }
.ops-sheet-top { display: flex; justify-content: space-between; gap: 0.75rem; align-items: flex-start; }
.ops-sheet-k { margin: 0; font-size: 0.9rem; font-weight: 650; }
.ops-sheet-t { margin: 0.15rem 0 0; font-size: 0.75rem; color: var(--ops-dim); }
.ops-sheet-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.ops-move { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ops-x { width: 1.75rem; height: 1.75rem; border: 1px solid var(--ops-line); background: transparent; color: var(--ops-dim); border-radius: 0.35rem; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.ops-x:hover { color: #fff; border-color: rgba(255,255,255,0.25); }

.ops-rail { display: flex; flex-direction: column; gap: 0.65rem; min-width: 0; }
.ops-toggle { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.5rem 0; border-bottom: 1px solid var(--ops-line); }
.ops-toggle:last-of-type { border-bottom: 0; padding-bottom: 0; }
.ops-toggle strong { display: block; font-size: 0.85rem; }
.ops-toggle span { display: block; font-size: 0.72rem; color: var(--ops-dim); margin-top: 0.1rem; }
.ops-toggle.is-off strong { color: var(--ops-dim); }
.ops-btn { border: 1px solid var(--ops-line); background: #0d0d0d; color: var(--ops-ink); font-size: 0.72rem; padding: 0.28rem 0.55rem; border-radius: 0.35rem; cursor: pointer; }
.ops-btn--on { border-color: rgba(109,207,138,0.45); color: #6dcf8a; }
.ops-btn:hover { border-color: rgba(255,255,255,0.25); }
.ops-row { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }
.ops-input { width: 100%; border: 1px solid var(--ops-line); background: #0d0d0d; color: inherit; border-radius: 0.5rem; padding: 0.45rem 0.55rem; font-size: 0.84rem; }
.ops-input:focus { outline: none; border-color: rgba(212,137,74,0.55); }
.ops-panel--log .ops-log { max-height: 16rem; overflow: auto; display: flex; flex-direction: column; gap: 0.35rem; margin-top: 0.35rem; }
.ops-log > div { display: grid; grid-template-columns: 5.8rem 1fr; gap: 0.45rem; font-size: 0.74rem; padding-bottom: 0.35rem; border-bottom: 1px solid rgba(255,255,255,0.04); }
.ops-log time { color: var(--ops-dim); font-variant-numeric: tabular-nums; }

@media (max-width: 1200px) {
  .ops-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ops-grid { grid-template-columns: 1fr; }
}
@media (max-width: 960px) {
  .ops-top { grid-template-columns: 1fr; }
  .ops-days { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px) {
  .ops-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ops-days { grid-template-columns: 1fr; }
}
