/* DeutschMaak — unified selection + quiz pill + silent DevTools protection */

html.telc-protected,
html.telc-protected body {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: none;
}

html.telc-protected input,
html.telc-protected textarea,
html.telc-protected select,
html.telc-protected [contenteditable="true"] {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
}

/* ── Unified ultra-compact glass pill ───────────────── */

#telc-selection-toolbar {
    position: fixed;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border-radius: 25px;
    border: 1px solid rgba(255, 255, 255, 0.4);
    background: rgba(255, 255, 255, 0.9);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", system-ui, sans-serif;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(3px) scale(0.96);
    transform-origin: center bottom;
    will-change: transform, opacity;
}

#telc-selection-toolbar[hidden] {
    display: none !important;
}

#telc-selection-toolbar.telc-pill--visible {
    animation: telc-pill-in 0.16s cubic-bezier(0.25, 0.8, 0.25, 1) forwards;
}

@keyframes telc-pill-in {
    from {
        opacity: 0;
        transform: translateY(3px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Icon-only actions ──────────────────────────────── */

.telc-icon-btn {
    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    margin: 0;
    padding: 4px;
    min-width: 26px;
    min-height: 26px;
    border-radius: 50%;
    color: #4a5568;
    background: transparent;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
}

.telc-icon-btn__glyph {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.15s ease, color 0.15s ease;
}

.telc-icon-btn__glyph svg {
    display: block;
    width: 100%;
    height: 100%;
}

.telc-icon-btn__badge {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    letter-spacing: -0.02em;
    white-space: nowrap;
    color: #27ae60;
    transition: max-width 0.22s ease, opacity 0.22s ease, margin 0.22s ease;
}

.telc-icon-btn__badge.is-visible {
    max-width: 72px;
    opacity: 1;
    margin-inline-start: 4px;
}

.telc-icon-btn:hover {
    color: #1a1a1a;
    background: rgba(26, 26, 26, 0.06);
}

.telc-icon-btn:hover .telc-icon-btn__glyph {
    transform: scale(1.08);
}

.telc-icon-btn:active {
    transform: scale(0.92);
}

.telc-icon-btn:active .telc-icon-btn__glyph {
    transform: scale(1);
}

.telc-icon-btn--copy.is-success {
    color: #27ae60;
    background: rgba(39, 174, 96, 0.1);
}

.telc-icon-btn--copy.is-success .telc-icon-btn__glyph {
    color: #27ae60;
}

.telc-icon-btn--copy.is-error .telc-icon-btn__badge.is-visible {
    color: #c0392b;
}

.telc-icon-btn--copy.is-error {
    background: rgba(192, 57, 43, 0.08);
}

.telc-icon-btn--translate:hover {
    color: #1e3a8a;
}

.telc-icon-btn--translate:hover .telc-icon-btn__glyph {
    color: #1e3a8a;
}

#telc-selection-toolbar[dir="rtl"] .telc-icon-btn {
    flex-direction: row-reverse;
}

#telc-selection-toolbar[dir="rtl"] .telc-icon-btn__badge.is-visible {
    margin-inline-start: 0;
    margin-inline-end: 4px;
}

/* ── Hören audio controls ───────────────────────────── */

audio[controls] {
    -webkit-user-select: none;
    user-select: none;
}

audio[controls]::-webkit-media-controls-enclosure {
    overflow: hidden;
}

audio[controls]::-webkit-media-controls-panel {
    width: calc(100% + 32px);
}

@media (max-width: 480px) {
    #telc-selection-toolbar {
        padding: 4px 8px;
        gap: 6px;
    }
    .telc-icon-btn {
        min-width: 28px;
        min-height: 28px;
    }
    .telc-icon-btn__glyph {
        width: 15px;
        height: 15px;
    }
}

@media (prefers-reduced-motion: reduce) {
    #telc-selection-toolbar.telc-pill--visible,
    .telc-icon-btn,
    .telc-icon-btn__glyph,
    .telc-icon-btn__badge {
        animation: none !important;
        transition: none !important;
    }
    #telc-selection-toolbar.telc-pill--visible {
        opacity: 1;
        transform: none;
    }
}