.text-workbench {
    display: grid;
    gap: 16px;
    width: 100%;
}

.name-sticky-editor {
    position: sticky;
    top: calc(var(--topbar-height) + 10px);
    z-index: 30;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 12px;
    width: min(100%, 720px);
    margin-inline: auto;
    padding: 12px 14px;
    border: 1px solid rgba(244, 124, 32, .5);
    border-radius: 14px;
    background: rgba(12, 15, 22, .94);
    box-shadow: 0 16px 34px rgba(0, 0, 0, .32), 0 0 0 1px rgba(244, 124, 32, .05);
    backdrop-filter: blur(16px);
}

.name-sticky-editor .text-field {
    grid-template-columns: auto minmax(180px, 1fr);
    align-items: center;
    gap: 11px;
}

.name-sticky-editor .text-field > span {
    white-space: nowrap;
}

.name-sticky-editor .text-field input {
    border-color: rgba(244, 124, 32, .3);
    background: rgba(8, 9, 13, .9);
    font-size: 1rem;
    padding-inline-end: 48px;
}

.name-input-control {
    position: relative;
    display: block;
    min-width: 0;
}

.name-input-control input {
    display: block;
}

.name-inline-copy {
    position: absolute;
    inset-block: 6px;
    inset-inline-end: 6px;
    display: inline-grid;
    place-items: center;
    width: 34px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: var(--orange-2);
    background: rgba(244, 124, 32, .12);
    cursor: pointer;
    transition: background .18s ease, color .18s ease;
}

.name-inline-copy:hover,
.name-inline-copy:focus-visible {
    color: #2a1508;
    background: var(--orange);
    outline: 0;
}

.name-inline-copy svg {
    width: 16px;
    height: 16px;
}

.name-sticky-icon {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(244, 124, 32, .35);
    border-radius: 11px;
    color: var(--orange-2);
    background: rgba(244, 124, 32, .1);
}

.name-sticky-icon svg {
    width: 18px;
    height: 18px;
}

.text-panel,
.text-results-panel,
.text-stats-grid,
.text-manual-builder {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(15, 19, 27, .78);
    box-shadow: var(--shadow);
}

.text-panel,
.text-results-panel,
.text-manual-builder {
    display: grid;
    gap: 15px;
    padding: clamp(15px, 2vw, 22px);
}

.text-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    align-items: start;
}

.text-field {
    display: grid;
    gap: 8px;
    min-width: 0;
}

.text-field > span,
.text-options-title {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 800;
}

.text-field input,
.text-field textarea,
.text-field select,
.text-search {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    color: var(--text);
    background: rgba(8, 9, 13, .72);
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease;
}

.text-field input,
.text-field select,
.text-search {
    min-height: 46px;
    padding: 0 13px;
}

/* A consistent dark select control for the duplicate cleaner. */
[data-text-tool="duplicate-remover"] [data-duplicate-sort] {
    appearance: none;
    padding-inline: 12px 34px;
    color: var(--text);
    background-color: rgba(8, 9, 13, .84);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23f5bd67' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
    background-position: left 11px center;
    background-repeat: no-repeat;
    background-size: 15px;
}

html[dir="ltr"] [data-text-tool="duplicate-remover"] [data-duplicate-sort] {
    background-position: right 11px center;
}

[data-text-tool="duplicate-remover"] [data-duplicate-sort] option {
    color: var(--text);
    background: #151923;
}

.text-field textarea {
    min-height: 245px;
    padding: 14px;
    resize: vertical;
    line-height: 1.85;
}

.text-field textarea.text-area-short {
    min-height: 170px;
}

.text-field input:focus,
.text-field textarea:focus,
.text-field select:focus,
.text-search:focus {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(244, 124, 32, .1);
}

.text-toolbar,
.text-filter-bar,
.text-mode-tabs,
.text-copy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
}

.text-toolbar {
    justify-content: space-between;
}

.text-toolbar-group {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
}

