
/* =========================================================
   BACKWARDS TEXT GENERATOR — CharacterCounter.com

   DESKTOP LAYOUT:
   1. Page heading
   2. Your Text | Backwards Text
   3. Reverse Mode settings
   4. Use Result as Input / Download TXT
   5. SEO content
   6. 300px Raptive sidebar

   MOBILE:
   - Input and output stacked vertically
   - Reverse Mode below both textareas
   - Two-column mode selector
   - Sidebar hidden

   ========================================================= */


/* =========================================================
   PAGE BASE
   ========================================================= */

.backwards-text-page {
    width: 100%;
    padding: 105px 15px 40px;
    color: #333;
    font-family: "Roboto", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

.backwards-text-page,
.backwards-text-page *,
.backwards-text-page *::before,
.backwards-text-page *::after {
    box-sizing: border-box;
}

.backwards-text-page [hidden] {
    display: none !important;
}

.backwards-text-page button,
.backwards-text-page textarea,
.backwards-text-page input {
    font-family: "Roboto", Arial, sans-serif;
}

.backwards-text-page button {
    -webkit-tap-highlight-color: transparent;
}

.backwards-text-page a {
    color: #1155cc;
    text-decoration: none;
}

.backwards-text-page a:hover {
    text-decoration: underline;
}

.backwards-text-page a:focus-visible {
    outline: 2px solid #1a73e8;
    outline-offset: 3px;
}

.backwards-text-page button:focus-visible {
    outline: 3px solid rgba(26, 115, 232, 0.35);
    outline-offset: 3px;
}


/* =========================================================
   MAIN LAYOUT

   Main Content | 300px Raptive Sidebar
   ========================================================= */

.backwards-text-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: stretch;
    gap: 28px;

    width: 100%;
    max-width: 1200px;

    margin: 0 auto;
}

.backwards-text-main {
    width: 100%;
    min-width: 0;
}

.backwards-text-sidebar {
    display: block;

    width: 300px;
    min-width: 300px;
    min-height: 100%;

    align-self: stretch;

    margin: 0;
    padding: 0;
}


/* =========================================================
   PAGE HEADING
   ========================================================= */

.backwards-text-heading {
    width: 100%;
    margin: 0 0 24px;
    text-align: center;
}

.backwards-text-heading h1 {
    margin: 0 0 10px;
    padding: 0;

    color: #333;
    font-size: 32px;
    line-height: 1.25;
    font-weight: 700;

    overflow-wrap: break-word;
}

.backwards-text-intro {
    width: 100%;
    max-width: 760px;

    margin: 0 auto;
    padding: 0;

    color: #555;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 400;
}


/* =========================================================
   JAVASCRIPT NOTICE
   ========================================================= */

.backwards-text-notice {
    margin: 0 0 18px;
    padding: 12px 15px;

    border: 1px solid #e3cf9b;
    border-radius: 7px;

    background: #fff9eb;
    color: #665022;

    font-size: 14px;
    line-height: 1.5;
}


/* =========================================================
   TOOL CONTAINER
   ========================================================= */

.backwards-text-tool {
    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;
}


/* =========================================================
   INPUT AND OUTPUT GRID

   FIRST SECTION OF TOOL

   Both textareas appear ABOVE Reverse Mode.
   ========================================================= */

.backwards-text-editor-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    align-items: start;

    gap: 20px;

    width: 100%;
    min-width: 0;

    margin: 0 0 26px;
    padding: 0;
}

.backwards-text-editor {
    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;
}


/* =========================================================
   EDITOR HEADINGS
   ========================================================= */

.backwards-text-editor-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;

    flex-wrap: wrap;

    gap: 8px 12px;

    width: 100%;
    min-height: 35px;

    margin: 0 0 10px;
}

.backwards-text-editor-heading h2 {
    margin: 0;
    padding: 0;

    color: #333;

    font-size: 19px;
    line-height: 1.35;
    font-weight: 700;
}


