/* TextPro Counter - estilos (con prefijo tp- para no chocar con el tema) */
.tp-app {
    --tp-blue: #2563eb;
    --tp-blue-dark: #1d4ed8;
    --tp-blue-bg: #eff6ff;
    --tp-slate-50: #f8fafc;
    --tp-slate-100: #f1f5f9;
    --tp-slate-200: #e2e8f0;
    --tp-slate-300: #cbd5e1;
    --tp-slate-400: #94a3b8;
    --tp-slate-500: #64748b;
    --tp-slate-600: #475569;
    --tp-slate-700: #334155;
    --tp-slate-800: #1e293b;
    --tp-rose-50: #fff1f2;
    --tp-rose-100: #ffe4e6;
    --tp-rose-500: #f43f5e;
    --tp-rose-600: #e11d48;
    --tp-emerald-100: #d1fae5;
    --tp-emerald-500: #10b981;
    --tp-emerald-700: #047857;
    --tp-amber-100: #fef3c7;
    --tp-amber-700: #b45309;
    --tp-radius: 14px;
    --tp-radius-sm: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--tp-slate-800);
    background: var(--tp-slate-50);
    display: flex;
    flex-direction: column;
    min-height: 100%;
    box-sizing: border-box;
    margin: 24px 0;
    border-radius: 18px;
    overflow: hidden;
    border: 1px solid var(--tp-slate-200);
}
.tp-app *, .tp-app *::before, .tp-app *::after { box-sizing: border-box; }
.tp-app button { font-family: inherit; cursor: pointer; }
.tp-app select, .tp-app input, .tp-app textarea { font-family: inherit; }
.tp-app a { text-decoration: none; }
.tp-hidden { display: none !important; }
.tp-muted { color: var(--tp-slate-500); }
.tp-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; display: inline-block; vertical-align: bottom; }

