.mobile-sidebar-close {
    display: none;
}

@media (hover: none) and (pointer: coarse),
       (max-width: 900px) {

    .remix-header {
        padding: 6px 10px;
        height: 46px;
    }
    .logo-text,
    .header-center {
        display: none;
    }
    .header-right {
        gap: 6px;
    }
    .network-badge,
    .proxy-status {
        padding: 3px 6px;
        font-size: 10px;
    }

    .remix-main {
        padding-bottom: 56px;
    }
    .main-content {
        flex-direction: column;
        overflow: visible;
    }

    .remix-icon-panel {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        width: 100%;
        height: 56px;
        flex-direction: row;
        padding: 0;
        border-right: none;
        border-top: 1px solid var(--border-color);
        background: var(--bg-secondary);
        z-index: 200;
    }
    .icon-group {
        flex-direction: row;
        flex: 1;
        justify-content: space-around;
    }
    .icon-separator {
        display: none;
    }
    .icon-item {
        width: auto;
        height: 56px;
        min-width: 44px;
        flex: 1;
    }
    .icon-item.active {
        border-left: none;
        border-top: 3px solid var(--accent-color);
    }
    .icon-item svg {
        width: 22px;
        height: 22px;
    }

    .remix-sidebar {
        position: fixed;
        top: 46px;
        left: 0;
        right: 0;
        bottom: 56px;
        width: 100% !important;
        min-width: 0;
        max-width: none;
        z-index: 150;
        border-right: none;
        box-shadow: 2px 0 14px rgba(0, 0, 0, 0.4);
        transform: translateX(-100%);
        transition: transform 0.25s ease-out;
    }
    body.mobile-sidebar-open .remix-sidebar {
        transform: translateX(0);
    }

    body.mobile-sidebar-open::after {
        content: "";
        position: fixed;
        top: 46px;
        left: 0;
        right: 0;
        bottom: 56px;
        background: rgba(0, 0, 0, 0.45);
        z-index: 140;
        pointer-events: none;
    }

    .mobile-sidebar-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        border: none;
        border-radius: 6px;
        background: transparent;
        color: var(--text-primary);
        cursor: pointer;
        margin-left: 8px;
    }
    .mobile-sidebar-close:hover {
        background: var(--hover-bg);
    }

    .vertical-resizer,
    .horizontal-resizer {
        display: none !important;
    }

    .right-section {
        width: 100%;
        min-height: calc(100vh - 46px - 56px);
    }

    .editor-header {
        overflow-x: auto;
        overflow-y: hidden;
    }
    .editor-tabs {
        flex-wrap: nowrap;
        min-width: max-content;
    }
    .editor-tab {
        padding: 0 14px;
        min-height: 40px;
        font-size: 13px;
    }
    .new-tab-btn {
        min-width: 40px;
    }

    .CodeMirror,
    .CodeMirror * {
        font-size: 14px !important;
    }
    .CodeMirror {
        line-height: 1.6 !important;
    }
    .CodeMirror-scroll {
        -webkit-overflow-scrolling: touch;
    }

    .remix-terminal {
        height: 140px;
    }
    .terminal-header {
        height: 30px;
    }
    .terminal-content {
        padding: 10px;
        font-size: 12px;
    }

    .plugin-header {
        padding: 12px 16px;
    }
    .plugin-header h3 {
        font-size: 15px;
        flex: 1;
    }

    .form-control {
        padding: 10px 12px;
        min-height: 44px;
    }
    .form-group label {
        font-size: 13px;
        margin-bottom: 8px;
    }
    input[type="checkbox"] {
        width: 18px !important;
        height: 18px !important;
    }
    .checkbox-group label {
        font-size: 13px;
    }

    input[type="text"],
    input[type="number"],
    input[type="url"],
    input[type="email"],
    input[type="password"],
    input[type="search"],
    select,
    textarea {
        font-size: 16px !important;
    }

    .remix-btn {
        padding: 12px 16px;
        font-size: 13px;
        min-height: 44px;
    }
    .workspace-action-btn {
        padding: 12px 14px;
        font-size: 13px;
        min-height: 44px;
    }
    .action-btn,
    .folder-action-btn {
        width: 32px;
        height: 32px;
    }
    .action-btn svg,
    .folder-action-btn svg {
        width: 16px;
        height: 16px;
    }

    .folder-actions {
        display: flex !important;
        gap: 4px;
    }

    .file-item,
    .folder-header {
        padding: 12px 16px;
        font-size: 14px;
    }

    .deploy-form-section {
        padding: 14px;
    }
    .function-item-horizontal {
        gap: 6px;
    }
    .function-button,
    .function-button-small {
        font-size: 11px !important;
        padding: 10px 8px !important;
        height: 42px !important;
    }
    .function-inputs-horizontal,
    .function-param-type,
    .function-param-input {
        height: 42px;
    }
    .function-param-type,
    .function-param-input {
        font-size: 13px !important;
    }
    .contract-address-input {
        flex-direction: column;
    }
    .contract-address-input input,
    .contract-address-input button {
        width: 100%;
    }

    .deployed-contracts {
        padding: 0 14px 14px;
    }
    .contract-header {
        padding: 10px 14px;
        min-height: 52px;
    }
    .contract-name {
        font-size: 13px;
    }
    .contract-address {
        font-size: 10px;
        max-width: 150px;
    }
    .copy-address-btn {
        padding: 8px 10px;
        min-height: 34px;
    }

    .modal-content {
        max-width: 95% !important;
        width: 95% !important;
        max-height: 90vh;
        overflow-y: auto;
        margin: 10px;
    }
    .modal-header h2 {
        font-size: 16px;
    }
    .modal-footer {
        flex-wrap: wrap;
    }
    .modal-footer .remix-btn {
        flex: 1;
        min-width: 100px;
    }
    .wallet-option {
        padding: 14px 16px;
        font-size: 14px;
        min-height: 56px;
    }
    .wallet-icon {
        font-size: 22px;
        width: 32px;
        height: 32px;
    }

    .settings-tabs,
    .debug-tabs,
    .search-tabs {
        flex-wrap: wrap;
    }
    .settings-tab,
    .debug-tab,
    .search-tab {
        padding: 10px 12px;
        font-size: 13px;
        min-height: 44px;
    }

    .editor-status {
        bottom: 4px;
        right: 8px;
        font-size: 10px;
        padding: 3px 6px;
        opacity: 0.75;
    }

    .context-menu {
        min-width: 200px;
    }
    .context-menu-item {
        padding: 12px 16px;
        font-size: 14px;
        min-height: 44px;
    }

    .range-input {
        height: 12px;
    }
    .range-input::-webkit-slider-thumb {
        width: 20px;
        height: 20px;
    }
    .range-input::-moz-range-thumb {
        width: 20px;
        height: 20px;
    }
    .color-picker-row {
        flex-wrap: wrap;
    }
    .color-hex-input {
        width: 100px !important;
    }
}

@media (max-width: 380px) {
    .remix-header {
        padding: 4px 8px;
    }
    .network-text,
    .proxy-status-text {
        display: none;
    }
    .contract-address {
        max-width: 120px;
    }
}

@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .remix-terminal {
        height: 100px;
    }
    .terminal-content {
        font-size: 11px;
    }
}
