.itfv3-shell__sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px;
    border-right: 1px solid #dcdcde;
    background: #f6f7f7;
    min-width: 0;
}

.itfv3-shell__brand {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.itfv3-shell__lab-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 40px;
    padding: 9px 12px;
    border: 1px solid #8c8f94;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-shell__lab-link:hover {
    background: #eef4fb;
    border-color: #2271b1;
    color: #135e96;
}

.itfv3-shell__new-chat {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 44px;
    padding: 10px 14px;
    border: 1px solid #2271b1;
    background: #2271b1;
    color: #ffffff;
    cursor: pointer;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.itfv3-shell__new-chat:hover {
    background: #135e96;
    border-color: #135e96;
}

.itfv3-shell__new-chat:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.itfv3-shell__stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
}

.itfv3-shell__stat {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.itfv3-shell__stat:hover {
    background: #eef4fb;
    border-color: #2271b1;
}

.itfv3-shell__stat.is-active,
.itfv3-shell__stat[aria-current="true"] {
    background: #e7f1ff;
    border-color: #2271b1;
    box-shadow: inset 0 0 0 1px #2271b1;
}

.itfv3-shell__stat-label {
    min-width: 0;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.itfv3-shell__stat-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    min-width: 28px;
    min-height: 28px;
    padding: 0 8px;
    border-radius: 999px;
    background: #f0f0f1;
    color: #1d2327;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.itfv3-shell__stat.is-active .itfv3-shell__stat-count,
.itfv3-shell__stat[aria-current="true"] .itfv3-shell__stat-count {
    background: #2271b1;
    color: #ffffff;
}

.itfv3-shell__search {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.itfv3-shell__search-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 140px;
    gap: 8px;
    align-items: stretch;
}

.itfv3-shell__search-field {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.itfv3-shell__search-input {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
}

.itfv3-shell__search-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.itfv3-shell__search-clear {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.itfv3-shell__search-clear:hover {
    background: #eef4fb;
    border-color: #2271b1;
}

.itfv3-shell__search-meta {
    font-size: 12px;
    line-height: 1.3;
    color: #50575e;
}

.itfv3-shell__sort {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.itfv3-shell__sort-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.itfv3-shell__sort-select {
    display: block;
    width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
    cursor: pointer;
}

.itfv3-shell__sort-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.itfv3-shell__theme-panel {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
}

.itfv3-shell__theme-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.itfv3-shell__theme-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
    font-size: 13px;
    font-weight: 600;
    color: #1d2327;
}

.itfv3-shell__theme-select {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.4;
}

.itfv3-shell__theme-select:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 1px #2271b1;
}

.itfv3-shell__theme-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.itfv3-shell__theme-apply,
.itfv3-shell__theme-clear {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    cursor: pointer;
    font-size: 14px;
    transition: background .15s ease, border-color .15s ease, opacity .15s ease;
}

.itfv3-shell__theme-apply:hover,
.itfv3-shell__theme-clear:hover {
    background: #eef4fb;
    border-color: #2271b1;
}

.itfv3-shell__theme-apply:disabled,
.itfv3-shell__theme-clear:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.itfv3-shell__history {
    flex: 0 0 auto;
    padding: 10px;
    border: 1px solid #dcdcde;
    background: #ffffff;
    overflow: auto;
    overscroll-behavior: contain;
    min-height: 220px;
    max-height: clamp(260px, 34vh, 420px);
    border-radius: 10px;
}

.itfv3-history-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.itfv3-history-list__item {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 6px;
    margin: 0;
    padding: 0;
}

.itfv3-history-list__button {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    width: 100%;
    padding: 10px 11px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #f6f7f7;
    color: #1d2327;
    text-align: left;
    font-size: 14px;
    line-height: 1.35;
    cursor: pointer;
    word-break: break-word;
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.itfv3-history-list__button:hover {
    background: #eef4fb;
    border-color: #2271b1;
}

.itfv3-history-list__item.is-active .itfv3-history-list__button,
.itfv3-history-list__button.is-active,
.itfv3-history-list__button[aria-current="true"] {
    background: #e7f1ff;
    border-color: #2271b1;
    box-shadow: inset 0 0 0 1px #2271b1;
}

.itfv3-history-list__title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    color: #1d2327;
}

.itfv3-history-list__preview {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-size: 12px;
    line-height: 1.35;
    color: #50575e;
}

.itfv3-history-list__actions {
    position: relative;
    display: flex;
    flex: 0 0 auto;
    align-items: stretch;
}

.itfv3-history-list__menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    min-width: 40px;
    min-height: 40px;
    padding: 0;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2327;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    transition: background .15s ease, border-color .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-history-list__menu-toggle:hover {
    background: #eef4fb;
    border-color: #2271b1;
    color: #2271b1;
}

.itfv3-history-list__menu-toggle[aria-expanded="true"] {
    background: #e7f1ff;
    border-color: #2271b1;
    color: #2271b1;
}

.itfv3-history-list__menu-toggle:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.itfv3-history-list__menu[hidden] {
    display: none !important;
}

.itfv3-history-list__menu {
    position: absolute;
    top: calc(100% + 4px);
    right: 0;
    z-index: 25;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 152px;
    padding: 6px;
    border: 1px solid #dcdcde;
    border-radius: 10px;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.itfv3-history-list__menu-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    min-height: 38px;
    padding: 7px 9px;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #1d2327;
    text-align: left;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, opacity .15s ease;
}

.itfv3-history-list__menu-item:hover {
    background: #eef4fb;
    color: #135e96;
}

.itfv3-history-list__menu-item--danger {
    color: #d63638;
}

.itfv3-history-list__menu-item--danger:hover {
    background: #fcf0f1;
    color: #b32d2e;
}

@media (max-width: 782px) {
    .itfv3-shell__sidebar {
        gap: 12px;
        padding: 14px;
        border-right: 0;
        border-bottom: 1px solid #dcdcde;
    }

    .itfv3-shell__history {
        min-height: 180px;
        max-height: 34vh;
    }

    .itfv3-history-list__item {
        gap: 6px;
    }

    .itfv3-history-list__button {
        padding: 10px 10px;
    }

    .itfv3-history-list__menu-toggle {
        width: 38px;
        min-width: 38px;
        min-height: 38px;
        font-size: 17px;
    }

    .itfv3-history-list__menu {
        min-width: 148px;
        padding: 5px;
    }

    .itfv3-history-list__menu-item {
        min-height: 37px;
        padding: 7px 8px;
    }

    .itfv3-shell__theme-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .itfv3-shell__sidebar {
        padding: 12px;
    }

    .itfv3-shell__stats {
        grid-template-columns: 1fr;
    }

    .itfv3-shell__search-toolbar {
        grid-template-columns: minmax(0, 1fr) 132px;
    }

    .itfv3-shell__search-field {
        flex-direction: column;
        align-items: stretch;
    }

    .itfv3-shell__search-clear {
        width: 100%;
    }

    .itfv3-shell__history {
        max-height: 30vh;
        padding: 8px;
    }

    .itfv3-history-list__title {
        font-size: 13px;
    }

    .itfv3-history-list__preview {
        font-size: 11px;
    }

    .itfv3-history-list__menu {
        min-width: 144px;
    }

    .itfv3-history-list__menu-item {
        font-size: 12px;
    }
}
/* ITFV3_HISTORY_SEQ_START */
.itfv3-history-list__title {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    min-width: 0;
}

.itfv3-history-list__title-main {
    min-width: 0;
}

.itfv3-history-list__seq {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 18px;
    padding: 0 6px;
    border: 1px solid rgba(56, 189, 248, 0.24);
    border-radius: 999px;
    background: rgba(56, 189, 248, 0.10);
    color: #9ed8ff;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.02em;
    opacity: 0.92;
    vertical-align: middle;
}

.itfv3-history-list__item.is-active .itfv3-history-list__seq,
.itfv3-history-list__button.is-active .itfv3-history-list__seq,
.itfv3-history-list__button[aria-current="true"] .itfv3-history-list__seq {
    border-color: rgba(56, 189, 248, 0.42);
    background: rgba(56, 189, 248, 0.18);
    color: #d8f0ff;
}
/* ITFV3_HISTORY_SEQ_END */