.text-button,
.text-chip,
.text-mode-button,
.symbol-card,
.decoration-card {
    border: 1px solid var(--line);
    color: var(--text);
    background: rgba(8, 9, 13, .56);
    font: inherit;
    cursor: pointer;
    transition: border-color .17s ease, color .17s ease, background .17s ease, transform .17s ease;
}

.text-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 10px;
    font-size: .82rem;
    font-weight: 800;
}

.text-button svg {
    width: 17px;
    height: 17px;
}

.text-button-primary {
    border-color: rgba(244, 124, 32, .44);
    color: #16100a;
    background: linear-gradient(135deg, var(--orange), var(--orange-2));
}

.text-button:hover,
.text-chip:hover,
.text-mode-button:hover,
.symbol-card:hover,
.decoration-card:hover {
    border-color: rgba(244, 124, 32, .6);
    color: var(--orange-2);
    transform: translateY(-1px);
}

.text-button-primary:hover {
    color: #08090d;
}

.text-chip,
.text-mode-button {
    min-height: 38px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: .76rem;
    font-weight: 800;
}

.text-chip.is-active,
.text-mode-button.is-active {
    border-color: rgba(244, 124, 32, .55);
    color: var(--orange-2);
    background: rgba(244, 124, 32, .11);
}

.decoration-filter-label-mobile {
    display: none;
}

.text-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.text-section-head > div {
    display: grid;
    gap: 3px;
}

.text-section-head h2,
.text-section-head h3 {
    margin: 0;
    color: var(--text);
    font-size: clamp(1rem, 2vw, 1.15rem);
}

.text-section-head p {
    margin: 0;
    color: var(--muted);
    font-size: .76rem;
}

.text-section-count {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    color: var(--orange-2);
    background: rgba(244, 124, 32, .1);
    font-size: .72rem;
    font-weight: 800;
}

.decoration-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 9px;
}

.decoration-card {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 66px;
    padding: 10px 12px 10px 36px;
    border-radius: 11px;
    overflow: hidden;
    direction: rtl;
    font-size: clamp(.86rem, 1.5vw, 1rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

[dir="ltr"] .decoration-card {
    padding: 10px 36px 10px 12px;
}

.decoration-card svg {
    position: absolute;
    inset-inline-end: 11px;
    width: 15px;
    height: 15px;
    color: var(--muted);
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
}

.name-symbol-filters {
    flex-wrap: nowrap;
    padding-bottom: 6px;
    overflow-x: auto;
    scrollbar-width: thin;
}

.name-symbol-filters .text-chip {
    flex: 0 0 auto;
}

.name-symbol-grid {
    grid-template-columns: repeat(auto-fill, minmax(54px, 1fr));
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    max-height: 430px;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow-y: auto;
    overflow-x: hidden;
    background: rgba(8, 9, 13, .38);
    scrollbar-color: rgba(244, 124, 32, .45) transparent;
    scrollbar-width: thin;
}

.name-symbol-card {
    min-width: 0;
    max-width: 100%;
    min-height: 52px;
    font-size: 1.3rem;
    overflow: hidden;
}

.symbol-library-actions {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding-top: 10px;
}

.symbol-library-actions[hidden] {
    display: none;
}

.symbols-selection-dock {
    position: sticky;
    top: calc(var(--topbar-height) + 10px);
    z-index: 12;
    display: grid;
    gap: 6px;
    margin-bottom: 10px;
    padding: 8px;
    border: 1px solid rgba(244, 124, 32, .34);
    border-radius: 12px;
    background: rgba(17, 19, 27, .96);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .2);
}

.symbols-selection-head,
.symbols-selection-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}

.symbols-selection-head {
    justify-content: space-between;
    color: var(--orange-2);
    font-size: .78rem;
    font-weight: 800;
}

.symbols-selection-title-mobile {
    display: none;
}

.symbols-selection-actions .text-button {
    min-height: 30px;
    padding: 4px 7px;
    font-size: .68rem;
}

.symbols-selection-actions .text-button svg {
    width: 13px;
    height: 13px;
}

