/* App layer for Mantik Treff. Only what the schema does not already cover:
   the video grid. Everything else uses .m- components. */

.treff-grid {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-bottom: var(--space-4);
}

.treff-tile {
    position: relative;
    background: #000;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.treff-tile video {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    background: #000;
}

/* Name and speaking indicator sit on the video, so they carry their own
   contrast instead of relying on the page tokens. */
.treff-tile-name {
    position: absolute;
    left: var(--space-2);
    bottom: var(--space-2);
    padding: 2px var(--space-2);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: var(--font-size-sm);
    border-radius: var(--radius);
}

.treff-speaking {
    position: absolute;
    right: var(--space-2);
    bottom: var(--space-2);
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px var(--space-2);
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: var(--font-size-sm);
    border-radius: var(--radius);
}

/* Never colour alone - the dot always comes with the word next to it. */
.treff-speaking-dot {
    width: 8px;
    height: 8px;
    border-radius: var(--radius);
    background: var(--text-mute);
}

.treff-speaking.is-active .treff-speaking-dot {
    background: var(--ok);
}

/* The own microphone is never played back - so its level has to be SEEN.
   Without this bar "is my microphone working?" cannot be answered while
   sitting alone in the room. */
.treff-level {
    position: absolute;
    left: var(--space-2);
    right: var(--space-2);
    top: var(--space-2);
    height: 6px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: var(--radius);
    overflow: hidden;
}

.treff-level-bar {
    height: 100%;
    width: 0;
    background: var(--ok);
    transition: width 80ms linear;
}

.treff-mic-note {
    margin-top: var(--space-2);
    font-size: var(--font-size-sm);
    color: var(--text-mute);
}

.treff-fields {
    display: grid;
    gap: var(--space-3);
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    margin-bottom: var(--space-3);
}

.treff-actions {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
}