/* =========================================================
   TRY EXAMPLE BUTTON
   ========================================================= */

.backwards-text-example-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-height: 32px;

    margin: 0;
    padding: 6px 10px;

    border: 1px solid #cbd7e7;
    border-radius: 6px;

    background: #f3f7fc;
    color: #145ba8;

    font-size: 13px;
    line-height: 1.3;
    font-weight: 600;

    white-space: nowrap;

    cursor: pointer;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.backwards-text-example-button i {
    font-size: 16px;
    line-height: 1;
}

.backwards-text-example-button:hover {
    border-color: #9bbce5;
    background: #e5f0ff;
    color: #104b8d;
}

.backwards-text-example-button:active {
    background: #d8e9ff;
}


/* =========================================================
   TEXTAREA WRAPPER
   ========================================================= */

.backwards-text-textarea-wrapper {
    position: relative;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;
}


/* =========================================================
   INPUT AND OUTPUT TEXTAREAS
   ========================================================= */

.backwards-text-page .backwards-text-textarea {
    display: block;

    width: 100%;
    max-width: 100%;

    height: 305px;
    min-height: 110px;
    max-height: 900px;

    margin: 0;
    padding: 16px 17px 65px;

    border: 2px solid #c9ced6;
    border-radius: 10px;

    background: #fff;
    color: #222;

    font-size: 16px;
    line-height: 1.65;
    font-weight: 400;

    outline: none;

    resize: vertical;

    overflow-x: hidden;
    overflow-y: auto;

    overflow-wrap: break-word;
    white-space: pre-wrap;

    tab-size: 4;

    box-shadow: none;

    transition:
        border-color 0.15s ease,
        box-shadow 0.15s ease;
}

.backwards-text-page .backwards-text-textarea::placeholder {
    color: #9299a2;
    opacity: 1;
}

.backwards-text-page .backwards-text-textarea:hover {
    border-color: #aeb4bd;
}

.backwards-text-page .backwards-text-textarea:focus {
    border-color: #1a73e8;

    box-shadow:
        0 0 0 3px rgba(26, 115, 232, 0.10);
}

.backwards-text-page .backwards-text-textarea:disabled {
    background: #f5f6f8;
    color: #888;

    cursor: not-allowed;
}


/* =========================================================
   INPUT TEXTAREA
   ========================================================= */

.backwards-text-page .backwards-text-input {
    background: #fff;
}


/* =========================================================
   OUTPUT TEXTAREA
   ========================================================= */

.backwards-text-page .backwards-text-output {
    background: #fff;
    color: #222;

    cursor: text;
}

.backwards-text-page .backwards-text-output:focus {
    border-color: #5f6368;

    box-shadow:
        0 0 0 3px rgba(95, 99, 104, 0.08);
}


/* =========================================================
   TEXTAREA ACTIONS

   Bottom-right inside textareas.

   Input: Undo / Clear
   Output: Copy
   ========================================================= */

.backwards-text-textarea-actions {
    position: absolute;

    right: 13px;
    bottom: 13px;

    display: flex;
    align-items: center;
    justify-content: flex-end;

    flex-wrap: wrap;

    gap: 7px;

    max-width: calc(100% - 26px);

    z-index: 2;
}


/* =========================================================
   INLINE ACTION BUTTONS
   ========================================================= */

.backwards-text-inline-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 5px;

    min-height: 34px;

    margin: 0;
    padding: 7px 10px;

    border: 1px solid #ccd3dc;
    border-radius: 6px;

    background: #f7f8fa;
    color: #444;

    font-size: 13px;
    line-height: 1.25;
    font-weight: 600;

    text-align: center;
    white-space: nowrap;

    cursor: pointer;
    user-select: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.backwards-text-inline-button i {
    flex: 0 0 auto;

    font-size: 16px;
    line-height: 1;
}