.symbols-selection-dock textarea {
    width: 100%;
    min-height: 42px;
    max-height: 86px;
    resize: vertical;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    background: rgba(8, 9, 13, .72);
    font: inherit;
    font-size: 1rem;
    line-height: 1.35;
}

.symbol-card {
    position: relative;
    display: grid;
    place-items: center;
    min-height: 60px;
    padding: 7px;
    border-radius: 10px;
    font-size: 1.35rem;
}

.symbol-card.is-copied,
.symbol-card.is-added,
.decoration-card.is-copied {
    border-color: rgba(44, 211, 148, .6);
    color: #2cd394;
    background: rgba(44, 211, 148, .08);
}

.text-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
}

.text-option {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 11px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(8, 9, 13, .42);
    font-size: .78rem;
    font-weight: 700;
    cursor: pointer;
}

.text-option input {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    accent-color: var(--orange);
}

.text-stats-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 1px;
    padding: 1px;
    overflow: hidden;
}

.text-stat {
    display: grid;
    gap: 6px;
    padding: 18px 12px;
    text-align: center;
    background: rgba(12, 15, 22, .93);
}

.text-stat strong {
    color: var(--orange-2);
    font-size: clamp(1.3rem, 3vw, 2rem);
    line-height: 1;
}

.text-stat span {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 800;
}

.text-live-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 16px;
    color: var(--muted);
    font-size: .75rem;
}

.text-live-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.text-live-meta svg {
    width: 15px;
    height: 15px;
    color: var(--orange-2);
}

.text-reader-panel {
    display: grid;
    gap: 15px;
    min-width: 0;
    padding: clamp(15px, 2vw, 22px);
    border: 1px solid rgba(244, 124, 32, .28);
    border-radius: var(--radius);
    background: linear-gradient(145deg, rgba(244, 124, 32, .055), rgba(15, 19, 27, .8));
    box-shadow: var(--shadow);
}

.reader-status {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    max-width: 100%;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: rgba(8, 9, 13, .48);
    font-size: .72rem;
    font-weight: 800;
}

.reader-status svg {
    flex: 0 0 auto;
    width: 16px;
    height: 16px;
    color: var(--orange-2);
}

.reader-status.is-reading {
    border-color: rgba(44, 211, 148, .35);
    color: #bdf5dc;
    background: rgba(44, 211, 148, .07);
}

.reader-status.is-paused {
    border-color: rgba(215, 169, 77, .4);
    color: var(--gold);
}

.reader-description-mobile {
    display: none;
}

.reader-control-bar {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}

.reader-settings {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    min-width: 0;
}

.reader-voice-field {
    flex: 0 1 360px;
    width: 360px;
    max-width: 360px;
}

.reader-speed-field {
    flex: 0 1 240px;
    width: 240px;
}

.reader-voice-picker {
    position: relative;
    min-width: 0;
}

.reader-voice-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 46px;
    padding: 0 13px;
    border: 1px solid var(--line);
    border-radius: 11px;
    outline: 0;
    color: var(--text);
    background: rgba(8, 9, 13, .72);
    font: inherit;
    text-align: start;
    cursor: pointer;
}

.reader-voice-toggle > span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.reader-voice-toggle svg {
    flex: 0 0 auto;
    width: 17px;
    height: 17px;
    color: var(--orange-2);
    transition: transform .18s ease;
}

.reader-voice-picker.is-open .reader-voice-toggle {
    border-color: var(--orange);
    box-shadow: 0 0 0 3px rgba(244, 124, 32, .1);
}

.reader-voice-picker.is-open .reader-voice-toggle svg {
    transform: rotate(180deg);
}

.reader-voice-menu {
    position: absolute;
    z-index: 30;
    inset-inline: 0;
    top: calc(100% + 7px);
    padding: 6px;
    border: 1px solid rgba(244, 124, 32, .32);
    border-radius: 12px;
    background: #0d1016;
    box-shadow: 0 18px 42px rgba(0, 0, 0, .48);
}

.reader-voice-menu[hidden] {
    display: none;
}

.reader-voice-list {
    display: grid;
    gap: 3px;
    max-height: 255px;
    padding-inline-end: 4px;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: var(--orange) #171b23;
}

