/* TAM-Chat Public Widget */

.tam-chat-widget {
    max-width: 640px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.tam-chat-title {
    font-size: 1.3em;
    margin-bottom: 20px;
    color: #1d2327;
}

/* Formular */
.tam-chat-row--2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.tam-chat-field {
    margin-bottom: 16px;
}

.tam-chat-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
    color: #1d2327;
    font-size: .9em;
}

.tam-chat-field input,
.tam-chat-field textarea {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #c3c4c7;
    border-radius: 4px;
    font-size: 1em;
    box-sizing: border-box;
    transition: border-color .15s;
}

.tam-chat-field input:focus,
.tam-chat-field textarea:focus {
    border-color: #2271b1;
    outline: none;
    box-shadow: 0 0 0 2px rgba(34,113,177,.2);
}

.tam-chat-field textarea {
    resize: vertical;
}

/* Buttons */
.tam-chat-btn {
    display: inline-block;
    padding: 10px 22px;
    border: none;
    border-radius: 4px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.tam-chat-btn--primary {
    background: #2271b1;
    color: #fff;
}

.tam-chat-btn--primary:hover {
    background: #135e96;
}

.tam-chat-btn--primary:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

.tam-chat-btn--secondary {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #c3c4c7;
}

.tam-chat-btn--secondary:hover {
    background: #dcdcde;
}

.tam-chat-error {
    color: #d63638;
    font-size: .9em;
    margin-top: 8px;
}

/* Thread */
.tam-chat-thread-header {
    margin-bottom: 12px;
}

.tam-chat-thread-status {
    color: #646970;
    font-size: .9em;
    margin: 4px 0 0;
}

.tam-chat-thread-public {
    background: #f6f7f7;
    border: 1px solid #dcdcde;
    border-radius: 8px;
    padding: 16px;
    min-height: 120px;
    max-height: 420px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.tam-chat-msg-pub {
    display: flex;
}

.tam-chat-msg-pub--user  { justify-content: flex-end; }
.tam-chat-msg-pub--admin { justify-content: flex-start; }

.tam-chat-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: .95em;
    line-height: 1.5;
}

.tam-chat-msg-pub--user  .tam-chat-bubble {
    background: #2271b1;
    color: #fff;
    border-bottom-right-radius: 2px;
}

.tam-chat-msg-pub--admin .tam-chat-bubble {
    background: #fff;
    border: 1px solid #dcdcde;
    color: #1d2327;
    border-bottom-left-radius: 2px;
}

.tam-chat-bubble p {
    margin: 0 0 4px;
    white-space: pre-wrap;
    word-break: break-word;
}

.tam-chat-bubble small {
    font-size: .8em;
    opacity: .7;
}

.tam-chat-thread-footer {
    margin-top: 12px;
    text-align: right;
}

/* Spinner */
.tam-chat-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 3px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: tam-spin .7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

@keyframes tam-spin {
    to { transform: rotate(360deg); }
}

@media (max-width: 480px) {
    .tam-chat-row--2col { grid-template-columns: 1fr; }
}
