/* MADO CHAT LOG PAGE CSS SSOT CLEAN BUILD 2026-07-11
 * Provider only: public/css/chat-log-page.css
 * Current markup source: includes/portal/chat-log-page.php
 * Removed: duplicated Stage 1 generation, unused tag/modal/period-filter branches,
 * repeated selector definitions, and historical patch-only blocks.
 * 2026-08-03: 参照Q&AはIDと質問タイトルを同じリンク部品で表示し、
 * site-qaのqa_id導線へ接続する。行ごとの別UIや固定幅テーブル列は増やさない。
 * 2026-08-19: 利用履歴の詳細行へ実ai_usedに基づく「AI利用」を追加。
 * 根拠率・参照URL・参照Q&A・AI利用の4項目をこのinline detail gridだけで管理する。
 * 2026-08-19: 参照Q&Aを詳細行の50%幅、残り3項目を残り50%で均等配分。
 * 同日のカレンダー／シナリオ到達・解決状況は通常表示だけをコンパクト化し、拡大カレンダーの可読性は維持する。
 * 2026-08-19: 通常表示の左右panelは同じgrid rowでstretchし、下端を必ず揃える。結果サマリー見出しは撤去、分岐ランキングはTOP3。
 * 2026-08-19: TOP3を3件表示できる前提で通常カレンダー6週分を約100px短縮し、左右panel全体の縦長化を抑える。
 * 分岐TOP3の順位・文言・件数は可読性のため各1px拡大。拡大カレンダーの寸法は変更しない。
 * 2026-08-21: 通常カレンダーをAI生成履歴に近い高さへ戻し、カレンダー操作ボタン・TOP3・検索/表示条件の可読性を調整。
 * 通常カレンダーだけを拡大し、既存の拡大表示・レスポンシブ・集計ロジックは変更しない。
 * 2026-08-21: 利用履歴の追加可読性調整。件数・集計カード・会話本文を段階的に拡大し、TOP3は文字/件数/枠線を黒で統一。
 * 検索placeholderは本文との差を1pxに戻す。レイアウト構造・集計経路・拡大カレンダーの寸法は変更しない。
 * 2026-08-21: 詳細行を根拠15 / AI利用15 / URL35 / Q&A35比率へ変更し、URL/Q&Aは1行省略表示。TOP3は灰枠・黒文字を維持しつつ余白と文字を拡大。
 * 2026-08-21: 詳細行4項目を参照Q&Aと同じ上下中央揃えへ統一し、チケット番号/状態を1px拡大。TOP3行間を12pxへ拡大。
 * 2026-08-21: 通常カレンダーをAI生成履歴のカレンダー寸法へ合わせ、モード切替を2px拡大。TOP3周辺の縦余白も追加。
 * 2026-08-21: 「AI・スタッフ件数 / 分岐チップ件数」を説明文直下へ移し、AI生成履歴の種別タブと同じ白/黒ピルデザインへ統一。カレンダー内の重複表示は廃止。
 * 2026-08-23: カレンダー拡大ボタンを見出し横へ移し、通常AI/スタッフ表示の6週セルを合計約1マス分（約96px）短縮。
 * 右のシナリオ到達・解決状況はカード/分岐一覧のfont-weightを各100下げる。拡大カレンダー寸法は変更しない。
 * 2026-08-23: カレンダー上部のモード/見出し/月表示を各1px縮小し、font-weightを100下げる。
 * 詳細4項目は11/11/39/39へ圧縮し、外側灰枠を廃止。根拠/AI利用=薄緑、URL=薄水色、項目間を縦線で区切る。
 * 2026-08-24: カレンダー表示切替はカレンダーパネル先頭の付箋型tabへ変更。選択中のみ背景色を付け、文字は濃いグレー/500。
 * AI水色は共通変数へ統一し、参照URL・AI source chip・AI hoverも同系色を使う。現行数値は17:28のAI生成履歴基準を正本とする。
 * 右のシナリオ到達・解決状況は全体をさらに1px縮小。AI回答hoverは水色、分岐TOP3は通常時=白/黒、hover時だけ薄緑。
 * 利用履歴一覧の対応状況列/selectorは表示経路ごと撤去する。
 * 2026-08-24: tablist用の白い帯は廃止し、左右panelの上端を揃えたままtabだけをcalendar panel上へ絶対配置する。
 * 分岐件数はAI/スタッフ件数と同じ12px/26px基準のcount chipへ揃え、TOP3の常時枠線は撤去する。
 * 2026-08-24: 右側「シナリオ到達・解決状況」の結果/AI利用カードはPOP分析「月の概要」の現行寸法
 * （2列、gap 8px、padding 10px 12px、radius 12px、value 20px）を基準にする。
 * 最終調整: panel title=17px/600、AI回答/AI利用/スタッフ対応=13px、count unit「件」=17px。
 * 集計state/クリックfilterは既存renderTrendPanel()のままで、表示専用CSSだけを統一する。
 * ページ冒頭のlead撤去に伴う未使用selectorも残さない。
 * 2026-08-24: 利用履歴一覧は「さらに20件」方式を廃止し、20件/pageのpaginationへ統一する。
 * 2026-08-24 17:05: カレンダー通常表示の件数「数字」だけ12px→13px。icon/件/box寸法・weight・集計ロジックは変更しない。
 * 2026-08-24 18:22: AI系の水色は参照Q&A IDリンク/POP設定で使うMADO共通brand accentを正本とする。
 * 背景=--mado-brand-accent-soft(#e6fbf9)、枠=--mado-brand-accent-border(#b9eeea)、文字=--mado-brand-accent-text(#129f9e)。
 * 利用履歴カレンダー、AI件数、参照URL、AI source UIはこの同一paletteを使い、第二の水色体系を増やさない。
 * 2026-08-24 17:48: AI・スタッフ件数表示ではhas-logsの旧#1d4ed8が日付番号へ継承されていたため、
 * 日付番号だけAI生成履歴と同じ#64748bへ固定する。branch modeの緑色表現は変更しない。
 */

