/* ========================
   ALIGNMENT FIX - Unicode & Bijoy Boxes FULL HEIGHT
   Boxes fill entire red border area
   ======================== */

/* Global Tablet Width Adjustments */
@media (min-width: 768px) and (max-width: 1200px) {
    .container {
        max-width: 100% !important;
        padding-left: 1rem !important;
        padding-right: 1rem !important;
    }

    .tool-section.tool-fullwidth {
        max-width: 100% !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }

    .tool-container,
    .converter-grid {
        width: 100% !important;
        max-width: 100% !important;
    }

    .converter-box {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Desktop Layout - Side by Side with controls below */
@media (min-width: 1024px) {

    /* Grid Layout - 2 columns */
    .converter-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        grid-template-rows: auto auto !important;
        gap: 0.8rem !important;
        align-items: stretch !important;
        max-width: 100%;
        margin: 0 auto;
    }

    /* Explicit grid placement */
    #unicode-box {
        grid-row: 1 !important;
        grid-column: 1 !important;
        min-width: 0 !important;
    }

    #bijoy-box {
        grid-row: 1 !important;
        grid-column: 2 !important;
        min-width: 0 !important;
    }

    /* Both boxes - FULL HEIGHT */
    .converter-box {
        display: flex !important;
        flex-direction: column !important;
        height: 100% !important;
        min-height: 500px !important;
    }

    /* Box Headers - Compact */
    #unicode-box .box-header,
    #bijoy-box .box-header {
        min-height: 50px !important;
        margin-bottom: 0.8rem !important;
        display: flex !important;
        align-items: center !important;
        flex-shrink: 0 !important;
    }

    /* Input Mode Section - Compact shape */
    #unicode-box .input-mode-section {
        margin-bottom: 0.5rem !important;
        padding: 0.25rem 0.8rem !important;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        border: 1px solid rgba(255, 255, 255, 0.2);
        flex-shrink: 0 !important;
        line-height: 1.2 !important;
    }

    /* Remove bottom margin from input-mode-options */
    #unicode-box .input-mode-options {
        margin-bottom: 0 !important;
        padding: 0.15rem 0 !important;
    }

    /* Gap between input-mode and textarea */
    #unicode-box .textarea-wrapper {
        margin-top: 0 !important;
        padding-top: 0 !important;
    }

    /* All 4 corners rounded on both textareas */
    #unicode-box .textarea-wrapper .text-area,
    #bijoy-box .textarea-wrapper .text-area {
        border-radius: 12px !important;
        margin-top: 0 !important;
    }

    /* Hide input mode section in Bijoy box */
    #bijoy-box .input-mode-section {
        display: none !important;
    }

    /* Textarea Wrappers - FILL REMAINING SPACE */
    #unicode-box .textarea-wrapper,
    #bijoy-box .textarea-wrapper {
        flex: 1 !important;
        display: flex !important;
        flex-direction: column !important;
        min-height: 0 !important;
    }

    /* Textareas - FILL ENTIRE WRAPPER */
    #unicode-box:not(.fullscreen-mode) .text-area,
    #bijoy-box:not(.fullscreen-mode) .text-area {
        flex: 1 !important;
        height: 100% !important;
        min-height: 350px !important;
        width: 100% !important;
        resize: vertical !important;
    }

    /* Hide the hint text below Bijoy textarea */
    #bijoy-box p,
    #bijoy-box .bijoy-note {
        display: none !important;
    }

    /* Center Controls - Horizontal row below boxes */
    .center-controls {
        grid-row: 2 !important;
        grid-column: 1 / 3 !important;
        display: flex !important;
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
        padding: 1rem 0 0 !important;
    }

    /* Swap Icon - Smaller size for desktop/tablet to match mobile proportions */
    .swap-icon {
        padding: 6px !important;
        width: 36px !important;
        height: 36px !important;
    }

    .swap-icon svg {
        width: 18px !important;
        height: 18px !important;
    }

    /* Conversion Buttons - Grid for perfect center alignment */
    .conversion-buttons {
        display: grid !important;
        grid-template-columns: 1fr auto 1fr !important;
        gap: 1.5rem !important;
        align-items: center !important;
        width: 100% !important;
        max-width: 600px !important;
    }

    #toBijoyBtn {
        justify-self: end !important;
        order: -1 !important;
    }

    .swap-icon {
        justify-self: center !important;
        order: 0 !important;
    }

    #toUnicodeBtn {
        justify-self: start !important;
        order: 1 !important;
    }

    .convert-action-btn {
        white-space: nowrap !important;
        padding: 0.6rem 1rem !important;
    }
}

