.tg-chat-launcher {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99990;
    display: none;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 10px 14px;
    border: 0;
    border-radius: 999px;
    background: #007aff;
    color: #fff;
    box-shadow: 0 14px 34px rgba(0, 122, 255, 0.25), 0 8px 18px rgba(15, 23, 42, 0.12);
    cursor: pointer;
    font-family: "Open Sans", Arial, sans-serif;
    font-size: 13px;
    font-weight: 800;
}

.tg-chat-launcher.tg-chat-launcher-visible {
    display: inline-flex;
}

.tg-chat-backdrop {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: none;
    background: rgba(15, 23, 42, 0.42);
}

.tg-chat-popup-mode .tg-chat-backdrop {
    display: block;
}

.tg-chat-launcher svg,
.tg-chat-panel svg {
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
}

.tg-chat-panel {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 99991;
    display: none;
    width: min(420px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 36px));
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.22), 0 8px 22px rgba(15, 23, 42, 0.12);
    color: #111827;
    font-family: "Open Sans", Arial, sans-serif;
}

.tg-chat-panel.tg-chat-panel-open {
    display: flex;
    flex-direction: column;
}

.tg-chat-popup-mode .tg-chat-panel {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: min(440px, calc(100vw - 32px));
    height: min(680px, calc(100vh - 48px));
    transform: translate(-50%, -50%);
}

body.tg-chat-popup-open {
    overflow: hidden;
}

.tg-chat-standalone-page {
    margin: 0;
    overflow: hidden;
    background: #f8fafc;
}

.tg-chat-standalone-mode .tg-chat-launcher,
.tg-chat-standalone-mode .tg-chat-backdrop,
.tg-chat-standalone-mode .tg-chat-popout {
    display: none;
}

.tg-chat-standalone-mode .tg-chat-panel {
    position: fixed;
    inset: 0;
    width: auto;
    height: auto;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.tg-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px;
    background: #007aff;
    color: #fff;
}

.tg-chat-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.tg-chat-title-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.16);
}

.tg-chat-title-avatar {
    background: #0f172a;
    color: #fff;
    font-size: 17px;
    line-height: 1;
    font-weight: 800;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
}

.tg-chat-title strong {
    display: block;
    overflow: hidden;
    max-width: 210px;
    font-size: 17px;
    line-height: 21px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tg-chat-status {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 11px;
    font-weight: 700;
}

.tg-chat-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

.tg-chat-close,
.tg-chat-popout,
.tg-chat-back,
.tg-chat-end {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    cursor: pointer;
}

.tg-chat-close,
.tg-chat-popout,
.tg-chat-back {
    width: 36px;
}

.tg-chat-end {
    gap: 6px;
    padding: 0 10px;
    font-size: 11px;
    font-weight: 800;
}

.tg-chat-close:hover,
.tg-chat-popout:hover,
.tg-chat-back:hover,
.tg-chat-end:hover {
    background: rgba(255, 255, 255, 0.22);
}

.tg-chat-end:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

.tg-chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 18px 16px;
    background: #f8fafc;
}

.tg-chat-empty,
.tg-chat-error,
.tg-chat-ended,
.tg-chat-loading {
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    font-weight: 600;
    line-height: 20px;
}

.tg-chat-error {
    border-color: #fecaca;
    color: #b91c1c;
    background: #fff7f7;
}

.tg-chat-ended {
    border-color: #bfdbfe;
    color: #1d4ed8;
    background: #eff6ff;
}

.tg-chat-start {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tg-chat-start-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: #007aff;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.18);
}

.tg-chat-start-copy strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    line-height: 22px;
    font-weight: 800;
}

.tg-chat-start-copy p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
}

.tg-chat-start-list {
    display: grid;
    gap: 8px;
    grid-column: 1 / -1;
}

.tg-chat-start-list span {
    position: relative;
    display: block;
    padding-left: 18px;
    color: #334155;
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
}

.tg-chat-start-list span::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.12);
}

