/* Word Counter - tool-specific styles. Composes the shared primitives in
 * tools.css; only layout unique to this tool lives here. */

:root {
    --wc-accent: #2563eb;
    --wc-accent-dark: #1d4ed8;
    --wc-accent-tint: #eff6ff;
}

.page-hero h1 .wc-hero-mark {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 0.4rem;
    color: var(--wc-accent);
}

/* ---- Input ---- */
.wc-field-label { display: block; font-weight: 600; font-size: 0.92rem; color: #333; margin-bottom: 6px; }
.wc-textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 200px;
    resize: vertical;
    line-height: 1.6;
}
.wc-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
.wc-toolbar-actions { display: flex; gap: 8px; }
.wc-toolbar-hint { font-size: 0.82rem; color: #94a3b8; }

/* ---- Live stat grid ---- */
.wc-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 18px 0 4px;
}
.wc-stat {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 16px 14px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.wc-stat-num {
    font-size: 1.7rem;
    font-weight: 700;
    color: #1f2937;
    line-height: 1.1;
    word-break: break-word;
}
.wc-stat-label {
    font-size: 0.78rem;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    font-weight: 600;
}
.wc-stat--primary {
    background: var(--wc-accent-tint);
    border-color: #bfdbfe;
}
.wc-stat--primary .wc-stat-num { color: var(--wc-accent-dark); font-size: 2rem; }

/* ---- Keyword-density panel ---- */
.wc-density-region { margin-top: 22px; }
.wc-density-sub { color: #64748b; font-size: 0.85rem; }
.wc-density-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
}
.wc-pill-group {
    display: inline-flex;
    border: 1px solid #d7dbe0;
    border-radius: 999px;
    overflow: hidden;
    background: #f8fafc;
}
.wc-pill {
    border: 0;
    background: transparent;
    padding: 6px 13px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #475569;
    cursor: pointer;
    border-right: 1px solid #e6e8eb;
}
.wc-pill:last-child { border-right: 0; }
.wc-pill.is-active { background: var(--wc-accent); color: #fff; }
.wc-stop-toggle {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.84rem;
    color: #475569;
    cursor: pointer;
    user-select: none;
}
.wc-stop-toggle input { accent-color: var(--wc-accent); }
.wc-stop-toggle input:disabled { opacity: 0.5; }

.wc-density-body { padding: 0; }
.wc-density-empty { padding: 26px 22px; color: #94a3b8; text-align: center; margin: 0; }

.wc-density-table th.col-count,
.wc-density-table th.col-density,
.wc-density-table td.col-count,
.wc-density-table td.col-density { text-align: right; }
.wc-density-table th.col-phrase { width: auto; }
.wc-density-table th.col-count { width: 110px; }
.wc-density-table th.col-density { width: 120px; }
.wc-density-table td.col-phrase { word-break: break-word; }
.wc-density-table td.col-count { font-variant-numeric: tabular-nums; color: #1f2937; font-weight: 600; }
.wc-density-table td.col-density { font-variant-numeric: tabular-nums; color: #475569; }

@media (max-width: 640px) {
    .wc-stats { grid-template-columns: repeat(2, 1fr); }
    .wc-stat-num { font-size: 1.5rem; }
    .wc-stat--primary .wc-stat-num { font-size: 1.7rem; }
    .wc-density-controls { width: 100%; justify-content: space-between; }
}