.backwards-text-inline-button:hover {
    border-color: #aeb6bf;
    background: #e9edf2;
    color: #333;
}

.backwards-text-inline-button:active {
    background: #dfe5ec;
}

.backwards-text-inline-button:disabled {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;

    opacity: 0.8;

    cursor: not-allowed;
}

.backwards-text-inline-button:disabled:hover {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;
}


/* =========================================================
   COPY BUTTON

   Briefly changes to "Copied!" through JavaScript.
   ========================================================= */

.backwards-text-page .backwards-text-copy-button {
    border-color: #c3d8f3;
    background: #edf5ff;
    color: #145ba8;
}

.backwards-text-page .backwards-text-copy-button:hover {
    border-color: #94bae8;
    background: #e1eeff;
    color: #124f94;
}

.backwards-text-page .backwards-text-copy-button:active {
    background: #d6e7ff;
}

.backwards-text-page .backwards-text-copy-button:disabled {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;
}

.backwards-text-page .backwards-text-copy-button:disabled:hover {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;
}


/* =========================================================
   EDITOR STATISTICS

   Characters: 0    Words: 0
   ========================================================= */

.backwards-text-editor-stats {
    display: flex;
    align-items: center;
    justify-content: flex-start;

    flex-wrap: wrap;

    gap: 7px 20px;

    width: 100%;

    margin: 10px 0 0;
    padding: 0 2px;

    color: #666;

    font-size: 13px;
    line-height: 1.5;
}

.backwards-text-editor-stats span {
    display: inline-flex;
    align-items: center;

    gap: 5px;

    white-space: nowrap;
}

.backwards-text-editor-stats strong {
    color: #333;

    font-size: 14px;
    font-weight: 700;

    font-variant-numeric: tabular-nums;
}


/* =========================================================
   REVERSE MODE PANEL

   SECOND SECTION OF TOOL

   Appears BELOW Your Text and Backwards Text.
   ========================================================= */

.backwards-text-options {
    display: block;

    width: 100%;
    min-width: 0;

    margin: 0 0 20px;
    padding: 17px 18px 16px;

    border: 1px solid #dce1e7;
    border-radius: 10px;

    background: #fafbfc;
}

.backwards-text-options-title {
    margin: 0 0 12px;
    padding: 0 7px;

    color: #333;

    font-size: 19px;
    line-height: 1.35;
    font-weight: 700;
}


/* =========================================================
   REVERSE MODE GRID

   Desktop: 3 columns
   Tablet: 2 or 3 columns
   Mobile: 2 columns
   ========================================================= */

.backwards-text-mode-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));

    gap: 10px;

    width: 100%;
    min-width: 0;
}


/* =========================================================
   REVERSE MODE RADIO CARDS
   ========================================================= */

.backwards-text-mode {
    position: relative;

    display: flex;
    align-items: stretch;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;

    cursor: pointer;
}

.backwards-text-mode input[type="radio"] {
    position: absolute;

    width: 1px;
    height: 1px;

    margin: 0;
    padding: 0;

    opacity: 0;
    overflow: hidden;
}

