/* teacher/messages — kompakt sohbet kabuğu */
.tmsg-drive-draft-banner {
    margin: 0.35rem 0.5rem 0;
    padding: 0.55rem 0.75rem;
    border-radius: 0.65rem;
    background: #ecfdf5;
    border: 1px solid #99f6e4;
    color: #065f46;
    font-size: 0.72rem;
    font-weight: 700;
}
.tmsg-drive-draft-banner i { margin-right: 0.35rem; }
#teacher-panel:has(#messages-view:not(.hidden)) main.mp-scroll-y,
#teacher-panel:has(#messages-view:not(.hidden)) main {
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    height: 100% !important;
    padding: 0.4rem 0.65rem 0.5rem !important;
}
#teacher-panel:has(#messages-view:not(.hidden)) > .flex-1.flex {
    min-height: 0 !important;
    overflow: hidden !important;
}
#teacher-panel:has(#messages-view:not(.hidden)) #teacher-workspace {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
#messages-view.hidden {
    display: none !important;
}
#messages-view:not(.hidden) {
    padding: 0 !important;
    gap: 0 !important;
    display: flex !important;
    flex-direction: column;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    height: 100% !important;
    max-height: 100% !important;
    overflow: hidden !important;
}
#messages-view:not(.hidden) .wa-shell {
    flex: 1 1 auto;
    min-height: 0 !important;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}
#messages-view:not(.hidden) .wa-layout {
    flex: 1 1 auto;
    min-height: 0 !important;
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}
#messages-view:not(.hidden) .wa-rail {
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
#messages-view:not(.hidden) .wa-stage {
    flex: 1;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#messages-view:not(.hidden) .wa-thread-wrap {
    flex: 1 1 auto;
    min-height: 0 !important;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
#messages-view:not(.hidden) .wa-thread {
    flex: 1 1 auto;
    min-height: 0 !important;
    max-height: none !important;
    overflow-y: scroll !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}
#messages-view:not(.hidden) .wa-composer {
    flex-shrink: 0;
}

.msg-active-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 9999px;
    background: #25d366;
    flex-shrink: 0;
    position: absolute;
    bottom: 0;
    right: 0;
    border: 2px solid #fff;
}
.msg-active-dot.is-offline { background: #aebac1; }

.wa-shell {
    --wa-green: #6eb5a0;
    --wa-green-dark: #5a9d8a;
    --wa-bg: #f4f6f8;
    --wa-panel: rgba(255, 255, 255, 0.92);
    --wa-border: #e4e9ed;
    --wa-text: #2d3741;
    --wa-muted: #7a8794;
    --wa-bubble-me: #e3f0ea;
    --wa-bubble-them: rgba(255, 255, 255, 0.88);
    background: var(--wa-bg);
    border: 1px solid var(--wa-border);
    border-radius: 0.9rem;
    overflow: hidden;
    min-height: 0;
    box-shadow: 0 2px 14px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(8px);
}
.wa-layout {
    display: grid;
    grid-template-columns: minmax(15.5rem, 20rem) 1fr;
    min-height: 0;
    height: 100%;
}
@media (max-width: 1023px) {
    .wa-layout { grid-template-columns: 1fr; grid-template-rows: 1fr; min-height: 0; }
    .wa-stage:not(.has-peer) { display: none; }
    .wa-rail.is-collapsed { display: none; }
    .wa-shell.is-thread-open .tmsg-mobile-back,
    #messages-view.is-tmsg-thread .tmsg-mobile-back { display: inline-flex !important; }
}

.wa-stage-head .tmsg-mobile-back { display: none; }

.wa-rail {
    background: var(--wa-panel);
    border-right: 1px solid var(--wa-border);
    display: flex;
    flex-direction: column;
    min-height: 0;
}
.wa-rail-top {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.55rem;
    background: var(--wa-bg);
    border-bottom: 1px solid var(--wa-border);
}
.wa-rail-title {
    margin: 0;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--wa-text);
    letter-spacing: -0.02em;
    white-space: nowrap;
}
.wa-icon-btn {
    width: 1.95rem;
    height: 1.95rem;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: var(--wa-muted);
    cursor: pointer;
    display: grid;
    place-items: center;
    transition: background 0.15s;
}
.wa-icon-btn:hover:not(:disabled) { background: rgba(11, 20, 26, 0.06); }
.wa-icon-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.wa-icon-btn--ghost { color: var(--wa-muted); }

