.ygmr-chat-shell {
    width: 100%;
}

.ygmr-chat-app {
    display: grid;
    grid-template-columns: 320px minmax(0, 1fr);
    min-height: 820px;
    border: 1px solid #e5e7eb;
    border-radius: 28px;
    overflow: hidden;
    background: #ffffff;
}

.ygmr-chat-sidebar {
    display: flex;
    flex-direction: column;
    background: #fcfdff;
    border-right: 1px solid #e5e7eb;
    min-width: 0;
}

.ygmr-chat-sidebar-top {
    padding: 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ygmr-chat-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.ygmr-chat-brand-mark {
    width: 46px;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #005a87;
    font-weight: 800;
    font-size: 14px;
    background: #ffffff;
    flex-shrink: 0;
}

.ygmr-chat-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
}

.ygmr-chat-brand-text strong {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
}

.ygmr-chat-brand-text span {
    margin-top: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
}

.ygmr-chat-new-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 999px;
    border: 1px solid #005a87;
    background: #005a87;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s ease;
}

.ygmr-chat-new-btn:hover {
    background: #014a6f;
    border-color: #014a6f;
}

.ygmr-chat-search-wrap {
    padding: 18px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.ygmr-chat-search {
    width: 100%;
    height: 46px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 0 16px;
    background: #ffffff;
    outline: none;
    font-size: 14px;
    color: #0f172a;
}

.ygmr-chat-search:focus {
    border-color: #005a87;
}

.ygmr-chat-history {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
}

.ygmr-chat-history-item {
    width: 100%;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #ffffff;
    text-align: left;
    padding: 16px;
    cursor: pointer;
    display: block;
    transition: 0.2s ease;
}

.ygmr-chat-history-item + .ygmr-chat-history-item {
    margin-top: 12px;
}

.ygmr-chat-history-item:hover,
.ygmr-chat-history-item.is-active {
    border-color: #c7d7e2;
    background: #f8fbfd;
}

.ygmr-chat-history-title {
    display: block;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.4;
}

.ygmr-chat-history-meta {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #64748b;
    font-weight: 500;
}

.ygmr-chat-sidebar-bottom {
    padding: 16px;
    border-top: 1px solid #e5e7eb;
}

.ygmr-chat-status-card {
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 16px;
    background: #ffffff;
}

.ygmr-chat-status-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #005a87;
    background: #f2f8fb;
    border: 1px solid #dbe8ef;
}

.ygmr-chat-status-card p {
    margin: 10px 0 0;
    color: #64748b;
    font-size: 13px;
    line-height: 1.6;
}

.ygmr-chat-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    background: #ffffff;
}

.ygmr-chat-main-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px 28px;
    border-bottom: 1px solid #e5e7eb;
}

.ygmr-chat-conversation-meta h2 {
    margin: 0 0 6px;
    font-size: 24px;
    font-weight: 800;
    line-height: 1.1;
    color: #0f172a;
}

.ygmr-chat-conversation-meta p {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.ygmr-chat-top-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.ygmr-chat-outline-btn,
.ygmr-chat-primary-btn,
.ygmr-chat-send-btn,
.ygmr-chat-attach-btn,
.ygmr-chat-chip {
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-family: inherit;
    transition: 0.2s ease;
}

.ygmr-chat-outline-btn {
    min-height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
}

.ygmr-chat-outline-btn:hover {
    border-color: #005a87;
    color: #005a87;
}

.ygmr-chat-primary-btn {
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: #005a87;
    border-color: #005a87;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
}

.ygmr-chat-primary-btn:hover,
.ygmr-chat-send-btn:hover {
    background: #014a6f;
    border-color: #014a6f;
    color: #ffffff;
}

.ygmr-chat-messages {
    flex: 1;
    padding: 28px;
    overflow-y: auto;
    background: linear-gradient(to bottom, rgba(255,255,255,0.98), rgba(255,255,255,0.98));
}

.ygmr-chat-day-separator {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

.ygmr-chat-day-separator span {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 14px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    color: #64748b;
    background: #ffffff;
}

.ygmr-chat-row {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    margin-bottom: 18px;
}

.ygmr-chat-row-user {
    justify-content: flex-end;
}

.ygmr-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: #005a87;
    flex-shrink: 0;
}

.ygmr-chat-avatar-user {
    color: #0f172a;
}

.ygmr-chat-bubble-wrap {
    max-width: min(78%, 760px);
}

.ygmr-chat-bubble {
    border-radius: 22px;
    padding: 16px 18px;
    font-size: 15px;
    line-height: 1.7;
    border: 1px solid #e5e7eb;
    word-break: break-word;
}

.ygmr-chat-bubble-ai {
    background: #ffffff;
    color: #0f172a;
}

.ygmr-chat-bubble-user {
    background: #f7fbfd;
    color: #0f172a;
    border-color: #d7e5ed;
}

.ygmr-chat-bubble-meta {
    margin-top: 8px;
    font-size: 12px;
    color: #94a3b8;
    padding: 0 4px;
}

.ygmr-chat-row-user .ygmr-chat-bubble-meta {
    text-align: right;
}

.ygmr-chat-input-panel {
    padding: 20px 28px 24px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.ygmr-chat-quick-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.ygmr-chat-chip {
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.ygmr-chat-chip:hover {
    border-color: #005a87;
    color: #005a87;
}

.ygmr-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 24px;
    padding: 12px;
    background: #ffffff;
}

.ygmr-chat-input {
    flex: 1;
    border: 0;
    outline: none;
    resize: none;
    min-height: 56px;
    max-height: 180px;
    padding: 8px 10px;
    font-size: 15px;
    line-height: 1.6;
    color: #0f172a;
    background: transparent;
}

.ygmr-chat-form-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.ygmr-chat-attach-btn {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    font-size: 24px;
    line-height: 1;
}

.ygmr-chat-send-btn {
    min-height: 46px;
    padding: 0 18px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 700;
    background: #005a87;
    border-color: #005a87;
    color: #ffffff;
}

.ygmr-chat-disclaimer {
    margin: 12px 2px 0;
    color: #94a3b8;
    font-size: 12px;
    line-height: 1.6;
}

@media (max-width: 1180px) {
    .ygmr-chat-app {
        grid-template-columns: 280px minmax(0, 1fr);
    }

    .ygmr-chat-bubble-wrap {
        max-width: 88%;
    }
}

@media (max-width: 960px) {
    .ygmr-chat-app {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .ygmr-chat-sidebar {
        border-right: 0;
        border-bottom: 1px solid #e5e7eb;
    }

    .ygmr-chat-main-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .ygmr-chat-top-actions {
        width: 100%;
    }
}

@media (max-width: 680px) {
    .ygmr-chat-main-top,
    .ygmr-chat-messages,
    .ygmr-chat-input-panel,
    .ygmr-chat-sidebar-top,
    .ygmr-chat-search-wrap {
        padding-left: 16px;
        padding-right: 16px;
    }

    .ygmr-chat-sidebar-bottom,
    .ygmr-chat-history {
        padding-left: 12px;
        padding-right: 12px;
    }

    .ygmr-chat-bubble-wrap {
        max-width: 100%;
    }

    .ygmr-chat-row {
        gap: 8px;
    }

    .ygmr-chat-avatar {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }

    .ygmr-chat-form {
        flex-direction: column;
        align-items: stretch;
    }

    .ygmr-chat-form-actions {
        justify-content: space-between;
    }
}