/* ── Card ─────────────────────────────────────── */
.tdg-wrapper {
    width: 100%;
}

.tdg-card {
    width: 100%;
    background-color: white;
    border: 1px solid #d0d0d0;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
    overflow: hidden;
}

/* ── Panels layout ────────────────────────────── */
.tdg-panels {
    display: flex;
    align-items: stretch;
}

.tdg-left-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #e0e0e0;
    min-width: 0;
}

.tdg-right-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* ── Panel header ─────────────────────────────── */
.tdg-panel-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 14px 14px;
    border-bottom: 1px solid #e0e0e0;
    background-color: #fafafa;
    flex-shrink: 0;
}

.tdg-panel-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    line-height: 1.5;
}

/* ── Message area ─────────────────────────────── */
.tdg-message-area {
    position: relative;
    flex: 1;
}

.tdg-message-textarea,
.tdg-message-textarea:focus {
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 17px;
    line-height: 1.75;
    color: black;
    background: white;
    padding: 15px;
    min-height: 200px;
    overflow: hidden;
}

/* ── Style field ──────────────────────────────── */
.tdg-field {
    display: flex;
    flex-direction: column;
    padding: 10px 15px;
}

.tdg-style-field {
    border-top: 1px solid #e0e0e0;
}

.tdg-field-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #777;
    line-height: 1.5;
    margin-bottom: 6px;
}

.tdg-field-textarea,
.tdg-field-textarea:focus {
    width: 100%;
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    font-size: 14px;
    line-height: 1.6;
    color: black;
    background: transparent;
    padding: 0;
    overflow: hidden;
}

/* ── Actions bar ──────────────────────────────── */
.tdg-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 52px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: auto;
}

.tdg-generate-btn,
.tdg-generate-btn:focus {
    background: #0c1550;
    color: white;
    border: none;
    border-radius: 7px;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
}

.tdg-generate-btn:hover {
    background: #162792;
    color: white;
}

.tdg-generate-btn:disabled {
    background: #999;
    cursor: not-allowed;
}

.tdg-speech-btn,
.tdg-speech-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
    margin-left: auto;
    outline: none;
}

.tdg-speech-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #222;
}

/* ── Output textarea ──────────────────────────── */
.tdg-output-textarea,
.tdg-output-textarea:focus {
    resize: none;
    border: none;
    outline: none !important;
    box-shadow: none !important;
    width: 100%;
    font-size: 17px;
    line-height: 1.75;
    color: black;
    background: white;
    padding: 15px;
    min-height: 200px;
    overflow: hidden;
}

/* ── Output actions ───────────────────────────── */
.tdg-output-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 12px;
    height: 52px;
    border-top: 1px solid #e0e0e0;
    background: #fafafa;
    flex-shrink: 0;
    margin-top: auto;
}

.tdg-tts-btn,
.tdg-tts-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    outline: none;
    margin-left: auto;
}

.tdg-tts-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #111;
}

.tdg-copy-btn,
.tdg-copy-btn:focus {
    display: flex;
    align-items: center;
    padding: 6px;
    border: 1px solid #d0d0d0;
    border-radius: 6px;
    color: black;
    background: white;
    font-size: 13px;
    font-weight: normal;
    cursor: pointer;
}

.tdg-copy-btn:hover {
    background: #f5f5f5;
    border-color: #aaa;
    color: #111;
}

/* ── Tooltips ─────────────────────────────────── */
.tdg-speech-btn,
.tdg-tts-btn,
.tdg-copy-btn {
    position: relative;
}

.tdg-speech-btn::after,
.tdg-tts-btn::after,
.tdg-copy-btn::after {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
    line-height: 1;
}

.tdg-speech-btn::before,
.tdg-tts-btn::before,
.tdg-copy-btn::before {
    content: "";
    position: absolute;
    bottom: calc(100% - 1px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s, visibility 0.2s;
    z-index: 1000;
    pointer-events: none;
}

.tdg-speech-btn:hover::after,
.tdg-speech-btn:hover::before,
.tdg-tts-btn:hover::after,
.tdg-tts-btn:hover::before,
.tdg-copy-btn:hover::after,
.tdg-copy-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

.tdg-speech-btn::after { content: "Audio to text"; }
.tdg-tts-btn::after    { content: "Text to speech"; }
.tdg-copy-btn::after   { content: "Copy"; }

/* ── Force black text ─────────────────────────── */
.tdg-wrapper textarea {
    color: black !important;
}

.tdg-wrapper textarea:focus {
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
    color: black !important;
}

/* ── Disclaimer ───────────────────────────────── */
.tdg-disclaimer {
    margin-top: 12px;
    text-align: center;
    font-size: 11px;
    font-style: italic;
    color: #999;
    line-height: 1.5;
}

/* ── Responsive ───────────────────────────────── */
@media (max-width: 768px) {
    .tdg-panels {
        flex-direction: column;
    }

    .tdg-left-panel {
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
    }
}