.backwards-text-mode-label {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 100%;
    min-width: 0;
    min-height: 47px;

    padding: 10px 12px;

    border: 1px solid #ccd3dc;
    border-radius: 7px;

    background: #fff;
    color: #444;

    font-size: 14px;
    line-height: 1.35;
    font-weight: 500;

    text-align: center;

    overflow-wrap: anywhere;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.backwards-text-mode:hover .backwards-text-mode-label {
    border-color: #9bbce5;
    background: #f1f7ff;
    color: #145ba8;
}


/* SELECTED MODE */

.backwards-text-mode input[type="radio"]:checked
+ .backwards-text-mode-label {
    border-color: #1a73e8;
    background: #eaf3ff;
    color: #145ba8;

    font-weight: 700;

    box-shadow: 0 0 0 1px rgba(26, 115, 232, 0.08);
}

.backwards-text-mode input[type="radio"]:checked
+ .backwards-text-mode-label::before {
    content: "";

    display: inline-block;
    flex: 0 0 auto;

    width: 8px;
    height: 8px;

    margin-right: 8px;

    border-radius: 50%;

    background: #1a73e8;
}

.backwards-text-mode input[type="radio"]:focus-visible
+ .backwards-text-mode-label {
    outline: 3px solid rgba(26, 115, 232, 0.3);
    outline-offset: 3px;
}

.backwards-text-mode input[type="radio"]:disabled
+ .backwards-text-mode-label {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #999;

    cursor: not-allowed;
}


/* =========================================================
   REVERSE MODE DESCRIPTION
   ========================================================= */

.backwards-text-mode-description {
    width: 100%;

    margin: 14px 0 0;
    padding: 0;

    color: #666;

    font-size: 14px;
    line-height: 1.55;

    overflow-wrap: break-word;
}


/* =========================================================
   MAIN ACTION BUTTONS

   BELOW Reverse Mode.

   Use Result as Input | Download TXT
   ========================================================= */

.backwards-text-main-actions {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 10px;

    width: 100%;

    margin: 20px 0 0;
    padding: 0;
}

.backwards-text-action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 8px;

    min-height: 43px;

    margin: 0;
    padding: 10px 16px;

    border: 1px solid #ccd3dc;
    border-radius: 7px;

    background: #f7f8fa;
    color: #444;

    font-size: 14px;
    line-height: 1.35;
    font-weight: 600;

    text-align: center;
    text-decoration: none;

    cursor: pointer;
    user-select: none;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease,
        box-shadow 0.15s ease;
}

.backwards-text-action-button i {
    flex: 0 0 auto;

    font-size: 18px;
    line-height: 1;
}

.backwards-text-action-button:hover {
    border-color: #aeb6bf;
    background: #e9edf2;
    color: #333;
}

.backwards-text-action-button:active {
    background: #dfe5ec;
}

.backwards-text-action-button:disabled {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;

    opacity: 0.8;

    cursor: not-allowed;
}

.backwards-text-action-button:disabled:hover {
    border-color: #e0e4e9;
    background: #f5f6f8;
    color: #969da6;
}


/* =========================================================
   USE RESULT AS INPUT BUTTON
   ========================================================= */

#swapTextButton:not(:disabled) {
    border-color: #c3d8f3;
    background: #edf5ff;
    color: #145ba8;
}

#swapTextButton:not(:disabled):hover {
    border-color: #94bae8;
    background: #e1eeff;
    color: #124f94;
}


/* =========================================================
   DOWNLOAD BUTTON
   ========================================================= */

#downloadTextButton:not(:disabled) {
    border-color: #ccd3dc;
    background: #f7f8fa;
    color: #444;
}

#downloadTextButton:not(:disabled):hover {
    border-color: #aeb6bf;
    background: #e9edf2;
    color: #333;
}


/* =========================================================
   TOOL STATUS
   ========================================================= */

.backwards-text-status {
    width: 100%;

    margin: 10px 0 0;
    padding: 0;

    color: #666;

    font-size: 13px;
    line-height: 1.5;

    text-align: center;

    overflow-wrap: break-word;
}

.backwards-text-status:empty {
    display: none;
}

.backwards-text-status.is-success {
    color: #257447;
}

.backwards-text-status.is-error {
    color: #bf3030;
}


/* =========================================================
   PRIVACY NOTE
   ========================================================= */

.backwards-text-privacy {
    display: flex;
    align-items: center;
    justify-content: center;

    flex-wrap: wrap;

    gap: 6px;

    width: 100%;

    margin: 16px 0 0;
    padding: 0;

    color: #777;

    font-size: 13px;
    line-height: 1.5;

    text-align: center;
}

