.celpip-keyboard-tool .celpip-typing-passage {
    max-block-size: 19rem;
    overflow: auto;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    background: var(--seo-soft);
    border: 1px solid var(--seo-line);
    border-radius: 10px;
    padding: 14px 18px;
}

.celpip-keyboard-options,
.celpip-keyboard-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
}

.celpip-keyboard-actions {
    margin: 16px 0;
}

.celpip-keyboard-options[hidden],
.celpip-keyboard-actions[hidden],
.celpip-spelling-entry[hidden] {
    display: none;
}

.celpip-keyboard-options > div {
    position: relative;
    flex: 1 1 10rem;
    min-width: 0;
}

.celpip-keyboard-options select,
.celpip-keyboard-tool textarea,
.celpip-spelling-entry input {
    display: block;
    box-sizing: border-box;
    border: 1px solid var(--seo-muted);
    border-radius: 8px;
    background: var(--seo-panel);
    color: var(--seo-text);
    padding: 10px 12px;
    min-height: 44px;
    font: inherit;
    width: 100%;
}

/* Keep native select behaviour with a consistent touch target in WebKit. */
.celpip-keyboard-options select {
    appearance: none;
    padding-inline-end: 36px;
}

.celpip-keyboard-options > div::after {
    content: "";
    position: absolute;
    inset-inline-end: 15px;
    inset-block-end: 21px;
    width: 7px;
    height: 7px;
    border: solid var(--seo-muted);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    pointer-events: none;
}

.celpip-keyboard-options label,
.celpip-keyboard-tool label,
.celpip-spelling-entry label {
    display: block;
    font-weight: 600;
    margin-bottom: 4px;
}

.celpip-keyboard-tool textarea {
    resize: vertical;
}

.celpip-keyboard-tool textarea[readonly] {
    background: var(--seo-bg);
}

.celpip-keyboard-actions button.seo-button {
    background: var(--seo-accent);
    color: var(--seo-on-accent);
}

.celpip-keyboard-actions button.seo-button:not(:disabled):hover {
    background: var(--seo-accent-hover);
}

.celpip-keyboard-actions button:disabled {
    opacity: .6;
    cursor: default;
}

.celpip-keyboard-actions p.celpip-typing-timer,
.celpip-keyboard-actions p[data-celpip-spelling-summary] {
    margin: 0;
    font-variant-numeric: tabular-nums;
}

.celpip-keyboard-definitions > div {
    border-bottom: 1px solid var(--seo-line);
    padding-block: 10px;
}

.celpip-keyboard-definitions dt,
.celpip-spelling-entry p[data-celpip-spelling-feedback] {
    font-weight: 600;
}

.celpip-spelling-list {
    list-style: decimal;
    padding-inline-start: 28px;
}

.celpip-spelling-list mark {
    color: var(--seo-text);
    background: var(--seo-soft);
    padding: 1px 3px;
    border-radius: 3px;
}

.celpip-spelling-entry {
    display: grid;
    gap: 5px;
    max-width: 28rem;
    margin-top: 12px;
}

.celpip-spelling-list details {
    margin-block: 12px 0;
}

@media (max-width: 600px) {
    .celpip-keyboard-tool .celpip-typing-passage {
        max-block-size: 11rem;
    }
}

.celpip-keyboard-actions button:not(.seo-button):hover {
    background: var(--seo-soft);
    border-color: var(--seo-muted);
}
