/* ============================================================
   RESET
============================================================ */

* {
    box-sizing: border-box;
}


html,
body {

    margin: 0;
    padding: 0;

    width: 100%;
    height: 100%;

}


body {

    overflow: hidden;

    font-family:
        Arial,
        Helvetica,
        sans-serif;

    background: #e9edf2;

}



/* ============================================================
   CLASSROOM
============================================================ */

.classroom {

    width: 100vw;
    height: 100vh;

}



/* ============================================================
   MAIN
============================================================ */

.classroom-main {

    width: 100%;
    height: 100%;

    display: grid;

    grid-template-columns:
        minmax(0, 1fr)
        235px;

    gap: 8px;

    padding: 8px;

}



/* ============================================================
   WORKSPACE
============================================================ */

.workspace {

    min-width: 0;
    min-height: 0;

    display: flex;
    flex-direction: column;

    overflow: hidden;

    border-radius: 10px;

    background: #ffffff;

    box-shadow:
        0 2px 12px
        rgba(0, 0, 0, 0.10);

}



/* ============================================================
   TEACHER TOOLBAR
============================================================ */

.teacher-toolbar {

    min-height: 52px;

    flex-shrink: 0;

    display: flex;
    align-items: center;

    gap: 6px;

    padding: 6px 8px;

    border-bottom:
        1px solid #d9dde3;

    background: #f5f6f8;

}


.teacher-tool {

    height: 36px;

    padding:
        0 11px;

    border:
        1px solid #ccd1d9;

    border-radius: 7px;

    background: #ffffff;

    color: #30343a;

    font-size: 13px;

    cursor: pointer;

}


.teacher-tool:hover {

    background: #edf2ff;

}


.teacher-tool.active {

    border-color: #246bfd;

    background: #246bfd;

    color: #ffffff;

}



/* ============================================================
   TOOLBAR SETTINGS
============================================================ */

.toolbar-setting {

    height: 36px;

    display: flex;
    align-items: center;

    gap: 5px;

    padding:
        0 7px;

    border:
        1px solid #ccd1d9;

    border-radius: 7px;

    background: #ffffff;

    font-size: 12px;

}


.toolbar-setting input[type="color"] {

    width: 27px;
    height: 27px;

    padding: 0;

    border: 0;

    cursor: pointer;

}


.toolbar-setting input[type="range"] {

    width: 70px;

}



/* ============================================================
   TEXT FORMATIERUNG
============================================================ */

.text-format-select {

    height: 36px;

    padding:
        0 8px;

    border:
        1px solid #ccd1d9;

    border-radius: 7px;

    outline: none;

    background: #ffffff;

    color: #30343a;

    font-size: 13px;

    cursor: pointer;

}


.text-format-select:hover,
.text-format-select:focus {

    border-color: #246bfd;

}


.screen-button {

    margin-left: auto;

}



/* ============================================================
   LESSON STAGE
============================================================ */

.lesson-stage {

    position: relative;

    flex: 1;

    min-width: 0;
    min-height: 0;

    overflow: hidden;

    background: #ffffff;

}



/* ============================================================
   CONTENT LAYER
============================================================ */

.content-layer {

    position: absolute;

    inset: 0;

    z-index: 1;

    overflow: hidden;

}



/* ============================================================
   TEXT BLOCK
============================================================ */

.text-block-wrapper {

    position: absolute;

    min-width: 100px;

    padding-top: 24px;

    border:
        1px dashed transparent;

    border-radius: 7px;

}


body[data-role="teacher"]
.text-block-wrapper:hover {

    border-color: #aebdd9;

}



/* ============================================================
   TEXT DRAG HANDLE
============================================================ */

.text-drag-handle {

    position: absolute;

    top: 2px;
    left: 4px;

    z-index: 5;

    width: 22px;
    height: 20px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 4px;

    color: #4f5968;

    background: #e5e9f0;

    font-size: 15px;

    cursor: grab;

    user-select: none;

    touch-action: none;

}


.text-drag-handle:hover {

    color: #ffffff;

    background: #246bfd;

}


.text-drag-handle:active {

    cursor: grabbing;

}



/* ============================================================
   TEXT
============================================================ */

.lesson-text-block {

    width: 100%;

    min-height: 44px;

    padding:
        8px 10px;

    border:
        1px solid transparent;

    border-radius: 5px;

    outline: none;

    color: #1d2633;

    background: transparent;

    font-family:
        Arial,
        sans-serif;

    font-size: 24px;

    line-height: 1.45;

    white-space: pre-wrap;

    overflow-wrap: break-word;

    word-wrap: break-word;

    word-break: normal;

    overflow-x: hidden;

    max-width: 100%;

}


