
.card-body {
    overflow-x: hidden;
}

.teacher-ai-actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
    margin-top: 1.15rem;
}

.teacher-ai-actions .btn {
    width: 100%;
    min-height: 2.9rem;
    white-space: nowrap;
}

@media (max-width: 900px) {
    .teacher-ai-actions {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 520px) {
    .teacher-ai-actions {
        grid-template-columns: 1fr;
    }
}

.ai-explanation,
.explanation-card,
.linguistic-explanation,
.report-explanation {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    box-sizing: border-box;
}

.linguistic-table-wrapper {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    box-sizing: border-box;
}

.linguistic-table {
    width: 100%;
    table-layout: fixed;
}

.linguistic-table td,
.linguistic-table th {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
    vertical-align: top;
}

.writing-characteristics-panel {
    border: 1px solid #e6ebf2;
    border-radius: 8px;
    background: #ffffff;
    padding: 0.9rem 1rem;
}

.writing-characteristics-list {
    display: grid;
    gap: 0.85rem;
}

.writing-characteristic-row {
    display: grid;
    gap: 0.35rem;
}

.writing-characteristic-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    color: #334155;
    font-size: 0.92rem;
    line-height: 1.25;
}

.writing-characteristic-topline strong {
    color: #1f2937;
    font-size: 0.9rem;
}

.writing-characteristic-track {
    width: 100%;
    height: 0.62rem;
    overflow: hidden;
    border-radius: 999px;
    background: #eef2f7;
}

.writing-characteristic-bar {
    height: 100%;
    border-radius: inherit;
}

.characteristic-consistency {
    background: #9ec5fe;
}

.characteristic-vocabulary {
    background: #a7f3d0;
}

.characteristic-variation {
    background: #fde68a;
}

.characteristic-structure {
    background: #c4b5fd;
}

.characteristic-repetition {
    background: #fecdd3;
}

.writing-behaviour-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    padding: 1rem;
}

.writing-behaviour-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    background: #f1f5f9;
    color: #334155;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.1;
}

.writing-behaviour-bar {
    display: flex;
    width: 100%;
    height: 1rem;
    overflow: hidden;
    border-radius: 8px;
    background: #eef2f7;
}

.writing-behaviour-segment {
    min-width: 0;
    height: 100%;
    background-size: 0.75rem 0.75rem;
}

.writing-behaviour-segment.cluster-0,
.writing-dot.cluster-0,
.writing-pattern-chip.cluster-0 {
    background-color: #15803d;
}

.writing-behaviour-segment.cluster-1,
.writing-dot.cluster-1,
.writing-pattern-chip.cluster-1 {
    background-color: #0f766e;
}

.writing-behaviour-segment.cluster-2,
.writing-dot.cluster-2,
.writing-pattern-chip.cluster-2 {
    background-color: #d97706;
}

.writing-behaviour-segment.cluster-3,
.writing-dot.cluster-3,
.writing-pattern-chip.cluster-3 {
    background-color: #2563eb;
}

.writing-behaviour-segment.cluster-4,
.writing-dot.cluster-4,
.writing-pattern-chip.cluster-4 {
    background-color: #7c3aed;
}

.writing-behaviour-segment.cluster-5,
.writing-dot.cluster-5,
.writing-pattern-chip.cluster-5 {
    background-color: #be123c;
}

.writing-behaviour-segment.cluster-unknown,
.writing-dot.cluster-unknown,
.writing-pattern-chip.cluster-unknown {
    background-color: #64748b;
}

.writing-behaviour-segment {
    background-image: repeating-linear-gradient(
        45deg,
        rgba(255, 255, 255, 0.22) 0,
        rgba(255, 255, 255, 0.22) 3px,
        transparent 3px,
        transparent 7px
    );
}

.writing-behaviour-labels {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
    font-size: 0.88rem;
    color: #334155;
}

.writing-dot {
    display: inline-block;
    width: 0.65rem;
    height: 0.65rem;
    margin-right: 0.35rem;
    border-radius: 999px;
    vertical-align: middle;
}