.backwards-text-privacy i {
    flex: 0 0 auto;

    color: #777;
    font-size: 15px;
    line-height: 1;
}


/* =========================================================
   SEO ARTICLE
   ========================================================= */

.backwards-text-content {
    width: 100%;
    min-width: 0;

    margin: 48px 0 0;
    padding: 0;

    color: #444;

    font-size: 16px;
    line-height: 1.75;
}

.backwards-text-content section {
    width: 100%;
    min-width: 0;

    margin: 0 0 36px;
    padding: 0;
}

.backwards-text-content section:last-child {
    margin-bottom: 0;
}


/* =========================================================
   ARTICLE HEADINGS
   ========================================================= */

.backwards-text-content h2 {
    margin: 0 0 15px;
    padding: 0;

    color: #333;

    font-size: 23px;
    line-height: 1.35;
    font-weight: 700;

    overflow-wrap: break-word;
}

.backwards-text-content h3 {
    margin: 25px 0 10px;
    padding: 0;

    color: #333;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;

    overflow-wrap: break-word;
}

.backwards-text-content h2 + h3 {
    margin-top: 15px;
}


/* =========================================================
   ARTICLE PARAGRAPHS
   ========================================================= */

.backwards-text-content p {
    margin: 0 0 16px;
    padding: 0;

    color: #444;

    font-size: 16px;
    line-height: 1.75;

    overflow-wrap: break-word;
}

.backwards-text-content strong {
    color: #333;
    font-weight: 700;
}

.backwards-text-content a {
    color: #1155cc;
    text-decoration: none;
}

.backwards-text-content a:hover {
    text-decoration: underline;
}


/* =========================================================
   ARTICLE LISTS
   ========================================================= */

.backwards-text-content ul,
.backwards-text-content ol {
    margin: 0 0 20px;
    padding-left: 25px;

    color: #444;

    font-size: 16px;
    line-height: 1.75;
}

.backwards-text-content ul {
    list-style-type: disc;
}

.backwards-text-content ol {
    list-style-type: decimal;
}

.backwards-text-content li {
    margin: 0 0 9px;
    padding: 0;
}

.backwards-text-content li:last-child {
    margin-bottom: 0;
}

.backwards-text-content li::marker {
    color: #555;
}


/* =========================================================
   INLINE CODE
   ========================================================= */

.backwards-text-content code {
    display: inline;

    max-width: 100%;

    padding: 2px 5px;

    border-radius: 4px;

    background: #f1f3f5;
    color: #333;

    font-family: Consolas, Monaco, monospace;
    font-size: 14px;

    overflow-wrap: anywhere;
}


/* =========================================================
   BACKWARDS TEXT EXAMPLE BOXES
   ========================================================= */

.backwards-text-content .backwards-text-example {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);

    align-items: start;

    gap: 8px 13px;

    width: 100%;

    margin: 14px 0 22px;
    padding: 15px 17px;

    border: 1px solid #e0e5eb;
    border-radius: 8px;

    background: #f8fafc;

    font-size: 15px;
    line-height: 1.6;
}

.backwards-text-example strong {
    color: #444;
    font-size: 14px;
    font-weight: 700;
}

.backwards-text-content .backwards-text-example code {
    display: block;

    width: fit-content;
    max-width: 100%;

    padding: 3px 8px;

    border: 1px solid #e4e8ed;
    border-radius: 5px;

    background: #fff;
    color: #222;

    font-size: 14px;
    line-height: 1.55;

    overflow-wrap: anywhere;
}


/* =========================================================
   MULTILINE EXAMPLE BLOCKS
   ========================================================= */

.backwards-text-example-block {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    align-items: stretch;

    gap: 13px;

    width: 100%;

    margin: 15px 0 22px;
    padding: 0;
}

.backwards-text-example-block > div {
    min-width: 0;

    padding: 14px 15px;

    border: 1px solid #e0e5eb;
    border-radius: 8px;

    background: #f8fafc;
}

