/* EG Live Word Counter v1.0.0 | GPL-2.0-or-later
 * Every rule is scoped to .eg-wc; no theme-wide form or heading styles.
 * Override --eg-wc-accent and --eg-wc-accent-soft to change the accent.
 */
.eg-wc {
    --eg-wc-accent: #116b56;
    --eg-wc-accent-soft: #eff8f4;
    --eg-wc-ink: #202a32;
    --eg-wc-muted: #59666e;
    --eg-wc-border: #d9e1e4;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    margin: 1.5rem 0 2rem;
    padding: clamp(18px, 3.4vw, 30px);
    border: 1px solid var(--eg-wc-border);
    border-radius: 14px;
    background: #fff;
    color: var(--eg-wc-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.5;
    text-align: start;
    color-scheme: light;
}

.eg-wc *,
.eg-wc *::before,
.eg-wc *::after {
    box-sizing: border-box;
}

.eg-wc [hidden] {
    display: none !important;
}

.eg-wc .eg-wc__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin: 0 0 22px;
}

.eg-wc .eg-wc__heading {
    min-width: 0;
}

.eg-wc .eg-wc__title {
    margin: 0 0 6px;
    padding: 0;
    border: 0;
    color: var(--eg-wc-ink);
    font-family: inherit;
    font-size: clamp(20px, 2.4vw, 25px);
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.025em;
    text-transform: none;
    overflow-wrap: anywhere;
}

.eg-wc .eg-wc__intro {
    margin: 0;
    color: var(--eg-wc-muted);
    font-size: 14px;
    line-height: 1.6;
}

.eg-wc .eg-wc__live {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--eg-wc-accent-soft);
    color: var(--eg-wc-accent);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.5;
}

.eg-wc .eg-wc__live::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.eg-wc .eg-wc__stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 0 0 22px;
    padding: 0;
    border: 0;
}

.eg-wc .eg-wc__stat {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid var(--eg-wc-border);
    border-radius: 9px;
    background: #f8fafb;
}

.eg-wc .eg-wc__stat--words {
    border-color: #c7ded4;
    background: var(--eg-wc-accent-soft);
}

.eg-wc .eg-wc__stat dt {
    margin: 0 0 5px;
    padding: 0;
    color: var(--eg-wc-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.4;
    text-transform: none;
    overflow-wrap: anywhere;
}

.eg-wc .eg-wc__stat dd {
    margin: 0;
    padding: 0;
    color: var(--eg-wc-ink);
    font-size: clamp(25px, 4vw, 36px);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.025em;
    font-variant-numeric: tabular-nums;
    overflow-wrap: anywhere;
}

.eg-wc .eg-wc__stat--words dd {
    color: var(--eg-wc-accent);
}

.eg-wc .eg-wc__label {
    display: block;
    margin: 0 0 8px;
    color: var(--eg-wc-ink);
    font-size: 14px;
    font-weight: 600;
}

.eg-wc .eg-wc__text {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 180px;
    height: auto;
    margin: 0;
    padding: 16px;
    border: 1px solid #abbac1;
    border-radius: 9px;
    outline: 0;
    background: #fff;
    box-shadow: none;
    color: var(--eg-wc-ink);
    font-family: inherit;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.7;
    letter-spacing: normal;
    text-transform: none;
    resize: vertical;
}

.eg-wc .eg-wc__text::placeholder {
    color: #697780;
    opacity: 1;
}

.eg-wc .eg-wc__text:focus {
    border-color: var(--eg-wc-accent);
    outline: 2px solid var(--eg-wc-accent);
    outline-offset: 2px;
}

.eg-wc .eg-wc__footer {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.eg-wc .eg-wc__privacy {
    flex: 1 1 220px;
    margin: 0;
    color: var(--eg-wc-muted);
    font-size: 12px;
    line-height: 1.6;
}

.eg-wc .eg-wc__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.eg-wc .eg-wc__button {
    display: inline-block;
    width: auto;
    min-height: 44px;
    margin: 0;
    padding: 9px 14px;
    border: 1px solid #b7c3c8;
    border-radius: 7px;
    background: #fff;
    box-shadow: none;
    color: var(--eg-wc-ink);
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: normal;
    text-decoration: none;
    text-transform: none;
    cursor: pointer;
    appearance: none;
}

.eg-wc .eg-wc__button:hover:not(:disabled) {
    border-color: var(--eg-wc-accent);
    background: var(--eg-wc-accent-soft);
    color: var(--eg-wc-accent);
}

.eg-wc .eg-wc__button:focus,
.eg-wc .eg-wc__details > summary:focus {
    outline: 2px solid var(--eg-wc-accent);
    outline-offset: 3px;
}

.eg-wc .eg-wc__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.eg-wc .eg-wc__button--undo {
    border-color: var(--eg-wc-accent);
    color: var(--eg-wc-accent);
}

.eg-wc .eg-wc__details {
    margin: 18px 0 0;
    padding: 14px 0 0;
    border: 0;
    border-top: 1px solid var(--eg-wc-border);
    background: transparent;
    color: var(--eg-wc-muted);
    font-size: 12px;
    line-height: 1.7;
}

.eg-wc .eg-wc__details > summary {
    display: list-item;
    width: fit-content;
    max-width: 100%;
    margin: 0;
    padding: 3px 0;
    color: var(--eg-wc-muted);
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
    cursor: pointer;
}

.eg-wc .eg-wc__details p {
    margin: 10px 0 0;
    color: inherit;
    font-size: inherit;
    line-height: inherit;
}

.eg-wc .eg-wc__fallback,
.eg-wc .eg-wc__notice {
    margin: 12px 0 0;
    padding: 12px;
    border: 1px solid #dec789;
    border-radius: 6px;
    background: #fff8e7;
    color: #584313;
    font-size: 13px;
}

.eg-wc .eg-wc__sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    clip-path: inset(50%) !important;
    border: 0 !important;
    white-space: nowrap !important;
}

@media (max-width: 480px) {
    .eg-wc .eg-wc__stats {
        gap: 7px;
    }

    .eg-wc .eg-wc__stat {
        padding: 12px 9px;
    }

    .eg-wc .eg-wc__stat dt {
        font-size: 11px;
    }

    .eg-wc .eg-wc__text {
        padding: 12px;
    }
}

@media (max-width: 360px) {
    .eg-wc .eg-wc__stats {
        grid-template-columns: 1fr;
    }

    .eg-wc .eg-wc__stat {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .eg-wc .eg-wc__stat dt {
        margin: 0;
        font-size: 12px;
    }
}

@media (forced-colors: active) {
    .eg-wc .eg-wc__text:focus,
    .eg-wc .eg-wc__button:focus,
    .eg-wc .eg-wc__details > summary:focus {
        outline-color: Highlight;
    }
}
