/* Character Counter - tool-specific styles. Composes shared primitives in
 * tools.css; only this tool's layout lives here. */

:root {
    --cc-accent: #0891b2;
    --cc-accent-dark: #0e7490;
    --cc-accent-tint: #ecfeff;
    --cc-near: #d97706;
    --cc-over: #dc2626;
}

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

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

/* ---- Gauge card ---- */
.cc-gauge-card {
    margin: 18px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 20px 22px;
}
.cc-gauge-top {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}
.cc-count-wrap { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.cc-count {
    font-size: 2.6rem;
    font-weight: 800;
    line-height: 1;
    color: var(--cc-accent-dark);
    font-variant-numeric: tabular-nums;
}
.cc-count-of { font-size: 1rem; color: #64748b; font-weight: 600; }

.cc-target-wrap { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cc-target-label { font-size: 0.85rem; color: #475569; font-weight: 600; }
.cc-target-select {
    font: inherit;
    font-size: 0.9rem;
    padding: 7px 30px 7px 11px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background-color: #fff;
    color: #1f2937;
    cursor: pointer;
    max-width: 100%;
}
.cc-target-select:focus { outline: 2px solid var(--cc-accent); border-color: var(--cc-accent); }
.cc-custom-input {
    font: inherit;
    width: 110px;
    padding: 7px 10px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
}
.cc-custom-input[hidden] { display: none; }
.cc-custom-input:focus { outline: 2px solid var(--cc-accent); border-color: var(--cc-accent); }

.cc-bar {
    margin-top: 16px;
    height: 10px;
    border-radius: 999px;
    background: #eef1f4;
    overflow: hidden;
}
.cc-bar-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--cc-accent);
    transition: width 0.12s ease-out, background-color 0.15s;
}
.cc-remaining {
    margin: 10px 0 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
}
.cc-gauge-card.is-near .cc-bar-fill { background: var(--cc-near); }
.cc-gauge-card.is-near .cc-remaining { color: var(--cc-near); }
.cc-gauge-card.is-over .cc-bar-fill { background: var(--cc-over); }
.cc-gauge-card.is-over .cc-count { color: var(--cc-over); }
.cc-gauge-card.is-over .cc-remaining { color: var(--cc-over); }

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

@media (max-width: 640px) {
    .cc-gauge-top { flex-direction: column; align-items: stretch; }
    .cc-target-wrap { justify-content: space-between; }
    .cc-target-select { flex: 1 1 auto; }
    .cc-count { font-size: 2.2rem; }
    .cc-stats { grid-template-columns: repeat(2, 1fr); }
}