body[data-role="teacher"]
.lesson-text-block:focus {

    border-color: #b5c7ef;

    background:
        rgba(
            245,
            248,
            255,
            0.75
        );

}



/* ============================================================
   STUDENT WAITING
============================================================ */

.student-waiting {

    position: absolute;

    inset: 0;

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 8px;

    color: #7a8290;

}


.waiting-icon {

    font-size: 50px;

}



/* ============================================================
   DRAWING BOARD
============================================================ */

#drawingBoard {

    position: absolute;

    inset: 0;

    z-index: 10;

    width: 100%;
    height: 100%;

    pointer-events: none;

}


body[data-role="teacher"]
#drawingBoard.drawing-enabled {

    pointer-events: auto;

    cursor: crosshair;

    touch-action: none;

}



/* ============================================================
   SCREEN SHARE
============================================================ */

.screen-share-layer {

    position: absolute;

    inset: 0;

    z-index: 30;

    display: none;

    align-items: center;
    justify-content: center;

    background: #101215;

}


.screen-share-layer.active.tab-visible {

    display: flex;

}


#screenVideo {

    width: 100%;
    height: 100%;

    object-fit: contain;

    background: #101215;

}


.stop-screen-share {

    position: absolute;

    bottom: 15px;
    left: 50%;

    transform:
        translateX(-50%);

    padding:
        9px 15px;

    border: 0;

    border-radius: 7px;

    color: #ffffff;

    background: #d83b3b;

    cursor: pointer;

}



/* ============================================================
   VIDEO SIDEBAR
============================================================ */

.video-column {

    min-width: 0;
    min-height: 0;

    display: flex;

    flex-direction: column;

    gap: 8px;

}



/* ============================================================
   PARTICIPANT PANEL
============================================================ */

.participant-panel {

    flex: 0 0 auto;

    overflow: hidden;

    border-radius: 9px;

    background: #191b1f;

    box-shadow:
        0 2px 9px
        rgba(0, 0, 0, 0.14);

}



/* ============================================================
   PARTICIPANT HEADER
============================================================ */

.participant-header {

    height: 30px;

    display: flex;

    align-items: center;
    justify-content: space-between;

    padding:
        0 9px;

    color: #f2f3f5;

    background: #17191d;

    font-size: 12px;

}



/* ============================================================
   ONLINE DOT
============================================================ */

.online-dot {

    width: 7px;
    height: 7px;

    border-radius: 50%;

    background: #39c86c;

}



/* ============================================================
   VIDEO 16:9
============================================================ */

.compact-video {

    position: relative;

    width: 100%;

    aspect-ratio:
        16 / 9;

    overflow: hidden;

    background: #25282d;

}


.compact-video video {

    position: absolute;

    inset: 0;

    width: 100%;
    height: 100%;

    object-fit: cover;

    background: #25282d;

}



/* ============================================================
   CAMERA OFF
============================================================ */

.camera-off-message {

    position: absolute;

    inset: 0;

    z-index: 5;

    display: none;

    flex-direction: column;

    align-items: center;
    justify-content: center;

    gap: 4px;

    color: #dce0e7;

    background: #292c31;

    font-size: 11px;

}


.camera-off-message.show {

    display: flex;

}


.camera-icon {

    font-size: 28px;

}



/* ============================================================
   PARTICIPANT CONTROLS
============================================================ */

.participant-controls {

    height: 40px;

    display: flex;

    align-items: center;
    justify-content: center;

    gap: 6px;

    padding: 4px;

    background: #17191d;

}



/* ============================================================
   MINI BUTTONS
============================================================ */

.mini-control {

    width: 37px;
    height: 30px;

    display: flex;

    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid #444952;

    border-radius: 6px;

    color: #ffffff;

    background: #30343a;

    font-size: 15px;

    cursor: pointer;

}


.mini-control:hover {

    background: #41464e;

}


.mini-control.active {

    border-color: #246bfd;

    background: #246bfd;

}



/* ============================================================
   HAND
============================================================ */

.raised-hand-indicator {

    display: none;

    font-size: 19px;

}


.raised-hand-indicator.show {

    display: inline;

    animation:
        handPulse
        0.7s
        infinite
        alternate;

}


@keyframes handPulse {

    from {

        transform:
            scale(1);

    }

    to {

        transform:
            scale(1.25);

    }

}



/* ============================================================
   ROOM STATUS
============================================================ */

.room-status {

    margin-top: auto;

    display: flex;

    flex-direction: column;

    align-items: center;

    gap: 2px;

    padding: 8px;

    border-radius: 8px;

    color: #7b8491;

    background: #f4f6f8;

    font-size: 10px;

}


.room-status strong {

    color: #414852;

    font-size: 11px;

}