/* Large Desktop - More space */
@media (min-width: 1280px) {
    .converter-grid {
        gap: 1rem !important;
    }

    .converter-box {
        min-height: 550px !important;
    }
}

/* Extra Large Desktop */
@media (min-width: 1920px) {
    .converter-grid {
        gap: 1.2rem !important;
    }

    .converter-box {
        min-height: 600px !important;
    }
}

/* Tablet Layout */
@media (min-width: 768px) and (max-width: 1023px) {
    .converter-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1.5rem !important;
    }

    .converter-box {
        height: auto !important;
        min-height: auto !important;
    }

    /* Textarea wrapper - CSS Grid stacking for reliable button positioning */
    #unicode-box:not(.fullscreen-mode) .textarea-wrapper,
    #bijoy-box:not(.fullscreen-mode) .textarea-wrapper {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr !important;
        position: relative !important;
        margin-bottom: 0 !important;
    }

    #unicode-box:not(.fullscreen-mode) .text-area,
    #bijoy-box:not(.fullscreen-mode) .text-area {
        grid-area: 1 / 1 !important;
        height: 250px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fullscreen button - grid-stacked inside textarea cell */
    #unicode-box:not(.fullscreen-mode) .fullscreen-btn,
    #bijoy-box:not(.fullscreen-mode) .fullscreen-btn {
        grid-area: 1 / 1 !important;
        align-self: end !important;
        justify-self: start !important;
        position: relative !important;
        margin: 0 0 0.5rem 0.5rem !important;
        z-index: 10 !important;
        bottom: auto !important;
        left: auto !important;
    }

    /* Show hint on tablet */
    #bijoy-box p,
    #bijoy-box .bijoy-note {
        display: block !important;
    }

    /* Horizontal conversion buttons on tablet */
    .center-controls {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 1rem !important;
    }

    .conversion-buttons {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 1rem !important;
    }

    .swap-icon {
        order: 0 !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        padding: 6px !important;
    }

    .swap-icon svg {
        transform: rotate(90deg) !important;
        width: 18px !important;
        height: 18px !important;
    }

    .swap-icon:hover svg {
        transform: rotate(270deg) !important;
    }
}

/* Mobile Layout */
@media (max-width: 767px) {
    .converter-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .converter-box {
        height: auto !important;
        min-height: auto !important;
    }

    /* Textarea wrapper - CSS Grid stacking for reliable button positioning */
    #unicode-box:not(.fullscreen-mode) .textarea-wrapper,
    #bijoy-box:not(.fullscreen-mode) .textarea-wrapper {
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: 1fr !important;
        position: relative !important;
        margin-bottom: 0 !important;
    }

    #unicode-box:not(.fullscreen-mode) .text-area,
    #bijoy-box:not(.fullscreen-mode) .text-area {
        grid-area: 1 / 1 !important;
        height: 180px !important;
        margin: 0 !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* Fullscreen button - grid-stacked inside textarea cell */
    #unicode-box:not(.fullscreen-mode) .fullscreen-btn,
    #bijoy-box:not(.fullscreen-mode) .fullscreen-btn {
        grid-area: 1 / 1 !important;
        align-self: end !important;
        justify-self: start !important;
        position: relative !important;
        margin: 0 0 0.5rem 0.5rem !important;
        z-index: 10 !important;
        bottom: auto !important;
        left: auto !important;
    }

    /* Show hint on mobile */
    #bijoy-box p,
    #bijoy-box .bijoy-note {
        display: block !important;
        font-size: 0.85rem !important;
    }

    /* Horizontal conversion buttons on mobile */
    .center-controls {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.5rem !important;
        padding: 0.3rem 0 !important;
    }

    .conversion-buttons {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.5rem !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .convert-action-btn {
        font-size: 0.75rem !important;
        padding: 0.45rem 1rem !important;
        white-space: nowrap !important;
        border-radius: 50px !important;
        gap: 4px !important;
        flex: 0 1 auto !important;
        max-width: none !important;
    }

    .convert-action-btn svg {
        width: 14px !important;
        height: 14px !important;
        flex-shrink: 0 !important;
    }

    /* Swap icon - match button height */
    .swap-icon {
        order: 0 !important;
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        padding: 4px !important;
        flex-shrink: 0 !important;
    }

    .swap-icon svg {
        transform: rotate(90deg) !important;
        width: 18px !important;
        height: 18px !important;
    }

    .swap-icon:hover svg {
        transform: rotate(270deg) !important;
    }
}