.backwards-text-example-block strong {
    display: block;

    margin: 0 0 9px;

    color: #444;

    font-size: 14px;
    font-weight: 700;
}

.backwards-text-example-block pre {
    display: block;

    width: 100%;
    max-width: 100%;

    margin: 0;
    padding: 12px;

    border: 1px solid #e4e8ed;
    border-radius: 6px;

    background: #fff;
    color: #222;

    font-family: Consolas, Monaco, monospace;
    font-size: 14px;
    line-height: 1.65;

    white-space: pre-wrap;
    overflow-wrap: anywhere;

    overflow-x: auto;
}


/* =========================================================
   FAQ SECTION
   ========================================================= */

.backwards-text-faq {
    width: 100%;
}

.backwards-text-faq h2 {
    margin-bottom: 20px;
}

.backwards-text-faq h3 {
    margin: 24px 0 8px;

    color: #333;

    font-size: 18px;
    line-height: 1.4;
    font-weight: 700;
}

.backwards-text-faq h3:first-of-type {
    margin-top: 0;
}

.backwards-text-faq p {
    margin: 0 0 14px;
}


/* =========================================================
   RELATED TOOLS
   ========================================================= */

.backwards-text-related-tools {
    width: 100%;

    margin-top: 38px;
    padding-top: 25px;

    border-top: 1px solid #e2e6eb;
}

.backwards-text-related-tools h2 {
    margin-bottom: 10px;
}

.backwards-text-content .backwards-text-related-intro {
    margin: 0 0 18px;

    color: #555;
}


/* =========================================================
   RELATED TOOL LINKS GRID
   ========================================================= */

.backwards-text-content .backwards-text-related-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    gap: 10px 16px;

    width: 100%;

    margin: 0 0 25px;
    padding: 0;

    list-style: none;
}

.backwards-text-related-links li {
    display: block;

    min-width: 0;

    margin: 0;
    padding: 0;

    list-style: none;
}

.backwards-text-related-links li::marker {
    content: "";
}

.backwards-text-related-links a {
    display: flex;
    align-items: center;

    width: 100%;
    min-height: 45px;

    padding: 10px 13px;

    border: 1px solid #e0e5eb;
    border-radius: 7px;

    background: #fafbfc;
    color: #1155cc;

    font-size: 15px;
    line-height: 1.4;
    font-weight: 500;

    overflow-wrap: break-word;

    transition:
        background-color 0.15s ease,
        border-color 0.15s ease,
        color 0.15s ease;
}

.backwards-text-related-links a:hover {
    border-color: #b8d1ef;
    background: #edf5ff;
    color: #0d4fa3;

    text-decoration: none;
}


/* =========================================================
   RELATED TOOL CALLOUTS
   ========================================================= */

.backwards-text-related-callouts {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));

    align-items: stretch;

    gap: 15px;

    width: 100%;
    min-width: 0;

    margin: 0;
    padding: 0;
}

.backwards-text-related-callout {
    min-width: 0;

    padding: 17px 18px;

    border: 1px solid #e0e5eb;
    border-radius: 9px;

    background: #fafbfc;
}

.backwards-text-content .backwards-text-related-callout h3 {
    margin: 0 0 9px;

    color: #333;

    font-size: 17px;
    line-height: 1.4;
    font-weight: 700;
}

.backwards-text-content .backwards-text-related-callout p {
    margin: 0;

    color: #555;

    font-size: 14px;
    line-height: 1.65;
}


/* =========================================================
   RESPONSIVE — SMALLER DESKTOP

   Keep 300px sidebar.
   ========================================================= */

@media screen and (max-width: 1150px) {

    .backwards-text-layout {
        gap: 22px;
    }

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

    .backwards-text-editor-grid {
        gap: 16px;
    }

}


/* =========================================================
   RESPONSIVE — MEDIUM DESKTOP

   Keep sidebar visible.
   Stack textareas to prevent cramped editors.
   ========================================================= */

