#orario-chat-widget { position: fixed; bottom: 16px; right: 16px; z-index: 9999; font-family: system-ui, sans-serif; }
.orario-chat-panel { width: 340px; max-height: 480px; background: #fff; border: 1px solid #cddcf6; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.18); display: flex; flex-direction: column; overflow: hidden; }
.orario-chat-panel-body { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: hidden; }
.orario-chat-panel--collapsed { max-height: none; }
.orario-chat-panel--collapsed .orario-chat-panel-body { display: none; }
.orario-chat-panel--collapsed .orario-chat-header { border-radius: 10px; cursor: pointer; flex-wrap: wrap; }
.orario-chat-header { padding: 8px 12px; background: #0d6efd; color: #fff; font-weight: 600; border-radius: 8px 8px 0 0; display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.orario-chat-title { flex: 1; min-width: 0; }
.orario-chat-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.orario-chat-toggle {
    background: rgba(255,255,255,.22);
    border: 1px solid rgba(255,255,255,.5);
    color: #fff;
    border-radius: 4px;
    width: 30px;
    height: 28px;
    padding: 0;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
    flex-shrink: 0;
}
.orario-chat-toggle:hover { background: rgba(255,255,255,.38); }
.orario-chat-toggle:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.orario-chat-full-link { color: #fff; text-decoration: underline; font-size: 12px; font-weight: 500; }
.orario-chat-full-link:hover { color: #dce9ff; }
.orario-chat-hint { background: #eef4ff; border-bottom: 1px solid #d6e5ff; padding: 6px 8px; font-size: 12px; color: #1f4d99; }
.orario-chat-messages { flex: 1; overflow-y: auto; padding: 8px; max-height: 300px; font-size: 13px; white-space: pre-wrap; background: #fcfdff; }
.orario-chat-msg { margin-bottom: 8px; padding: 6px 8px; border-radius: 6px; }
.orario-chat-user { background: #e7f1ff; }
.orario-chat-bot { background: #f4f4f4; border: 1px solid #e2e8f3; white-space: normal; }
.orario-chat-input-row { display: flex; gap: 6px; padding: 8px; border-top: 1px solid #eee; }
.orario-chat-input-row textarea { flex: 1; resize: none; font-size: 13px; }
.orario-chat-input-row button { background: #0d6efd; color: #fff; border: none; border-radius: 4px; padding: 0 10px; cursor: pointer; }
.orario-chat-bot-rich { display: flex; flex-direction: column; gap: 6px; }
.orario-chat-bot-header {
    background: #eef4ff;
    border: 1px solid #cfe0ff;
    border-radius: 6px;
    padding: 5px 6px;
    color: #1e4fa8;
    font-weight: 600;
}
.orario-chat-bot-line { background: #fff; border: 1px solid #e4ebf7; border-radius: 6px; padding: 5px 6px; color: #1f2c44; }
.orario-chat-bot-ora { display: inline-block; background: #0d6efd; color: #fff; border-radius: 4px; padding: 0 5px; margin-right: 4px; font-weight: 600; font-size: 11px; }
.orario-chat-bot-giorno { display: inline-block; margin-right: 4px; background: #e2e8f0; color: #334155; border-radius: 4px; padding: 0 5px; font-weight: 700; font-size: 11px; vertical-align: middle; }
.orario-chat-bot-materia { color: #16407f; font-weight: 700; }
.orario-chat-bot-classe { display: inline-block; margin-left: 5px; background: #e8f7ed; border: 1px solid #bfe8cc; color: #16623a; border-radius: 999px; padding: 0 7px; font-weight: 600; font-size: 11px; }
.orario-chat-bot-docenti { color: #5d3b8c; font-weight: 600; }
.orario-chat-bot-aula { color: #7a4a14; font-weight: 600; }
.orario-chat-bot-plain { background: #fff; border-left: 3px solid #7aa7ff; padding: 5px 6px; border-radius: 4px; }

.orario-chat-bot-line-current {
    border: 2px solid #ffb020;
    background: linear-gradient(90deg, #fff7e6 0%, #fff 100%);
    box-shadow: 0 0 0 2px rgba(255, 176, 32, 0.12);
}
.orario-chat-bot-line-past {
    background: #f3f6fb;
    border-color: #d8e2f0;
    opacity: 0.88;
}
.orario-chat-token-btn {
    border: 1px solid #cfe0ff;
    background: #f3f8ff;
    color: inherit;
    border-radius: 6px;
    padding: 0 6px;
    font-size: 12px;
    line-height: 18px;
    cursor: pointer;
    margin-right: 4px;
    vertical-align: baseline;
}
.orario-chat-token-btn:hover { background: #e6f1ff; }
.orario-chat-token-row { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; margin-top: 3px; }

.orario-chat-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 6px;
}
.orario-chat-suggestion-btn {
    border: 1px solid #b9d4ff;
    background: #edf5ff;
    color: #184b9a;
    border-radius: 999px;
    padding: 2px 10px;
    font-size: 12px;
    cursor: pointer;
}
.orario-chat-suggestion-btn:hover { background: #ddeeff; }
.orario-chat-suggestion-btn.is-active {
    background: #0d6efd;
    color: #fff;
    border-color: #0b5ed7;
    font-weight: 600;
}
.orario-chat-suggestion-btn.is-active:hover { background: #0b5ed7; color: #fff; }
.orario-chat-suggestion-btn.kind-classe { background: #e9f8ee; border-color: #bfe8cc; color: #1b6b3f; }
.orario-chat-suggestion-btn.kind-docente { background: #f3ecff; border-color: #ddccff; color: #5a3791; }
.orario-chat-suggestion-btn.kind-aula { background: #fff2e6; border-color: #ffd8b3; color: #8a4d10; }
.orario-chat-suggestion-btn.kind-materia { background: #eaf2ff; border-color: #c8dcff; color: #154a9a; }
.orario-chat-suggestion-kind {
    display: inline-block;
    border-radius: 999px;
    padding: 0 6px;
    margin-right: 6px;
    font-size: 11px;
    border: 1px solid currentColor;
}

/* Griglia settimanale (vista orario tipo tabellone) */
.orario-chat-week-outer {
    white-space: normal;
    max-width: 100%;
}
.orario-chat-week-subtitle {
    font-size: 13px;
    font-weight: 600;
    color: #1e3a5f;
    margin-top: 6px;
    margin-bottom: 4px;
}
.orario-chat-week-scroll {
    overflow-x: auto;
    max-width: 100%;
    margin-top: 6px;
    -webkit-overflow-scrolling: touch;
}
.orario-chat-week-block {
    margin-top: 10px;
}
.orario-chat-week-block-follow {
    margin-top: 16px;
    padding-top: 12px;
    border-top: 1px solid #dbe3f3;
}
.orario-chat-week-plesso-label {
    font-weight: 700;
    font-size: 12px;
    color: #0d2d69;
    margin-bottom: 6px;
    text-align: center;
}
.orario-chat-week-table {
    border-collapse: collapse;
    font-size: 11px;
    min-width: 520px;
    width: 100%;
    background: #fff;
    white-space: normal;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.orario-chat-week-table th,
.orario-chat-week-table td {
    border: 1px solid #b8c8e0;
    padding: 5px 4px;
    vertical-align: top;
    text-align: center;
    line-height: 1.25;
}
.orario-chat-week-corner,
.orario-chat-week-dayhead {
    background: #e8eef9;
    font-weight: 700;
    color: #0d2d69;
}
.orario-chat-week-time {
    background: #f1f4fb;
    text-align: left;
    white-space: nowrap;
    font-weight: 600;
    color: #334155;
}
.ocw-onum { margin-right: 4px; }
.ocw-ofasc { font-weight: 500; color: #64748b; font-size: 10px; }
.orario-chat-week-empty {
    background: #f4f4f6;
    color: #94a3b8;
}

/* Fascia oraria corrente (giorno + ora in base a Europe/Rome) */
.orario-chat-week-now-col {
    background: #ffe8d6 !important;
    box-shadow: inset 0 -3px 0 #e85d04;
}
.orario-chat-week-now-row {
    background: #fff4eb !important;
    box-shadow: inset 3px 0 0 #e85d04;
}
.orario-chat-week-now {
    box-shadow: inset 0 0 0 2px #e85d04;
    background-color: rgba(232, 93, 4, 0.14) !important;
}
.orario-chat-week-cell {
    min-width: 72px;
    max-width: 140px;
}
.ocw-subj {
    font-weight: 700;
    font-size: 10px;
    text-transform: uppercase;
    margin-bottom: 3px;
    color: #0f172a;
}
.orario-chat-week-cell .ocw-subj + .ocw-classe {
    margin-top: 4px;
}
.ocw-tokens {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    justify-content: center;
    align-items: flex-start;
}
.orario-chat-week-cell .orario-chat-token-btn.ocw-ttok {
    font-size: 9px;
    line-height: 1.25;
    padding: 1px 5px;
    margin: 0;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    vertical-align: top;
}
.orario-chat-week-cell a.ocw-portale-link.ocw-ttok {
    font-size: inherit;
    line-height: 1.25;
    padding: 1px 5px;
    margin: 0;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
    text-align: center;
    vertical-align: top;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: inherit;
    border-radius: 4px;
}
.orario-chat-week-cell a.ocw-portale-link.ocw-ttok:hover {
    color: #0f172a;
    background: rgba(255, 255, 255, 0.35);
}
.ocw-multi { font-size: 9px; font-weight: 600; opacity: 0.85; }
.ocw-doc { font-size: 10px; color: #1e293b; }
.ocw-aula { font-size: 9px; color: #475569; margin-top: 2px; }
.ocw-classe { font-size: 9px; color: #166534; font-weight: 600; margin-top: 2px; }
.ocw-plesso {
    font-size: 8px;
    color: #475569;
    font-weight: 600;
    margin-top: 4px;
    line-height: 1.2;
    text-align: center;
    font-style: italic;
}

.ocw-g0 { background: #fef3c7; }
.ocw-g1 { background: #bfdbfe; }
.ocw-g2 { background: #fecaca; }
.ocw-g3 { background: #fed7aa; }
.ocw-g4 { background: #bbf7d0; }
.ocw-g5 { background: #99f6e4; }
.ocw-g6 { background: #fbcfe8; }
.ocw-g7 { background: #ddd6fe; }
.ocw-g8 { background: #e2e8f0; }
.ocw-g9 { background: #cffafe; }
.ocw-g10 { background: #fde68a; }
.ocw-g11 { background: #d9f99d; }

/* Ricevimento genitori (non materia): evidenziato in tutte le viste settimanali */
.orario-chat-week-cell.ocw-ricevimento {
    background: #f3e8ff !important;
    border-left: 4px solid #7c3aed;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.12);
}
.orario-chat-week-cell.ocw-ricevimento .ocw-subj {
    color: #5b21b6;
    font-weight: 700;
}
.orario-chat-week-cell.ocw-ricevimento .ocw-classe,
.orario-chat-week-cell.ocw-ricevimento .ocw-doc,
.orario-chat-week-cell.ocw-ricevimento .ocw-aula {
    color: #6d28d9;
}
.orario-chat-week-cell .ocw-ricevimento-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.orario-chat-week-cell .ocw-ricevimento-link:hover {
    color: #4c1d95;
}

.orario-ricevimenti-plesso-table .ocw-doc {
    line-height: 1.35;
}

/* Supplenze docente (portale): supplente in evidenza, titolare assente attenuato */
.orario-chat-week-cell a.ocw-doc-supplente,
.orario-chat-week-cell span.ocw-doc-supplente {
    font-weight: 700;
}
.orario-chat-week-cell a.ocw-doc-assente,
.orario-chat-week-cell span.ocw-doc-assente,
.orario-chat-week-cell a.ocw-doc-titolare-sost,
.orario-chat-week-cell button.ocw-doc-titolare-sost {
    opacity: 0.65;
    color: #6c757d !important;
    text-decoration: line-through;
    text-decoration-thickness: 1px;
    font-weight: 400;
}

.orario-chat-week-cell a.ocw-doc-supplente,
.orario-chat-week-cell button.ocw-doc-supplente {
    font-weight: 700;
}