.tg-chat-start-hint {
    grid-column: 1 / -1;
    padding: 10px 12px;
    border-radius: 12px;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: 12px;
    line-height: 18px;
    font-weight: 800;
}

.tg-chat-waiting {
    display: grid;
    gap: 14px;
    width: 100%;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tg-chat-waiting-top {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.tg-chat-waiting-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 14px;
    background: #007aff;
    color: #fff;
    box-shadow: 0 10px 20px rgba(0, 122, 255, 0.18);
}

.tg-chat-waiting-copy strong {
    display: block;
    color: #0f172a;
    font-size: 16px;
    line-height: 22px;
    font-weight: 800;
}

.tg-chat-waiting-copy p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
}

.tg-chat-waiting-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
}

.tg-chat-waiting-meta strong {
    color: #0f172a;
    font-size: 14px;
    font-weight: 800;
}

.tg-chat-waiting-message {
    padding: 12px;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    background: #f8fbff;
}

.tg-chat-waiting-message span {
    display: block;
    margin-bottom: 5px;
    color: #64748b;
    font-size: 11px;
    line-height: 16px;
    font-weight: 800;
}

.tg-chat-waiting-message p {
    margin: 0;
    color: #1f2937;
    font-size: 13px;
    line-height: 19px;
    font-weight: 600;
    overflow-wrap: anywhere;
}

.tg-chat-overview {
    display: grid;
    gap: 16px;
}

.tg-chat-overview-hero {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #f8fbff 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tg-chat-overview-new {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 12px;
    background: #007aff;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    line-height: 18px;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(0, 122, 255, 0.18);
}

.tg-chat-overview-new:hover {
    background: #006ee6;
}

.tg-chat-overview-list {
    display: grid;
    gap: 9px;
    grid-column: 1 / -1;
}

.tg-chat-overview-list > strong {
    color: #0f172a;
    font-size: 13px;
    line-height: 18px;
    font-weight: 800;
}

.tg-chat-overview-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    padding: 12px;
    border: 1px solid #e5e7eb;
    border-radius: 14px;
    background: #fff;
    color: #111827;
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.tg-chat-overview-item:hover {
    border-color: #bfdbfe;
    background: #f8fbff;
}

.tg-chat-overview-item-main {
    display: grid;
    gap: 3px;
    min-width: 0;
}

.tg-chat-overview-item-main strong {
    overflow: hidden;
    color: #0f172a;
    font-size: 13px;
    line-height: 18px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tg-chat-overview-item-main small {
    color: #64748b;
    font-size: 11px;
    line-height: 16px;
    font-weight: 700;
}

.tg-chat-overview-badge {
    flex: 0 0 auto;
    padding: 5px 8px;
    border-radius: 999px;
    font-size: 10px;
    line-height: 14px;
    font-weight: 800;
}

.tg-chat-overview-badge-active {
    background: #dcfce7;
    color: #15803d;
}

.tg-chat-overview-badge-closed {
    background: #e2e8f0;
    color: #475569;
}

.tg-chat-overview-empty {
    padding: 14px;
    border: 1px dashed #cbd5e1;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.68);
    color: #64748b;
    font-size: 12px;
    line-height: 18px;
    font-weight: 700;
    text-align: center;
}

.tg-chat-overview-hero .tg-chat-closed {
    margin-bottom: 0;
    box-shadow: none;
}

.tg-chat-closed {
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 14px;
    padding: 18px;
    margin-bottom: 14px;
    border: 1px solid #fed7aa;
    border-radius: 16px;
    background: linear-gradient(180deg, #fff 0%, #fff7ed 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tg-chat-closed-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    border-radius: 14px;
    background: #f97316;
    color: #fff;
    box-shadow: 0 10px 20px rgba(249, 115, 22, 0.18);
}

.tg-chat-closed-copy strong,
.tg-chat-hours strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 21px;
    font-weight: 800;
}

.tg-chat-closed-copy p {
    margin: 7px 0 0;
    color: #475569;
    font-size: 13px;
    line-height: 20px;
    font-weight: 600;
}

.tg-chat-hours {
    display: grid;
    grid-column: 1 / -1;
    gap: 0;
    overflow: hidden;
    border: 1px solid #ffedd5;
    border-radius: 12px;
    background: #fff;
}

.tg-chat-hours-table {
    display: grid;
    overflow: hidden;
    border: 1px solid #ffedd5;
    border-radius: 12px;
    background: #fff;
}

.tg-chat-hours-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #fff7ed;
    color: #111827;
    font-size: 12px;
    line-height: 18px;
    font-weight: 400;
}