/* ============================================================
   JOIN REQUEST MODAL

   Dieses Popup liegt über dem GESAMTEN Browserfenster.
============================================================ */

#joinRequestModal {

    display: none;

    position: fixed !important;

    top: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;

    width: 100vw !important;
    height: 100vh !important;

    z-index: 999999 !important;

    align-items: center !important;
    justify-content: center !important;

    padding: 20px;

    background:
        rgba(15, 20, 28, 0.48) !important;

    backdrop-filter:
        blur(2px);

}


#joinRequestModal.visible {

    display: flex !important;

}



/* ============================================================
   MODAL BOX
============================================================ */

#joinRequestModal
.join-request-modal-box {

    position: relative !important;

    width: 400px !important;

    max-width:
        calc(100vw - 40px) !important;

    padding:
        30px !important;

    border-radius:
        16px !important;

    background:
        #ffffff !important;

    color:
        #202631 !important;

    text-align:
        center !important;

    box-shadow:
        0 20px 60px
        rgba(0, 0, 0, 0.35) !important;

}



/* ============================================================
   MODAL ICON
============================================================ */

#joinRequestModal
.join-request-modal-icon {

    margin-bottom: 8px;

    font-size: 44px;

}



/* ============================================================
   MODAL TITLE
============================================================ */

#joinRequestModal
.join-request-modal-title {

    margin-bottom: 22px;

    color: #202631 !important;

    font-size: 22px;

    font-weight: bold;

}



/* ============================================================
   JOIN REQUEST CONTENT
============================================================ */

#joinRequestModal
.student-join-requests {

    position: static !important;

    width: 100% !important;

    padding: 0 !important;

    background:
        transparent !important;

}


#joinRequestModal
.join-request {

    position: static !important;

    width: 100% !important;

    padding: 0 !important;

    border: 0 !important;

    background:
        transparent !important;

    color:
        #202631 !important;

}



/* ============================================================
   STUDENT NAME
============================================================ */

#joinRequestModal
.join-request-name {

    margin-bottom: 8px;

    color:
        #202631 !important;

    font-size:
        23px !important;

    font-weight:
        bold;

}



/* ============================================================
   REQUEST TEXT
============================================================ */

#joinRequestModal
.join-request-text {

    margin-bottom: 24px;

    color:
        #6c7480 !important;

    font-size:
        14px !important;

    line-height:
        1.4;

}



/* ============================================================
   MODAL BUTTONS
============================================================ */

#joinRequestModal
.join-request-buttons {

    display: flex !important;

    gap: 10px;

    width: 100%;

}


#joinRequestModal
.join-approve,
#joinRequestModal
.join-reject {

    flex: 1;

    height: 45px;

    border: 0;

    border-radius: 8px;

    color:
        #ffffff !important;

    font-size: 14px;

    font-weight: bold;

    cursor: pointer;

}


/* ============================================================
   STUDENT HAT DIE HAND GEHOBEN
============================================================ */

.participant-panel.student-hand-raised {
    box-shadow:
        0 0 0 3px #f2b705,
        0 4px 15px rgba(0, 0, 0, 0.25);
}

.participant-panel.student-hand-raised
.participant-header {
    background: #8a6700;
}

.participant-panel.student-hand-raised
.raised-hand-indicator {
    display: inline;
}


/* ============================================================
   APPROVE
============================================================ */

#joinRequestModal
.join-approve {

    background:
        #269653 !important;

}


#joinRequestModal
.join-approve:hover {

    background:
        #207f46 !important;

}



/* ============================================================
   REJECT
============================================================ */

#joinRequestModal
.join-reject {

    background:
        #c53d3d !important;

}


#joinRequestModal
.join-reject:hover {

    background:
        #a93131 !important;

}



/* ============================================================
   BUTTON DISABLED
============================================================ */

#joinRequestModal
.join-approve:disabled,
#joinRequestModal
.join-reject:disabled {

    opacity: 0.55;

    cursor: wait;

}



/* ============================================================
   RESPONSIVE
============================================================ */

@media (max-width: 800px) {

    body {

        overflow: auto;

    }


    .classroom {

        width: 100%;
        height: auto;

        min-height: 100vh;

    }


    .classroom-main {

        display: flex;

        flex-direction: column;

        min-height: 100vh;

    }


    .workspace {

        min-height: 650px;

    }


    .video-column {

        display: grid;

        grid-template-columns:
            1fr
            1fr;

    }


    .room-status {

        display: none;

    }


    #joinRequestModal
    .join-request-modal-box {

        width:
            calc(100vw - 30px) !important;

        padding:
            24px 18px !important;

    }

}
/* ============================================================
   PRAESENTATION: SCREEN-ANNOTATIONEN + LIVE-MAUS + TABELLE
============================================================ */

.screen-annotation-canvas {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 34;
    pointer-events: none;
}