body.mado-portal-account-page .mado-portal-shell--action-chat-log .mado-portal-shell__content-frame.is-standard,
.mado-portal-shell--action-chat-log .mado-portal-shell__content-frame.is-standard {
    box-sizing: border-box;
    width: 100%;
    max-width: calc(
        1140px
        + var(--mado-portal-page-gutter-x, clamp(18px, 2.4vw, 32px))
        + var(--mado-portal-page-gutter-x, clamp(18px, 2.4vw, 32px))
    );
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--mado-portal-page-gutter-x, clamp(18px, 2.4vw, 32px));
    padding-right: var(--mado-portal-page-gutter-x, clamp(18px, 2.4vw, 32px));
}

@media (max-width: 782px) {
    body.mado-portal-account-page .mado-portal-shell--action-chat-log .mado-portal-shell__content-frame.is-standard,
    .mado-portal-shell--action-chat-log .mado-portal-shell__content-frame.is-standard {
        padding-left: var(--mado-portal-page-gutter-x-mobile, 16px);
        padding-right: var(--mado-portal-page-gutter-x-mobile, 16px);
    }
}

.mado-chat-log-page {

    /* AI palette source: MADO共通brand accent / 参照Q&A IDリンク・POP設定 (2026-08-24 18:22 confirmed). */
    --mado-chat-log-count-blue-border: var(--mado-brand-accent-border, #b9eeea);
    --mado-chat-log-count-blue-background: var(--mado-brand-accent-soft, #e6fbf9);
    --mado-chat-log-count-blue-text: var(--mado-brand-accent-text, #129f9e);
    --mado-chat-log-count-blue-hover-background: #d8f7f4;
    --mado-chat-log-count-blue-hover-text: var(--mado-brand-accent-text, #129f9e);
    --mado-chat-log-count-blue-hover-border: var(--mado-brand-accent, #06bfb5);
    --mado-chat-log-count-blue-selected-background: #d8f7f4;
    --mado-chat-log-branch-green-border: #a7d9a3;
    --mado-chat-log-branch-green-background: #eef9ed;
    --mado-chat-log-branch-green-text: #3aae39;
    display: block;
    width: 100%;
    max-width: 1140px;
    min-width: 0;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;

}

.mado-chat-log-page__heading {

    margin: 0 0 12px;

}

.mado-chat-log-calendar-mode-tabs {

    position: absolute;
    left: 14px;
    top: -41px;
    z-index: 2;
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;

}

.mado-chat-log-search-card,
.mado-chat-log-panel,
.mado-chat-log-list-container {

    background: #ffffff;
    border: 1px solid #dbe4ee;
    border-radius: 16px;
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.05);

}

.mado-chat-log-search-card {

    width: 100%;
    max-width: none;
    min-width: 0;
    padding: 24px;
    margin-bottom: 18px;
    box-sizing: border-box;

}

.mado-chat-log-search-card__title {

    margin: 0;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;

}

.mado-chat-log-search-card__help {

    margin: 8px 0 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;

}

.mado-chat-log-search-form {

    margin-top: 18px;

}

.mado-chat-log-search-form__label {

    display: inline-block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #334155;

}

.mado-chat-log-search-form__controls {

    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;

}

.mado-chat-log-search-input:focus {

    border-color: #2563eb;
    outline: 2px solid rgba(37, 99, 235, 0.15);
    outline-offset: 0;

}

.mado-chat-log-search-input {

    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 10px;
    background: #ffffff;
    font-size: 15px;
    line-height: 1.4;
    color: #0f172a;
    box-shadow: none;
    min-width: 0;

}

.mado-chat-log-search-input::placeholder {

    font-size: 15px;

}

.mado-chat-log-action-button {

    appearance: none;
    -webkit-appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-width: 0;
    min-height: 40px;
    padding: 8px 15px;
    border: 1px solid #111827;
    border-radius: 999px;
    background: #ffffff;
    background-image: none;
    color: #111827;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;

}

.mado-chat-log-action-button:hover,
.mado-chat-log-action-button:focus-visible {

    border-color: #111827;
    background: #111827;
    color: #ffffff;

}

.mado-chat-log-action-button:focus {

    outline: none;

}

.mado-chat-log-action-button:focus-visible {

    outline: 2px solid rgba(17, 24, 39, 0.2);
    outline-offset: 2px;

}

.mado-chat-log-action-button:active {

    transform: translateY(1px);

}

.mado-chat-log-action-button--primary {

    border-color: var(--mado-chat-log-count-blue-text);
    background: var(--mado-chat-log-count-blue-text);
    color: #ffffff;

}

.mado-chat-log-action-button--primary:hover,
.mado-chat-log-action-button--primary:focus-visible {

    border-color: var(--mado-chat-log-count-blue-text);
    background: var(--mado-chat-log-count-blue-text);
    color: #ffffff;

}

.mado-chat-log-search-clear,
.mado-chat-log-filter-summary__reset {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);

}

.mado-chat-log-search-clear:hover,
.mado-chat-log-search-clear:focus-visible,
.mado-chat-log-filter-summary__reset:hover,
.mado-chat-log-filter-summary__reset:focus-visible {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);

}

.mado-chat-log-action-button__icon {

    display: block;
    flex: 0 0 auto;
    width: 19.2px;
    height: 19.2px;
    fill: currentColor;

}

.mado-chat-log-search-submit {

    min-width: 0;

}

.mado-chat-log-detail__section-title {

    font-size: 13px;
    font-weight: 700;
    color: #334155;

}

.mado-chat-log-branch-chip,
.period-btn {

    appearance: none;
    border: 1px solid;
    border-radius: 999px;
    cursor: pointer;
    padding: 6px 10px;
    font-size: 11px;
    line-height: 1.2;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;

}

.period-btn {

    border-color: #c7d2fe;
    background: #eef2ff;
    color: #4338ca;

}

.period-btn:hover {

    border-color: #93c5fd;
    background: #dbeafe;
    color: #1d4ed8;

}

.period-btn.is-active {

    border-color: #2563eb;
    background: #2563eb;
    color: #ffffff;

}

.mado-chat-log-filter-summary {

    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-top: 16px;
    padding: 14px 16px;
    border-radius: 12px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;

}

.mado-chat-log-filter-summary__reset {

    flex: 0 0 auto;
    align-self: flex-start;
    font-size: 14px;

}

.mado-chat-log-usage {

    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;

}

.mado-chat-log-usage__item {

    flex: 1 1 260px;
    padding: 14px 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #334155;
    font-size: 14px;
    line-height: 1.7;

}

.mado-chat-log-usage__item strong {

    display: block;
    margin-bottom: 4px;
    color: #0f172a;

}

.mado-chat-log-usage__muted {

    color: #64748b;

}

.mado-chat-log-list-container {

    overflow: hidden;
    margin-top: 18px;
    scroll-margin-top: 24px;

}

.mado-chat-log-list__header {

    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    padding: 18px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;

}

.mado-chat-log-list__title {

    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;

}

.mado-chat-log-list__subtitle {

    margin-top: 4px;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;

}

.mado-chat-log-list__count {

    flex: 0 0 auto;
    padding: 8px 12px;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: 12px;
    font-weight: 700;

}

.mado-chat-log-list-empty,
.mado-chat-log-list-error,
.mado-chat-log-panel__placeholder {

    padding: 24px;
    text-align: center;
    color: #64748b;
    font-size: 14px;
    line-height: 1.7;

}

.mado-chat-log-list-error,
.mado-chat-log-panel__placeholder.is-error {

    color: #b91c1c;

}

.mado-chat-log-list__page-summary {

    padding: 9px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    color: #64748b;
    font-size: 12px;
    line-height: 1.4;

}

.mado-chat-log-pagination {

    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
    padding: 16px 20px 20px;

}

.mado-chat-log-pagination button {

    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 34px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;

}

.mado-chat-log-pagination button:hover,
.mado-chat-log-pagination button:focus-visible {

    border-color: #94a3b8;
    background: #f8fafc;
    outline: none;

}

.mado-chat-log-pagination button.is-active {

    border-color: #0f172a;
    background: #0f172a;
    color: #ffffff;

}

.mado-chat-log-table-wrap {

    overflow-x: auto;

}

.mado-chat-log-table__head,
.mado-chat-log-table__cell {

    padding: 14px 16px;
    border-bottom: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;

}

.mado-chat-log-table__head {

    background: #ffffff;
    color: #334155;
    font-size: 13px;
    font-weight: 700;

}

.mado-chat-log-table__head:nth-child(2),
.mado-chat-log-table__head:nth-child(3) {

    font-size: 14px;

}

.mado-chat-log-table__head--time,
.mado-chat-log-table__cell--time {

    width: 92px;

}

.mado-chat-log-table__head--actions,
.mado-chat-log-table__cell--actions {

    width: 144px;

}

.mado-chat-log-table__row:nth-child(even) {

    background: #fbfdff;

}

.mado-chat-log-table__row:hover {

    background: #f8fbff;

}

.mado-chat-log-secondary-grid {

    display: grid;
    width: 100%;
    max-width: none;
    min-width: 0;
    grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
    gap: 18px;
    margin-bottom: 18px;
    align-items: start;
    box-sizing: border-box;

}

.mado-chat-log-top-grid {

    grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
    align-items: stretch;
    margin-top: 41px;

}

.mado-chat-log-top-grid > * {

    min-width: 0;

}

.mado-chat-log-top-grid > .mado-chat-log-panel {

    height: 100%;
    padding: 16px;
    box-sizing: border-box;

}

.mado-chat-log-panel {

    padding: 20px;

}

.mado-chat-log-panel__header {

    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
    margin-bottom: 12px;

}

.mado-chat-log-panel__title {

    margin: 0;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.35;
    color: #0f172a;

}

.mado-chat-log-calendar-panel {

    position: relative;

}

.mado-chat-log-calendar-panel .mado-chat-log-panel__title {

    font-size: 19px;
    font-weight: 700;

}

.mado-chat-log-calendar-panel > .mado-chat-log-panel__header {

    align-items: center;

}

.mado-chat-log-trend-panel > .mado-chat-log-panel__header .mado-chat-log-panel__title {

    font-size: 17px;
    font-weight: 600;

}

.mado-chat-log-trend-stack {

    display: grid;
    gap: 12px;

}

.mado-chat-log-trend-section {

    display: grid;
    gap: 9px;

}

.mado-chat-log-trend-section--results {

    gap: 8px;

}

.mado-chat-log-trend-section--results + .mado-chat-log-trend-section {

    gap: 12px;
    margin-top: 6px;

}

.mado-chat-log-trend-section__header {

    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;

}

.mado-chat-log-trend-section__title {

    margin: 0;
    font-size: 14px;
    font-weight: 500;
    color: #0f172a;

}

.mado-chat-log-result-groups {

    display: grid;
    gap: 10px;

}

.mado-chat-log-result-group {

    display: grid;
    gap: 5px;

}

.mado-chat-log-result-group__title {

    margin: 0;
    color: #334155;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.35;

}

.mado-chat-log-result-group__grid {

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

}

.mado-chat-log-page button.mado-chat-log-result-card {

    appearance: none;
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    font: inherit;
    text-align: left;
    opacity: 1;
    filter: none;
    box-shadow: none;
    -webkit-text-fill-color: currentColor;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;

}

.mado-chat-log-page button.mado-chat-log-result-card.is-clickable {

    cursor: pointer;

}

.mado-chat-log-page button.mado-chat-log-result-card.is-disabled {

    cursor: default;

}

.mado-chat-log-page button.mado-chat-log-result-card.is-clickable:hover,
.mado-chat-log-page button.mado-chat-log-result-card.is-clickable:focus-visible {

    border-color: #cbd5e1;
    background: #f1f5f9;
    color: #0f172a;
    opacity: 1;
    filter: none;
    box-shadow: none;
    -webkit-text-fill-color: currentColor;

}

.mado-chat-log-page button.mado-chat-log-result-card:focus {

    outline: none;

}

.mado-chat-log-page button.mado-chat-log-result-card:focus-visible {

    outline: 2px solid rgba(15, 23, 42, 0.16);
    outline-offset: 2px;

}

.mado-chat-log-result-group.is-source-ai button.mado-chat-log-result-card.is-clickable:hover,
.mado-chat-log-result-group.is-source-ai button.mado-chat-log-result-card.is-clickable:focus-visible,
.mado-chat-log-result-group.is-source-ai button.mado-chat-log-result-card.is-active,
.mado-chat-log-result-group.is-source-ai button.mado-chat-log-result-card.is-active:hover,
.mado-chat-log-result-group.is-source-ai button.mado-chat-log-result-card.is-active:focus-visible {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);
    box-shadow: inset 0 0 0 1px rgba(11, 104, 112, 0.06);

}

.mado-chat-log-page .mado-chat-log-result-card__label {

    color: inherit;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;

}

.mado-chat-log-page .mado-chat-log-result-card__count {

    margin-top: 3px;
    color: inherit;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;

}

.mado-chat-log-ai-usage-group {

    margin-top: 2px;

}

.mado-chat-log-ai-usage-grid {

    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;

}

.mado-chat-log-ai-usage-card {

    width: 100%;
    padding: 10px 12px;
    border: 1px solid #dbe4ee;
    border-radius: 12px;
    background: #f8fafc;
    color: #0f172a;
    box-sizing: border-box;

}

.mado-chat-log-ai-usage-card__label {

    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;

}

.mado-chat-log-ai-usage-card__count {

    margin-top: 3px;
    font-size: 20px;
    font-weight: 800;
    line-height: 1.15;

}

.mado-chat-log-count-unit {

    margin-left: 1px;
    font-size: 17px;
    font-weight: inherit;
    line-height: 1;

}


.mado-chat-log-ai-usage-note {

    margin-top: 4px;

}

.mado-chat-log-branch-filter {

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;

}

.mado-chat-log-trend-note {

    color: #64748b;
    font-size: 11px;
    line-height: 1.45;

}

.mado-chat-log-trend-note--scope {

    margin-bottom: 0;
    font-size: 12px;
    line-height: 1.4;

}

.mado-chat-log-trend-note--inline {

    padding-left: 4px;

}

.mado-chat-log-detail {

    display: grid;
    gap: 16px;

}

.mado-chat-log-detail__meta {

    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    color: #64748b;
    font-size: 13px;

}

.mado-chat-log-detail__section {

    display: grid;
    gap: 10px;
    padding: 16px;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #ffffff;

}

.mado-chat-log-detail__section-title {

    display: flex;
    align-items: center;
    gap: 7px;
    margin: 0;

}

.mado-chat-log-detail__text {

    color: #0f172a;
    font-size: 14px;
    line-height: 1.8;
    white-space: pre-wrap;
    word-break: break-word;

}

.mado-chat-log-detail__message {

    margin-bottom: 12px;

}

.mado-chat-log-detail__message:last-child {

    margin-bottom: 0;

}

.mado-chat-log-detail__message-meta {

    margin-bottom: 6px;
    color: #6b7280;
    font-size: 12px;
    line-height: 1.5;

}

.mado-chat-log-detail__text.is-answer {

    background: #f8fafc;

}

.mado-chat-log-detail__muted {

    color: #64748b;
    font-size: 13px;
    line-height: 1.7;

}

.mado-chat-log-calendar__header {

    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 9px;

}

.mado-chat-log-calendar__month {

    font-size: 19px;
    font-weight: 600;
    color: #0f172a;

}

.mado-chat-log-calendar__nav {

    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #004e77;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-shadow: none;
    transition: transform 0.2s ease, color 0.2s ease;

}

.mado-chat-log-calendar__nav:hover,
.mado-chat-log-calendar__nav:focus,
.mado-chat-log-calendar__nav:focus-visible {

    color: #00688f;
    background: transparent;
    border-color: transparent;
    box-shadow: none;
    outline: none;

}

.mado-chat-log-calendar__nav:active {

    transform: scale(0.95);

}

.mado-chat-log-calendar__nav-icon {

    display: block;
    width: 30px;
    height: 30px;
    transition: transform 0.3s ease-in-out;

}

.mado-chat-log-calendar__nav-icon circle {

    fill: #f0fbff;
    transition: fill 0.2s ease;

}

.mado-chat-log-calendar__nav:hover .mado-chat-log-calendar__nav-icon circle,
.mado-chat-log-calendar__nav:focus-visible .mado-chat-log-calendar__nav-icon circle {

    fill: #dff3fb;

}

.mado-chat-log-calendar__nav.is-next:hover .mado-chat-log-calendar__nav-icon,
.mado-chat-log-calendar__nav.is-next:focus .mado-chat-log-calendar__nav-icon,
.mado-chat-log-calendar__nav.is-next:focus-visible .mado-chat-log-calendar__nav-icon {

    transform: translateX(5px);

}

.mado-chat-log-calendar__nav.is-prev .mado-chat-log-calendar__nav-icon {

    transform: rotate(180deg);

}

.mado-chat-log-calendar__nav.is-prev:hover .mado-chat-log-calendar__nav-icon,
.mado-chat-log-calendar__nav.is-prev:focus .mado-chat-log-calendar__nav-icon,
.mado-chat-log-calendar__nav.is-prev:focus-visible .mado-chat-log-calendar__nav-icon {

    transform: rotate(180deg) translateX(5px);

}

.mado-chat-log-calendar__table {

    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;

}

.mado-chat-log-calendar__weekday {

    padding: 8px 6px;
    text-align: center;
    color: #475569;
    font-size: 14px;
    font-weight: 700;

}

.mado-chat-log-calendar__weekday.is-sun {

    color: #dc2626;

}

.mado-chat-log-calendar__weekday.is-sat {

    color: #2563eb;

}

.mado-chat-log-calendar__cell,
.mado-chat-log-calendar__blank {

    padding: 3px;

}

.mado-chat-log-calendar__day {

    display: grid;
    gap: 3px;
    width: 100%;
    min-height: 0;
    aspect-ratio: 1 / 1;
    padding: 8px 6px;
    border: 1px solid transparent;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    text-align: center;
    transition: transform 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;

}

.mado-chat-log-calendar__day:hover {

    transform: translateY(-1px);
    border-color: #bfdbfe;

}

.mado-chat-log-calendar__day.has-logs {

    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);

}