/* Extra-small mobile override (<=480px) */
@media (max-width: 480px) {
    .center-controls {
        flex-direction: row !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.4rem !important;
        padding: 0.2rem 0 !important;
    }

    .conversion-buttons {
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 0.4rem !important;
        flex-wrap: nowrap !important;
        width: 100% !important;
    }

    .convert-action-btn {
        font-size: 0.7rem !important;
        padding: 0.4rem 0.8rem !important;
        white-space: nowrap !important;
        border-radius: 50px !important;
        gap: 3px !important;
        flex: 0 1 auto !important;
    }

    .convert-action-btn svg {
        width: 12px !important;
        height: 12px !important;
    }

    .swap-icon {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        padding: 3px !important;
    }

    .swap-icon svg {
        width: 16px !important;
        height: 16px !important;
    }
}

/* Tiny screens (<=360px - iPhone SE, older devices) */
@media (max-width: 360px) {
    .convert-action-btn {
        font-size: 0.65rem !important;
        padding: 0.35rem 0.45rem !important;
        gap: 2px !important;
    }

    .convert-action-btn svg {
        width: 10px !important;
        height: 10px !important;
    }

    .swap-icon {
        width: 26px !important;
        height: 26px !important;
        min-width: 26px !important;
        padding: 2px !important;
    }

    .swap-icon svg {
        width: 14px !important;
        height: 14px !important;
    }
}

/* Ultra-tiny screens (<=320px - iPhone 4) */
@media (max-width: 320px) {
    .conversion-buttons {
        gap: 0.25rem !important;
    }

    .convert-action-btn {
        font-size: 0.6rem !important;
        padding: 0.3rem 0.4rem !important;
        gap: 2px !important;
    }

    .convert-action-btn svg {
        width: 9px !important;
        height: 9px !important;
    }

    .swap-icon {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px !important;
        padding: 2px !important;
    }

    .swap-icon svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* Ensure both boxes have same padding - desktop only */
@media (min-width: 1024px) {

    #unicode-box,
    #bijoy-box {
        padding: 1.5rem !important;
    }
}

/* Tablet padding */
@media (min-width: 768px) and (max-width: 1023px) {

    #unicode-box,
    #bijoy-box {
        padding: 1rem !important;
    }
}

/* Mobile padding - match responsive-fix.css */
@media (max-width: 767px) {

    #unicode-box,
    #bijoy-box {
        padding: 0.8rem !important;
    }
}

/* Remove any extra margins that might cause misalignment */
#unicode-box>*:last-child,
#bijoy-box>*:last-child {
    margin-bottom: 0 !important;
}

/* Base fullscreen button style */
.fullscreen-btn {
    position: absolute;
    bottom: 0.5rem;
    left: 0.5rem;
    background: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 6px;
    padding: 0.3rem;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
    z-index: 10;
    opacity: 0.6;
}

.fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.5);
    opacity: 1;
}

.textarea-wrapper {
    position: relative;
}

/* ========================
   FULLSCREEN MODE - All Devices Responsive
   ======================== */

