/* Twaino Word Counter v2 — Compact above-the-fold layout */

.tw-wc-app{max-width:1200px;margin:0 auto;padding-top:20px;font-family:inherit;color:#1a1a2e}
.tw-wc-app *,.tw-wc-app *::before,.tw-wc-app *::after{box-sizing:border-box}

/* Tab content */
.tw-wc-app .tw-tools-tab-content{display:none}
.tw-wc-app .tw-tools-tab-content.tw-tools-tab-active{display:block;height:100%}

/* Header */
.tw-wc-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:12px;gap:10px;flex-wrap:wrap}
.tw-wc-tabs{display:flex;gap:0;border-bottom:2px solid #e5e7eb;margin:0}
.tw-wc-tabs .tw-tools-tab{padding:8px 20px;font-size:13px;font-weight:600;color:#6b7280;background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-2px;cursor:pointer;transition:all .2s;border-radius:0;line-height:1.4}
.tw-wc-tabs .tw-tools-tab:hover{background:#56aea4;color:#fff;border-color:#56aea4}
.tw-wc-tabs .tw-tools-tab.tw-tools-tab-active{color:#56aea4;border-bottom-color:#56aea4}

/* Action buttons */
.tw-wc-header-actions{display:flex;gap:6px}
.tw-wc-btn-action{display:inline-flex;align-items:center;gap:5px;padding:6px 12px;font-size:12px;font-weight:500;color:#6b7280;background:#fff;border:1px solid #e5e7eb;border-radius:6px;cursor:pointer;transition:all .15s;font-family:inherit;line-height:1}
.tw-wc-btn-action:hover{background:#f3f4f6;color:#1a1a2e;border-color:#d1d5db}
.tw-wc-btn-action svg{flex-shrink:0}

/* ═══ BLOCK 1: Editor + Stats — unified card ═══ */
.tw-wc-block1{display:grid;grid-template-columns:1fr 280px;background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden;margin-bottom:14px}
.tw-wc-editor-side{border-right:1px solid #e5e7eb;display:flex;flex-direction:column;min-height:280px}
.tw-wc-textarea{width:100%;height:100%;min-height:260px;border:none;outline:none;padding:16px;font-size:15px;line-height:1.65;resize:vertical;font-family:inherit;color:#1a1a2e;background:transparent;display:block}
.tw-wc-textarea::placeholder{color:#b0b5c0}

/* URL tab */
.tw-wc-url-row{display:flex;gap:8px;padding:16px;align-items:center}
.tw-wc-input{flex:1;height:40px;padding:0 12px;border:1px solid #e5e7eb;border-radius:8px;font-size:14px;color:#1a1a2e;outline:none;transition:border-color .2s;font-family:inherit}
.tw-wc-input:focus{border-color:#56aea4;box-shadow:0 0 0 3px rgba(86,174,164,.1)}
/* Bouton Analyser — outline vert discret */
.tw-wc-btn-primary{height:40px;padding:0 20px;background:#fff;color:#56aea4;font-size:13px;font-weight:600;border:1.5px solid #56aea4;border-radius:20px;cursor:pointer;transition:all .15s;white-space:nowrap;font-family:inherit}
.tw-wc-btn-primary:hover{background:#56aea4;color:#fff}
.tw-wc-btn-primary:disabled{opacity:.5;cursor:not-allowed}
.tw-wc-url-status{padding:0 16px 12px;min-height:16px}

/* Stats side */
.tw-wc-stats-side{display:flex;flex-direction:column}
.tw-wc-stat-row{display:flex;align-items:center;justify-content:space-between;padding:7px 14px;border-bottom:1px solid #f3f4f6}
.tw-wc-stat-row:last-child{border-bottom:none}
.tw-wc-stat-lbl{font-size:13px;color:#6b7280}
.tw-wc-stat-val{font-size:14px;font-weight:700;color:#1a1a2e;text-align:right}
.tw-wc-stat-highlight{background:#f0fdf8}
.tw-wc-stat-highlight .tw-wc-stat-val{font-size:20px;color:#56aea4}
.tw-wc-stat-highlight .tw-wc-stat-lbl{font-weight:600;color:#1a1a2e}

/* Flesch badge */
.tw-wc-stat-flesch{position:relative}
.tw-wc-flesch-badge{font-size:10px;font-weight:700;padding:2px 7px;border-radius:4px;text-transform:uppercase;letter-spacing:.03em;margin-left:6px}
.tw-wc-flesch-easy .tw-wc-flesch-badge{background:#dcfce7;color:#16a34a}
.tw-wc-flesch-medium .tw-wc-flesch-badge{background:#fef3c7;color:#ca8a04}
.tw-wc-flesch-hard .tw-wc-flesch-badge{background:#fee2e2;color:#dc2626}
.tw-wc-flesch-easy .tw-wc-stat-val{color:#16a34a}
.tw-wc-flesch-medium .tw-wc-stat-val{color:#ca8a04}
.tw-wc-flesch-hard .tw-wc-stat-val{color:#dc2626}

/* ═══ BLOCK 2: Top 10 + Density side by side ═══ */
.tw-wc-block2{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin-bottom:14px}

/* Cards */
.tw-wc-card{background:#fff;border:1px solid #e5e7eb;border-radius:10px;overflow:hidden}

/* Chart (Top 10) */
.tw-wc-chart-section{padding:14px 16px}
.tw-wc-chart-section .tw-wc-card-label{margin-bottom:10px;display:block}
.tw-wc-chart-row{display:flex;align-items:center;gap:8px;margin-bottom:4px}
.tw-wc-chart-label{width:90px;text-align:right;font-size:12px;font-weight:600;color:#1a1a2e;flex-shrink:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tw-wc-chart-bar-wrap{flex:1;background:#f3f4f6;border-radius:3px;overflow:hidden;height:18px}
.tw-wc-chart-bar{height:100%;background:linear-gradient(90deg,#56aea4,#9FFDCE);border-radius:3px;transition:width .4s;min-width:2px}
.tw-wc-chart-count{font-size:12px;color:#6b7280;width:36px;flex-shrink:0;text-align:right}

/* Density */
.tw-wc-density-compact{padding:10px 14px}
.tw-wc-density-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}
.tw-wc-card-label{font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#6b7280}
.tw-wc-density-tabs{display:flex;gap:0;border:1px solid #e5e7eb;border-radius:5px;overflow:hidden}
.tw-wc-dtab{padding:3px 10px;font-size:11px;font-weight:600;border:none;background:#f8f9fa;color:#6b7280;cursor:pointer;transition:all .15s;font-family:inherit;line-height:1.4}
.tw-wc-dtab.tw-wc-dtab-active{background:#56aea4;color:#fff}
.tw-wc-dtab:hover:not(.tw-wc-dtab-active){background:#56aea4;color:#fff;border-color:#56aea4}
.tw-wc-density-list{max-height:240px;overflow-y:auto}
.tw-wc-density-row{display:flex;align-items:center;gap:6px;padding:4px 0;font-size:12px}
.tw-wc-density-word{font-weight:600;color:#1a1a2e;min-width:70px;max-width:100px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tw-wc-density-bar-wrap{flex:1;height:5px;background:#f3f4f6;border-radius:3px;overflow:hidden}
.tw-wc-density-bar{height:100%;background:linear-gradient(90deg,#9FFDCE,#56aea4);border-radius:3px;transition:width .3s}
.tw-wc-density-count{color:#6b7280;min-width:20px;text-align:right}
.tw-wc-density-pct{font-weight:600;color:#56aea4;min-width:42px;text-align:right}

/* ═══ ARTICLE TOGGLE — discret, blanc avec lisere vert ═══ */
.tw-wc-article-toggle{margin-bottom:12px}
.tw-wc-toggle-btn{display:flex;align-items:center;gap:8px;width:100%;padding:12px 16px;background:#fff;border:1.5px solid #56aea4;border-radius:10px;cursor:pointer;font-size:14px;font-weight:600;color:#56aea4;font-family:inherit;transition:all .15s;text-align:left}
.tw-wc-toggle-btn:hover{background:#f0fdf8;border-color:#4a9e94;color:#4a9e94}
.tw-wc-toggle-chevron{transition:transform .25s ease;flex-shrink:0;color:#56aea4}
.tw-wc-toggle-btn:hover .tw-wc-toggle-chevron{color:#4a9e94}
.tw-wc-toggle-btn.tw-wc-toggle-open .tw-wc-toggle-chevron{transform:rotate(180deg)}

/* Empty & alerts */
.tw-wc-empty{text-align:center;color:#b0b5c0;font-size:12px;padding:16px 8px}
.tw-wc-alert{padding:8px 12px;border-radius:6px;font-size:12px;margin:6px 0 0}
.tw-wc-alert-success{background:#f0fdf4;color:#16a34a;border:1px solid #bbf7d0}
.tw-wc-alert-error{background:#fef2f2;color:#dc2626;border:1px solid #fecaca}
.tw-wc-loading{display:flex;align-items:center;gap:6px;padding:6px 0;color:#6b7280;font-size:12px}
.tw-wc-spinner{width:16px;height:16px;border:2px solid #e5e7eb;border-top-color:#56aea4;border-radius:50%;animation:tw-wc-spin .6s linear infinite}
@keyframes tw-wc-spin{to{transform:rotate(360deg)}}

/* Value animation */
.tw-wc-val-pop{animation:tw-wc-pop .25s ease}
@keyframes tw-wc-pop{0%{transform:scale(1)}50%{transform:scale(1.06)}100%{transform:scale(1)}}

/* ═══ Responsive ═══ */
@media(max-width:880px){
  .tw-wc-block1{grid-template-columns:1fr}
  .tw-wc-editor-side{border-right:none;border-bottom:1px solid #e5e7eb}
  .tw-wc-textarea{min-height:200px}
  .tw-wc-block2{grid-template-columns:1fr}
}
@media(max-width:500px){
  .tw-wc-header{flex-direction:column;align-items:stretch}
  .tw-wc-header-actions{justify-content:flex-end}
  .tw-wc-url-row{flex-direction:column}
  .tw-wc-btn-primary{width:100%}
  .tw-wc-chart-label{width:70px}
}

/* H1 inside toggle — same visual as before, semantic H1 */
.tw-wc-h2{font-size:14px;font-weight:600;margin:0;padding:0;color:inherit;font-family:inherit;line-height:1.4}
