.word-filter-panel {
    margin-bottom: 2rem;
    padding: 1.25rem;
    border: 2px solid #e5e7eb;
    border-radius: 1.25rem;
    background: linear-gradient(135deg, rgba(241, 250, 238, 0.85), #fff);
}

.word-filter-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.word-filter-title {
    margin: 0 0 0.25rem;
    color: #1d3557;
    font-size: 1.125rem;
    font-weight: 700;
}

.word-filter-description,
.word-filter-status {
    color: #4b5563;
    font-size: 0.875rem;
    line-height: 1.5;
}

.word-filter-reset {
    flex: none;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 2px solid #1d3557;
    border-radius: 0.75rem;
    color: #1d3557;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.word-filter-reset:hover,
.word-filter-reset:focus-visible {
    background: #1d3557;
    color: #fff;
}

.word-preset-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 1rem;
    padding: 0;
    border: 0;
}

.word-preset-list legend {
    width: 100%;
    margin-bottom: 0.5rem;
    color: #1d3557;
    font-size: 0.875rem;
    font-weight: 700;
}

.word-preset-btn {
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 2px solid #a8dadc;
    border-radius: 9999px;
    background: #fff;
    color: #1d3557;
    font-size: 0.875rem;
    font-weight: 700;
    transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.word-preset-btn:hover,
.word-preset-btn:focus-visible {
    border-color: #457b9d;
}

.word-preset-btn[aria-pressed="true"] {
    border-color: #1d3557;
    background: #1d3557;
    color: #fff;
}

.word-filter-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.875rem;
}

.word-filter-field {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.word-filter-label {
    color: #1d3557;
    font-size: 0.8125rem;
    font-weight: 700;
}

.word-filter-control {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    background: #fff;
    color: #1d3557;
}

.word-filter-control:focus {
    border-color: #e63946;
    outline: 3px solid rgba(230, 57, 70, 0.16);
    outline-offset: 1px;
}

.word-filter-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 4.25rem;
    padding: 0.625rem 0.75rem;
    border: 2px solid #d1d5db;
    border-radius: 0.75rem;
    background: #fff;
    color: #1d3557;
    cursor: pointer;
}

.word-filter-toggle:focus-within {
    border-color: #e63946;
    outline: 3px solid rgba(230, 57, 70, 0.16);
    outline-offset: 1px;
}

.word-filter-toggle input {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    accent-color: #e63946;
}

.word-filter-toggle span {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}

.word-filter-toggle strong {
    font-size: 0.875rem;
}

.word-filter-toggle small {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.35;
}

.word-filter-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1rem;
}

.word-filter-status {
    margin: 0;
    font-weight: 600;
}

.word-filter-status[data-state="error"] {
    color: #b42318;
}

.word-result-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.75rem;
    padding: 0.75rem 1rem;
    border: 2px solid #a8dadc;
    border-radius: 1rem;
    background: #fff;
}

.word-result-actions[hidden] {
    display: none;
}

.word-result-copy-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.875rem;
    border: 2px solid #1d3557;
    border-radius: 0.75rem;
    background: #1d3557;
    color: #fff;
    font-size: 0.875rem;
    font-weight: 700;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.word-result-copy-all:hover,
.word-result-copy-all:focus-visible {
    border-color: #e63946;
    background: #e63946;
}

.word-result-copy-all svg {
    width: 1.125rem;
    height: 1.125rem;
}

.word-result-action-status {
    margin: 0;
    color: #1d3557;
    font-size: 0.875rem;
    font-weight: 600;
}

#generateBtn:disabled {
    cursor: not-allowed;
    opacity: 0.55;
    transform: none;
    box-shadow: none;
}

@media (max-width: 640px) {
    .word-filter-header,
    .word-filter-footer,
    .word-result-actions {
        align-items: stretch;
        flex-direction: column;
    }

    .word-filter-grid {
        grid-template-columns: 1fr;
    }

    .word-filter-reset {
        align-self: flex-start;
    }

    .word-result-copy-all {
        width: 100%;
    }
}