@media screen and (max-width: 1020px) {

    .backwards-text-layout {
        gap: 20px;
    }

    .backwards-text-editor-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 24px;

        margin-bottom: 25px;
    }

    .backwards-text-page .backwards-text-textarea {
        height: 255px;
    }

    .backwards-text-options {
        padding: 16px;
    }

    .backwards-text-content h2 {
        font-size: 22px;
    }

}


/* =========================================================
   RESPONSIVE — TABLETS

   Hide sidebar below 900px.
   Restore full-width main content.
   ========================================================= */

@media screen and (max-width: 900px) {

    .backwards-text-page {
        padding: 95px 18px 35px;
    }

    .backwards-text-layout {
        display: block;

        width: 100%;
        max-width: 850px;

        margin: 0 auto;
    }

    .backwards-text-main {
        width: 100%;
    }

    .backwards-text-sidebar {
        display: none !important;
    }

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

        gap: 18px;
        margin-bottom: 26px;
    }

    .backwards-text-page .backwards-text-textarea {
        height: 285px;
    }

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

}


/* =========================================================
   RESPONSIVE — SMALL TABLETS / LARGE PHONES

   Stack Your Text and Backwards Text.
   Keep Reverse Mode below both.
   ========================================================= */

@media screen and (max-width: 740px) {

    .backwards-text-page {
        padding: 90px 16px 30px;
    }

    .backwards-text-heading {
        margin-bottom: 21px;
    }

    .backwards-text-heading h1 {
        font-size: 30px;
    }

    .backwards-text-intro {
        font-size: 16px;
    }

    .backwards-text-editor-grid {
        grid-template-columns: minmax(0, 1fr);

        gap: 24px;
        margin-bottom: 25px;
    }

    .backwards-text-page .backwards-text-textarea {
        height: 230px;
        min-height: 110px;
    }

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

    .backwards-text-content {
        margin-top: 42px;
    }

    .backwards-text-content h2 {
        font-size: 22px;
    }

    .backwards-text-content h3 {
        font-size: 18px;
    }

    .backwards-text-related-callouts {
        grid-template-columns: minmax(0, 1fr);
    }

}


/* =========================================================
   RESPONSIVE — MOBILE
   ========================================================= */

