/* ============================================================
   SMS 26 - application styles
   Chat page layout copied from capacity26ar/tt_css/brand.css
   (the learn page), so the history page is a pure chat page.
   Bubble colours follow the application logo palette
   (orange #ffa500 / cream #fff5e6 / dark #382801).
   ============================================================ */

.ct_chat_page {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.ct_chat_page > .b_chat_history {
    flex: 1 1 auto;
    height: auto;
    min-height: 0;
    overflow-y: auto;
    padding: 10px;
}

.ct_chat_page > .b_hist_spc {
    flex: 0 0 auto;
    min-height: 10px;
}

.ct_chat_page .k_chatline {
    width: 100%;
    clear: both;
    margin: 6px 0;
}

/* outgoing bubble - very faint logo orange */
.ct_chat_page .k_userbot {
    max-width: 82%;
    box-sizing: border-box;
    padding: 8px 12px;
    line-height: 1.45;
    font-size: 14px;
    background-color: #fff8ee;
    color: #382801;
    border: 1px solid #ffe6c2;
    border-radius: 10px 0 10px 10px;
}

/* incoming bubble - very faint logo cream */
.ct_chat_page .k_sysbot {
    max-width: 82%;
    box-sizing: border-box;
    display: inline-block;
    padding: 8px 12px;
    line-height: 1.45;
    font-size: 14px;
    background-color: #fffdf9;
    color: #382801;
    border: 1px solid #f2e6d5;
    border-radius: 0 10px 10px 10px;
}

/* suggestion chips line */
.ct_sugg {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    padding: 8px 10px;
    border-top: 1px solid #e0e0e0;
    background-color: #ffffff;
    flex: 0 0 auto;
    min-height: 34px;
}

.ct_sugg::-webkit-scrollbar {
    display: none;
}

.ct_sugg_chip {
    flex: 0 0 auto;
    padding: 5px 12px;
    border: 1px solid #ffcf80;
    border-radius: 20px;
    background-color: #fff5e6;
    color: #382801;
    white-space: nowrap;
    font-size: 12px;
    max-width: 260px;
    overflow: hidden;
    text-overflow: ellipsis;
    cursor: pointer;
}

.ct_sugg_chip:active {
    background-color: #ffe5cc;
}

/* day divider */
.ct_day {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 10px 0;
}

.ct_day::before,
.ct_day::after {
    content: "";
    flex: 1;
    border-top: 1px dashed #b9b9b9;
}

.ct_day span {
    font-size: 12px;
    color: #8a8a8a;
    padding: 0 10px;
    white-space: nowrap;
}

/* right panel: gateway status icon (green connected / red disconnected) */
.b_gw_on { color: #1a9e3a; }
.b_gw_off { color: #c62828; }
.b_gw_on svg,
.b_gw_off svg { stroke: currentColor; }

/* right panel: sending icon spins while a batch is moving (reuses ttstyles spin) */
.b_spin svg { animation: spin 2s linear infinite; transform-origin: center; }

/* right panel: fit the icon SVG to its square cell */
.b_svgfit svg { width: 100%; height: 100%; }

/* right panel: heartbeat ECG scrolls right-to-left while the gateway is connected */
.b_ecgbox { overflow: hidden; }
.b_ecg { display: block; width: 200%; height: 100%; }
.b_beat .b_ecg { animation: b_ecgscroll 3s linear infinite; }
@keyframes b_ecgscroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* right panel: batch percentage shown over the sending icon */
.b_pctwrap { position: relative; }
.b_pct {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    color: #382801;
    pointer-events: none;
}