.mado-chat-log-calendar__day.is-empty {

    color: #94a3b8;

}

.mado-chat-log-calendar__day.is-selected {

    background: #2563eb;
    border-color: #2563eb;
    color: #ffffff;

}

.mado-chat-log-calendar__day.is-today {

    border-color: #2563eb;

}

.mado-chat-log-calendar__day-number {

    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;

}

.mado-chat-log-calendar__day-count {

    font-size: 10px;
    line-height: 1.2;

}

.mado-chat-log-calendar__note {

    margin-top: 7px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;

}

@media (max-width: 960px) {

    .mado-chat-log-search-form__controls,
.mado-chat-log-filter-summary {

        flex-direction: column;
        align-items: stretch;

    }

    .mado-chat-log-secondary-grid {

        grid-template-columns: 1fr;

    }

    .mado-chat-log-calendar__expand-button {

        display: none;

    }

    .mado-chat-log-table {

        min-width: 760px;

    }

}

@media (max-width: 640px) {

    .mado-chat-log-search-card,
.mado-chat-log-panel {

        padding: 18px;

    }

    .mado-chat-log-branch-row {

        grid-template-columns: auto 1fr;

    }

    .mado-chat-log-branch-row__count {

        grid-column: 2;
        justify-self: end;

    }

    .mado-chat-log-calendar__day {

        padding: 6px 4px;
        border-radius: 10px;

    }

    .mado-chat-log-calendar__day-number {

        font-size: 14px;

    }

    .mado-chat-log-calendar__day-count {

        font-size: 9px;

    }

}