.writing-behaviour-note {
    border-left: 3px solid #64748b;
    padding: 0.55rem 0.75rem;
    background: #f8fafc;
    color: #475569;
    font-size: 0.88rem;
}

.writing-pattern-chip {
    display: inline-flex;
    align-items: center;
    max-width: 15rem;
    border-radius: 999px;
    padding: 0.3rem 0.55rem;
    color: #ffffff;
    font-size: 0.76rem;
    font-weight: 700;
    line-height: 1.15;
    overflow-wrap: anywhere;
}

@media (max-width: 767.98px) {
    .writing-behaviour-labels {
        grid-template-columns: 1fr;
    }
}

.suspicious-card {
    border: 1px solid #e9ecef;
    border-radius: 14px;
    background: #fff;
}

.suspicious-risk-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 0.35rem 0.8rem;
    font-size: 0.84rem;
    font-weight: 700;
    line-height: 1;
}

.risk-badge-very-high {
    background: #fdeaea;
    color: #b42318;
}

.risk-badge-high {
    background: #f4e3b2;
    color: #7a5a00;
}

.risk-badge-moderate {
    background: #ffd9e1;
    color: #8c3b55;
}

.risk-badge-low {
    background: #fff7bf;
    color: #7a6500;
}

.risk-badge-very-low {
    background: #e4f8e7;
    color: #1f7a3d;
}

.risk-badge-unknown {
    background: #eceff3;
    color: #52606d;
}

.suspicious-highlight {
  padding: 0.05rem 0.2rem;
  border-radius: 0.3rem;
  line-height: 1.9;
}

.suspicious-highlight.risk-highlight-very-high {
    background: #f83f3f;
    color: #ffffff;
}

.suspicious-highlight.risk-highlight-high {
    background: #ffab40;
    color: #1f2933;
}

.suspicious-highlight.risk-highlight-moderate {
    background: #ffcbdc;
    color: #1f2933;
}

.suspicious-highlight.risk-highlight-low {
    background: #ffef73;
    color: #1f2933;
}

.suspicious-highlight.risk-highlight-very-low {
    background: #c7efcc;
    color: #1f2933;
}

.suspicious-highlight.risk-highlight-unknown {
    background: #dfe6ee;
    color: #1f2933;
}

mark.suspicious-highlight {
    color: inherit;
}

mark.suspicious-highlight.risk-highlight-very-high {
    background: #f83f3f;
    color: #ffffff;
}

mark.suspicious-highlight.risk-highlight-high {
    background: #ffab40;
    color: #1f2933;
}

mark.suspicious-highlight.risk-highlight-moderate {
    background: #ffcbdc;
    color: #1f2933;
}

mark.suspicious-highlight.risk-highlight-low {
    background: #ffef73;
    color: #1f2933;
}

mark.suspicious-highlight.risk-highlight-very-low {
    background: #c7efcc;
    color: #1f2933;
}

mark.suspicious-highlight.risk-highlight-unknown {
    background: #dfe6ee;
    color: #1f2933;
}


#submissionsTable th,
#submissionsTable td {
    text-align: center;
    vertical-align: middle;
}

#submissionsTable th {
    white-space: nowrap;
}

#submissionsTable td {
    padding: 14px 12px;
}

#submissionsTable .decision-col {
    min-width: 220px;
}

#submissionsTable .explanation-col {
    min-width: 260px;
}

.decision-badge {
    display: inline-block;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    max-width: 220px;
    white-space: normal;
    text-align: center;
}

.explanation-preview {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    max-width: 240px;
    margin: 0 auto;
}

.explanation-preview.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

.action-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

#submissionsTable {
    min-width: 1600px;
}


.explanation-preview {
    display: -webkit-box;
    -webkit-line-clamp: 2;   /* show 2 lines */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.explanation-preview.expanded {
    -webkit-line-clamp: unset;
    overflow: visible;
}

table {
    table-layout: auto;
}

.decision-col {
    width: 220px;
}

.explanation-col {
    width: 420px;
}

.explanation-cell {
    width: 420px;
    white-space: normal;
    word-wrap: break-word;
}