body[data-role="teacher"] .screen-share-layer.active .screen-annotation-canvas.presentation-input-enabled {
    pointer-events: auto;
}

.teacher-live-cursor {
    position: absolute;
    z-index: 38;
    display: none;
    align-items: center;
    gap: 4px;
    pointer-events: none;
    transform: translate(2px, 2px);
    color: #ffffff;
    font-size: 12px;
    text-shadow: 0 1px 3px rgba(0,0,0,.9);
}

.teacher-live-cursor.show {
    display: flex;
}

.teacher-live-cursor-arrow {
    font-size: 24px;
    line-height: 1;
    transform: rotate(45deg);
}

.teacher-live-cursor-label {
    padding: 2px 6px;
    border-radius: 10px;
    background: rgba(0,0,0,.68);
}

.screen-share-layer.presentation-pointer-mode .screen-annotation-canvas {
    cursor: default;
}

.screen-share-layer.presentation-pen-mode .screen-annotation-canvas {
    cursor: crosshair;
}

.lesson-table-block {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

.lesson-table-block td,
.lesson-table-block th {
    min-width: 70px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #7b8490;
    vertical-align: top;
}

.lesson-table-block td:focus,
.lesson-table-block th:focus {
    outline: 2px solid rgba(52, 105, 230, .35);
    outline-offset: -2px;
}

.text-block-wrapper.table-block-wrapper {
    min-width: 320px;
    width: min(620px, calc(100% - 40px));
}

.stop-screen-share {
    z-index: 45;
}

/* ============================================================
   REPARATUR: STUDENT SCREENSHOT TOOL
============================================================ */
.student-whiteboard-toolbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 6px 8px;
    border-bottom: 1px solid #d9dde3;
    background: #f5f6f8;
}

.student-capture-button {
    height: 34px;
    padding: 0 12px;
    border: 1px solid #ccd1d9;
    border-radius: 7px;
    background: #fff;
    color: #30343a;
    font-size: 12px;
    cursor: pointer;
    box-shadow: 0 2px 7px rgba(0,0,0,.08);
}

.capture-selection {
    position: absolute;
    z-index: 25;
    display: none;
    left: 10%;
    top: 10%;
    width: 55%;
    height: 55%;
    min-width: 180px;
    min-height: 120px;
    border: 2px dashed #246bfd;
    background: rgba(36,107,253,.06);
}

.capture-selection.active,
.capture-selection.show {
    display: block;
}

.capture-selection-label,
.capture-move-handle,
.capture-actions {
    position: absolute;
    z-index: 2;
    background: #fff;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    box-shadow: 0 2px 7px rgba(0,0,0,.10);
}

.capture-selection-label {
    top: -31px;
    left: -2px;
    padding: 5px 8px;
    font-size: 11px;
}

.capture-move-handle {
    top: 6px;
    left: 6px;
    padding: 5px 8px;
    font-size: 11px;
    cursor: move;
    user-select: none;
    touch-action: none;
}

.capture-actions {
    right: -2px;
    bottom: -42px;
    display: flex;
    gap: 5px;
    padding: 4px;
}

.capture-actions button {
    height: 28px;
    padding: 0 8px;
    border: 1px solid #ccd1d9;
    border-radius: 5px;
    background: #fff;
    cursor: pointer;
    white-space: nowrap;
}

.capture-resize-handle {
    position: absolute;
    z-index: 3;
    width: 13px;
    height: 13px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #246bfd;
}
.capture-resize-nw { left:-7px; top:-7px; cursor:nwse-resize; }
.capture-resize-ne { right:-7px; top:-7px; cursor:nesw-resize; }
.capture-resize-sw { left:-7px; bottom:-7px; cursor:nesw-resize; }
.capture-resize-se { right:-7px; bottom:-7px; cursor:nwse-resize; }

/* ============================================================
   REPARATUR: CHAT
============================================================ */
.classroom-chat {
    flex: 1 1 0;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid #d9dde3;
    border-radius: 9px;
    background: #fff;
    box-shadow: 0 2px 9px rgba(0,0,0,.08);
}

.chat-header {
    height: 30px;
    display: flex;
    align-items: center;
    padding: 0 9px;
    border-bottom: 1px solid #e1e4e8;
    background: #f5f6f8;
    color: #30343a;
    font-size: 12px;
    font-weight: 700;
}

.chat-messages {
    flex: 1 1 auto;
    min-height: 80px;
    overflow-y: auto;
    padding: 7px;
    background: #fff;
    font-size: 11px;
}