.mado-chat-log-filter-summary__text {

    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    color: #334155;
    font-size: 14px;
    line-height: 1.6;

}

.mado-chat-log-filter-summary__body {

    display: grid;
    gap: 8px;

}

.mado-chat-log-filter-summary__title {

    color: #0f172a;
    font-size: 14px;
    font-weight: 700;

}

.mado-chat-log-filter-summary__rows {

    display: grid;
    gap: 4px;

}

.mado-chat-log-filter-summary__row {

    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: baseline;

}

.mado-chat-log-filter-summary__row-label {

    color: #64748b;
    font-weight: 700;

}

.mado-chat-log-filter-summary__row-value {

    color: #0f172a;

}

.mado-chat-log-filter-summary__count {

    color: #0f172a;
    font-weight: 700;
    white-space: nowrap;

}

.mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__cell,
.mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__blank {

    height: 80px;

}

.mado-chat-log-calendar__day.is-source-split {

    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 5px;
    width: 100%;
    min-height: 78px;
    aspect-ratio: auto;
    padding: 6px 7px;
    cursor: default;

}

.mado-chat-log-calendar__day.is-source-split:hover {

    transform: none;
    border-color: transparent;

}

.mado-chat-log-calendar__day.is-source-split.is-today {

    border-color: transparent;
    background: var(--mado-chat-log-count-blue-background);
    box-shadow: inset 0 0 0 1px var(--mado-chat-log-count-blue-border);

}