/* Hide EVERYTHING else when fullscreen is active */
body.has-fullscreen nav,
body.has-fullscreen .navbar,
body.has-fullscreen header,
body.has-fullscreen footer,
body.has-fullscreen .info-section,
body.has-fullscreen .instructions-section,
body.has-fullscreen .comment-section,
body.has-fullscreen .ad-section,
body.has-fullscreen .cookie-consent,
body.has-fullscreen .main-content>*:not(.converter-section) {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

body.has-fullscreen {
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    height: 100vh !important;
    height: 100dvh !important;
    width: 100% !important;
}

/* Remove container margin-top (inline 80px for navbar) in fullscreen */
body.has-fullscreen .container {
    margin-top: 0 !important;
    padding: 0 !important;
}

body.has-fullscreen .main-content,
body.has-fullscreen .converter-section,
body.has-fullscreen .converter-grid {
    margin: 0 !important;
    padding: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    min-height: 0 !important;
    border: none !important;
    gap: 0 !important;
    display: block !important;
    overflow: hidden !important;
}

/* Hide other converter elements when one is fullscreen */
body.has-fullscreen .converter-box:not(.fullscreen-mode),
body.has-fullscreen .center-controls {
    display: none !important;
    visibility: hidden !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* ---- The fullscreen box itself ---- */
body.has-fullscreen .converter-box.fullscreen-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100vh !important;
    height: 100dvh !important;
    max-width: none !important;
    max-height: none !important;
    min-width: 0 !important;
    min-height: 100vh !important;
    min-height: 100dvh !important;
    z-index: 999999 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-radius: 0 !important;
    border: none !important;
    margin: 0 !important;
    padding: 1.2rem 1.5rem !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    box-shadow: none !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    transform: none !important;
    animation: none !important;
}

/* ---- Header row: title + copy/clear ---- */
body.has-fullscreen .converter-box.fullscreen-mode .box-header {
    flex: 0 0 auto !important;
    margin-bottom: 0.6rem !important;
    min-height: auto !important;
    height: auto !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding-right: 0 !important;
    max-width: none !important;
    width: 100% !important;
    gap: 16px !important;
    box-sizing: border-box !important;
}

/* Buttons stay at the right end thanks to h2 flex:1 */
body.has-fullscreen .converter-box.fullscreen-mode .box-header .copy-btn {
    flex-shrink: 0 !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .box-header .clear-btn {
    margin-right: 0 !important;
    flex-shrink: 0 !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
    font-size: 1.5rem !important;
    color: #fff !important;
    margin: 0 !important;
    white-space: nowrap !important;
    flex: 1 1 auto !important;
}

/* ---- Input mode section (Unicode only) ---- */
body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
    display: flex !important;
    flex: 0 0 auto !important;
    margin-bottom: 0.6rem !important;
    background: rgba(255, 255, 255, 0.15) !important;
    border-radius: 10px !important;
    padding: 0.4rem 1rem !important;
    align-items: center !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    max-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
}

/* Bijoy box has no input mode section */
body.has-fullscreen #bijoy-box.fullscreen-mode .input-mode-section {
    display: none !important;
}

/* ---- Textarea wrapper - MUST fill all remaining space ---- */
body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper {
    flex: 1 1 0 !important;
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: 0 !important;
    /* trick: flex-grow with height:0 forces fill */
    max-height: none !important;
    overflow: hidden !important;
    position: relative !important;
}

/* ---- Textarea - fills entire remaining area ---- */
body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
    flex: 1 1 0 !important;
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    font-size: 1.1rem !important;
    line-height: 1.8 !important;
    border-radius: 12px !important;
    resize: none !important;
    padding: 1rem !important;
    box-sizing: border-box !important;
    margin: 0 !important;
    border: 2px solid rgba(255, 255, 255, 0.3) !important;
    background: rgba(255, 255, 255, 0.95) !important;
    color: #1a1a2e !important;
    overflow-y: auto !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area:focus,
body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea:focus {
    outline: none !important;
    border-color: rgba(255, 255, 255, 0.6) !important;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.15) !important;
}