.reader-voice-list::-webkit-scrollbar {
    width: 8px;
}

.reader-voice-list::-webkit-scrollbar-track {
    border-radius: 999px;
    background: #171b23;
}

.reader-voice-list::-webkit-scrollbar-thumb {
    border: 2px solid #171b23;
    border-radius: 999px;
    background: linear-gradient(var(--orange), var(--orange-2));
}

.reader-voice-group {
    padding: 7px 9px 4px;
    color: var(--orange-2);
    font-size: .68rem;
    font-weight: 900;
}

.reader-voice-option {
    position: relative;
    display: grid;
    gap: 2px;
    width: 100%;
    padding: 8px 30px 8px 10px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--text);
    background: transparent;
    font: inherit;
    text-align: start;
    cursor: pointer;
}

[dir="ltr"] .reader-voice-option {
    padding: 8px 10px 8px 30px;
}

.reader-voice-option:hover,
.reader-voice-option.is-selected {
    border-color: rgba(244, 124, 32, .28);
    background: rgba(244, 124, 32, .1);
}

.reader-voice-option.is-selected::after {
    position: absolute;
    inset-inline-start: 10px;
    top: 50%;
    color: var(--orange-2);
    content: '✓';
    font-weight: 900;
    transform: translateY(-50%);
}

.reader-voice-option small {
    color: var(--muted);
    font-size: .68rem;
}

.reader-speed-field input[type="range"] {
    width: 100%;
    min-height: 46px;
    margin: 0;
    padding: 0;
    accent-color: var(--orange);
    cursor: pointer;
}

.reader-speed-field output {
    color: var(--orange-2);
}

.reader-actions {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: nowrap;
    align-items: center;
    gap: 9px;
}

.reader-actions .text-button:disabled {
    opacity: .42;
    cursor: not-allowed;
    transform: none;
}

.text-manual-preview {
    display: grid;
    place-items: center;
    min-height: 88px;
    padding: 18px;
    border: 1px dashed rgba(244, 124, 32, .34);
    border-radius: 12px;
    color: var(--text);
    background: rgba(244, 124, 32, .055);
    direction: rtl;
    text-align: center;
    font-size: clamp(1rem, 2.3vw, 1.35rem);
    font-weight: 800;
    overflow-wrap: anywhere;
}

.text-empty {
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
    min-height: 150px;
    margin: 0;
    padding: 20px;
    color: var(--muted);
    text-align: center;
}

.text-privacy-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: 0;
    color: var(--muted);
    font-size: .75rem;
}

.text-privacy-note svg {
    width: 16px;
    height: 16px;
    color: var(--orange-2);
}

.text-tool-article {
    display: grid;
    gap: 14px;
    margin-top: 22px;
    padding-top: 24px;
    border-top: 1px solid rgba(244, 124, 32, .35);
}

.text-tool-article h2,
.text-tool-article h3,
.text-tool-article p,
.text-tool-article ul {
    margin: 0;
}

.text-tool-article h2 {
    color: var(--text);
    font-size: clamp(1.15rem, 2.4vw, 1.5rem);
}

.text-tool-article h3 {
    margin-top: 4px;
    color: var(--orange-2);
    font-size: 1rem;
}

.text-tool-article p,
.text-tool-article li {
    color: var(--muted);
    line-height: 1.95;
    font-size: .87rem;
}

.text-tool-article ul {
    display: grid;
    gap: 6px;
    padding-inline-start: 20px;
}