.wa-search-wrap {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    padding: 0.28rem 0.55rem;
    background: #fff;
    border: 1px solid var(--wa-border);
    border-radius: 999px;
    min-width: 0;
}
.wa-search-wrap i { color: var(--wa-muted); font-size: 0.7rem; }
.wa-search-wrap input {
    flex: 1;
    min-width: 0;
    border: none;
    background: transparent;
    font-size: 0.72rem;
    color: var(--wa-text);
    outline: none;
}
.wa-search-wrap input::placeholder { color: #8696a0; }

.wa-rail-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.2rem 0.75rem 0.12rem;
    font-size: 0.6rem;
    font-weight: 800;
    color: var(--wa-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.wa-rail-filters {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.28rem;
    padding: 0.35rem 0.55rem 0.4rem;
    border-bottom: 1px solid var(--wa-border, #e9edef);
    overflow-x: auto;
    scrollbar-width: none;
    background: #f8fafc;
}
.wa-rail-filters::-webkit-scrollbar { display: none; }
.wa-filter-chip {
    flex: 0 0 auto;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #475569;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.28rem 0.55rem;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1.2;
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.wa-filter-chip:hover { background: #f1f5f9; }
.wa-filter-chip.is-active {
    background: #0f172a;
    border-color: #0f172a;
    color: #fff;
}
.wa-role-tag {
    display: inline-block;
    margin-left: 0.28rem;
    padding: 0.05rem 0.32rem;
    border-radius: 999px;
    font-size: 0.55rem;
    font-weight: 800;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    vertical-align: middle;
    background: #e2e8f0;
    color: #475569;
}
.wa-role-tag.is-student { background: #dbeafe; color: #1d4ed8; }
.wa-role-tag.is-teacher { background: #dcfce7; color: #15803d; }
.wa-role-tag.is-admin { background: #fef3c7; color: #b45309; }
.wa-role-tag.is-parent { background: #ffe4e6; color: #be123c; }
.wa-urgent-pill {
    font-size: 0.62rem;
    font-weight: 800;
    color: #fff;
    background: #e07a8a;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    text-transform: none;
    letter-spacing: 0;
    margin-left: auto;
}
.wa-urgent-pill:empty { display: none; }

.wa-people {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.wa-person {
    width: 100%;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.42rem 0.7rem;
    border: none;
    border-bottom: 1px solid #f1f5f9;
    background: transparent;
    cursor: pointer;
    transition: background 0.12s;
}
.wa-person:hover { background: #f5f6f6; }
.wa-person.is-active { background: #f0f2f5; }
.wa-person.is-urgent { background: linear-gradient(90deg, #fff5f5, transparent 80%); }

.wa-person-avatar {
    position: relative;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #dfe5e7, #c5cdd1);
    color: #54656f;
    font-weight: 700;
    font-size: 0.72rem;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    flex-shrink: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
.wa-person-avatar .wa-avatar-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
    text-align: center;
}
.wa-person-avatar .wa-avatar-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}
.wa-person.is-urgent .wa-person-avatar { background: linear-gradient(145deg, #f87171, #dc2626); }

.wa-person-body { min-width: 0; flex: 1; }
.wa-person-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}
.wa-person-name {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--wa-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.wa-person-time {
    font-size: 0.65rem;
    color: var(--wa-muted);
    flex-shrink: 0;
}
.wa-person-preview {
    font-size: 0.68rem;
    color: var(--wa-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-top: 0.02rem;
}
.wa-person.is-urgent .wa-person-preview { color: #dc2626; font-weight: 600; }

.wa-badge {
    min-width: 1.15rem;
    height: 1.15rem;
    padding: 0 0.3rem;
    border-radius: 999px;
    background: var(--wa-green);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.wa-urgent-icon {
    width: 1.35rem;
    height: 1.35rem;
    border-radius: 50%;
    background: #ea0038;
    color: #fff;
    display: grid;
    place-items: center;
    font-size: 0.65rem;
    flex-shrink: 0;
}

.wa-stage {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: #f0ebe4 url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23d8d2c9' fill-opacity='0.18'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.wa-stage-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.4rem 0.75rem;
    background: var(--wa-bg);
    border-bottom: 1px solid var(--wa-border);
}
.wa-stage-peer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}
.wa-avatar {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: linear-gradient(145deg, #14b8a6, #0d9488);
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    display: grid;
    place-items: center;
    flex-shrink: 0;
    overflow: hidden;
}
.wa-stage-head strong {
    display: block;
    color: var(--wa-text);
    font-size: 0.84rem;
    font-weight: 700;
}
.wa-stage-head span:not(.hidden) {
    display: block;
    color: var(--wa-muted);
    font-size: 0.72rem;
    margin-top: 0.05rem;
}
.wa-stage-head .hidden,
.wa-peer-typing.hidden,
#tmsg-peer-meta.hidden {
    display: none !important;
}
.wa-stage-actions { display: flex; gap: 0.25rem; flex-shrink: 0; }
@media (max-width: 640px) {
    .wa-stage-actions .wa-icon-btn {
        width: 1.85rem;
        height: 1.85rem;
        min-width: 1.85rem;
        font-size: 0.72rem;
    }
}

.tmsg-avatar-wrap { position: relative; flex-shrink: 0; }
.tmsg-avatar-btn {
    border: none;
    background: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    border-radius: 50%;
    line-height: 0;
}
.tmsg-avatar-btn:disabled { cursor: default; }
.tmsg-peer-text { min-width: 0; }
.tmsg-head-menu {
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0;
    z-index: 50;
    min-width: 10.5rem;
    padding: 0.35rem;
    background: #fff;
    border: 1px solid var(--wa-border);
    border-radius: 0.65rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.tmsg-head-menu button {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    border: none;
    background: transparent;
    border-radius: 0.45rem;
    padding: 0.55rem 0.65rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #334155;
    text-align: left;
    cursor: pointer;
}
.tmsg-head-menu button:hover:not(:disabled) { background: #f1f5f9; }
.tmsg-head-menu button:disabled { opacity: 0.45; cursor: not-allowed; }
.tmsg-head-menu button i { width: 1rem; text-align: center; }
.tmsg-head-menu button i.fa-wand-magic-sparkles { color: #8b7ec8; }
.tmsg-head-menu button i.fa-list-check { color: #0284c7; }
.tmsg-head-menu button i.fa-book { color: #059669; }

.wa-thread {
    flex: 1;
    overflow-y: auto;
    padding: 0.65rem 3.5%;
    display: flex;
    flex-direction: column;
    gap: 0.28rem;
    min-height: 0;
}
.wa-empty-state {
    margin: auto;
    text-align: center;
    color: var(--wa-muted);
    font-size: 0.78rem;
    max-width: 16rem;
    line-height: 1.45;
}
.wa-empty-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 0.5rem;
    border-radius: 50%;
    background: rgba(255,255,255,0.78);
    display: grid;
    place-items: center;
    font-size: 1.25rem;
    color: #8696a0;
    box-shadow: 0 0 0 1px rgba(226, 232, 240, 0.9);
}
.wa-link-btn {
    border: none;
    background: none;
    color: var(--wa-green-dark);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font-size: inherit;
}

.wa-bubble-row { display: flex; margin-bottom: 0.15rem; }
.wa-bubble-row.is-me { justify-content: flex-end; }
.wa-bubble-row.is-them { justify-content: flex-start; }
.wa-bubble {
    max-width: min(75%, 28rem);
    padding: 0.45rem 0.65rem 0.35rem;
    border-radius: 0.5rem;
    font-size: 0.84rem;
    line-height: 1.4;
    word-break: break-word;
    box-shadow: 0 1px 0.5px rgba(11, 20, 26, 0.13);
    position: relative;
}
.wa-bubble-row.is-me .wa-bubble {
    background: var(--wa-bubble-me);
    border-top-right-radius: 0;
}
.wa-bubble-row.is-them .wa-bubble {
    background: var(--wa-bubble-them);
    border-top-left-radius: 0;
}
.wa-bubble-time {
    float: right;
    margin: 0.2rem 0 0 0.5rem;
    font-size: 0.62rem;
    color: #667781;
    line-height: 1;
}

/* Zengin kartlar */
.wa-card {
    max-width: min(85%, 30rem);
    border-radius: 0.65rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(11, 20, 26, 0.12);
    background: #fff;
    border: 1px solid #e9edef;
}
.wa-card-head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #fff;
}
.wa-card-head--urgent { background: linear-gradient(135deg, #f43f5e, #e11d48); }
.wa-card-head--hw { background: linear-gradient(135deg, #10b981, #059669); }
.wa-card-head--task { background: linear-gradient(135deg, #0ea5e9, #0284c7); }
.wa-card-head--poll { background: linear-gradient(135deg, #8b5cf6, #7c3aed); }
.wa-card-body {
    padding: 0.65rem 0.75rem;
    font-size: 0.8rem;
    color: var(--wa-text);
}
.wa-card-body em {
    display: block;
    font-style: normal;
    color: var(--wa-muted);
    font-size: 0.75rem;
    margin-top: 0.25rem;
}
.wa-card-cta {
    display: block;
    width: 100%;
    border: none;
    border-top: 1px solid #e9edef;
    background: #f0f2f5;
    padding: 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--wa-green-dark);
    cursor: pointer;
    text-align: center;
}
.wa-card-cta:hover { background: #e9edef; }
.wa-card-cta.is-done { color: #667781; cursor: default; }

.wa-poll-opt {
    display: block;
    width: 100%;
    text-align: left;
    border: 1px solid #e9edef;
    background: #f8f9fa;
    border-radius: 0.4rem;
    padding: 0.45rem 0.6rem;
    margin-top: 0.35rem;
    font-size: 0.75rem;
    cursor: pointer;
}
.wa-poll-opt:hover { background: #e9edef; }
.wa-poll-bar {
    height: 0.35rem;
    background: #e9edef;
    border-radius: 999px;
    margin-top: 0.25rem;
    overflow: hidden;
}
.wa-poll-bar span {
    display: block;
    height: 100%;
    background: var(--wa-green);
    border-radius: 999px;
}

.wa-img-bubble img {
    max-width: 100%;
    border-radius: 0.35rem;
    display: block;
}
.wa-voice-play {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 10rem;
}
.wa-voice-play button {
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    border: none;
    background: var(--wa-green);
    color: #fff;
    cursor: pointer;
}

.wa-composer {
    padding: 0.32rem 0.7rem 0.42rem;
    background: var(--wa-bg);
    border-top: 1px solid var(--wa-border);
}
.wa-composer-inner {
    display: flex;
    align-items: flex-end;
    gap: 0.45rem;
}
.wa-composer input[type="text"],
.wa-composer textarea#chat-input-text,
.wa-composer #chat-input-text {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--wa-border);
    background: #fff;
    border-radius: 1.1rem;
    padding: 0.42rem 0.8rem;
    font-size: 0.78rem;
    outline: none;
    color: #111b21;
    -webkit-text-fill-color: #111b21;
    caret-color: #111b21;
    resize: none;
    line-height: 1.35;
    max-height: 6.5rem;
    min-height: 2.05rem;
    font-family: inherit;
}
.wa-composer input[type="text"]::placeholder,
.wa-composer #chat-input-text::placeholder {
    color: #8696a0;
    -webkit-text-fill-color: #8696a0;
}
.wa-composer input:disabled,
.wa-composer #chat-input-text:disabled { opacity: 0.6; }
.wa-attach-wrap,
.wa-send-btn {
    align-self: center;
}
.wa-send-btn {
    width: 2.05rem;
    height: 2.05rem;
    border-radius: 50%;
    border: none;
    background: var(--wa-green);
    color: #fff;
    cursor: pointer;
    display: grid;
    place-items: center;
    flex-shrink: 0;
}
.wa-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.tmsg-loc-btn {
    flex-shrink: 0;
    background: #fff;
    color: var(--wa-muted);
}
.tmsg-loc-btn.is-on { color: var(--wa-green, #128c7e); }
.tmsg-loc-btn:disabled { opacity: 0.4; cursor: not-allowed; }

.wa-attach-wrap { position: relative; }
.wa-attach-btn { background: #fff; }
.wa-attach-menu {
    position: absolute;
    bottom: calc(100% + 0.5rem);
    left: 0;
    background: #fff;
    border-radius: 0.75rem;
    box-shadow: 0 4px 20px rgba(11, 20, 26, 0.18);
    padding: 0.35rem;
    min-width: 11rem;
    z-index: 20;
}
.wa-attach-menu button {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    border: none;
    background: transparent;
    padding: 0.55rem 0.65rem;
    border-radius: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--wa-text);
    cursor: pointer;
    text-align: left;
}
.wa-attach-menu button:hover { background: #f0f2f5; }
.wa-attach-menu button i { width: 1.25rem; text-align: center; }

.wa-voice-bar {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.45rem;
    padding: 0.45rem 0.65rem;
    background: #fff;
    border-radius: 0.5rem;
    font-size: 0.78rem;
}
.wa-voice-dot {
    width: 0.55rem;
    height: 0.55rem;
    border-radius: 50%;
    background: #ea0038;
    animation: waVoicePulse 1s ease infinite;
}
@keyframes waVoicePulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}
.wa-voice-cancel, .wa-voice-send {
    border: none;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    margin-left: auto;
}
.wa-voice-send { color: var(--wa-green-dark); }
.wa-voice-cancel { color: #ea0038; }

.tmsg-empty {
    padding: 1.5rem;
    text-align: center;
    color: var(--wa-muted);
    font-size: 0.8rem;
}

/* Çalışma planı modal içi */
#tmsg-study-plan-body .karne-checklist-check { accent-color: #00a884; }

/* Son görülme / yazıyor */
.wa-peer-meta { display: block; color: var(--wa-muted); font-size: 0.72rem; margin-top: 0.05rem; }
.wa-peer-typing {
    display: block;
    color: var(--wa-green);
    font-size: 0.72rem;
    font-weight: 600;
    margin-top: 0.05rem;
}
.wa-typing-bounce {
    display: inline-flex;
    align-items: flex-end;
    gap: 0.12rem;
    margin-left: 0.15rem;
    vertical-align: baseline;
}
.wa-typing-bounce span {
    width: 0.22rem;
    height: 0.22rem;
    border-radius: 50%;
    background: var(--wa-green);
    animation: waTypingBounce 1.1s ease-in-out infinite;
}
.wa-typing-bounce span:nth-child(2) { animation-delay: 0.15s; }
.wa-typing-bounce span:nth-child(3) { animation-delay: 0.3s; }
@keyframes waTypingBounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
    30% { transform: translateY(-0.18rem); opacity: 1; }
}
.wa-peer-meta.is-online { color: var(--wa-green-dark); }
.wa-thread-wrap { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.wa-typing-banner {
    padding: 0.35rem 1rem;
    font-size: 0.72rem;
    color: var(--wa-green-dark);
    font-weight: 600;
    background: rgba(255,255,255,0.85);
    border-bottom: 1px solid var(--wa-border);
}
.wa-typing-dots::after { content: '...'; animation: waDots 1.2s steps(4,end) infinite; }
@keyframes waDots { 0%,20% { content: ''; } 40% { content: '.'; } 60% { content: '..'; } 80%,100% { content: '...'; } }

.wa-read-tick {
    float: right;
    margin-left: 0.25rem;
    font-size: 0.62rem;
    color: #8696a0;
    letter-spacing: -0.15em;
}
.wa-read-tick.is-read { color: #53bdeb; }
.wa-bubble-row.is-me .wa-bubble { padding-bottom: 0.25rem; }

.tmsg-flag-banner {
    margin: 0.45rem 0.75rem 0;
    padding: 0.65rem 0.8rem;
    border-radius: 0.85rem;
    background: #fff1f2;
    border: 1px solid #fda4af;
    color: #9f1239;
    font-size: 0.75rem;
    line-height: 1.4;
}
.tmsg-flag-banner.hidden { display: none; }
.tmsg-flag-banner strong { display: block; font-size: 0.72rem; letter-spacing: 0.03em; text-transform: uppercase; margin-bottom: 0.2rem; }
.tmsg-flag-banner p { margin: 0; color: #881337; }
.tmsg-flag-banner em { font-style: normal; color: #be123c; font-weight: 800; }
.wa-bubble-row.is-flag-hit .wa-bubble,
.wa-bubble-row.is-flag-hit .wa-card {
    outline: 3px solid #e11d48;
    box-shadow: 0 0 0 7px rgba(225, 29, 72, 0.18);
    animation: tmsgFlagPulse 1.1s ease 2;
}
@keyframes tmsgFlagPulse {
    0%, 100% { box-shadow: 0 0 0 7px rgba(225, 29, 72, 0.18); }
    50% { box-shadow: 0 0 0 12px rgba(225, 29, 72, 0.08); }
}

/* Çalışma planı stüdyosu */
.tmsg-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 440;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
}
.tmsg-modal-overlay.hidden { display: none !important; }
.tmsg-modal-sheet {
    width: min(52rem, 100%);
    max-height: min(88vh, 46rem);
    overflow: auto;
    background: #fff;
    border-radius: 1.1rem;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}
.tmsg-quick-modal { width: min(26rem, 100%); }
.tmsg-modal-sheet.tmsg-sp-modal {
    width: min(76rem, 98vw);
    max-height: min(96vh, 62rem);
    border: 1px solid #e2e8f0;
}
.tmsg-sp-modal { border: 1px solid #e2e8f0; }
.tmsg-sp-modal-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
    padding: 1rem 1.25rem; border-bottom: 1px solid #e2e8f0; background: #f8fafc;
}
.tmsg-sp-modal-head h3 { margin: 0; font-size: 1rem; font-weight: 800; color: #0f172a; }
.tmsg-sp-modal-head p { margin: 0.25rem 0 0; font-size: 0.75rem; color: #64748b; }
.tmsg-sp-modal-body { padding: 1rem 1.25rem; }
.tmsg-sp-modal-foot {
    display: flex; flex-wrap: wrap; gap: 0.5rem; justify-content: flex-end;
    padding: 0.85rem 1.25rem; border-top: 1px solid #e2e8f0; background: #f8fafc;
}
.tmsg-sp-foot-primary {
    border: none; border-radius: 0.65rem; padding: 0.65rem 1.1rem;
    background: #00a884; color: #fff; font-size: 0.78rem; font-weight: 700; cursor: pointer;
}
.tmsg-sp-foot-secondary {
    border: 1px solid #e2e8f0; border-radius: 0.65rem; padding: 0.65rem 0.9rem;
    background: #fff; color: #334155; font-size: 0.75rem; font-weight: 700; cursor: pointer;
}
.tmsg-sp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 900px) { .tmsg-sp-grid { grid-template-columns: 1fr; } }
.tmsg-sp-section { margin-bottom: 1rem; }
.tmsg-sp-section h4 { margin: 0 0 0.5rem; font-size: 0.82rem; font-weight: 800; color: #0f172a; }
.tmsg-sp-muted { font-size: 0.72rem; color: #64748b; margin: 0.25rem 0; }
.tmsg-sp-label { display: block; font-size: 0.7rem; font-weight: 700; color: #475569; margin-bottom: 0.25rem; }
.tmsg-sp-input, .tmsg-sp-textarea, .tmsg-sp-day-input {
    width: 100%; border: 1px solid #e2e8f0; border-radius: 0.55rem;
    padding: 0.5rem 0.65rem; font-size: 0.75rem; background: #f8fafc;
}
.tmsg-sp-textarea { resize: vertical; min-height: 5rem; }
.tmsg-sp-textarea--mentor { min-height: 11rem; font-size: 0.78rem; line-height: 1.45; }
.tmsg-sp-nets-table { width: 100%; border-collapse: collapse; font-size: 0.7rem; margin: 0.35rem 0; }
.tmsg-sp-nets-table th, .tmsg-sp-nets-table td { border: 1px solid #e2e8f0; padding: 0.3rem 0.4rem; text-align: center; }
.tmsg-sp-nets-table th { background: #f1f5f9; font-weight: 700; }
.tmsg-sp-nets-table td.is-bad { color: #dc2626; font-weight: 700; }
.tmsg-sp-weak-list { max-height: 18rem; overflow-y: auto; }
.tmsg-sp-insights {
    background: linear-gradient(180deg, #f0f9ff 0%, #f8fafc 100%);
    border: 1px solid #bae6fd;
    border-radius: 0.65rem;
    padding: 0.75rem 0.85rem;
}
.tmsg-sp-insight-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.35rem 0 0.5rem; }
.tmsg-sp-insight-chip {
    display: inline-flex; align-items: center; gap: 0.3rem;
    font-size: 0.68rem; font-weight: 700; color: #0c4a6e;
    background: #e0f2fe; border-radius: 999px; padding: 0.2rem 0.55rem;
}
.tmsg-sp-insight-chip.is-up { background: #dcfce7; color: #166534; }
.tmsg-sp-insight-chip.is-down { background: #fee2e2; color: #991b1b; }
.tmsg-sp-insight-chip.is-warn { background: #ffedd5; color: #9a3412; }
.tmsg-sp-insight-label { margin: 0.45rem 0 0.2rem; font-size: 0.68rem; font-weight: 800; color: #475569; }
.tmsg-sp-insight-list { margin: 0; padding-left: 1.1rem; font-size: 0.72rem; color: #334155; }
.tmsg-sp-insight-list li { margin-bottom: 0.2rem; }
.tmsg-sp-insight-list em { font-style: normal; color: #0284c7; font-weight: 700; font-size: 0.65rem; }
.tmsg-sp-weak-group { background: #f8fafc; border: 1px solid #e2e8f0; border-radius: 0.55rem; padding: 0.5rem; margin-bottom: 0.45rem; }
.tmsg-sp-weak-group strong { display: block; font-size: 0.72rem; margin-bottom: 0.35rem; }
.tmsg-sp-weak-item { display: flex; gap: 0.45rem; font-size: 0.72rem; margin-bottom: 0.25rem; cursor: pointer; }
.tmsg-sp-weak-item em { font-style: normal; font-weight: 700; }
.tmsg-sp-weak-item em.is-kritik { color: #dc2626; }
.tmsg-sp-weak-item em.is-warn { color: #d97706; }
.tmsg-sp-alert { background: #fff7ed; border: 1px solid #fed7aa; border-radius: 0.55rem; padding: 0.65rem; }
.tmsg-sp-link-btn { border: none; background: none; color: #0284c7; font-weight: 700; font-size: 0.72rem; cursor: pointer; text-decoration: underline; }
.tmsg-sp-ai-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.tmsg-sp-ai-btn {
    border: none; border-radius: 999px; padding: 0.4rem 0.75rem;
    background: linear-gradient(135deg, #8b5cf6, #6366f1); color: #fff;
    font-size: 0.68rem; font-weight: 700; cursor: pointer; white-space: nowrap;
}
.tmsg-sp-weekly { display: grid; gap: 0.45rem; margin-bottom: 0.75rem; max-height: 22rem; overflow-y: auto; }
.tmsg-sp-day-input { font-family: inherit; }

/* —— Sütlaç + AI Kopilot —— */
.wa-icon-btn--ai { color: #8b7ec8; }
.wa-icon-btn--ai:hover:not(:disabled) { background: rgba(139, 126, 200, 0.12); }

.wa-person-sutlac {
    background: linear-gradient(90deg, rgba(237, 233, 254, 0.65), transparent 85%);
    border-bottom-color: #ede9fe;
}
.wa-person-sutlac.is-active { background: linear-gradient(90deg, #ede9fe, #f5f3ff 60%); }
.wa-person-avatar--sutlac {
    background: linear-gradient(145deg, #c4b5fd, #a78bfa);
    overflow: hidden;
}
.wa-person-avatar--sutlac img {
    width: 100%; height: 100%; object-fit: cover;
}
.wa-person-avatar--sutlac .msg-active-dot { background: #a78bfa; border-color: #ede9fe; }
.wa-sutlac-badge {
    font-size: 0.58rem; font-weight: 800; color: #7c6bb0;
    background: rgba(237, 233, 254, 0.9); padding: 0.05rem 0.35rem;
    border-radius: 999px; margin-left: 0.15rem; vertical-align: middle;
}
.wa-avatar--sutlac { background: linear-gradient(145deg, #c4b5fd, #a78bfa); overflow: hidden; }
.wa-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }

.wa-bubble-ai {
    background: rgba(255, 255, 255, 0.82) !important;
    border: 1px solid rgba(196, 181, 253, 0.45);
    backdrop-filter: blur(6px);
    display: flex; gap: 0.45rem; align-items: flex-start;
    max-width: min(82%, 30rem);
}
.wa-ai-inline-avatar {
    width: 1.65rem; height: 1.65rem; border-radius: 50%; flex-shrink: 0;
    object-fit: cover; background: #ede9fe;
}
.wa-ai-text { flex: 1; min-width: 0; color: #3d3558; white-space: pre-wrap; }
.wa-ai-connect {
    display: inline-flex;
    margin-top: 0.45rem;
    border: 0;
    border-radius: 0.7rem;
    background: #7c3aed;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 800;
    padding: 0.35rem 0.65rem;
    cursor: pointer;
}
.wa-bubble-ai.is-typing {
    display: flex; align-items: center; gap: 0.25rem; padding: 0.65rem 0.85rem;
}
.wa-bubble-ai.is-typing span {
    width: 0.4rem; height: 0.4rem; border-radius: 50%; background: #a78bfa;
    animation: tmsgAiDot 1.2s ease infinite;
}
.wa-bubble-ai.is-typing span:nth-child(2) { animation-delay: 0.15s; }
.wa-bubble-ai.is-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tmsgAiDot {
    0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
    40% { opacity: 1; transform: scale(1); }
}

.tmsg-ai-quickbar {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.28rem;
    margin-bottom: 0.28rem;
    padding: 0.05rem 0;
    overflow-x: auto;
    scrollbar-width: none;
}
.tmsg-ai-quickbar::-webkit-scrollbar { display: none; }
.tmsg-ai-chip .tmsg-ai-chip-label { display: inline; }
.tmsg-ai-chip {
    border: 1px solid rgba(13, 148, 136, 0.22);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    color: #0f766e; border-radius: 999px;
    padding: 0.18rem 0.5rem; font-size: 0.62rem; font-weight: 700;
    cursor: pointer; display: inline-flex; align-items: center; gap: 0.28rem;
    transition: background 0.15s, border-color 0.15s;
    white-space: nowrap;
    flex-shrink: 0;
}
.tmsg-ai-chip:hover { background: #f5f3ff; border-color: #c4b5fd; }
.tmsg-ai-chip--sm { font-size: 0.64rem; padding: 0.25rem 0.55rem; }

.tmsg-ai-drawer {
    position: fixed; inset: 0; z-index: 430;
    background: rgba(45, 55, 65, 0.28);
    backdrop-filter: blur(3px);
    display: flex; justify-content: flex-end;
}
.tmsg-ai-drawer.hidden { display: none !important; }
.tmsg-ai-drawer-panel {
    width: min(100%, 22rem);
    height: 100%;
    background: rgba(252, 251, 255, 0.94);
    backdrop-filter: blur(14px);
    border-left: 1px solid rgba(196, 181, 253, 0.35);
    box-shadow: -8px 0 32px rgba(107, 91, 149, 0.12);
    display: flex; flex-direction: column;
}
.tmsg-ai-drawer-head {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 0.75rem;
    padding: 0.85rem 1rem; border-bottom: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(245, 243, 255, 0.6);
}
.tmsg-ai-drawer-head h3 {
    margin: 0; font-size: 0.92rem; font-weight: 800; color: #4c3d78;
    display: flex; align-items: center; gap: 0.4rem;
}
.tmsg-ai-drawer-head p { margin: 0.2rem 0 0; font-size: 0.7rem; color: #7a8794; font-weight: 600; }
.tmsg-ai-drawer-actions {
    display: flex; flex-wrap: wrap; gap: 0.3rem;
    padding: 0.55rem 0.75rem; border-bottom: 1px solid rgba(226, 232, 240, 0.6);
}
.tmsg-ai-drawer-thread {
    flex: 1; overflow-y: auto; padding: 0.75rem;
    display: flex; flex-direction: column; gap: 0.35rem;
}
.tmsg-ai-drawer-empty {
    margin: auto; text-align: center; font-size: 0.75rem; color: #7a8794;
    line-height: 1.5; max-width: 14rem; padding: 1rem;
}
.tmsg-ai-insert-row {
    display: flex; gap: 0.35rem; margin: -0.15rem 0 0.5rem 0.35rem;
}
.tmsg-ai-insert-row button {
    border: 1px solid rgba(196, 181, 253, 0.45);
    background: rgba(255, 255, 255, 0.8);
    color: #6b5b95; border-radius: 0.45rem;
    padding: 0.3rem 0.55rem; font-size: 0.65rem; font-weight: 700; cursor: pointer;
}
.tmsg-ai-insert-row button:hover { background: #f5f3ff; }
.tmsg-ai-drawer-foot {
    display: flex; gap: 0.45rem; padding: 0.65rem 0.75rem;
    border-top: 1px solid rgba(226, 232, 240, 0.8);
    background: rgba(248, 250, 252, 0.85);
}
.tmsg-ai-drawer-foot input {
    flex: 1; border: 1px solid #e2e8f0; border-radius: 0.55rem;
    padding: 0.55rem 0.7rem; font-size: 0.78rem; background: #fff; outline: none;
}
.tmsg-ai-drawer-foot input:focus { border-color: #c4b5fd; box-shadow: 0 0 0 2px rgba(196, 181, 253, 0.25); }
.tmsg-ai-drawer-send {
    width: 2.25rem; height: 2.25rem; border-radius: 50%; border: none;
    background: linear-gradient(135deg, #b8a9e8, #9f8fd4);
    color: #fff; cursor: pointer; display: grid; place-items: center; flex-shrink: 0;
}
.tmsg-ai-drawer-send:hover { filter: brightness(1.05); }

#teacher-panel.teacher-shell-v2 #messages-view:not(.hidden) {
    max-width: none;
    margin: 0;
}
.tmsg-watch-btn {
    color: #0f766e;
}
.tmsg-watch-panel {
    position: fixed;
    inset: 0;
    z-index: 540;
    background: rgba(17, 27, 33, 0.45);
    display: flex;
    align-items: stretch;
    justify-content: center;
    padding: 1rem;
}
.tmsg-watch-panel.hidden { display: none !important; }
.tmsg-watch-sheet {
    width: min(980px, 100%);
    background: #fff;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 18px 50px rgba(0,0,0,0.22);
}
.tmsg-watch-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid #e5e7eb;
    background: #f0fdf4;
}
.tmsg-watch-head h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: 800;
    color: #0f766e;
}
.tmsg-watch-head p {
    margin: 0.2rem 0 0;
    font-size: 0.78rem;
    color: #64748b;
}
.tmsg-watch-layout {
    display: grid;
    grid-template-columns: minmax(220px, 280px) 1fr;
    min-height: min(70vh, 640px);
}
.tmsg-watch-list {
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    background: #f8fafc;
}
.tmsg-watch-item {
    display: block;
    width: 100%;
    text-align: left;
    border: none;
    border-bottom: 1px solid #eef2f7;
    background: transparent;
    padding: 0.7rem 0.8rem;
    cursor: pointer;
}
.tmsg-watch-item.is-active { background: #ecfdf5; }
.tmsg-watch-item strong { display: block; font-size: 0.82rem; color: #0f172a; }
.tmsg-watch-item span { display: block; margin-top: 0.15rem; font-size: 0.72rem; color: #64748b; }
.tmsg-watch-item em { display: block; margin-top: 0.15rem; font-size: 0.62rem; color: #94a3b8; font-style: normal; }
.tmsg-watch-thread {
    overflow-y: auto;
    padding: 0.85rem;
    background: #efeae2;
}
.tmsg-watch-thread-head {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.7rem;
    font-size: 0.82rem;
}
.tmsg-watch-bubble {
    background: #fff;
    border-radius: 0.7rem;
    padding: 0.55rem 0.7rem;
    margin-bottom: 0.45rem;
    box-shadow: 0 1px 0.5px rgba(11,20,26,0.12);
}
.tmsg-watch-bubble b { display: block; font-size: 0.72rem; color: #0f766e; }
.tmsg-watch-bubble p { margin: 0.2rem 0 0; font-size: 0.84rem; color: #111b21; white-space: pre-wrap; }
.tmsg-watch-bubble em { display: block; margin-top: 0.2rem; font-size: 0.62rem; color: #667781; font-style: normal; text-align: right; }
.tmsg-watch-empty { padding: 1.2rem; color: #64748b; font-size: 0.84rem; text-align: center; }
@media (max-width: 720px) {
    .tmsg-watch-layout { grid-template-columns: 1fr; }
    .tmsg-watch-list { max-height: 32vh; border-right: none; border-bottom: 1px solid #e5e7eb; }
}
@media (max-width: 1023px) {
    #teacher-panel:has(#messages-view:not(.hidden)) main.mp-scroll-y,
    #teacher-panel:has(#messages-view:not(.hidden)) main {
        min-height: 0 !important;
        max-height: 100% !important;
        height: auto !important;
        flex: 1 1 auto !important;
    }
    #messages-view:not(.hidden) {
        flex: 1 1 auto !important;
        min-height: 0 !important;
        height: 100% !important;
        max-height: 100% !important;
    }
    #messages-view .wa-rail-top {
        grid-template-columns: minmax(0, 1fr) auto;
    }
    #messages-view .wa-rail-title { display: none; }
}