/* ---- Exit/fullscreen button in fullscreen mode (now in header flow) ---- */
body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
    position: static !important;
    z-index: 1000000 !important;
    background: rgba(255, 255, 255, 0.25) !important;
    border: 1px solid rgba(255, 255, 255, 0.4) !important;
    border-radius: 8px !important;
    padding: 0.4rem !important;
    width: 40px !important;
    height: 40px !important;
    opacity: 1 !important;
    cursor: pointer !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: background 0.2s ease !important;
    flex-shrink: 0 !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn:hover {
    background: rgba(255, 255, 255, 0.45) !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
    stroke: #fff !important;
    width: 20px !important;
    height: 20px !important;
}

/* ---- Copy and clear buttons ---- */
body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
    background: rgba(255, 255, 255, 0.2) !important;
    color: #fff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .copy-btn:hover,
body.has-fullscreen .converter-box.fullscreen-mode .clear-btn:hover {
    background: rgba(255, 255, 255, 0.35) !important;
}

body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
    stroke: #fff !important;
}

/* ---- Hide hint text in fullscreen Bijoy ---- */
body.has-fullscreen #bijoy-box.fullscreen-mode p,
body.has-fullscreen #bijoy-box.fullscreen-mode .bijoy-note {
    display: none !important;
}

/* ========================================
   FULLSCREEN RESPONSIVE BREAKPOINTS
   ======================================== */

/* --- Mobile Portrait (iPhone SE, small Android) --- */
@media (max-width: 480px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 0.6rem 0.8rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 0.4rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1.1rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 0.4rem !important;
        padding: 0.3rem 0.5rem !important;
        font-size: 0.8rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label {
        font-size: 0.75rem !important;
        margin-right: 0.4rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        padding: 0.7rem !important;
        border-radius: 8px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 34px !important;
        height: 34px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 16px !important;
        height: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 32px !important;
        height: 32px !important;
        padding: 0.25rem !important;
    }
}

/* --- Mobile Landscape & larger phones (481px - 767px) --- */
@media (min-width: 481px) and (max-width: 767px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 0.8rem 1rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1.2rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label {
        font-size: 0.85rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1rem !important;
        line-height: 1.7 !important;
        padding: 0.8rem !important;
    }
}

/* --- Tablet Portrait (768px - 1023px) --- */
@media (min-width: 768px) and (max-width: 1023px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 1rem 1.2rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1.4rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1.05rem !important;
        line-height: 1.8 !important;
        padding: 1rem !important;
    }
}