.mado-chat-log-calendar__day.is-future {

    background: #f8fafc;

}

.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__day-number,
.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__day-count {

    color: #94a3b8;
    opacity: 0.4;

}

.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count {

    border-color: #e2e8f0;
    background: #f8fafc;
    color: #94a3b8;
    opacity: 0.4;

}

.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count:hover,
.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count:focus-visible {

    border-color: #cbd5e1;
    background: #f1f5f9;

}

.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count.is-selected {

    border-color: #004e77;
    background: #f8fafc;
    color: #94a3b8;
    opacity: 1;

}

.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count.is-selected .mado-chat-log-calendar__source-icon,
.mado-chat-log-calendar__day.is-future .mado-chat-log-calendar__source-count.is-selected .mado-chat-log-calendar__source-count-value {

    opacity: 0.4;

}

.mado-chat-log-calendar:not(.is-branch-mode) .mado-chat-log-calendar__day.is-source-split .mado-chat-log-calendar__day-number {

    align-self: center;
    color: #64748b;
    line-height: 1;

}

.mado-chat-log-calendar__source-counts {

    display: grid;
    grid-template-columns: 1fr;
    gap: 4px;
    width: 100%;

}

.mado-chat-log-calendar__source-count {

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 26px;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: border-color 0.16s ease, background-color 0.16s ease, transform 0.16s ease;

}