.text-toast {
    position: fixed;
    inset-inline-end: 24px;
    bottom: 24px;
    z-index: 80;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(360px, calc(100vw - 32px));
    padding: 11px 15px;
    border: 1px solid rgba(44, 211, 148, .35);
    border-radius: 11px;
    color: #dffbed;
    background: rgba(13, 31, 25, .96);
    box-shadow: 0 16px 40px rgba(0, 0, 0, .35);
    font-size: .8rem;
    font-weight: 800;
    transform: translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.text-toast.is-visible {
    transform: translateY(0);
    opacity: 1;
}

@media (max-width: 1100px) {
    .reader-control-bar {
        flex-wrap: wrap;
    }

    .decoration-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .text-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    /* Keep the cleaner compact on phones without changing the other text tools. */
    [data-text-tool="text-cleaner"] .text-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    [data-text-tool="duplicate-remover"] .text-options {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 5px;
    }

    [data-text-tool="case-converter"] .text-mode-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="reverser-sorter"] .text-mode-tabs {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="reverser-sorter"] .text-mode-button {
        min-width: 0;
        min-height: 35px;
        padding: 5px 3px;
        font-size: clamp(.55rem, 2.2vw, .67rem);
        line-height: 1.1;
        text-align: center;
    }

    [data-text-tool="case-converter"] .text-mode-button {
        min-width: 0;
        min-height: 35px;
        padding: 5px 3px;
        font-size: clamp(.55rem, 2.2vw, .67rem);
        line-height: 1.1;
        text-align: center;
    }

    [data-text-tool="case-converter"] .text-toolbar-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="case-converter"] .text-toolbar-group .text-button {
        width: 100%;
        min-width: 0;
        min-height: 35px;
        padding: 5px 6px;
        gap: 4px;
        font-size: .67rem;
        white-space: nowrap;
    }

    [data-text-tool="case-converter"] .text-toolbar-group .text-button svg {
        width: 13px;
        height: 13px;
        flex: 0 0 auto;
    }

    [data-text-tool="duplicate-remover"] .text-option {
        min-height: 38px;
        padding: 5px 6px;
        gap: 5px;
        font-size: clamp(.55rem, 2.2vw, .68rem);
        line-height: 1.18;
    }

    [data-text-tool="duplicate-remover"] .text-option input {
        width: 14px;
        height: 14px;
    }

    [data-text-tool="duplicate-remover"] [data-duplicate-sort] {
        min-height: 40px;
        padding-inline: 10px 31px;
        font-size: .72rem;
        background-position: left 9px center;
        background-size: 13px;
    }

    html[dir="ltr"] [data-text-tool="duplicate-remover"] [data-duplicate-sort] {
        background-position: right 9px center;
    }

    [data-text-tool="text-cleaner"] .text-option {
        gap: 5px;
        min-height: 36px;
        padding: 5px 6px;
        font-size: clamp(.58rem, 2.35vw, .7rem);
        line-height: 1.2;
    }

    [data-text-tool="text-cleaner"] .text-option input {
        width: 14px;
        height: 14px;
    }

    [data-text-tool="text-cleaner"] .text-toolbar-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="text-cleaner"] .text-toolbar-group .text-button {
        min-width: 0;
        min-height: 35px;
        padding: 5px 4px;
        gap: 4px;
        font-size: clamp(.56rem, 2.2vw, .68rem);
        line-height: 1;
        white-space: nowrap;
    }

    [data-text-tool="text-cleaner"] .text-toolbar-group .text-button svg {
        width: 13px;
        height: 13px;
        flex: 0 0 auto;
    }

    [data-text-tool="name-decorator"] [data-decoration-filters] {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: stretch;
        gap: 3px;
    }

    [data-text-tool="name-decorator"] [data-decoration-filters] .text-chip {
        flex: 1 1 0;
        min-width: 0;
        min-height: 30px;
        padding-inline: 3px;
        border-radius: 8px;
        font-size: clamp(.54rem, 2.1vw, .64rem);
        line-height: 1.1;
        white-space: nowrap;
    }

    [data-text-tool="name-decorator"] [data-decoration-filters] .decoration-filter-label-full {
        display: none;
    }

    [data-text-tool="name-decorator"] [data-decoration-filters] .decoration-filter-label-mobile {
        display: inline;
    }

    [data-text-tool="name-decorator"] .text-toolbar-group {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 6px;
    }

    [data-text-tool="name-decorator"] .text-toolbar-group .text-button {
        width: 100%;
        min-width: 0;
        min-height: 37px;
        padding: 6px 7px;
        font-size: .72rem;
        white-space: nowrap;
    }

    [data-text-tool="name-decorator"] .text-copy-row {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="name-decorator"] .text-copy-row .text-button {
        min-width: 0;
        min-height: 34px;
        padding: 5px 4px;
        justify-content: center;
        gap: 3px;
        font-size: .66rem;
        white-space: nowrap;
    }

    [data-text-tool="name-decorator"] .text-copy-row .text-button svg {
        width: 13px;
        height: 13px;
        flex: 0 0 auto;
    }

    [data-text-tool="symbols-copy"] .text-filter-bar {
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        min-height: 46px;
        box-sizing: border-box;
        padding: 4px 2px 7px;
        scrollbar-width: thin;
        -webkit-overflow-scrolling: touch;
    }

    [data-text-tool="symbols-copy"] .text-filter-bar .text-chip {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    [data-text-tool="symbols-copy"] .symbol-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        min-width: 0;
        overflow: hidden;
        gap: 5px;
    }

    [data-text-tool="symbols-copy"] .symbol-card {
        min-width: 0;
        max-width: 100%;
        min-height: 40px;
        padding: 3px;
        font-size: 1.08rem;
        overflow: hidden;
        white-space: nowrap;
    }

    [data-text-tool="symbols-copy"] .symbol-card.has-long-symbol {
        font-size: .64rem;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-dock {
        top: calc(var(--topbar-height) + 7px);
        gap: 4px;
        margin-bottom: 7px;
        padding: 6px;
        border-radius: 10px;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-head {
        flex-wrap: nowrap;
        gap: 4px;
        min-width: 0;
        font-size: .7rem;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-title {
        min-width: 0;
        white-space: nowrap;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-title-full {
        display: none;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-title-mobile {
        display: inline;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-actions {
        flex: 0 0 auto;
        gap: 4px;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-actions .text-button {
        min-height: 27px;
        padding: 3px 5px;
        gap: 3px;
        font-size: .62rem;
        white-space: nowrap;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-actions .text-button svg {
        width: 11px;
        height: 11px;
    }

    [data-text-tool="symbols-copy"] .symbols-selection-dock textarea {
        min-height: 34px;
        max-height: 64px;
        padding: 5px 7px;
        font-size: .82rem;
        line-height: 1.25;
    }

    [data-text-tool="text-counter"] .text-stats-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1px;
    }

    [data-text-tool="text-counter"] .text-stat {
        min-width: 0;
        gap: 3px;
        padding: 9px 3px;
    }

    [data-text-tool="text-counter"] .text-stat span {
        order: -1;
        overflow: hidden;
        font-size: .61rem;
        line-height: 1.15;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .text-stat strong {
        font-size: 1.1rem;
    }

    [data-text-tool="text-counter"] .text-reader-panel {
        gap: 9px;
        padding: 10px;
    }

    [data-text-tool="text-counter"] .text-reader-panel .text-section-head {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding-bottom: 8px;
    }

    [data-text-tool="text-counter"] .text-reader-panel .text-section-head h2 {
        font-size: .98rem;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .text-reader-panel .text-section-head p {
        margin-top: 2px;
        font-size: .64rem;
        line-height: 1.35;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .reader-description-full {
        display: none;
    }

    [data-text-tool="text-counter"] .reader-description-mobile {
        display: inline;
    }

    [data-text-tool="text-counter"] .reader-status {
        gap: 4px;
        padding: 4px 6px;
        font-size: .58rem;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .reader-status svg {
        width: 12px;
        height: 12px;
    }

    [data-text-tool="text-counter"] .reader-control-bar,
    [data-text-tool="text-counter"] .reader-settings {
        display: grid;
        width: 100%;
        gap: 6px;
    }

    [data-text-tool="text-counter"] .reader-settings {
        grid-template-columns: 145px minmax(0, 1fr);
        align-items: end;
    }

    [data-text-tool="text-counter"] .reader-voice-field,
    [data-text-tool="text-counter"] .reader-speed-field {
        width: auto;
        max-width: none;
    }

    [data-text-tool="text-counter"] .reader-voice-field > span,
    [data-text-tool="text-counter"] .reader-speed-field > span {
        gap: 2px;
        font-size: .6rem;
        line-height: 1.1;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .reader-voice-toggle,
    [data-text-tool="text-counter"] .reader-speed-field input[type="range"] {
        min-height: 36px;
    }

    [data-text-tool="text-counter"] .reader-voice-toggle {
        gap: 5px;
        padding: 5px 7px;
        font-size: .7rem;
    }

    [data-text-tool="text-counter"] .reader-voice-toggle svg {
        width: 13px;
        height: 13px;
    }

    [data-text-tool="text-counter"] .reader-actions {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        width: 100%;
        gap: 5px;
    }

    [data-text-tool="text-counter"] .reader-actions .text-button {
        width: auto;
        min-width: 0;
        min-height: 35px;
        padding: 4px 3px;
        gap: 3px;
        font-size: .6rem;
        white-space: nowrap;
    }

    [data-text-tool="text-counter"] .reader-actions .text-button svg {
        width: 12px;
        height: 12px;
        flex: 0 0 auto;
    }

    [data-text-tool="text-counter"] + .text-tool-article > h2 {
        font-size: .74rem;
        letter-spacing: -.25px;
        white-space: nowrap;
    }

    [data-text-tool="name-decorator"] .text-toolbar-group .text-button svg {
        width: 14px;
        height: 14px;
    }

    .name-sticky-editor {
        top: calc(var(--topbar-height) + 7px);
        grid-template-columns: auto minmax(0, 1fr);
        gap: 9px;
        padding: 9px;
        border-radius: 12px;
        width: 100%;
    }

    .name-sticky-editor .text-field {
        grid-template-columns: minmax(0, 1fr);
        gap: 5px;
    }

    .name-sticky-editor .text-field input {
        min-height: 42px;
    }

    .name-sticky-icon {
        width: 40px;
        height: 40px;
    }

    .text-grid-two,
    .text-options {
        grid-template-columns: minmax(0, 1fr);
    }

    .decoration-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    [data-text-tool="name-decorator"] .decoration-grid {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    [data-text-tool="name-decorator"] .decoration-card {
        min-width: 0;
        overflow-wrap: anywhere;
    }

    [data-text-tool="name-decorator"] .decoration-card {
        min-height: 42px;
        padding: 6px 5px 6px 25px;
        font-size: clamp(.5rem, 2.25vw, .64rem);
        line-height: 1.1;
        white-space: nowrap !important;
    }

    [dir="ltr"] [data-text-tool="name-decorator"] .decoration-card {
        padding: 6px 25px 6px 5px;
    }

    [data-text-tool="name-decorator"] .decoration-card span {
        display: block;
        min-width: 0;
        max-width: 100%;
        overflow: hidden;
    }

    [data-text-tool="name-decorator"] .decoration-card svg {
        inset-inline-end: 5px;
        width: 13px;
        height: 13px;
    }

    .text-stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .text-toolbar,
    .text-section-head {
        align-items: stretch;
        flex-direction: column;
    }

    .text-toolbar-group,
    .text-toolbar-group .text-button {
        width: 100%;
    }

    .text-field textarea {
        min-height: 210px;
    }

    .reader-control-bar,
    .reader-settings {
        align-items: stretch;
        flex-direction: column;
        width: 100%;
    }

    .reader-voice-field,
    .reader-speed-field {
        width: 100%;
        max-width: none;
    }

    .reader-actions,
    .reader-actions .text-button {
        width: 100%;
    }

    .name-symbol-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
        max-height: 360px;
        padding: 7px;
        gap: 6px;
    }

    .name-symbol-card {
        min-height: 46px;
        padding: 5px;
        font-size: 1.15rem;
    }

    .text-toast {
        inset-inline-start: calc(clamp(60px, 17vw, 72px) + 9px);
        inset-inline-end: 9px;
        max-width: none;
        bottom: 16px;
        justify-content: center;
    }
}