.tg-chat-hours-row:last-child {
    border-bottom: 0;
}

.tg-chat-hours-row-today {
    background: #f8fbff;
}

.tg-chat-hours-open {
    color: #111827;
    white-space: nowrap;
}

.tg-chat-hours-closed {
    color: #ef4444;
    font-weight: 600;
    white-space: nowrap;
}

.tg-chat-rating {
    display: grid;
    gap: 14px;
    padding: 16px;
    margin-bottom: 14px;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
    box-shadow: 0 12px 26px rgba(15, 23, 42, 0.06);
}

.tg-chat-rating-copy strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    line-height: 21px;
    font-weight: 800;
}

.tg-chat-rating-copy p {
    margin: 6px 0 0;
    color: #475569;
    font-size: 12px;
    line-height: 18px;
    font-weight: 600;
}

.tg-chat-rating-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.tg-chat-rating-actions button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    padding: 9px 10px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 16px;
    font-weight: 800;
}

.tg-chat-rating-actions button:hover {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.tg-chat-rating-actions button:disabled {
    cursor: default;
}

.tg-chat-rating-actions .tg-chat-rating-active {
    border-color: #22c55e;
    background: #f0fdf4;
    color: #15803d;
}

.tg-chat-rating-actions .tg-chat-rating-negative-active {
    border-color: #f87171;
    background: #fef2f2;
    color: #b91c1c;
}

.tg-chat-message {
    display: flex;
    margin-bottom: 14px;
}

.tg-chat-message-user {
    justify-content: flex-end;
}

.tg-chat-bubble {
    max-width: 82%;
    padding: 10px 12px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid #e5e7eb;
    color: #1f2937;
    font-size: 13px;
    line-height: 19px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.tg-chat-message-user .tg-chat-bubble {
    border-color: #007aff;
    background: #007aff;
    color: #fff;
}

.tg-chat-message-closed-by-agent .tg-chat-bubble {
    width: 100%;
    max-width: 100%;
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.tg-chat-bubble-title,
.tg-chat-bubble-text {
    display: block;
}

.tg-chat-bubble-title {
    margin-bottom: 5px;
    color: #172554;
    font-weight: 800;
}

.tg-chat-bubble-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 40px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 0;
    border-radius: 11px;
    background: #007aff;
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 12px;
    line-height: 16px;
    font-weight: 800;
}

.tg-chat-bubble-action:hover {
    background: #006ee6;
}

.tg-chat-bubble-action:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.tg-chat-meta {
    display: block;
    margin-top: 5px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 700;
}

.tg-chat-message-user .tg-chat-meta {
    color: rgba(255, 255, 255, 0.72);
}

.tg-chat-system-notice {
    margin: 0 0 14px;
    text-align: center;
}

.tg-chat-system-notice span {
    display: inline-flex;
    max-width: 100%;
    padding: 7px 10px;
    border-radius: 999px;
    background: #e0f2fe;
    color: #0369a1;
    font-size: 11px;
    line-height: 16px;
    font-weight: 800;
}

.tg-chat-form {
    position: relative;
    display: flex;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.tg-chat-emoji {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 66px;
    z-index: 2;
    display: none;
    overflow: hidden;
    border: 1px solid #dbe3ef;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 16px 44px rgba(15, 23, 42, 0.18);
}

.tg-chat-emoji.tg-chat-emoji-open {
    display: block;
}

.tg-chat-emoji-search {
    width: calc(100% - 20px);
    margin: 10px;
    padding: 9px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    outline: none;
    color: #111827;
    font: inherit;
    font-size: 12px;
}

.tg-chat-emoji-search:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.08);
}

.tg-chat-emoji-cats {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    padding: 0 10px 8px;
}

.tg-chat-emoji-cats button {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 1px solid #e5e7eb;
    border-radius: 999px;
    background: #f8fafc;
    color: #475569;
    cursor: pointer;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
}

.tg-chat-emoji-cats .tg-chat-emoji-cat-active {
    border-color: #007aff;
    background: #eff6ff;
    color: #007aff;
}

.tg-chat-emoji-list {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 2px;
    max-height: 210px;
    overflow-y: auto;
    padding: 8px 10px 10px;
    border-top: 1px solid #eef2f7;
}

.tg-chat-emoji-list button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    border: 0;
    border-radius: 8px;
    background: transparent;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.tg-chat-emoji-list button:hover {
    background: #eff6ff;
}

.tg-chat-emoji-loading {
    grid-column: 1 / -1;
    padding: 18px 4px;
    color: #64748b;
    font-size: 12px;
    font-weight: 700;
    text-align: center;
}

.tg-chat-input {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 42px;
    max-height: 112px;
    padding: 11px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 12px;
    outline: none;
    resize: none;
    color: #111827;
    background: #fff;
    font: inherit;
    font-size: 13px;
    line-height: 18px;
}

.tg-chat-input:focus {
    border-color: #007aff;
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.08);
}