.mado-chat-log-calendar__source-count.is-ai {

    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);

}

.mado-chat-log-calendar__source-count.is-staff {

    background: #f1fbf1;
    color: var(--mado-chat-log-branch-green-text);

}

.mado-chat-log-calendar__source-count:hover,
.mado-chat-log-calendar__source-count:focus-visible {

    border-color: var(--mado-chat-log-count-blue-hover-border);
    background: var(--mado-chat-log-count-blue-hover-background);
    outline: none;

}


.mado-chat-log-calendar__source-count.is-staff:hover,
.mado-chat-log-calendar__source-count.is-staff:focus-visible {

    border-color: var(--mado-chat-log-branch-green-border);
    background: var(--mado-chat-log-branch-green-background);

}

.mado-chat-log-calendar__source-count:focus {

    outline: none;

}

.mado-chat-log-calendar__source-count:active {

    transform: translateY(1px);

}

.mado-chat-log-calendar__source-count.is-selected {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-selected-background);
    box-shadow: inset 0 0 0 1px rgba(6, 191, 181, 0.10);

}

.mado-chat-log-calendar__source-count.is-ai.is-selected {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-selected-background);
    color: var(--mado-chat-log-count-blue-hover-text);
    box-shadow: inset 0 0 0 1px rgba(6, 191, 181, 0.10);

}

.mado-chat-log-calendar__source-count.is-staff.is-selected {

    border-color: #3aae39;
    background: #e6f7e5;
    color: var(--mado-chat-log-branch-green-text);
    box-shadow: inset 0 0 0 1px rgba(58, 174, 57, 0.12);

}

.mado-chat-log-calendar__source-icon {

    display: block;
    flex: 0 0 auto;
    width: 12px;
    height: 12px;

}

.mado-chat-log-source-badge__icon,
.mado-chat-log-detail__section-icon {

    display: block;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;

}

.mado-chat-log-calendar__source-count-value {

    color: currentColor;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;

}

.mado-chat-log-source-badge {

    display: inline-flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: 6px;
    width: fit-content;
    min-height: 26px;
    padding: 4px 8px;
    border: 1px solid var(--mado-chat-log-count-blue-border);
    border-radius: 999px;
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;

}

.mado-chat-log-source-badge.is-ai {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-background);
    color: var(--mado-chat-log-count-blue-text);

}

.mado-chat-log-source-badge.is-staff {

    border-color: #a7d9a3;
    background: #eef9ed;
    color: #2f8f2f;

}

.mado-chat-log-source-badge > span:last-child {

    display: inline-block;
    white-space: nowrap;

}

.mado-chat-log-table__reply-head {

    display: flex;
    align-items: flex-start;
    flex: 0 0 auto;
    margin-bottom: 0;

}

.mado-chat-log-table__reply-body {

    display: flex;
    align-items: flex-start;
    gap: 10px;

}

.mado-chat-log-table__snippet--reply {

    flex: 1 1 auto;
    min-width: 0;

}

.mado-chat-log-table__cell--ticket-number {

    font-size: 14px;
    line-height: 1.5;

}

.mado-chat-log-table__row.is-even,
.mado-chat-log-table__detail-row.is-even {

    background: #fbfdff;

}

.mado-chat-log-table__row:hover,
.mado-chat-log-table__row:hover + .mado-chat-log-table__detail-row {

    background: #f8fbff;

}

.mado-chat-log-table__row .mado-chat-log-table__cell {

    border-bottom: 0;
    padding-bottom: 10px;

}

.mado-chat-log-table__detail-cell {

    padding: 0 16px 14px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: top;

}

.mado-chat-log-inline-detail {

    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;

}

.mado-chat-log-inline-detail__grid {

    display: grid;
    grid-template-columns: minmax(0, 11fr) minmax(0, 11fr) minmax(0, 39fr) minmax(0, 39fr);
    gap: 0;
    min-width: 0;

}

.mado-chat-log-inline-detail__item.is-url .mado-chat-log-inline-detail__value,
.mado-chat-log-inline-detail__item.is-qa .mado-chat-log-inline-detail__value {

    overflow: hidden;

}

.mado-chat-log-inline-detail__item.is-url .mado-chat-log-inline-detail__value a {

    display: block;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}

.mado-chat-log-inline-detail__item {

    display: flex;
    align-items: center;
    gap: 5px;
    min-width: 0;
    min-height: 34px;
    padding: 5px 9px;
    border-left: 1px solid #d8e3ed;
    box-sizing: border-box;

}

.mado-chat-log-inline-detail__item:first-child {

    border-left: 0;

}

.mado-chat-log-inline-detail__item.is-evidence,
.mado-chat-log-inline-detail__item.is-ai-usage {

    background: #eef9ed;

}

.mado-chat-log-inline-detail__item.is-url {

    background: var(--mado-chat-log-count-blue-background);

}

.mado-chat-log-inline-detail__item.is-qa {

    background: #ffffff;

}

.mado-chat-log-inline-detail__label {

    flex: 0 0 auto;
    margin: 0;
    color: #475569;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;

}

.mado-chat-log-inline-detail__separator {

    margin-left: 2px;

}

.mado-chat-log-inline-detail__value {

    flex: 1 1 auto;
    min-width: 0;
    color: #0f172a;
    font-size: 13px;
    line-height: 1.45;
    word-break: break-word;

}

.mado-chat-log-inline-detail__value a {

    color: #0369a1;
    text-decoration: underline;

}

.mado-chat-log-inline-detail__qa-list {

    display: grid;
    gap: 7px;
    min-width: 0;

}

