.special-text-input {
    width: 100%;
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.9rem;
    line-height: 1.6;
}

.special-text-input__editor {
    min-height: calc(1.6em * var(--rows, 4) + 12px);
    padding: 6px 8px;
    border: 1px solid var(--rz-input-border-color, #ced4da);
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow: auto;
    outline: none;
}

.special-text-input__editor:focus {
    border-color: var(--rz-primary, #1976d2);
}

.special-text-input__editor:empty::before {
    content: attr(data-placeholder);
    color: #999;
    pointer-events: none;
}

.special-text-input__chip {
    display: inline-block;
    padding: 0 4px;
    margin: 0 1px;
    background-color: #4a4a4a;
    color: #ffe9a8;
    border-radius: 3px;
    font-size: 0.75em;
    font-weight: bold;
    line-height: 1.2;
    vertical-align: baseline;
    font-family: Consolas, "Courier New", monospace;
    user-select: all; /* selection encloses the whole chip */
    -webkit-user-modify: read-only;
    cursor: default;
}

/* LF and CR chips force a visual line break so Enter (and CR) look like a
   newline while still being represented as chips in the document. A CR
   immediately followed by an LF should only break the line once - the LF
   will provide the break, so suppress the CR's break in that case. */
.special-text-input__chip[data-char="10"]::after,
.special-text-input__chip[data-char="13"]::after {
    content: "";
    display: block;
}

.special-text-input__chip[data-char="13"]:has(+ .special-text-input__chip[data-char="10"])::after {
    display: none;
}

.special-text-input--disabled .special-text-input__editor {
    background-color: #f5f5f5;
    cursor: not-allowed;
    color: #777;
}

/* Single-line mode: force no wrap, no line breaks, horizontal scroll. */
.special-text-input--single-line .special-text-input__editor {
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    min-height: calc(1.6em + 12px);
}

.special-text-input--single-line .special-text-input__chip[data-char="10"]::after,
.special-text-input--single-line .special-text-input__chip[data-char="13"]::after {
    display: none;
}

/* Borderless mode: drop the editor's own border / padding / background so it
   can sit inside another bordered container (e.g. SpecialCharacterInput). */
.special-text-input--borderless .special-text-input__editor {
    border: 0;
    border-radius: 0;
    background-color: transparent;
    padding: 4px 6px;
}

.special-text-input--borderless .special-text-input__editor:focus {
    border-color: transparent;
}