.chat-empty { color: #8a919d; text-align: center; padding-top: 12px; }
.chat-message { margin-bottom: 6px; padding: 5px 7px; border-radius: 7px; background: #f0f3f7; overflow-wrap: anywhere; }
.chat-message.own { background: #e7efff; }
.chat-message-meta { margin-bottom: 2px; color: #737b88; font-size: 9px; }

.chat-compose {
    display: grid;
    grid-template-columns: minmax(0,1fr) 34px;
    gap: 5px;
    padding: 6px;
    border-top: 1px solid #e1e4e8;
    background: #f8f9fa;
}

#chatInput {
    width: 100%;
    min-width: 0;
    height: 46px;
    resize: none;
    padding: 6px 7px;
    border: 1px solid #ccd1d9;
    border-radius: 6px;
    outline: none;
    font: inherit;
    font-size: 11px;
}

#chatInput:focus { border-color: #246bfd; }
#chatSendButton {
    width: 34px;
    height: 34px;
    align-self: end;
    border: 0;
    border-radius: 6px;
    background: #246bfd;
    color: #fff;
    cursor: pointer;
}
#chatSendButton:disabled { opacity: .45; cursor: default; }

/* ============================================================
   LIVE-MAUS + TABELLE (WHITEBOARD)
============================================================ */
.whiteboard-live-pointer {
    position: absolute;
    z-index: 22;
    display: none;
    align-items: flex-start;
    gap: 2px;
    pointer-events: none;
    transform: translate(0,0);
}
.whiteboard-live-pointer-arrow {
    width: 24px;
    height: 32px;
    display: block;
    line-height: 0;
}
.whiteboard-live-pointer-arrow svg { display:block; width:24px; height:32px; }
.whiteboard-live-pointer.show { display: flex; }

.whiteboard-live-pointer-label { padding: 2px 6px; border-radius: 9px; background: rgba(25,27,31,.78); color: #fff; font-size: 10px; }
body[data-role="teacher"] .lesson-stage.live-pointer-enabled { cursor: default; }

.lesson-table-block { width: 100%; border-collapse: collapse; background: #fff; }
.lesson-table-block td { min-width: 70px; height: 36px; padding: 7px 9px; border: 1px solid #7b8490; vertical-align: top; }
.lesson-table-block td:focus { outline: 2px solid rgba(36,107,253,.35); outline-offset: -2px; }
.text-block-wrapper.table-block-wrapper {
    min-width: 220px;
    width: 420px;
    max-width: calc(100% - 20px);
    resize: both;
    overflow: auto;
    padding-right: 4px;
    padding-bottom: 4px;
}

.text-remove-button {
    position: absolute;
    top: 2px;
    right: 4px;
    z-index: 6;
    width: 24px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 4px;
    background: #f1e4e4;
    color: #a93232;
    font-size: 12px;
    cursor: pointer;
}
.text-remove-button:hover { background: #d83b3b; color: #fff; }

/* ============================================================
   WHITEBOARD TABS
============================================================ */
.whiteboard-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 36px;
    padding: 5px 8px 0;
    border: 1px solid #d6dce5;
    border-bottom: 0;
    border-radius: 10px 10px 0 0;
    background: #eef2f7;
    overflow: hidden;
}
.whiteboard-tab-list {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: thin;
}
.whiteboard-tab {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    min-width: 88px;
    height: 31px;
    padding: 0 10px;
    border: 1px solid #c9d0da;
    border-bottom: 0;
    border-radius: 7px 7px 0 0;
    background: #dde3eb;
    color: #333;
    font: inherit;
    cursor: pointer;
}
.whiteboard-tab.active { background: #fff; color: #111; font-weight: 600; }
.whiteboard-tab-name { white-space: nowrap; }
.whiteboard-tab-close {
    display: inline-grid;
    place-items: center;
    width: 18px;
    height: 18px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #6b7280;
    cursor: pointer;
    font-size: 15px;
    line-height: 1;
}
.whiteboard-tab-close:hover { background: #e9bcbc; color: #a51d1d; }
.whiteboard-tab-add {
    flex: 0 0 auto;
    width: 34px;
    height: 31px;
    border: 1px solid #bfc8d4;
    border-radius: 7px 7px 0 0;
    background: #fff;
    color: #246bfd;
    font-size: 21px;
    line-height: 1;
    cursor: pointer;
}
.whiteboard-tab-add:hover { background: #eaf1ff; }
.whiteboard-tabs + .lesson-stage { border-top-left-radius: 0; border-top-right-radius: 0; }
body[data-role="student"] .whiteboard-tab { cursor: default; }

/* ============================================================
   BILDSCHIRMFREIGABE - LIVE ANNOTATIONEN
============================================================ */
.screen-annotation-canvas,
.screen-annotation-texts {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.screen-annotation-canvas { z-index: 32; pointer-events: none; }
.screen-annotation-texts { z-index: 33; pointer-events: none; }
body[data-role="teacher"] .screen-share-layer.annotation-draw .screen-annotation-canvas {
    pointer-events: auto;
    cursor: crosshair;
}
body[data-role="teacher"] .screen-share-layer.annotation-text .screen-annotation-texts {
    pointer-events: auto;
    cursor: text;
}
.screen-annotation-text {
    position: absolute;
    max-width: 60%;
    padding: 3px 6px;
    border-radius: 4px;
    color: #fff;
    background: rgba(0,0,0,.58);
    font: 600 22px/1.25 Arial, sans-serif;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.screen-annotation-toolbar {
    position: absolute;
    z-index: 36;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px;
    border-radius: 9px;
    background: rgba(18,20,24,.88);
    box-shadow: 0 3px 14px rgba(0,0,0,.28);
}
.screen-annotation-button {
    border: 1px solid #5d6570;
    border-radius: 6px;
    padding: 7px 10px;
    color: #fff;
    background: #30343a;
    cursor: pointer;
}
.screen-annotation-button.active { background: #1769e0; border-color: #1769e0; }
.screen-annotation-color { width: 34px; height: 32px; padding: 2px; border: 0; background: transparent; }
.screen-annotation-strength { display:flex; align-items:center; gap:5px; color:#fff; font-size:12px; }
.screen-annotation-strength input { width: 80px; }
#screenVideo { position: relative; z-index: 31; }
.stop-screen-share { z-index: 37; }

/* V6: Bildschirmfreigabe lebt in genau einem Whiteboard-Tab. */
.screen-annotation-toolbar { display: none !important; }
.screen-share-layer:not(.tab-visible) { display: none !important; }


/* ============================================================
   V7 FEINSCHLIFF: SCREEN-TEXT + CHAT-AUSRICHTUNG
============================================================ */
/* Der rote Stop-Button im Videobereich wird nicht mehr benutzt. */
.stop-screen-share { display: none !important; }

/* Text wird direkt auf der Freigabe editiert - ohne Browser-Prompt. */
body[data-role="teacher"] .screen-share-layer.annotation-text .screen-annotation-texts {
    pointer-events: auto;
}
body[data-role="teacher"] .screen-share-layer.annotation-text .screen-annotation-text {
    pointer-events: auto;
}
.screen-annotation-text[contenteditable="true"] {
    min-width: 90px;
    min-height: 32px;
    outline: 1px dashed rgba(255,255,255,.75);
    cursor: text;
}
.screen-annotation-text.editing {
    background: rgba(0,0,0,.66);
}

/* Chat exakt in der Breite der Kamera-Panels halten. */
.video-column > .classroom-chat {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    align-self: stretch;
}
.classroom-chat .chat-compose {
    width: 100%;
    min-width: 0;
}
.classroom-chat #chatInput {
    display: block;
    max-width: 100%;
}


/* ============================================================
   UNTERRICHTS-LAUFZEIT
============================================================ */
.lesson-runtime {
    margin-left: auto;
    padding: 0 12px;
    color: #000;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: 30px;
    font-weight: 800;
    line-height: 36px;
    text-align: center;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
    white-space: nowrap;
}

.student-whiteboard-toolbar .lesson-runtime {
    margin-left: auto;
}

/* ============================================================
   V9.2 – GRUPPENUNTERRICHT / MEETING-MODUS
   Toolbar bleibt immer sichtbar. Nur die eigentliche Arbeitsflaeche
   wird im Meeting-Modus ausgeblendet.
============================================================ */
.student-panels { display:flex; flex-direction:column; gap:8px; min-height:0; }
.student-panels .participant-panel { flex:0 0 auto; }
.other-student-panels { display:flex; flex-direction:column; gap:8px; }
.meeting-button { white-space:nowrap; }
.meeting-button.active { background:#246bfd; color:#fff; }

/* Normale rechte Spalte darf bei mehreren Schuelern scrollen. */
body[data-role="teacher"] .video-column { overflow-y:auto; padding-right:2px; }

/* Im Meeting bleibt .workspace bestehen, damit die Teacher-Toolbar sichtbar
   und der Meeting-Button jederzeit wieder anklickbar bleibt. */
body.meeting-mode .classroom-main { grid-template-columns:1fr; }
body.meeting-mode .whiteboard-tabs,
body.meeting-mode .lesson-stage { 
    opacity:0; visibility:hidden; pointer-events:none;
    transition:opacity .25s ease;
}
/* Student behält seine obere Screenshot-Leiste. */
body.meeting-mode .student-whiteboard-toolbar { opacity:1; visibility:visible; pointer-events:auto; }

/* Video-Bereich unterhalb der Werkzeugleiste in die Mitte holen. */
body.meeting-mode .video-column {
    position:fixed;
    z-index:70;
    top:62px;
    left:50%;
    transform:translateX(-50%);
    width:min(1180px, calc(100vw - 80px));
    height:calc(100vh - 78px);
    padding:18px;
    display:grid;
    grid-template-columns:repeat(2,minmax(300px,520px));
    grid-auto-rows:min-content;
    justify-content:center;
    align-content:center;
    gap:16px;
    overflow:auto;
    background:transparent;
    transition:left .38s ease, width .38s ease, transform .38s ease;
}
body.meeting-mode .video-column > .participant-panel,
body.meeting-mode .student-panels > .participant-panel,
body.meeting-mode .other-student-panels > .participant-panel {
    width:100%; max-width:520px; justify-self:center; align-self:center;
}
body.meeting-mode .student-panels,
body.meeting-mode .other-student-panels { display:contents; }
body.meeting-mode .participant-header { height:38px; font-size:16px; }
body.meeting-mode .compact-video { aspect-ratio:16/9; }

/* Im Meeting stehen nur die Personen im Mittelpunkt. Chat bleibt verborgen. */
body.meeting-mode .video-column > .classroom-chat { display:none !important; }
body.meeting-mode .video-column > .room-status { display:none !important; }

@media (max-width:1000px){
 body.meeting-mode .video-column{
   grid-template-columns:repeat(2,minmax(240px,1fr));
   width:calc(100vw - 28px); top:72px; align-content:start;
 }
 body.meeting-mode .video-column > .classroom-chat{display:none !important;}
}
@media (max-width:700px){
 body.meeting-mode .video-column{grid-template-columns:1fr;top:72px;}
 body.meeting-mode .video-column > .classroom-chat{display:none !important;}
}


/* V9.4 – Meeting: alle Kamerakacheln gross und identisch */
body.meeting-mode .video-column {
    width: min(1460px, calc(100vw - 48px));
    grid-template-columns: repeat(2, minmax(420px, 680px));
    grid-auto-rows: auto;
    gap: 22px;
    padding: 20px;
}
body.meeting-mode .video-column > .participant-panel,
body.meeting-mode .student-panels > .participant-panel,
body.meeting-mode .other-student-panels > .participant-panel {
    width: 100%;
    max-width: 680px;
    min-width: 0;
    margin: 0;
}
body.meeting-mode .participant-panel .compact-video {
    width: 100%;
    aspect-ratio: 16 / 9;
    min-height: 0;
}
body.meeting-mode .participant-panel .compact-video video {
    width: 100%; height: 100%; object-fit: cover;
}
@media (max-width: 1000px) {
 body.meeting-mode .video-column { grid-template-columns: repeat(2,minmax(300px,1fr)); width:calc(100vw - 24px); gap:14px; }
}
@media (max-width: 700px) {
 body.meeting-mode .video-column { grid-template-columns:1fr; width:calc(100vw - 16px); }
}


/* V9.5 – Meeting: identische Kamerakacheln fuer alle Teilnehmer */
.meeting-control-spacer { display:none; }
body.meeting-mode .meeting-control-spacer {
    display:flex; height:40px; min-height:40px; padding:4px; background:#17191d;
}
body.meeting-mode .participant-panel { display:flex; flex-direction:column; }
body.meeting-mode .participant-panel .participant-header { flex:0 0 38px; }
body.meeting-mode .participant-panel .compact-video { flex:0 0 auto; }
body.meeting-mode .participant-panel .participant-controls { flex:0 0 40px; }

/* ============================================================
   V9.7 – MEETING: 4 gleich grosse Kamera-Plaetze + Chat rechts
============================================================ */
body.meeting-mode .video-column {
    top: 62px;
    left: 0;
    transform: none;
    width: 100vw;
    height: calc(100vh - 62px);
    box-sizing: border-box;
    padding: 18px;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(280px, 330px);
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-content: stretch;
    justify-content: stretch;
    overflow: hidden;
}
body.meeting-mode .student-panels,
body.meeting-mode .other-student-panels { display: contents; }
body.meeting-mode .video-column > .participant-panel,
body.meeting-mode .student-panels > .participant-panel,
body.meeting-mode .other-student-panels > .participant-panel {
    width: 100%;
    height: 100%;
    max-width: none;
    min-width: 0;
    min-height: 0;
    margin: 0;
    align-self: stretch;
    justify-self: stretch;
    overflow: hidden;
}
body.meeting-mode .participant-panel .compact-video {
    flex: 1 1 auto;
    width: 100%;
    min-height: 0;
    aspect-ratio: auto;
}
body.meeting-mode .participant-panel .compact-video video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
body.meeting-mode .video-column > .classroom-chat {
    display: flex !important;
    grid-column: 3;
    grid-row: 1 / 3;
    width: 100%;
    height: 100%;
    min-height: 0;
    margin: 0;
}
body.meeting-mode .video-column > .room-status { display: none !important; }

/* Hand gehoben: komplette Student-Kachel deutlich rot markieren. */
.participant-panel.student-hand-raised {
    outline: 4px solid #e00000;
    outline-offset: -4px;
    box-shadow: 0 0 0 2px #e00000, 0 0 22px rgba(224,0,0,.45);
}
.participant-panel.student-hand-raised .participant-header {
    background: #b00000;
}

@media (max-width: 1100px) {
    body.meeting-mode .video-column {
        grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(240px, 280px);
        gap: 10px;
        padding: 10px;
    }
}

/* ============================================================
   V9.9 - 14-ZOLL-LAYOUT + AUSFAHRBARER CHAT
============================================================ */
:root { --classroom-topbar-height: 62px; }
.chat-drawer-button { display:none; }

@media (max-width: 1300px) {
    .teacher-toolbar {
        flex-wrap: wrap;
        align-content: center;
        gap: 4px;
        padding: 4px 6px;
    }
    .teacher-tool, .toolbar-setting, .text-format-select {
        height: 32px;
        font-size: 12px;
    }
    .teacher-tool { padding-left: 7px; padding-right: 7px; }
    .toolbar-setting { padding-left: 5px; padding-right: 5px; }
    .toolbar-setting input[type="range"] { width: 52px; }
    .screen-button { margin-left: 0; }

    .chat-drawer-button {
        display:flex;
        position:fixed;
        z-index:1002;
        left:0;
        top:50%;
        transform:translateY(-50%);
        width:42px;
        height:64px;
        align-items:center;
        justify-content:center;
        border:1px solid #c8ced8;
        border-left:0;
        border-radius:0 10px 10px 0;
        background:#fff;
        box-shadow:0 3px 14px rgba(0,0,0,.18);
        font-size:21px;
        cursor:pointer;
    }
    .chat-drawer-button.drawer-open { left:min(360px, calc(100vw - 54px)); }
    .chat-unread-dot {
        display:none;
        position:absolute;
        right:5px;
        top:7px;
        width:10px;
        height:10px;
        border-radius:50%;
        background:#e00000;
        box-shadow:0 0 0 2px #fff;
    }
    .chat-unread-dot.show { display:block; }

    .video-column > .classroom-chat,
    body.meeting-mode .video-column > .classroom-chat {
        display:flex !important;
        position:fixed !important;
        z-index:1001;
        left:0;
        top:var(--classroom-topbar-height);
        bottom:0;
        width:min(360px, calc(100vw - 54px)) !important;
        height:auto !important;
        min-height:0;
        margin:0 !important;
        transform:translateX(-105%);
        transition:transform .22s ease;
        box-shadow:5px 0 20px rgba(0,0,0,.2);
        background:#fff;
    }
    .video-column > .classroom-chat.drawer-open,
    body.meeting-mode .video-column > .classroom-chat.drawer-open { transform:translateX(0); }

    /* Der Chat belegt im Meeting keine Grid-Spalte mehr: volle Fläche für 4 Kameras. */
    body.meeting-mode .video-column {
        top:var(--classroom-topbar-height);
        height:calc(100vh - var(--classroom-topbar-height));
        grid-template-columns:repeat(2,minmax(0,1fr));
        grid-template-rows:repeat(2,minmax(0,1fr));
        padding:10px;
        gap:10px;
    }
}

@media (max-width: 760px) {
    .teacher-toolbar { max-height:108px; overflow-y:auto; }
    body.meeting-mode .video-column { grid-template-columns:1fr; grid-template-rows:none; overflow-y:auto; }
}


/* ============================================================
   V10.0 - WHATSAPP-ARTIGE GRUPPENCHAT-BLASEN
============================================================ */
.chat-messages { display:flex; flex-direction:column; align-items:stretch; gap:5px; }
.chat-message {
    width:fit-content;
    max-width:84%;
    margin:0 0 2px 0;
    padding:7px 9px;
    border-radius:8px;
    background:#eef1f4;
    box-shadow:0 1px 1px rgba(0,0,0,.08);
    overflow-wrap:anywhere;
}
.chat-message.other { align-self:flex-start; border-top-left-radius:2px; }
.chat-message.own {
    align-self:flex-end;
    margin-left:auto;
    background:#d9fdd3;
    border-top-right-radius:2px;
}
.chat-message-meta { font-weight:700; font-size:10px; margin-bottom:3px; color:#3678a8; }
.chat-message.own .chat-message-meta { color:#237a45; text-align:right; }

/* Green-Screen-Schalter */
#greenScreenButton.active { background:#20a84a; color:#fff; border-color:#16853a; }