/* --- Desktop / Laptop (1024px - 1439px) --- */
@media (min-width: 1024px) and (max-width: 1439px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 1.2rem 2rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 0.7rem !important;
        gap: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1.5rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 0.6rem !important;
        padding: 0.4rem 1rem !important;
        border-radius: 10px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label,
    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .radio-option {
        font-size: 0.95rem !important;
        padding: 0.35rem 0.7rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-title {
        font-size: 0.95rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-hint {
        font-size: 0.9rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1.1rem !important;
        line-height: 1.8 !important;
        padding: 1.2rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 40px !important;
        height: 40px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 20px !important;
        height: 20px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 38px !important;
        height: 38px !important;
        padding: 0.3rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
        width: 18px !important;
        height: 18px !important;
    }
}

/* --- Large Desktop / iMac (1440px - 1919px) --- */
@media (min-width: 1440px) and (max-width: 1919px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 1.2rem 2rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 0.7rem !important;
        gap: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1.9rem !important;
        font-weight: 700 !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 0.7rem !important;
        padding: 0.5rem 1.2rem !important;
        border-radius: 10px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label,
    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .radio-option {
        font-size: 1.1rem !important;
        padding: 0.45rem 0.9rem !important;
        border-radius: 8px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-title {
        font-size: 1.1rem !important;
        font-weight: 600 !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-hint {
        font-size: 1rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1.3rem !important;
        line-height: 1.9 !important;
        padding: 1.5rem !important;
        border-radius: 14px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 46px !important;
        height: 46px !important;
        border-radius: 10px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 22px !important;
        height: 22px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 44px !important;
        height: 44px !important;
        padding: 0.4rem !important;
        border-radius: 10px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
        width: 22px !important;
        height: 22px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn span {
        font-size: 1rem !important;
    }
}

/* --- Ultra-wide / 4K (1920px+) --- */
@media (min-width: 1920px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 1.5rem 2.5rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 0.8rem !important;
        gap: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 2.2rem !important;
        font-weight: 700 !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 0.8rem !important;
        padding: 0.6rem 1.5rem !important;
        border-radius: 12px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label,
    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .radio-option {
        font-size: 1.2rem !important;
        padding: 0.5rem 1rem !important;
        border-radius: 8px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-title {
        font-size: 1.2rem !important;
        font-weight: 600 !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-hint {
        font-size: 1.05rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section input[type="radio"] {
        width: 18px !important;
        height: 18px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1.5rem !important;
        line-height: 2 !important;
        padding: 1.8rem !important;
        border-radius: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 52px !important;
        height: 52px !important;
        border-radius: 12px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 26px !important;
        height: 26px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 48px !important;
        height: 48px !important;
        padding: 0.5rem !important;
        border-radius: 12px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
        width: 24px !important;
        height: 24px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn span {
        font-size: 1.1rem !important;
    }
}

/* --- Extra Large / 2K+ (2560px+) --- */
@media (min-width: 2560px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 2rem 4rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 1rem !important;
        gap: 20px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 2.8rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.02em !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 1rem !important;
        padding: 0.8rem 2.5rem !important;
        border-radius: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label,
    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .radio-option {
        font-size: 1.5rem !important;
        padding: 0.7rem 1.5rem !important;
        border-radius: 10px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-title {
        font-size: 1.5rem !important;
        font-weight: 600 !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-hint {
        font-size: 1.25rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section input[type="radio"] {
        width: 22px !important;
        height: 22px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 1.8rem !important;
        line-height: 2 !important;
        padding: 2rem !important;
        border-radius: 18px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 60px !important;
        height: 60px !important;
        border-radius: 14px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 30px !important;
        height: 30px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 56px !important;
        height: 56px !important;
        padding: 0.6rem !important;
        border-radius: 14px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
        width: 28px !important;
        height: 28px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn span {
        font-size: 1.3rem !important;
    }
}

/* --- 4K / Ultra-wide (3840px+) --- */
@media (min-width: 3840px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 3rem 6rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 1.5rem !important;
        gap: 24px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 3rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 1.5rem !important;
        padding: 1rem 2.5rem !important;
        border-radius: 16px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section label,
    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .radio-option {
        font-size: 1.6rem !important;
        padding: 0.8rem 1.5rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-title {
        font-size: 1.6rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section .input-mode-hint {
        font-size: 1.4rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section input[type="radio"] {
        width: 22px !important;
        height: 22px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 2rem !important;
        line-height: 2.2 !important;
        padding: 3rem !important;
        border-radius: 20px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn {
        width: 64px !important;
        height: 64px !important;
        border-radius: 14px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .fullscreen-btn svg {
        width: 32px !important;
        height: 32px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn {
        width: 60px !important;
        height: 60px !important;
        padding: 0.6rem !important;
        border-radius: 14px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn svg,
    body.has-fullscreen .converter-box.fullscreen-mode .clear-btn svg {
        width: 30px !important;
        height: 30px !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .copy-btn span {
        font-size: 1.4rem !important;
    }
}

/* --- Short viewport / landscape phones --- */
@media (max-height: 500px) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding: 0.4rem 0.8rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header {
        margin-bottom: 0.3rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .box-header h2 {
        font-size: 1rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .input-mode-section {
        margin-bottom: 0.3rem !important;
        padding: 0.2rem 0.5rem !important;
    }

    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper .text-area,
    body.has-fullscreen .converter-box.fullscreen-mode .textarea-wrapper textarea {
        font-size: 0.9rem !important;
        padding: 0.5rem !important;
    }
}

/* --- iOS safe areas (notch, home indicator) --- */
@supports (padding-top: env(safe-area-inset-top)) {
    body.has-fullscreen .converter-box.fullscreen-mode {
        padding-top: calc(0.3rem + env(safe-area-inset-top)) !important;
        padding-bottom: calc(0.3rem + env(safe-area-inset-bottom)) !important;
        padding-left: calc(0.5rem + env(safe-area-inset-left)) !important;
        padding-right: calc(0.5rem + env(safe-area-inset-right)) !important;
    }
}