.mado-chat-log-inline-detail__value .mado-chat-log-inline-detail__qa-link {

    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 7px;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--mado-brand-accent-border, #b9eeea);
    border-radius: 10px;
    background: var(--mado-brand-accent-soft, #e6fbf9);
    color: #0f172a;
    text-decoration: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;

}

.mado-chat-log-inline-detail__value .mado-chat-log-inline-detail__qa-link:hover,
.mado-chat-log-inline-detail__value .mado-chat-log-inline-detail__qa-link:focus-visible {

    border-color: var(--mado-brand-accent, #06bfb5);
    background: #ffffff;
    color: #0f172a;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(15, 118, 110, 0.12);
    outline: 0;

}

.mado-chat-log-inline-detail__value .mado-chat-log-inline-detail__qa-link.is-static {

    cursor: default;

}

.mado-chat-log-inline-detail__qa-id {

    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    border-radius: 999px;
    background: #ffffff;
    color: var(--mado-brand-accent-text, #129f9e);
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;

}

.mado-chat-log-inline-detail__qa-title {

    min-width: 0;
    color: #172033;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.5;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

}

.mado-chat-log-inline-detail__ai-usage {

    color: #0f172a;
    font-weight: 600;

}

.mado-chat-log-inline-detail__ai-usage.is-used,
.mado-chat-log-inline-detail__ai-usage.is-not-used {

    color: #0f172a;

}

.mado-chat-log-inline-detail__muted {

    color: #64748b;

}

.mado-chat-log-inline-detail__error {

    color: #b91c1c;

}

.mado-chat-log-detail__message.is-ai-answer,
.mado-chat-log-detail__message.is-staff-answer {

    border-left: 3px solid #004e77;
    padding-left: 10px;

}

.mado-chat-log-calendar__expand-button {

    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 32px;
    margin-left: auto;
    padding: 6px 10px;
    border: 1px solid #111827;
    border-radius: 999px;
    background: #ffffff;
    color: #111827;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;

}

.mado-chat-log-calendar__expand-button:hover,
.mado-chat-log-calendar__expand-button:focus-visible {

    border-color: #111827;
    background: #111827;
    color: #ffffff;

}

.mado-chat-log-calendar__expand-button:focus {

    outline: none;

}

.mado-chat-log-calendar__expand-button:focus-visible {

    outline: 2px solid rgba(17, 24, 39, 0.2);
    outline-offset: 2px;

}

.mado-chat-log-calendar__expand-button:active {

    transform: translateY(1px);

}

.mado-chat-log-calendar__expand-icon {

    display: block;
    flex: 0 0 auto;
    width: 14px;
    height: 14px;

}

.mado-chat-log-calendar-backdrop[hidden] {

    display: none;

}

.mado-chat-log-calendar-backdrop {

    position: fixed;
    inset: 0;
    z-index: 10020;
    background: rgba(15, 23, 42, 0.54);

}

body.mado-chat-log-calendar-expanded {

    overflow: hidden;

}

.mado-chat-log-calendar-panel.is-expanded {

    position: fixed;
    inset: clamp(12px, 3vh, 30px) clamp(12px, 3vw, 44px);
    z-index: 10021;
    width: auto;
    max-width: none;
    max-height: none;
    margin: 0;
    overflow: auto;
    padding: clamp(18px, 2.4vw, 30px);
    border-color: #b8d8e8;
    background: #ffffff;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.28);

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-panel__header {

    margin-bottom: 12px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-panel__title {

    font-size: 21px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__month {

    font-size: 22px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__cell,
.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__blank {

    height: 124px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__day.is-source-split {

    min-height: 122px;
    gap: 10px;
    padding: 12px 10px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__day-number {

    font-size: 16px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__source-counts {

    gap: 7px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__source-count {

    min-height: 36px;
    gap: 8px;
    padding: 7px 10px;
    font-size: 13px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__source-icon {

    width: 16px;
    height: 16px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__source-count-value {

    font-size: 15px;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar__note {

    font-size: 13px;

}

@media (max-width: 1120px) {

    .mado-chat-log-top-grid {

        grid-template-columns: minmax(0, 1fr);
        align-items: start;

    }

    .mado-chat-log-top-grid > .mado-chat-log-panel {

        height: auto;

    }

}

@media (max-width: 760px) {

    .mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__cell,
.mado-chat-log-calendar.is-source-split .mado-chat-log-calendar__blank {

        height: 72px;

    }

    .mado-chat-log-calendar__day.is-source-split {

        min-height: 70px;
        gap: 4px;
        padding: 5px 4px;

    }

    .mado-chat-log-calendar__source-count {

        gap: 4px;
        min-height: 23px;
        padding: 3px 4px;
        font-size: 11px;

    }

    .mado-chat-log-calendar__source-icon {

        width: 11px;
        height: 11px;

    }

    .mado-chat-log-calendar__source-count-value {

        font-size: 13px;

    }

}

.mado-chat-log-calendar__mode-pill {

    appearance: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    margin: 0 0 -1px;
    padding: 8px 16px;
    border: 1px solid #c3d1df;
    border-bottom-color: #dbe4ee;
    border-radius: 11px 11px 0 0;
    background: #ffffff;
    color: #334155;
    font: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
    box-shadow: none;
    text-shadow: none;
    white-space: nowrap;
    transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;

}

.mado-chat-log-calendar__mode-pill:hover,
.mado-chat-log-calendar__mode-pill:focus-visible {

    color: #334155;
    outline: none;

}

.mado-chat-log-calendar__mode-pill.is-chat:hover,
.mado-chat-log-calendar__mode-pill.is-chat:focus-visible {

    border-color: var(--mado-chat-log-count-blue-border);
    background: var(--mado-chat-log-count-blue-background);

}

.mado-chat-log-calendar__mode-pill.is-branch:hover,
.mado-chat-log-calendar__mode-pill.is-branch:focus-visible {

    border-color: var(--mado-chat-log-branch-green-border);
    background: var(--mado-chat-log-branch-green-background);

}

.mado-chat-log-calendar__mode-pill.is-chat.is-active,
.mado-chat-log-calendar__mode-pill.is-chat.is-active:hover,
.mado-chat-log-calendar__mode-pill.is-chat.is-active:focus-visible {

    border-color: var(--mado-chat-log-count-blue-border);
    border-bottom-color: var(--mado-chat-log-count-blue-background);
    background: var(--mado-chat-log-count-blue-background);
    color: #334155;
    box-shadow: none;

}

.mado-chat-log-calendar__mode-pill.is-branch.is-active,
.mado-chat-log-calendar__mode-pill.is-branch.is-active:hover,
.mado-chat-log-calendar__mode-pill.is-branch.is-active:focus-visible {

    border-color: var(--mado-chat-log-branch-green-border);
    border-bottom-color: var(--mado-chat-log-branch-green-background);
    background: var(--mado-chat-log-branch-green-background);
    color: #334155;
    box-shadow: none;

}

.mado-chat-log-calendar-panel.is-expanded .mado-chat-log-calendar-mode-tabs {

    position: static;
    margin: 0 0 16px;
    padding: 0;
    border-radius: 0;
    background: transparent;

}

.mado-chat-log-branch-filter .mado-chat-log-branch-chip,
.mado-chat-log-branch-filter .mado-chat-log-branch-chip:hover,
.mado-chat-log-branch-filter .mado-chat-log-branch-chip.is-active {

    border-color: var(--mado-chat-log-branch-green-border);
    background: var(--mado-chat-log-branch-green-background);
    color: var(--mado-chat-log-branch-green-text);
    font-size: 13px;
    font-weight: 500;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.has-logs {

    background: #ecfdf5;
    color: #15803d;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-selected {

    background: #16a34a;
    border-color: #16a34a;
    color: #ffffff;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-today {

    border-color: #16a34a;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-future {

    border-color: transparent;
    background: #f8fafc;
    color: #94a3b8;
    opacity: 0.4;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-future.is-selected {

    border-color: #16a34a;
    background: #f8fafc;
    color: #94a3b8;
    opacity: 1;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-future.is-selected .mado-chat-log-calendar__day-number,
.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-future.is-selected .mado-chat-log-calendar__day-count {

    opacity: 0.4;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day-count {

    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    min-height: 26px;
    box-sizing: border-box;
    padding: 4px 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    background: var(--mado-chat-log-branch-green-background);
    color: var(--mado-chat-log-branch-green-text);
    font-size: 12px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;

}

.mado-chat-log-calendar.is-branch-mode .mado-chat-log-calendar__day.is-selected .mado-chat-log-calendar__day-count {

    background: rgba(255, 255, 255, 0.20);
    color: #ffffff;

}

.mado-chat-log-branch-list {

    display: grid;
    gap: 14px;
    max-height: none;
    overflow: visible;
    padding-right: 0;

}

.mado-chat-log-branch-row {

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    width: 100%;
    border: 0;
    border-radius: 12px;
    color: #111827;
    cursor: pointer;
    text-align: left;
    transition: background-color 0.18s ease, transform 0.18s ease;
    gap: 8px;
    padding: 9px 10px;
    background: #ffffff;

}

.mado-chat-log-branch-row__label {

    min-width: 0;
    font-size: 14px;
    font-weight: 400;
    color: inherit;
    line-height: 1.3;

}

.mado-chat-log-branch-row__rank {

    font-size: 14px;
    font-weight: 500;
    color: inherit;

}

.mado-chat-log-branch-row:hover,
.mado-chat-log-branch-row:focus-visible {

    transform: translateY(-1px);
    background: var(--mado-chat-log-branch-green-background);
    color: #111827;
    outline: none;

}

.mado-chat-log-branch-row.is-active {

    background: var(--mado-chat-log-branch-green-background);
    color: #111827;
    box-shadow: none;

}

.mado-chat-log-branch-row__count {

    font-weight: 500;
    white-space: nowrap;
    color: inherit;
    font-size: 15px;

}

.mado-chat-log-table {

    width: 100%;
    border-collapse: collapse;
    min-width: 760px;

}

@media (max-width: 720px) {

    .mado-chat-log-search-form__controls {

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

    }

    .mado-chat-log-search-input {

        grid-column: 1 / -1;

    }

    .mado-chat-log-action-button {

        width: 100%;

    }

    .mado-chat-log-filter-summary__reset {

        width: auto;

    }

}

@media (max-width: 640px) {

    .mado-chat-log-calendar-panel.is-expanded {

        inset: 8px;
        padding: 14px;
        border-radius: 14px;

    }

    .mado-chat-log-inline-detail__grid {

        grid-template-columns: 1fr;
        gap: 0;

    }

    .mado-chat-log-inline-detail__item,
    .mado-chat-log-inline-detail__item:first-child {

        border-left: 0;
        border-top: 1px solid #d8e3ed;

    }

    .mado-chat-log-inline-detail__item:first-child {

        border-top: 0;

    }

}

.mado-chat-log-table__cell--time {

    font-size: 15px;

}

.mado-chat-log-table__snippet {

    color: #0f172a;
    line-height: 1.7;
    white-space: normal;
    word-break: break-word;
    font-size: 15px;

}


/* 2026-08-19: calendar/trend visual lock. Keep both panels on the same baseline. */
.mado-chat-log-top-grid > .mado-chat-log-trend-panel .mado-chat-log-panel__header {
    margin-bottom: 7px;
}

@media (min-width: 1121px) {
    .mado-chat-log-top-grid > .mado-chat-log-calendar-panel,
    .mado-chat-log-top-grid > .mado-chat-log-trend-panel {
        align-self: stretch;
        height: 100%;
    }
}