/* Header */
.tp-header {
    background: #fff;
    border-bottom: 1px solid var(--tp-slate-200);
    z-index: 5;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.tp-header-inner {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}
.tp-brand { display: flex; align-items: center; gap: 12px; }
.tp-logo {
    width: 40px; height: 40px; border-radius: 12px;
    background: var(--tp-blue); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 20px;
    box-shadow: 0 4px 10px rgba(37,99,235,0.25);
    flex-shrink: 0;
}
.tp-title { font-weight: 700; font-size: 17px; line-height: 1.2; margin: 0; }
.tp-badge-pro {
    font-size: 10px; background: #dbeafe; color: var(--tp-blue);
    padding: 2px 8px; border-radius: 999px; text-transform: uppercase;
    letter-spacing: .03em; font-weight: 700; margin-left: 4px;
}
.tp-subtitle { font-size: 12px; color: var(--tp-slate-500); margin: 0; }

.tp-header-actions { display: flex; align-items: center; gap: 10px; }
.tp-btn-icon {
    border: none; background: none; color: var(--tp-slate-600);
    padding: 8px; border-radius: 10px; font-size: 13px;
    display: flex; align-items: center; gap: 6px;
}
.tp-btn-icon:hover { background: var(--tp-slate-100); }
.tp-btn-icon-label { display: none; }
@media (min-width: 768px) { .tp-btn-icon-label { display: inline; } }
.tp-divider { width: 1px; height: 24px; background: var(--tp-slate-200); }
.tp-select {
    background: var(--tp-slate-100); border: none; border-radius: 10px;
    padding: 7px 10px; font-size: 12px; font-weight: 500; color: var(--tp-slate-700);
}
.tp-select:focus { outline: 2px solid var(--tp-blue); }

/* Stats bar */
.tp-stats-section {
    background: var(--tp-slate-100);
    border-bottom: 1px solid var(--tp-slate-200);
    padding: 12px 16px;
}
.tp-stats-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
}
@media (min-width: 640px) { .tp-stats-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .tp-stats-grid { grid-template-columns: repeat(6, 1fr); } }
.tp-stat-card {
    background: #fff; padding: 12px; border-radius: var(--tp-radius-sm);
    border: 1px solid var(--tp-slate-200); text-align: center;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.tp-stat-label { font-size: 11px; text-transform: uppercase; font-weight: 700; color: var(--tp-slate-400); letter-spacing: .03em; }
.tp-stat-value { font-size: 22px; font-weight: 800; color: var(--tp-slate-700); margin-top: 2px; }
.tp-stat-value-accent { color: var(--tp-blue); }

/* Main layout */
.tp-main {
    flex-grow: 1; width: 100%;
    padding: 20px 16px; display: grid; grid-template-columns: 1fr; gap: 24px;
}
@media (min-width: 900px) { .tp-main { grid-template-columns: 7fr 5fr; } }
.tp-col-editor { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tp-col-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Goal banner */
.tp-goal-banner {
    background: #fff; border: 1px solid var(--tp-slate-200); border-radius: var(--tp-radius);
    padding: 16px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
    display: flex; flex-direction: column; gap: 12px; align-items: stretch;
}
@media (min-width: 640px) { .tp-goal-banner { flex-direction: row; align-items: center; justify-content: space-between; } }
.tp-goal-left { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tp-goal-label { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--tp-slate-500); white-space: nowrap; }
.tp-goal-custom { display: flex; align-items: center; gap: 8px; }
.tp-input-number {
    width: 80px; font-size: 12px; background: var(--tp-slate-100); border: none;
    border-radius: 10px; padding: 7px 8px; text-align: center;
}
.tp-goal-right { width: 100%; display: flex; flex-direction: column; gap: 4px; }
@media (min-width: 640px) { .tp-goal-right { width: 190px; } }
.tp-goal-progress-labels { display: flex; justify-content: space-between; font-size: 12px; color: var(--tp-slate-500); }
.tp-progress-track { width: 100%; background: var(--tp-slate-200); height: 8px; border-radius: 999px; overflow: hidden; }
.tp-progress-track-thick { height: 10px; margin: 8px 0; }
.tp-progress-bar { background: var(--tp-blue); height: 100%; width: 0%; border-radius: 999px; transition: width .3s ease, background .3s ease; }
.tp-progress-bar-blue { background: #3b82f6; }

/* Editor card */
.tp-editor-card {
    background: #fff; border: 1px solid var(--tp-slate-200); border-radius: 18px;
    overflow: hidden; display: flex; flex-direction: column; flex-grow: 1;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.tp-toolbar {
    padding: 10px 12px; background: var(--tp-slate-50); border-bottom: 1px solid var(--tp-slate-200);
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px;
}
.tp-toolbar-left, .tp-toolbar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }

.tp-btn {
    font-size: 12px; font-weight: 600; padding: 7px 10px; border-radius: 10px;
    background: #fff; border: 1px solid var(--tp-slate-200); color: var(--tp-slate-700);
    display: inline-flex; align-items: center; gap: 5px;
}
.tp-btn:hover { background: var(--tp-slate-100); }
.tp-btn-blue { background: var(--tp-blue-bg); color: var(--tp-blue); border-color: transparent; }
.tp-btn-blue:hover { background: #dbeafe; }
.tp-btn-rose { background: var(--tp-rose-50); color: var(--tp-rose-600); border-color: transparent; }
.tp-btn-rose:hover { background: var(--tp-rose-100); }
.tp-btn-solid-blue { background: var(--tp-blue); color: #fff; border-color: transparent; padding: 6px 12px; }
.tp-btn-solid-blue:hover { background: var(--tp-blue-dark); }

.tp-dropdown { position: relative; }
.tp-dropdown-menu {
    position: absolute; left: 0; top: 100%; margin-top: 4px; width: 200px;
    background: #fff; border: 1px solid var(--tp-slate-200); border-radius: 12px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.1); z-index: 20; padding: 4px;
    opacity: 0; visibility: hidden; transform: translateY(-4px);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
}
.tp-dropdown:hover .tp-dropdown-menu,
.tp-dropdown:focus-within .tp-dropdown-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.tp-dropdown-item {
    display: block; width: 100%; text-align: left; background: none; border: none;
    padding: 7px 10px; font-size: 12px; border-radius: 8px; color: var(--tp-slate-700);
}
.tp-dropdown-item:hover { background: var(--tp-slate-100); }

.tp-findreplace { background: var(--tp-slate-100); border-bottom: 1px solid var(--tp-slate-200); padding: 12px; }
.tp-findreplace-inputs { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 8px; }
@media (min-width: 640px) { .tp-findreplace-inputs { grid-template-columns: 1fr 1fr; } }
.tp-input-text {
    font-size: 12px; padding: 7px 10px; border-radius: 10px;
    border: 1px solid var(--tp-slate-300); background: #fff; width: 100%;
}
.tp-findreplace-footer { display: flex; align-items: center; justify-content: space-between; font-size: 12px; }

.tp-textarea-wrap { position: relative; flex-grow: 1; min-height: 350px; display: flex; flex-direction: column; }
.tp-textarea {
    width: 100%; height: 100%; min-height: 380px; padding: 16px; background: transparent;
    border: 0; color: var(--tp-slate-800); font-size: 16px; line-height: 1.6; resize: vertical;
}
.tp-textarea:focus { outline: none; box-shadow: none; }
.tp-textarea::placeholder { color: var(--tp-slate-400); }

.tp-toast {
    position: absolute; bottom: 16px; right: 16px; background: var(--tp-slate-800); color: #fff;
    font-size: 12px; padding: 8px 12px; border-radius: 10px; opacity: 0;
    transition: opacity .3s ease; pointer-events: none; box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

.tp-editor-footer {
    padding: 8px 16px; background: var(--tp-slate-50); border-top: 1px solid var(--tp-slate-200);
    font-size: 12px; color: var(--tp-slate-500); display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap;
}
.tp-editor-footer-actions { display: flex; gap: 12px; }
.tp-link-btn { background: none; border: none; color: var(--tp-slate-500); font-size: 12px; padding: 0; }
.tp-link-btn:hover { color: var(--tp-blue); }

/* Cards (right column) */
.tp-card {
    background: #fff; border: 1px solid var(--tp-slate-200); border-radius: 18px;
    padding: 18px; box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.tp-card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 8px; flex-wrap: wrap; }
.tp-card-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; color: var(--tp-slate-400); margin: 0 0 14px; }
.tp-card-header .tp-card-title { margin-bottom: 0; }

.tp-metric-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }
.tp-metric-box { background: var(--tp-slate-50); border: 1px solid var(--tp-slate-100); border-radius: 12px; padding: 10px; }
.tp-metric-label { font-size: 11px; color: var(--tp-slate-500); display: block; }
.tp-metric-value { font-size: 17px; font-weight: 700; color: var(--tp-slate-800); margin-top: 4px; }
.tp-metric-hint { font-size: 10px; color: var(--tp-slate-400); }

.tp-readability { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--tp-slate-100); }
.tp-readability-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; gap: 8px; }
.tp-readability-title { font-size: 12px; font-weight: 600; color: var(--tp-slate-600); }
.tp-readability-desc { font-size: 12px; color: var(--tp-slate-500); margin: 4px 0 0; }

.tp-badge { font-size: 11px; font-weight: 700; padding: 2px 10px; border-radius: 999px; white-space: nowrap; }
.tp-badge-neutral { background: var(--tp-slate-100); color: var(--tp-slate-600); }
.tp-badge-easy { background: var(--tp-emerald-100); color: var(--tp-emerald-700); }
.tp-badge-standard { background: #dbeafe; color: var(--tp-blue-dark); }
.tp-badge-medium { background: var(--tp-amber-100); color: var(--tp-amber-700); }
.tp-badge-hard { background: var(--tp-rose-100); color: var(--tp-rose-600); }

.tp-ngram-toggle { display: flex; background: var(--tp-slate-100); padding: 2px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.tp-ngram-btn { background: none; border: none; padding: 5px 8px; border-radius: 8px; color: var(--tp-slate-600); }
.tp-ngram-btn-active { background: #fff; color: var(--tp-blue); font-weight: 700; box-shadow: 0 1px 2px rgba(0,0,0,0.06); }

.tp-checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--tp-slate-600); margin-bottom: 12px; cursor: pointer; }
.tp-checkbox-row input { accent-color: var(--tp-blue); }

.tp-keywords-scroll { overflow-y: auto; max-height: 220px; padding-right: 4px; }
.tp-empty-hint { font-size: 12px; color: var(--tp-slate-400); font-style: italic; text-align: center; padding: 24px 0; }
.tp-keyword-item { display: flex; flex-direction: column; gap: 4px; font-size: 12px; margin-bottom: 8px; }
.tp-keyword-row { display: flex; justify-content: space-between; align-items: center; font-weight: 500; }
.tp-keyword-phrase { color: var(--tp-slate-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.tp-keyword-count { color: var(--tp-slate-400); font-size: 11px; }
.tp-keyword-bar-track { width: 100%; background: var(--tp-slate-100); height: 6px; border-radius: 999px; overflow: hidden; }
.tp-keyword-bar { background: #3b82f6; height: 100%; border-radius: 999px; }

.tp-stats-detail { display: flex; flex-direction: column; gap: 2px; font-size: 12px; }
.tp-stat-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--tp-slate-100); color: var(--tp-slate-500); gap: 8px; }
.tp-stat-row-last { border-bottom: none; }
.tp-stat-row-value { font-weight: 700; color: var(--tp-slate-700); text-align: right; }

/* Footer */
.tp-footer { margin-top: auto; border-top: 1px solid var(--tp-slate-200); padding: 16px; text-align: center; font-size: 12px; color: var(--tp-slate-500); }
