/* ========== Tone Rewriter Widget ========== */

.tone-rewriter {
    background: #fff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.tone-rewriter:focus-within {
    border-color: #059669;
}

/* Tab Bar */
.tr-tabs {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #f1f5f9;
    padding: 0 4px;
    min-height: 38px;
}

.tr-tab {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 600;
    color: #94a3b8;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}

.tr-tab:hover {
    color: #475569;
}

.tr-tab.active {
    color: #059669;
    border-bottom-color: #059669;
}

.tr-check {
    display: none;
    font-size: 11px;
    color: #059669;
}

.tr-tab.chosen .tr-check {
    display: inline;
}

.tr-tab.chosen {
    color: #059669;
}

/* Tone tabs hidden until generated */
.tr-tone-tab {
    display: none;
}

.tr-tone-tab.visible {
    display: flex;
}

/* Spacer */
.tr-spacer {
    flex: 1;
}

/* Rewrite button */
.tr-rewrite-btn {
    padding: 5px 12px;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    background: #f0fdf4;
    border: 1px solid #a7f3d0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 4px 6px 4px 0;
    white-space: nowrap;
}

.tr-rewrite-btn:hover {
    background: #dcfce7;
    border-color: #6ee7b7;
}

.tr-rewrite-btn i {
    font-size: 11px;
}

.tr-rewrite-btn.processing {
    pointer-events: none;
    opacity: 0.7;
}

/* Content Body */
.tr-body {
    position: relative;
    min-height: 80px;
}

.tr-pane {
    display: none;
}

.tr-pane.active {
    display: block;
}

.tr-textarea {
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    resize: vertical;
    min-height: 80px;
    line-height: 1.7;
}

.tr-textarea:focus {
    box-shadow: none !important;
}

.tr-preview {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.7;
    color: #334155;
    white-space: pre-wrap;
}

/* Processing */
.tr-processing {
    display: none;
    padding: 24px 14px;
    text-align: center;
}

.tr-processing.active {
    display: block;
}

.tr-processing i {
    color: #059669;
    font-size: 18px;
    margin-bottom: 8px;
}

.tr-processing p {
    font-size: 12px;
    color: #94a3b8;
    margin: 0;
}

/* Footer */
.tr-footer {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    border-top: 1px solid #f1f5f9;
    background: #fafbfc;
}

.tr-footer.visible {
    display: flex;
}

.tr-footer-hint {
    font-size: 11px;
    color: #94a3b8;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tr-footer-actions {
    display: flex;
    gap: 6px;
}

.tr-btn {
    padding: 5px 14px;
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: all 0.15s;
    display: flex;
    align-items: center;
    gap: 5px;
}

.tr-btn-primary {
    background: #059669;
    color: #fff;
}

.tr-btn-primary:hover {
    background: #047857;
}

.tr-btn-secondary {
    background: #e2e8f0;
    color: #475569;
}

.tr-btn-secondary:hover {
    background: #cbd5e1;
}

/* Applied Banner */
.tr-applied {
    display: none;
    font-size: 11px;
    font-weight: 600;
    color: #059669;
    padding: 6px 12px;
    background: #f0fdf4;
    border-top: 1px solid #a7f3d0;
    align-items: center;
    gap: 5px;
}

.tr-applied.visible {
    display: flex;
}
