.ts-app { max-width: 680px; margin: 0 auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* Title */
.ts-title { font-size: 24px; font-weight: 700; color: var(--text); text-align: center; }
.ts-subtitle { font-size: 14px; color: var(--text-2); text-align: center; margin-top: -4px; }

/* Input */
.ts-input-wrap { position: relative; }
.ts-input {
    width: 100%; padding: 12px 44px 36px 14px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 18px; font-family: inherit; resize: vertical; min-height: 80px;
    outline: none; transition: border-color 0.15s; line-height: 1.5;
}
.ts-input:focus { border-color: var(--primary-light); }
.ts-input-actions {
    position: absolute; bottom: 10px; left: 12px; right: 12px;
    display: flex; align-items: center; gap: 8px;
}
.ts-char-count { font-size: 11px; color: var(--text-2); }
.ts-clear-btn { background: none; border: none; font-size: 12px; color: var(--text-2); cursor: pointer; }
.ts-clear-btn:hover { color: var(--text); }

/* Paste button inside textarea */
.ts-paste-btn {
    position: absolute; top: 10px; right: 10px;
    background: none; border: 1px solid var(--border); border-radius: 6px;
    cursor: pointer; font-size: 18px; padding: 4px 8px;
    opacity: 0.5; transition: opacity 0.15s;
    line-height: 1;
}
.ts-paste-btn:hover { opacity: 1; background: #f5f5f5; }

/* Split button */
.ts-split-btn {
    padding: 11px; background: var(--primary); color: #fff; border: none;
    border-radius: var(--radius); font-size: 15px; font-weight: 700; cursor: pointer;
    transition: background 0.15s;
}
.ts-split-btn:hover { background: var(--primary-dark); }
.ts-split-btn:disabled { background: var(--border); color: var(--text-2); cursor: not-allowed; }

/* Section label */
.ts-section-label {
    font-size: 12px; font-weight: 700; text-transform: uppercase; color: var(--text-2);
    letter-spacing: 0.5px; margin-bottom: 4px;
}

/* Sentence translation */
.ts-sentence-translation {
    border: 1.5px solid var(--primary-light); border-radius: var(--radius);
    background: #f0faf0; padding: 14px;
}
.ts-sentence-text { font-size: 16px; line-height: 1.5; color: var(--text); margin-top: 6px; }

/* Word cards */
.ts-results { display: flex; flex-direction: column; gap: 8px; }
.ts-words { display: flex; flex-direction: column; gap: 10px; }

.ts-word-card {
    border: 1.5px solid var(--border); border-radius: var(--radius);
    background: var(--bg); overflow: hidden;
}
.ts-word-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 14px; border-bottom: 1px solid var(--border); background: var(--bg-2);
}
.ts-word-left { display: flex; align-items: center; gap: 8px; }
.ts-speaker-btn {
    background: none; border: none; cursor: pointer; font-size: 18px;
    padding: 2px 4px; border-radius: 4px; opacity: 0.6; transition: opacity 0.15s;
}
.ts-speaker-btn:hover { opacity: 1; }
.ts-word-thai { font-size: 24px; font-weight: 600; }
.ts-word-english { font-size: 14px; color: var(--text-2); font-style: italic; }

.ts-word-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 16px; }

/* Character breakdown sections */
.ts-char-section { display: flex; flex-direction: column; gap: 4px; }

.ts-char-heading {
    font-size: 18px; font-weight: 700; color: var(--text);
    margin-bottom: 2px;
}

.ts-char-word {
    font-size: 22px; font-weight: 600; color: var(--primary-dark);
    margin-bottom: 4px;
}

.ts-char-row {
    display: flex; align-items: center; gap: 6px;
    padding: 3px 0; font-size: 18px; line-height: 1.4;
}

.ts-char-speaker {
    cursor: pointer; font-size: 16px;
    flex-shrink: 0;
}
.ts-char-speaker:hover { opacity: 0.7; }

.ts-char-letter {
    font-weight: 700; font-size: 20px; color: var(--text);
}

.ts-char-dash { color: var(--text-2); }

.ts-char-desc { color: #666; font-size: 18px; }

.ts-char-vowel-placeholder {
    font-size: 18px; color: var(--text);
    border: 1px dashed #ccc; border-radius: 4px;
    padding: 1px 5px; background: #fafafa;
}

.ts-char-arrow { color: #999; font-size: 16px; }

/* Highlighted characters in word display */
.ts-highlight { font-weight: 700; color: blue; }

/* Loading */
.ts-loading { text-align: center; padding: 20px; color: var(--text-2); font-size: 14px; }