.tg-chat-emoji-toggle,
.tg-chat-send {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 12px;
    background: #007aff;
    color: #fff;
    cursor: pointer;
}

.tg-chat-emoji-toggle {
    flex: 0 0 auto;
    background: #f1f5f9;
    color: #475569;
}

.tg-chat-emoji-toggle:hover {
    background: #e2e8f0;
    color: #0f172a;
}

.tg-chat-send:disabled,
.tg-chat-emoji-toggle:disabled,
.tg-chat-input:disabled {
    cursor: not-allowed;
    opacity: 0.58;
}

html.dark .tg-chat-panel {
    border-color: #1e293b;
    background: #0f172a;
    color: #f8fafc;
}

html.dark .tg-chat-messages {
    background: #020617;
}

html.dark .tg-chat-empty,
html.dark .tg-chat-ended,
html.dark .tg-chat-loading {
    border-color: #1e293b;
    background: #0f172a;
    color: #94a3b8;
}

html.dark .tg-chat-bubble {
    border-color: #1e293b;
    background: #111827;
    color: #e5e7eb;
}

html.dark .tg-chat-message-closed-by-agent .tg-chat-bubble {
    border-color: #1d4ed8;
    background: rgba(96, 165, 250, 0.12);
    color: #dbeafe;
}

html.dark .tg-chat-bubble-title {
    color: #eff6ff;
}

html.dark .tg-chat-start {
    border-color: #1e293b;
    background: #0f172a;
}

html.dark .tg-chat-waiting {
    border-color: #1e293b;
    background: #0f172a;
}

html.dark .tg-chat-waiting-meta {
    background: #111827;
    color: #94a3b8;
}

html.dark .tg-chat-waiting-meta strong {
    color: #f8fafc;
}

html.dark .tg-chat-waiting-message {
    border-color: #1d4ed8;
    background: rgba(96, 165, 250, 0.1);
}

html.dark .tg-chat-waiting-message span {
    color: #93c5fd;
}

html.dark .tg-chat-waiting-message p {
    color: #dbeafe;
}

html.dark .tg-chat-system-notice span {
    background: rgba(14, 165, 233, 0.16);
    color: #7dd3fc;
}

html.dark .tg-chat-start-copy strong,
html.dark .tg-chat-waiting-copy strong {
    color: #f8fafc;
}

html.dark .tg-chat-start-copy p,
html.dark .tg-chat-waiting-copy p,
html.dark .tg-chat-start-list span {
    color: #cbd5e1;
}