@media screen and (max-width: 520px) {

    .backwards-text-page {
        padding: 85px 13px 28px;
    }

    .backwards-text-heading {
        margin-bottom: 19px;
    }

    .backwards-text-heading h1 {
        font-size: 27px;
        line-height: 1.3;
    }

    .backwards-text-intro {
        font-size: 15px;
        line-height: 1.55;
    }

    /* TEXT EDITORS FIRST */

    .backwards-text-editor-grid {
        gap: 23px;
        margin-bottom: 25px;
    }

    .backwards-text-editor-heading h2 {
        font-size: 18px;
    }

    .backwards-text-example-button {
        min-height: 31px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .backwards-text-page .backwards-text-textarea {
        height: 210px;
        min-height: 110px;

        padding: 13px 13px 62px;

        font-size: 16px;
        line-height: 1.6;

        border-radius: 9px;
    }

    .backwards-text-textarea-actions {
        right: 10px;
        bottom: 10px;

        gap: 6px;
    }

    .backwards-text-inline-button {
        min-height: 33px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .backwards-text-editor-stats {
        gap: 7px 16px;
        font-size: 12px;
    }

    .backwards-text-editor-stats strong {
        font-size: 13px;
    }

    /* REVERSE MODE BELOW TEXT EDITORS */

    .backwards-text-options {
        margin-bottom: 18px;
        padding: 14px 12px;

        border-radius: 9px;
    }

    .backwards-text-options-title {
        font-size: 18px;
    }

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

        gap: 8px;
    }

    .backwards-text-mode-label {
        min-height: 45px;

        padding: 9px 8px;

        font-size: 13px;
        line-height: 1.35;
    }

    .backwards-text-mode-description {
        margin-top: 12px;
        font-size: 13px;
    }

    /* MAIN ACTIONS */

    .backwards-text-main-actions {
        gap: 8px;
        margin-top: 18px;
    }

    .backwards-text-action-button {
        min-height: 42px;

        padding: 10px 12px;

        font-size: 13px;
    }

    .backwards-text-privacy {
        font-size: 12px;
    }

    /* ARTICLE */

    .backwards-text-content {
        margin-top: 36px;
        font-size: 15px;
    }

    .backwards-text-content section {
        margin-bottom: 31px;
    }

    .backwards-text-content h2 {
        margin-bottom: 12px;
        font-size: 21px;
    }

    .backwards-text-content h3 {
        margin-top: 22px;
        font-size: 17px;
    }

    .backwards-text-content p,
    .backwards-text-content ul,
    .backwards-text-content ol {
        font-size: 15px;
        line-height: 1.75;
    }

    .backwards-text-content ul,
    .backwards-text-content ol {
        padding-left: 23px;
    }

    .backwards-text-example-block {
        grid-template-columns: minmax(0, 1fr);
        gap: 10px;
    }

    .backwards-text-content .backwards-text-example {
        padding: 13px;
    }

    .backwards-text-example-block > div {
        padding: 12px;
    }

    /* RELATED TOOLS */

    .backwards-text-content .backwards-text-related-links {
        grid-template-columns: minmax(0, 1fr);
        gap: 9px;
    }

    .backwards-text-related-links a {
        min-height: 43px;
        font-size: 14px;
    }

    .backwards-text-related-callout {
        padding: 15px;
    }

}


/* =========================================================
   RESPONSIVE — VERY SMALL MOBILE
   ========================================================= */

@media screen and (max-width: 370px) {

    .backwards-text-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .backwards-text-heading h1 {
        font-size: 25px;
    }

    .backwards-text-options {
        padding: 12px 10px;
    }

    .backwards-text-mode-grid {
        gap: 7px;
    }

    .backwards-text-mode-label {
        min-height: 46px;

        padding: 8px 6px;

        font-size: 12px;
    }

    .backwards-text-mode input[type="radio"]:checked
    + .backwards-text-mode-label::before {
        width: 6px;
        height: 6px;

        margin-right: 5px;
    }

    .backwards-text-main-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .backwards-text-action-button {
        width: 100%;
    }

    .backwards-text-content h2 {
        font-size: 20px;
    }

}


/* =========================================================
   REDUCED MOTION ACCESSIBILITY
   ========================================================= */

@media (prefers-reduced-motion: reduce) {

    .backwards-text-page *,
    .backwards-text-page *::before,
    .backwards-text-page *::after {
        scroll-behavior: auto !important;

        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;

        animation-iteration-count: 1 !important;
    }

}


/* =========================================================
   PRINT STYLES
   ========================================================= */

@media print {

    .backwards-text-page {
        padding: 0;
        color: #000;
    }

    .backwards-text-layout {
        display: block;
        max-width: none;
    }

    .backwards-text-sidebar,
    .backwards-text-example-button,
    .backwards-text-textarea-actions,
    .backwards-text-main-actions {
        display: none !important;
    }

    .backwards-text-editor-grid {
        display: block;
    }

    .backwards-text-editor {
        margin-bottom: 20px;
    }

    .backwards-text-page .backwards-text-textarea {
        height: auto;
        min-height: 150px;
        max-height: none;

        padding: 12px;

        border: 1px solid #999;

        box-shadow: none;

        resize: none;
    }

    .backwards-text-options {
        border: 1px solid #bbb;
        background: #fff;
    }

    .backwards-text-content {
        margin-top: 30px;
    }

    .backwards-text-content a {
        color: #000;
        text-decoration: underline;
    }

}