html.dark .tg-chat-start-hint {
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

html.dark .tg-chat-overview-hero {
    border-color: #1e293b;
    background: #0f172a;
}

html.dark .tg-chat-overview-list > strong,
html.dark .tg-chat-overview-item-main strong {
    color: #f8fafc;
}

html.dark .tg-chat-overview-item {
    border-color: #1e293b;
    background: #0f172a;
    color: #f8fafc;
}

html.dark .tg-chat-overview-item:hover {
    border-color: #334155;
    background: #111827;
}

html.dark .tg-chat-overview-item-main small {
    color: #94a3b8;
}

html.dark .tg-chat-overview-badge-active {
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

html.dark .tg-chat-overview-badge-closed {
    background: #1e293b;
    color: #cbd5e1;
}

html.dark .tg-chat-overview-empty {
    border-color: #334155;
    background: rgba(15, 23, 42, 0.72);
    color: #94a3b8;
}

html.dark .tg-chat-closed {
    border-color: rgba(249, 115, 22, 0.34);
    background: linear-gradient(180deg, #0f172a 0%, #1c1917 100%);
}

html.dark .tg-chat-closed-copy strong,
html.dark .tg-chat-hours strong {
    color: #f8fafc;
}

html.dark .tg-chat-closed-copy p {
    color: #cbd5e1;
}

html.dark .tg-chat-hours-table {
    border-color: rgba(249, 115, 22, 0.24);
    background: #0f172a;
}

html.dark .tg-chat-hours {
    border-color: rgba(249, 115, 22, 0.24);
    background: #0f172a;
}

html.dark .tg-chat-hours-row {
    border-color: rgba(249, 115, 22, 0.12);
    color: #cbd5e1;
}

html.dark .tg-chat-hours-row-today {
    background: rgba(96, 165, 250, 0.08);
}

html.dark .tg-chat-hours-open {
    color: #cbd5e1;
}

html.dark .tg-chat-rating {
    border-color: #1e293b;
    background: #0f172a;
}

html.dark .tg-chat-rating-copy strong {
    color: #f8fafc;
}

html.dark .tg-chat-rating-copy p {
    color: #cbd5e1;
}

html.dark .tg-chat-rating-actions button {
    border-color: #334155;
    background: #111827;
    color: #cbd5e1;
}

html.dark .tg-chat-rating-actions button:hover {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

html.dark .tg-chat-rating-actions .tg-chat-rating-active {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.12);
    color: #86efac;
}

html.dark .tg-chat-rating-actions .tg-chat-rating-negative-active {
    border-color: #f87171;
    background: rgba(248, 113, 113, 0.12);
    color: #fca5a5;
}

html.dark .tg-chat-form {
    border-color: #1e293b;
    background: #0f172a;
}

html.dark .tg-chat-emoji {
    border-color: #334155;
    background: #0f172a;
}

html.dark .tg-chat-emoji-search {
    border-color: #334155;
    background: #020617;
    color: #f8fafc;
}

html.dark .tg-chat-emoji-cats button {
    border-color: #334155;
    background: #111827;
    color: #cbd5e1;
}

html.dark .tg-chat-emoji-cats .tg-chat-emoji-cat-active {
    border-color: #60a5fa;
    background: rgba(96, 165, 250, 0.12);
    color: #93c5fd;
}

html.dark .tg-chat-emoji-list {
    border-color: #1e293b;
}

html.dark .tg-chat-emoji-list button:hover,
html.dark .tg-chat-emoji-toggle {
    background: #111827;
    color: #cbd5e1;
}

html.dark .tg-chat-input {
    border-color: #334155;
    background: #020617;
    color: #f8fafc;
}

@media (max-width: 520px) {
    .tg-chat-launcher {
        right: 14px;
        bottom: 14px;
    }

    .tg-chat-panel {
        inset: 0;
        width: auto;
        height: auto;
        border: 0;
        border-radius: 0;
    }

    .tg-chat-end {
        width: 36px;
        padding: 0;
    }

    .tg-chat-end span {
        display: none;
    }

    .tg-chat-emoji-list {
        grid-template-columns: repeat(7, 1fr);
    }

    body.tg-chat-open {
        overflow: hidden;
    }
}
